SWIGEXPORT void D_locateResources(char * jarg1) { Ogre::String *arg1 = 0 ; if (!jarg1) { SWIG_DSetPendingException(SWIG_DIllegalArgumentException, "null string"); return ; } Ogre::String arg1_str(jarg1); arg1 = &arg1_str; locateResources((std::string const &)*arg1); }
void CEditor::PreLoadResources() { #ifdef _DEBUG mRoot = new Ogre::Root("plugins_d.cfg", "Ogre.cfg", "Ogre.log"); #else mRoot = new Ogre::Root("plugins.cfg", "Ogre.cfg", "Ogre.log"); #endif locateResources(); mRoot->setRenderSystem(mRoot->getRenderSystemByName("Direct3D9 Rendering Subsystem")); mRoot->initialise(false, Ogre::StringUtil::BLANK); }
void ApplicationContext::setup() { mWindow = createWindow(); setupInput(mGrabInput); locateResources(); #ifdef OGRE_BUILD_COMPONENT_RTSHADERSYSTEM initialiseRTShaderSystem(); #endif loadResources(); // adds context as listener to process context-level (above the sample level) events mRoot->addFrameListener(this); #if OGRE_PLATFORM != OGRE_PLATFORM_ANDROID Ogre::WindowEventUtilities::addWindowEventListener(mWindow, this); #endif }
KDvoid SdkSample::_setup ( RenderWindow* pWindow ) { // assign mRoot here in case Root was initialised after the Sample's constructor ran. m_pRoot = Root::getSingletonPtr ( ); m_pWindow = pWindow; locateResources ( ); createSceneManager ( ); setupView ( ); m_pTrayMgr = new SdkTrayManager ( "SampleControls", pWindow, this ); // create a tray interface loadResources ( ); m_bResourcesLoaded = true; // show stats and logo and hide the cursor m_pTrayMgr->showFrameStats ( TL_BOTTOMLEFT ); m_pTrayMgr->showLogo ( TL_BOTTOMRIGHT ); m_pTrayMgr->hideCursor ( ); // create a params panel for displaying sample details StringVector aItems; aItems.push_back ( "cam.pX" ); aItems.push_back ( "cam.pY" ); aItems.push_back ( "cam.pZ" ); aItems.push_back ( "" ); aItems.push_back ( "cam.oW" ); aItems.push_back ( "cam.oX" ); aItems.push_back ( "cam.oY" ); aItems.push_back ( "cam.oZ" ); aItems.push_back ( "" ); aItems.push_back ( "Filtering" ); aItems.push_back ( "Poly Mode" ); m_pDetailsPanel = m_pTrayMgr->createParamsPanel ( TL_NONE, "DetailsPanel", 200, aItems ); m_pDetailsPanel->hide ( ); m_pDetailsPanel->setParamValue ( 9, "Bilinear" ); m_pDetailsPanel->setParamValue ( 10, "Solid" ); setupContent ( ); m_bContentSetup = true; m_bDone = false; }
int main(int argc, char *argv[]) { struct busTicket myTicket; pname = argc > 0 ? argv[1] : "CUSTOMER"; pid = getpid(); printInfo("Initializing Customer"); /* initialize shared resource variables */ locateResources(&semid, &shmid, &shm); /* get in line */ semWait(semid, SEM_LINE); printInfo("My turn in line"); /* wait for mutex */ semWait(semid, SEM_MUTEX); /* tell agent my name */ snprintf(shm->name, sizeof(shm->name), "%s", pname); semSignal(semid, SEM_AGENT); /* wait for my ticket to be assigned */ semWait(semid, SEM_TICKET); /* get the ticket */ myTicket = shm->ticket; sprintf(buf, "My Ticket: [Name:%s Seat:%d Depart:%ld]", myTicket.name, myTicket.seat, myTicket.depart); printInfo(buf); /* release mutex */ if(myTicket.depart == shm->nbDepart) { printInfo("Waiting for next bus"); shm->nbWait++; semSignal(semid, SEM_MUTEX); /* wait for next bus */ semWait(semid, SEM_NBUS); } else { semSignal(semid, SEM_MUTEX); } /* board the bus */ printInfo("Boarding the bus"); return EXIT_SUCCESS; }
/*----------------------------------------------------------------------------- | Extended to setup a default tray interface and camera controller. -----------------------------------------------------------------------------*/ void Framework::_setup(Ogre::RenderWindow* window, OIS::Keyboard* keyboard, OIS::Mouse* mouse, XRENREN::FileSystemLayer* fsLayer) { // assign mRoot here in case Root was initialised after the Sample's constructor ran. mRoot = Ogre::Root::getSingletonPtr(); mWindow = window; mMouse = mouse; mFSLayer = fsLayer; locateResources(); createSceneManager(); setupView(); mTrayMgr = new SdkTrayManager("SampleControls", window, mouse, this); // create a tray interface #ifdef USE_RTSHADER_SYSTEM // Initialize shader generator. // Must be before resource loading in order to allow parsing extended material attributes. bool success = initializeRTShaderSystem(mSceneMgr); if (!success) { OGRE_EXCEPT(Ogre::Exception::ERR_FILE_NOT_FOUND, "Shader Generator Initialization failed - Core shader libs path not found", "SdkSample::_setup"); } #endif loadResources(); mResourcesLoaded = true; // show stats and logo and hide the cursor mTrayMgr->showFrameStats(TL_BOTTOMLEFT); mTrayMgr->hideLogo(); mTrayMgr->showCursor(); setupDetailsPanel(); setupContent(); mContentSetup = true; mDone = false; }
void TestContext::setup() { // standard setup mWindow = createWindow(); mWindow->setDeactivateOnFocusChange(false); setupInput(false);// grab input, since moving the window seemed to change the results (in Linux anyways) locateResources(); loadResources(); Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5); mRoot->addFrameListener(this); #if OGRE_PLATFORM != OGRE_PLATFORM_ANDROID Ogre::WindowEventUtilities::addWindowEventListener(mWindow, this); #endif // get the path and list of test plugins from the config file Ogre::ConfigFile testConfig; testConfig.load(mFSLayer->getConfigFilePath("tests.cfg")); mPluginDirectory = testConfig.getSetting("TestFolder"); Ogre::ConfigFile::SectionIterator sections = testConfig.getSectionIterator(); // parse for the test sets and plugins that they're made up of for (; sections.hasMoreElements(); sections.moveNext()) { Ogre::String setName = sections.peekNextKey(); if (setName != "") { mTestSets[setName] = Ogre::StringVector(); Ogre::ConfigFile::SettingsMultiMap::iterator it = sections.peekNextValue()->begin(); for (; it != sections.peekNextValue()->end(); ++it) mTestSets[setName].push_back(it->second); } } // timestamp for the filename char temp[25]; time_t raw = time(0); strftime(temp, 19, "%Y_%m_%d_%H%M_%S", gmtime(&raw)); Ogre::String filestamp = Ogre::String(temp); // name for this batch (used for naming the directory, and uniquely identifying this batch) Ogre::String batchName = mTestSetName + "_" + filestamp; // a nicer formatted version for display strftime(temp, 20, "%Y-%m-%d %H:%M:%S", gmtime(&raw)); Ogre::String timestamp = Ogre::String(temp); if (mReferenceSet) batchName = "Reference"; else if (mBatchName != "AUTO") batchName = mBatchName; // set up output directories setupDirectories(batchName); // an object storing info about this set mBatch = new TestBatch(batchName, mTestSetName, timestamp, mWindow->getWidth(), mWindow->getHeight(), mOutputDir + batchName + "/"); mBatch->comment = mComment; OgreBites::Sample* firstTest = loadTests(mTestSetName); runSample(firstTest); }