#include <OglTexture.h>


Public Member Functions | |
| OglTexture () | |
| virtual | ~OglTexture () |
| virtual void | init () |
| Initialization method called at graph modification, during bottom-up traversal. | |
| virtual void | initVisual () |
| Initialize the textures, or other graphical resources. | |
| virtual void | reinit () |
| Update method called when variables used in precomputation are modified. | |
| void | fwdDraw (Pass) |
| Called before objects in the current branch are displayed. | |
| void | bwdDraw (Pass) |
| Called after objects in the current branch are displayed. | |
| std::string | getTextureName () |
| void | getTextureUnit () |
| virtual void | bind ()=0 |
| virtual void | unbind ()=0 |
Static Public Member Functions | |
| static void | setActiveTexture (unsigned short unit) |
| Utility function to set current active texture. | |
Static Public Attributes | |
| static unsigned short | MAX_NUMBER_OF_TEXTURE_UNIT = 1 |
Protected Member Functions | |
| virtual void | forwardDraw ()=0 |
| virtual void | backwardDraw ()=0 |
Protected Attributes | |
| Data< int > | textureUnit |
| Data< bool > | enabled |
This is an abstract class which passes a texture id to an uniform sampler variable defined into the shader and load the image into OpenGL. At the moment, only texture2D is supported.
Definition at line 53 of file OglTexture.h.
| sofa::component::visualmodel::OglTexture::OglTexture | ( | ) |
Definition at line 47 of file OglTexture.cpp.
| sofa::component::visualmodel::OglTexture::~OglTexture | ( | ) | [virtual] |
Definition at line 54 of file OglTexture.cpp.
| virtual void sofa::component::visualmodel::OglTexture::backwardDraw | ( | ) | [protected, pure virtual] |
| virtual void sofa::component::visualmodel::OglTexture::bind | ( | ) | [pure virtual] |
| void sofa::component::visualmodel::OglTexture::bwdDraw | ( | Pass | ) | [virtual] |
Called after objects in the current branch are displayed.
Reimplemented from sofa::core::VisualModel.
Definition at line 107 of file OglTexture.cpp.
References backwardDraw(), enabled, sofa::core::objectmodel::Data< T >::getValue(), setActiveTexture(), textureUnit, and unbind().
| virtual void sofa::component::visualmodel::OglTexture::forwardDraw | ( | ) | [protected, pure virtual] |
| void sofa::component::visualmodel::OglTexture::fwdDraw | ( | Pass | ) | [virtual] |
Called before objects in the current branch are displayed.
Reimplemented from sofa::core::VisualModel.
Definition at line 97 of file OglTexture.cpp.
References bind(), enabled, forwardDraw(), sofa::core::objectmodel::Data< T >::getValue(), setActiveTexture(), and textureUnit.
| std::string sofa::component::visualmodel::OglTexture::getTextureName | ( | ) |
| void sofa::component::visualmodel::OglTexture::getTextureUnit | ( | ) |
| void sofa::component::visualmodel::OglTexture::init | ( | void | ) | [virtual] |
Initialization method called at graph modification, during bottom-up traversal.
Reimplemented from sofa::component::visualmodel::OglShaderElement.
Definition at line 64 of file OglTexture.cpp.
| void sofa::component::visualmodel::OglTexture::initVisual | ( | ) | [virtual] |
Initialize the textures, or other graphical resources.
Called once before the first frame is drawn, and if the graphical context has been recreated.
Reimplemented from sofa::core::VisualModel.
Reimplemented in sofa::component::visualmodel::OglTexture2D.
Definition at line 69 of file OglTexture.cpp.
References sofa::core::objectmodel::Data< T >::getValue(), MAX_NUMBER_OF_TEXTURE_UNIT, sofa::core::objectmodel::Data< T >::setValue(), and textureUnit.
| void sofa::component::visualmodel::OglTexture::reinit | ( | ) | [virtual] |
Update method called when variables used in precomputation are modified.
Reimplemented from sofa::core::objectmodel::BaseObject.
Reimplemented in sofa::component::visualmodel::OglTexture2D.
Definition at line 88 of file OglTexture.cpp.
References sofa::core::objectmodel::Data< T >::getValue(), MAX_NUMBER_OF_TEXTURE_UNIT, sofa::core::objectmodel::Data< T >::setValue(), and textureUnit.
| void sofa::component::visualmodel::OglTexture::setActiveTexture | ( | unsigned short | unit | ) | [static] |
Utility function to set current active texture.
Definition at line 59 of file OglTexture.cpp.
Referenced by bwdDraw(), fwdDraw(), and sofa::component::visualmodel::OglTexture2D::initVisual().
| virtual void sofa::component::visualmodel::OglTexture::unbind | ( | ) | [pure virtual] |
Data<bool> sofa::component::visualmodel::OglTexture::enabled [protected] |
unsigned short sofa::component::visualmodel::OglTexture::MAX_NUMBER_OF_TEXTURE_UNIT = 1 [static] |
Data<int> sofa::component::visualmodel::OglTexture::textureUnit [protected] |
Definition at line 57 of file OglTexture.h.
Referenced by bwdDraw(), fwdDraw(), sofa::component::visualmodel::OglTexture2D::initVisual(), initVisual(), sofa::component::visualmodel::OglTexture2D::parse(), and reinit().
1.5.7.1