Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Ogre::GLSLLinkProgramManager Class Reference

Ogre assumes that there are seperate vertex and fragment programs to deal with but GLSL has one program object that represents the active vertex and fragment shader objects during a rendering state. More...

#include <OgreGLSLLinkProgramManager.h>

Inheritance diagram for Ogre::GLSLLinkProgramManager:

Ogre::Singleton< GLSLLinkProgramManager > List of all members.

Public Member Functions

 GLSLLinkProgramManager (void)
 ~GLSLLinkProgramManager (void)
GLSLLinkProgramgetActiveLinkProgram (void)
 Get the program object that links the two active shader objects together if a program object was not already created and linked a new one is created and linked.

void setActiveFragmentShader (GLSLGpuProgram *fragmentGpuProgram)
 Set the active fragment shader for the next rendering state.

void setActiveVertexShader (GLSLGpuProgram *vertexGpuProgram)
 Set the active vertex shader for the next rendering state.


Static Public Member Functions

GLSLLinkProgramManagergetSingleton (void)
GLSLLinkProgramManagergetSingletonPtr (void)

Static Protected Attributes

GLSLLinkProgramManagerms_Singleton

Private Types

typedef HashMap< GLuint, GLSLLinkProgram * > LinkProgramMap
typedef LinkProgramMap::iterator LinkProgramIterator

Private Attributes

LinkProgramMap LinkPrograms
 container holding previously created program objects

GLSLGpuProgrammActiveVertexGpuProgram
 active objects defining the active rendering gpu state

GLSLGpuProgrammActiveFragmentGpuProgram
GLSLLinkProgrammActiveLinkProgram

Detailed Description

Ogre assumes that there are seperate vertex and fragment programs to deal with but GLSL has one program object that represents the active vertex and fragment shader objects during a rendering state.

GLSL Vertex and fragment shader objects are compiled seperately and then attached to a program object and then the program object is linked. Since Ogre can only handle one vertex program and one fragment program being active in a pass, the GLSL Link Program Manager does the same. The GLSL Link program manager acts as a state machine and activates a program object based on the active vertex and fragment program. Previously created program objects are stored along with a unique key in a hash_map for quick retrieval the next time the program object is required.

Definition at line 47 of file OgreGLSLLinkProgramManager.h.


Member Typedef Documentation

typedef LinkProgramMap::iterator Ogre::GLSLLinkProgramManager::LinkProgramIterator [private]
 

Definition at line 53 of file OgreGLSLLinkProgramManager.h.

typedef HashMap<GLuint, GLSLLinkProgram*> Ogre::GLSLLinkProgramManager::LinkProgramMap [private]
 

Definition at line 52 of file OgreGLSLLinkProgramManager.h.


Constructor & Destructor Documentation

Ogre::GLSLLinkProgramManager::GLSLLinkProgramManager void   ) 
 

Ogre::GLSLLinkProgramManager::~GLSLLinkProgramManager void   ) 
 


Member Function Documentation

GLSLLinkProgram* Ogre::GLSLLinkProgramManager::getActiveLinkProgram void   ) 
 

Get the program object that links the two active shader objects together if a program object was not already created and linked a new one is created and linked.

GLSLLinkProgramManager& Ogre::GLSLLinkProgramManager::getSingleton void   )  [static]
 

Reimplemented from Ogre::Singleton< GLSLLinkProgramManager >.

GLSLLinkProgramManager* Ogre::GLSLLinkProgramManager::getSingletonPtr void   )  [static]
 

Reimplemented from Ogre::Singleton< GLSLLinkProgramManager >.

void Ogre::GLSLLinkProgramManager::setActiveFragmentShader GLSLGpuProgram fragmentGpuProgram  ) 
 

Set the active fragment shader for the next rendering state.

The active program object will be cleared. Normally called from the GLSLGpuProgram::bindProgram and unbindProgram methods

void Ogre::GLSLLinkProgramManager::setActiveVertexShader GLSLGpuProgram vertexGpuProgram  ) 
 

Set the active vertex shader for the next rendering state.

The active program object will be cleared. Normally called from the GLSLGpuProgram::bindProgram and unbindProgram methods


Member Data Documentation

LinkProgramMap Ogre::GLSLLinkProgramManager::LinkPrograms [private]
 

container holding previously created program objects

Definition at line 56 of file OgreGLSLLinkProgramManager.h.

GLSLGpuProgram* Ogre::GLSLLinkProgramManager::mActiveFragmentGpuProgram [private]
 

Definition at line 60 of file OgreGLSLLinkProgramManager.h.

GLSLLinkProgram* Ogre::GLSLLinkProgramManager::mActiveLinkProgram [private]
 

Definition at line 61 of file OgreGLSLLinkProgramManager.h.

GLSLGpuProgram* Ogre::GLSLLinkProgramManager::mActiveVertexGpuProgram [private]
 

active objects defining the active rendering gpu state

Definition at line 59 of file OgreGLSLLinkProgramManager.h.

GLSLLinkProgramManager * Ogre::Singleton< GLSLLinkProgramManager >::ms_Singleton [static, protected, inherited]
 

Definition at line 54 of file OgreSingleton.h.


The documentation for this class was generated from the following file:

Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Mar 12 14:54:16 2006