Changeset 1244 for code/branches/ogre/src/orxonox/GraphicsEngine.cc
- Timestamp:
- May 7, 2008, 9:20:42 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ogre/src/orxonox/GraphicsEngine.cc
r1243 r1244 70 70 this->renderWindow_ = 0; 71 71 this->setConfigValues(); 72 C OUT(4) << "*** GraphicsEngine:Constructed" << std::endl;72 CCOUT(4) << "Constructed" << std::endl; 73 73 } 74 74 … … 87 87 void GraphicsEngine::destroy() 88 88 { 89 COUT(4) << " *** GraphicsEngine:Destroying objects..." << std::endl;89 COUT(4) << "Destroying objects..." << std::endl; 90 90 Ogre::WindowEventUtilities::removeWindowEventListener(this->renderWindow_, this); 91 91 if (this->root_) … … 101 101 delete Ogre::LogManager::getSingletonPtr(); 102 102 } 103 COUT(4) << " *** GraphicsEngine:Destroying objects done" << std::endl;103 COUT(4) << "Destroying objects done" << std::endl; 104 104 } 105 105 … … 118 118 bool GraphicsEngine::setup(std::string& dataPath) 119 119 { 120 CCOUT(3) << "Setting up..." << std::endl; 120 121 // temporary overwrite of dataPath, change ini file for permanent change 121 122 if (dataPath != "") … … 139 140 else 140 141 logger = Ogre::LogManager::getSingletonPtr(); 141 C OUT(4) << "*** GraphicsEngine:Ogre LogManager created/assigned" << std::endl;142 CCOUT(4) << "Ogre LogManager created/assigned" << std::endl; 142 143 143 144 // create our own log that we can listen to … … 153 154 154 155 // Root will detect that we've already created a Log 155 C OUT(4) << "*** GraphicsEngine:Creating Ogre Root..." << std::endl;156 CCOUT(4) << "Creating Ogre Root..." << std::endl; 156 157 root_ = new Ogre::Root(plugin_filename); 157 C OUT(4) << "*** GraphicsEngine:Creating Ogre Root done" << std::endl;158 CCOUT(4) << "Creating Ogre Root done" << std::endl; 158 159 159 160 // specify where Ogre has to look for resources. This call doesn't parse anything yet! 160 161 declareRessourceLocations(); 161 162 163 CCOUT(3) << "Set up done." << std::endl; 162 164 return true; 163 165 } … … 165 167 void GraphicsEngine::declareRessourceLocations() 166 168 { 169 CCOUT(4) << "Declaring Resources" << std::endl; 167 170 //TODO: Specify layout of data file and maybe use xml-loader 168 171 //TODO: Work with ressource groups (should be generated by a special loader) … … 194 197 bool GraphicsEngine::loadRenderer() 195 198 { 199 CCOUT(4) << "Configuring Renderer" << std::endl; 196 200 if (!root_->restoreConfig() && !root_->showConfigDialog()) 197 201 return false; 198 202 203 CCOUT(4) << "Creating render window" << std::endl; 199 204 this->renderWindow_ = root_->initialise(true, "OrxonoxV2"); 200 205 if (!root_->isInitialised()) 201 return false; 206 { 207 CCOUT(2) << "Error: Creating Ogre root object failed" << std::endl; 208 return false; 209 } 202 210 Ogre::WindowEventUtilities::addWindowEventListener(this->renderWindow_, this); 203 211 Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5); … … 205 213 } 206 214 207 void GraphicsEngine::initialiseResources() 208 { 215 bool GraphicsEngine::initialiseResources() 216 { 217 CCOUT(4) << "Initialising resources" << std::endl; 209 218 //TODO: Do NOT load all the groups, why are we doing that? And do we really do that? initialise != load... 210 Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); 219 try 220 { 221 Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); 222 } 223 catch (Ogre::Exception e) 224 { 225 CCOUT(2) << "Error: There was an Error when initialising the resources." << std::endl; 226 CCOUT(2) << "ErrorMessage: " << e.getFullDescription() << std::endl; 227 return false; 228 } 229 return true; 211 230 } 212 231 … … 216 235 bool GraphicsEngine::createNewScene() 217 236 { 237 CCOUT(4) << "Creating new SceneManager" << std::endl; 218 238 if (scene_) 219 return false; 239 { 240 CCOUT(2) << "SceneManager already exists! Skipping." << std::endl; 241 return false; 242 } 220 243 scene_ = root_->createSceneManager(Ogre::ST_GENERIC, "Default SceneManager"); 221 C OUT(3) << "Info:Created SceneManager: " << scene_ << std::endl;244 CCOUT(3) << "Created SceneManager: " << scene_ << std::endl; 222 245 return true; 223 246 }
Note: See TracChangeset
for help on using the changeset viewer.