Changeset 8336 for code/branches/kicklib2/src/libraries
- Timestamp:
- Apr 26, 2011, 6:49:49 AM (14 years ago)
- Location:
- code/branches/kicklib2/src/libraries/core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/kicklib2/src/libraries/core/GUIManager.cc
r8304 r8336 57 57 # include <RendererModules/Ogre/CEGUIOgreRenderer.h> 58 58 # include <RendererModules/Ogre/CEGUIOgreResourceProvider.h> 59 # include <OgreCamera.h> 60 # include <OgreRenderQueueListener.h> 61 # include <OgreSceneManager.h> 59 62 #endif 60 63 … … 109 112 We need this to fix a problem with an uninitialised member variable 110 113 in CEGUI < 0.7 <br> 111 Notice th at"public" modifier for the otherwise private variables.112 */ 113 class CEGUILUA_APILuaScriptModuleWorkaround : public CEGUI::ScriptModule114 Notice the "public" modifier for the otherwise private variables. 115 */ 116 class LuaScriptModuleWorkaround : public CEGUI::ScriptModule 114 117 { 115 118 public: … … 125 128 int d_activeErrFuncIndex; 126 129 }; 130 #else 131 /// RenderQueueListener based class used to hook into the ogre rendering system 132 class RQListener : public Ogre::RenderQueueListener 133 { 134 public: 135 /// Callback from Ogre invoked before other stuff in our target queue is rendered 136 void renderQueueEnded(Ogre::uint8 id, const Ogre::String& invocation, bool& skipThisQueue) 137 { 138 if (id == Ogre::RENDER_QUEUE_SKIES_LATE)//Ogre::RENDER_QUEUE_OVERLAY) 139 CEGUI::System::getSingleton().renderGUI(); 140 } 141 }; 127 142 #endif 128 143 … … 171 186 #else 172 187 guiRenderer_ = &OgreRenderer::create(*GraphicsManager::getInstance().getRenderWindow()); 188 // We use our own RenderQueueListener so we can draw UNDER overlays 189 guiRenderer_->setFrameControlExecutionEnabled(false); 190 rqListener_ = new RQListener(); 173 191 resourceProvider_ = &OgreRenderer::createOgreResourceProvider(); 174 192 imageCodec_ = &OgreRenderer::createOgreImageCodec(); … … 245 263 #else 246 264 System::destroy(); 247 delete ceguiLogger_;248 265 OgreRenderer::destroyOgreResourceProvider(*resourceProvider_); 249 266 OgreRenderer::destroyOgreImageCodec(*imageCodec_); 250 267 OgreRenderer::destroy(*guiRenderer_); 251 268 LuaScriptModule::destroy(*scriptModule_); 269 delete ceguiLogger_; 270 delete rqListener_; 252 271 #endif 253 272 delete luaState_; … … 292 311 void GUIManager::setCamera(Ogre::Camera* camera) 293 312 { 294 this->camera_ = camera;295 313 #ifdef ORXONOX_OLD_CEGUI 296 314 if (camera == NULL) … … 298 316 else 299 317 this->guiRenderer_->setTargetSceneManager(camera->getSceneManager()); 300 #endif 318 #else 319 if (camera_ != NULL && camera_->getSceneManager() != NULL) 320 camera_->getSceneManager()->removeRenderQueueListener(rqListener_); 321 if (camera != NULL && camera->getSceneManager() != NULL) 322 camera->getSceneManager()->addRenderQueueListener(rqListener_); 323 #endif 324 this->camera_ = camera; 301 325 } 302 326 -
code/branches/kicklib2/src/libraries/core/GUIManager.h
r8283 r8336 165 165 #else 166 166 CEGUI::OgreRenderer* guiRenderer_; //!< CEGUI's interface to the Ogre Engine 167 Ogre::RenderQueueListener* rqListener_; //!< RQ listener so we can draw UNDER Ogre overlays 167 168 CEGUI::OgreResourceProvider* resourceProvider_; //!< CEGUI's resource provider 168 169 CEGUI::OgreImageCodec* imageCodec_;
Note: See TracChangeset
for help on using the changeset viewer.