nodachi2D::nodachi2D() { initializePhysics(); loadLevel(); intitializeRenderContext(); initializeThreads(); }
kajiya2D::kajiya2D() { //this->globalGameObjectManager_->saveObjects( objectFile ); //this->globalGameObjectManager_->saveMaterials( materialFile ); //this->globalGameObjectManager_->saveVisualAppearances( visualAppearancesFile ); loadLevelData("",""); intitializeRenderContext(); initializeThreads(); }
ThreadPool::ThreadPool(int initThreads, int maxThreads,bool console) { this->console = console; this->lowp = -1; this->highp = -1; this->initThreads = initThreads; this->maxThreads = maxThreads; this->runFlag = false; joinComplete = false; prioritypooling = false; initPointers(); initializeThreads(); }
ThreadPool::ThreadPool(int initThreads, int maxThreads, int lowp, int highp,bool console) { this->console = console; if (lowp > highp) throw "Low Priority should be less than Highest Priority"; this->initThreads = initThreads; this->maxThreads = maxThreads; this->lowp = lowp; this->highp = highp; this->runFlag = false; joinComplete = false; prioritypooling = true; initPointers(); initializeThreads(); }
void ThreadPool::init(int initThreads, int maxThreads,bool console) { if(wpool!=NULL)return; this->console = console; this->lowp = -1; this->highp = -1; this->initThreads = initThreads; this->maxThreads = maxThreads; joinComplete = false; prioritypooling = false; initPointers(); initializeThreads(); start(); }
ThreadPool::ThreadPool(int maxThreads) { if (maxThreads < 1) maxThreads = 1; #ifndef WIN32 pthread_mutex_lock(&mutexSync); #endif this->maxThreads = maxThreads; this->queueSize = maxThreads+2; incompleteTask = 0; #ifndef WIN32 availableTask=new IlmThread::Semaphore(0); availableThreads=new IlmThread::Semaphore(maxThreads); #endif initializeThreads(); #ifndef WIN32 pthread_mutex_unlock(&mutexSync); #endif }
void Renderer::updateConfiguration(bool initialUpdate) { bool newConfiguration = swiftConfig->hasNewConfiguration(); if(newConfiguration || initialUpdate) { terminateThreads(); SwiftConfig::Configuration configuration = {}; swiftConfig->getConfiguration(configuration); precacheVertex = !newConfiguration && configuration.precache; precacheSetup = !newConfiguration && configuration.precache; precachePixel = !newConfiguration && configuration.precache; VertexProcessor::setRoutineCacheSize(configuration.vertexRoutineCacheSize); PixelProcessor::setRoutineCacheSize(configuration.pixelRoutineCacheSize); SetupProcessor::setRoutineCacheSize(configuration.setupRoutineCacheSize); switch(configuration.textureSampleQuality) { case 0: Sampler::setFilterQuality(FILTER_POINT); break; case 1: Sampler::setFilterQuality(FILTER_LINEAR); break; case 2: Sampler::setFilterQuality(FILTER_ANISOTROPIC); break; default: Sampler::setFilterQuality(FILTER_ANISOTROPIC); break; } switch(configuration.mipmapQuality) { case 0: Sampler::setMipmapQuality(MIPMAP_POINT); break; case 1: Sampler::setMipmapQuality(MIPMAP_LINEAR); break; default: Sampler::setMipmapQuality(MIPMAP_LINEAR); break; } setPerspectiveCorrection(configuration.perspectiveCorrection); switch(configuration.transcendentalPrecision) { case 0: logPrecision = APPROXIMATE; expPrecision = APPROXIMATE; rcpPrecision = APPROXIMATE; rsqPrecision = APPROXIMATE; break; case 1: logPrecision = PARTIAL; expPrecision = PARTIAL; rcpPrecision = PARTIAL; rsqPrecision = PARTIAL; break; case 2: logPrecision = ACCURATE; expPrecision = ACCURATE; rcpPrecision = ACCURATE; rsqPrecision = ACCURATE; break; case 3: logPrecision = WHQL; expPrecision = WHQL; rcpPrecision = WHQL; rsqPrecision = WHQL; break; case 4: logPrecision = IEEE; expPrecision = IEEE; rcpPrecision = IEEE; rsqPrecision = IEEE; break; default: logPrecision = ACCURATE; expPrecision = ACCURATE; rcpPrecision = ACCURATE; rsqPrecision = ACCURATE; break; } switch(configuration.transparencyAntialiasing) { case 0: transparencyAntialiasing = TRANSPARENCY_NONE; break; case 1: transparencyAntialiasing = TRANSPARENCY_ALPHA_TO_COVERAGE; break; default: transparencyAntialiasing = TRANSPARENCY_NONE; break; } switch(configuration.threadCount) { case -1: threadCount = CPUID::coreCount(); break; case 0: threadCount = CPUID::processAffinity(); break; default: threadCount = configuration.threadCount; break; } CPUID::setEnableSSE4_1(configuration.enableSSE4_1); CPUID::setEnableSSSE3(configuration.enableSSSE3); CPUID::setEnableSSE3(configuration.enableSSE3); CPUID::setEnableSSE2(configuration.enableSSE2); CPUID::setEnableSSE(configuration.enableSSE); for(int pass = 0; pass < 10; pass++) { optimization[pass] = configuration.optimization[pass]; } forceWindowed = configuration.forceWindowed; postBlendSRGB = configuration.postBlendSRGB; exactColorRounding = configuration.exactColorRounding; forceClearRegisters = configuration.forceClearRegisters; #ifndef NDEBUG minPrimitives = configuration.minPrimitives; maxPrimitives = configuration.maxPrimitives; #endif } if(!initialUpdate && !worker[0]) { initializeThreads(); } }