Changeset 11085
- Timestamp:
- Jan 23, 2016, 9:34:29 PM (9 years ago)
- Location:
- code/trunk/src
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/core/CorePrereqs.h
r11071 r11085 184 184 struct GameStateInfo; 185 185 struct GameStateTreeNode; 186 class GlowMaterialListener; 186 187 class GraphicsManager; 187 188 class GUIManager; -
code/trunk/src/libraries/core/GraphicsManager.cc
r11071 r11085 38 38 #include <OgreRoot.h> 39 39 #include <OgreLogManager.h> 40 #include <OgreMaterialManager.h> 40 41 #include <OgreRenderWindow.h> 41 42 #include <OgreRenderSystem.h> … … 56 57 #include "Game.h" 57 58 #include "GameMode.h" 59 #include "GlowMaterialListener.h" 58 60 #include "GUIManager.h" 59 61 #include "Loader.h" … … 100 102 , renderWindow_(nullptr) 101 103 , viewport_(nullptr) 104 , glowMaterialListener_(nullptr) 102 105 , lastFrameStartTime_(0.0f) 103 106 , lastFrameEndTime_(0.0f) … … 140 143 orxout(internal_status) << "destroying GraphicsManager..." << endl; 141 144 145 Ogre::MaterialManager::getSingleton().removeListener(this->glowMaterialListener_); 142 146 Ogre::WindowEventUtilities::removeWindowEventListener(renderWindow_, ogreWindowEventListener_); 147 143 148 ModifyConsoleCommand(__CC_printScreen_name).resetFunction(); 144 149 ModifyConsoleCommand(__CC_GraphicsManager_group, __CC_setScreenResolution_name).resetFunction(); … … 153 158 safeObjectDelete(&ogreLogger_); 154 159 safeObjectDelete(&ogreWindowEventListener_); 160 safeObjectDelete(&glowMaterialListener_); 155 161 156 162 orxout(internal_status) << "finished destroying GraphicsManager" << endl; … … 306 312 307 313 Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(Ogre::MIP_UNLIMITED); 314 315 this->glowMaterialListener_ = new GlowMaterialListener(); 316 Ogre::MaterialManager::getSingleton().addListener(this->glowMaterialListener_); 308 317 309 318 //Add program icon -
code/trunk/src/libraries/core/GraphicsManager.h
r11071 r11085 127 127 Ogre::LogManager* ogreLogger_; 128 128 Ogre::Root* ogreRoot_; //!< Ogre's root 129 Ogre::RenderWindow* renderWindow_; //!< the one and only render window 130 Ogre::Viewport* viewport_; //!< default full size viewport 131 float lastFrameStartTime_; //!< Time stamp of the beginning of the last frame 132 float lastFrameEndTime_; //!< Time stamp of the end of the last frame 129 Ogre::RenderWindow* renderWindow_; //!< the one and only render window 130 Ogre::Viewport* viewport_; //!< default full size viewport 131 GlowMaterialListener* glowMaterialListener_; //!< Material Listener for the 'Glow' compositor 132 float lastFrameStartTime_; //!< Time stamp of the beginning of the last frame 133 float lastFrameEndTime_; //!< Time stamp of the end of the last frame 133 134 134 135 // XML files for the resources and the debug overlay -
code/trunk/src/orxonox/Scene.cc
r11080 r11085 58 58 #include "Level.h" 59 59 #include "RenderQueueListener.h" 60 #include "graphics/GlobalShader.h" 60 61 61 62 namespace orxonox … … 91 92 92 93 this->radar_ = new Radar(); 94 this->glowShader_ = new GlobalShader(this); 95 this->glowShader_->setScene(WeakPtr<Scene>(this), this->getObjectID()); // avoid circular reference 96 this->glowShader_->getShader().setCompositorName("Glow"); 93 97 } 94 98 else … … 100 104 this->renderQueueListener_ = nullptr; 101 105 this->radar_ = nullptr; 106 this->glowShader_ = nullptr; 102 107 } 103 108 … … 124 129 if (this->radar_) 125 130 this->radar_->destroy(); 131 if (this->glowShader_) 132 this->glowShader_->destroy(); 126 133 127 134 if (GameMode::showsGraphics()) -
code/trunk/src/orxonox/Scene.h
r11080 r11085 118 118 float soundReferenceDistance_; //!< This holds a reference distance, which represents the distance between our scene and the listener 119 119 Radar* radar_; //!< This is a pointer to a Radar object assigned with this scene 120 WeakPtr<GlobalShader> glowShader_; 120 121 121 122 -
code/trunk/src/orxonox/graphics/GlobalShader.h
r11071 r11085 48 48 virtual void changedVisibility() override; 49 49 50 inline const Shader& getShader() const50 inline Shader& getShader() 51 51 { return this->shader_; } 52 52
Note: See TracChangeset
for help on using the changeset viewer.