Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11132


Ignore:
Timestamp:
Mar 6, 2016, 9:18:13 PM (4 years ago)
Author:
landauf
Message:

fixed overlays with ogre 1.9.
OverlaySystem must be initialized once after ogre-root and connected as listener to every (?) scene manager

Location:
code/branches/ogre1.9/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ogre1.9/src/libraries/core/CMakeLists.txt

    r10624 r11132  
    100100  LINK_LIBRARIES
    101101    ${OGRE_LIBRARY}
     102    ${OGRE_OVERLAY_LIBRARY}
    102103    ${Boost_FILESYSTEM_LIBRARY}
    103104    ${Boost_SYSTEM_LIBRARY} # Filesystem dependency
  • code/branches/ogre1.9/src/libraries/core/GraphicsManager.cc

    r11115 r11132  
    4545#include <OgreViewport.h>
    4646#include <OgreWindowEventUtilities.h>
     47#if OGRE_VERSION >= 0x010900
     48#   include <Overlay/OgreOverlaySystem.h>
     49#endif
    4750
    4851#include "SpecialConfig.h"
     
    115118        this->loadOgreRoot();
    116119
     120#if OGRE_VERSION >= 0x010900
     121        this->overlaySystem_ = new Ogre::OverlaySystem();
     122#else
     123        this->overlaySystem_ = nullptr;
     124#endif
     125
    117126        // At first, add the root paths of the data directories as resource locations
    118127        Ogre::ResourceGroupManager::getSingleton().addResourceLocation(ConfigurablePaths::getDataPathString(), "FileSystem");
     
    155164        Loader::getInstance().unload(extResources_.get());
    156165
     166#if OGRE_VERSION >= 0x010900
     167        safeObjectDelete(&overlaySystem_);
     168#endif
    157169        safeObjectDelete(&ogreRoot_);
    158170        safeObjectDelete(&ogreLogger_);
  • code/branches/ogre1.9/src/libraries/core/GraphicsManager.h

    r11085 r11132  
    5252
    5353#include "util/DestructionHelper.h"
     54#include "util/OgreForwardRefs.h"
    5455#include "util/Singleton.h"
    5556#include "config/Configurable.h"
     
    7980        void postUpdate(const Clock& time);
    8081
    81         Ogre::Viewport* getViewport()         { return this->viewport_; }
    82         Ogre::RenderWindow* getRenderWindow() { return this->renderWindow_; }
     82        Ogre::Viewport* getViewport()           { return this->viewport_; }
     83        Ogre::RenderWindow* getRenderWindow()   { return this->renderWindow_; }
     84        Ogre::OverlaySystem* getOverlaySystem() { return this->overlaySystem_; }
    8385        size_t getRenderWindowHandle();
    8486
     
    129131        Ogre::RenderWindow*      renderWindow_;            //!< the one and only render window
    130132        Ogre::Viewport*          viewport_;                //!< default full size viewport
     133        Ogre::OverlaySystem*     overlaySystem_;
    131134        GlowMaterialListener*    glowMaterialListener_;    //!< Material Listener for the 'Glow' compositor
    132135        float                    lastFrameStartTime_;      //!< Time stamp of the beginning of the last frame
  • code/branches/ogre1.9/src/orxonox/Scene.cc

    r11131 r11132  
    9494            this->sceneManager_->addRenderQueueListener(this->renderQueueListener_);//add our own renderQueueListener
    9595#if OGRE_VERSION >= 0x010900
    96             this->overlaySystem_ = new Ogre::OverlaySystem();
    97             this->sceneManager_->addRenderQueueListener(this->overlaySystem_);
     96            this->sceneManager_->addRenderQueueListener(GraphicsManager::getInstance().getOverlaySystem());
    9897#endif
    9998
     
    142141            {
    143142#if OGRE_VERSION >= 0x010900
    144                 this->sceneManager_->removeRenderQueueListener(this->overlaySystem_);
    145                 delete this->overlaySystem_;
     143                this->sceneManager_->removeRenderQueueListener(GraphicsManager::getInstance().getOverlaySystem());
    146144#endif
    147145                this->sceneManager_->removeRenderQueueListener(this->renderQueueListener_);
  • code/branches/ogre1.9/src/orxonox/Scene.h

    r11131 r11132  
    111111            Ogre::SceneNode*         rootSceneNode_; //!< This is a pointer to the root node of the Scene tree
    112112            RenderQueueListener*     renderQueueListener_; //!< this is a pointer to the RenderQueueListener we're using for this Scene
    113             Ogre::OverlaySystem*     overlaySystem_;
    114113
    115114            std::string              skybox_; //!< This string holds information about the skybox we're using
Note: See TracChangeset for help on using the changeset viewer.