Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 26, 2011, 8:50:06 PM (14 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
Location:
code/branches/usability/src/orxonox/graphics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/usability/src/orxonox/graphics/GlobalShader.cc

    r5781 r7972  
    6161        SUPER(GlobalShader, XMLPort, xmlelement, mode);
    6262
    63         XMLPortParamExtern(GlobalShader, Shader, &this->shader_, "compositor", setCompositor, getCompositor, xmlelement, mode);
     63        XMLPortParamExtern(GlobalShader, Shader, &this->shader_, "compositor", setCompositorName, getCompositorName, xmlelement, mode);
    6464    }
    6565
     
    6767    {
    6868        registerVariable(this->bVisible_,                                         VariableDirection::ToClient, new NetworkCallback<GlobalShader>(this, &GlobalShader::changedVisibility));
    69         registerVariable(const_cast<std::string&>(this->shader_.getCompositor()), VariableDirection::ToClient, new NetworkCallback<Shader>(&this->shader_, &Shader::changedCompositor));
     69        registerVariable(const_cast<std::string&>(this->shader_.getCompositorName()), VariableDirection::ToClient, new NetworkCallback<Shader>(&this->shader_, &Shader::changedCompositorName));
    7070    }
    7171
  • code/branches/usability/src/orxonox/graphics/GlobalShader.h

    r7163 r7972  
    5353        private:
    5454            void registerVariables();
    55             void changedCompositor();
    5655
    5756            Shader shader_;
Note: See TracChangeset for help on using the changeset viewer.