Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 26, 2011, 8:50:06 PM (13 years ago)
Author:
landauf
Message:

slight rework of the Shader class:

  • correctly loads and initializes active and inactive shaders in different scenes
  • uses the fast Ogre::CompositorManager::getSingleton().setCompositorEnabled() instead of the slow compositorInstance_→setEnabled() to change the visibility of a shader
  • uses consistently GraphicsManager::getInstance().getViewport() to get the viewport - this is not optimal, scenemanager→getCurrentViewport() would be better, however this returns NULL when displaying a new scene for the first time
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/usability/src/libraries/tools/Shader.h

    r7966 r7972  
    6565            void updateVisibility();
    6666
    67             inline void setCompositor(const std::string& compositor)
     67            inline void setCompositorName(const std::string& name)
    6868            {
    69                 if (this->compositor_ != compositor)
     69                if (this->compositorName_ != name)
    7070                {
    71                     this->compositor_ = compositor;
    72                     this->changedCompositor();
     71                    this->compositorName_ = name;
     72                    this->changedCompositorName();
    7373                }
    7474            }
    75             inline const std::string& getCompositor() const
    76                 { return this->compositor_; }
    77             void changedCompositor();
     75            inline const std::string& getCompositorName() const
     76                { return this->compositorName_; }
     77            void changedCompositorName();
     78            void changedCompositorName(Ogre::Viewport* viewport);
    7879
    79             void setSceneManager(Ogre::SceneManager* scenemanager);
     80            inline void setSceneManager(Ogre::SceneManager* scenemanager)
     81                { this->scenemanager_ = scenemanager; }
    8082            inline Ogre::SceneManager* getSceneManager() const
    8183                { return this->scenemanager_; }
     
    9496
    9597        private:
     98            static bool hasCgProgramManager();
     99
    96100            Ogre::SceneManager* scenemanager_;
    97101            Ogre::CompositorInstance* compositorInstance_;
    98102            bool bVisible_;
    99103            bool bLoadCompositor_;
    100             bool bViewportInitialized_;
    101             std::string compositor_;
    102             std::string oldcompositor_;
     104            std::string compositorName_;
     105            std::string oldcompositorName_;
    103106
    104107            static MaterialMap parameters_s;
Note: See TracChangeset for help on using the changeset viewer.