Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound 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:

[legend]
List of all members.

## Public Methods

| GLSLLinkProgramManager (void)
| ~GLSLLinkProgramManager (void)
GLSLLinkProgram * | 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.
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 Methods

GLSLLinkProgramManager & | getSingleton (void)
GLSLLinkProgramManager * | getSingletonPtr (void)

## Static Protected Attributes

GLSLLinkProgramManager * | ms_Singleton = 0

## Private Types

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

## Private Attributes

LinkProgramMap | LinkPrograms
| container holding previously created program objects
GLSLGpuProgram * | mActiveVertexGpuProgram
| active objects defining the active rendering gpu state
GLSLGpuProgram * | mActiveFragmentGpuProgram
GLSLLinkProgram * | mActiveLinkProgram

## 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. Referenced by getActiveLinkProgram(), and ~GLSLLinkProgramManager().

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

| Definition at line 52 of file OgreGLSLLinkProgramManager.h.

## Constructor & Destructor Documentation

Ogre::GLSLLinkProgramManager::GLSLLinkProgramManager | ( | void |  | ) |

| Definition at line 49 of file OgreGLSLLinkProgramManager.cpp.

Ogre::GLSLLinkProgramManager::~GLSLLinkProgramManager | ( | void |  | ) |

| Definition at line 56 of file OgreGLSLLinkProgramManager.cpp. References LinkProgramIterator, and LinkPrograms.

## 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.

Definition at line 68 of file OgreGLSLLinkProgramManager.cpp.

References Ogre::GLSLLinkProgram::activate(), Ogre::GLSLProgram::attachToProgramObject(), Ogre::GLSLLinkProgram::getGLHandle(), Ogre::GLSLGpuProgram::getGLSLProgram(), Ogre::GLSLGpuProgram::getProgramID(), LinkProgramIterator, LinkPrograms, mActiveFragmentGpuProgram, mActiveLinkProgram, and mActiveVertexGpuProgram.

GLSLLinkProgramManager & Ogre::GLSLLinkProgramManager::getSingleton | ( | void |  | ) | `[static]`

| Reimplemented from Ogre::Singleton< GLSLLinkProgramManager >. Definition at line 43 of file OgreGLSLLinkProgramManager.cpp. References Ogre::Singleton< GLSLLinkProgramManager >::ms_Singleton.

GLSLLinkProgramManager * Ogre::GLSLLinkProgramManager::getSingletonPtr | ( | void |  | ) | `[static]`

| Reimplemented from Ogre::Singleton< GLSLLinkProgramManager >. Definition at line 37 of file OgreGLSLLinkProgramManager.cpp. References Ogre::Singleton< GLSLLinkProgramManager >::ms_Singleton.

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 Definition at line 127 of file OgreGLSLLinkProgramManager.cpp. References Ogre::glUseProgramObjectARB_ptr, mActiveFragmentGpuProgram, and mActiveLinkProgram.

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 Definition at line 140 of file OgreGLSLLinkProgramManager.cpp. References Ogre::glUseProgramObjectARB_ptr, mActiveLinkProgram, and mActiveVertexGpuProgram.

## Member Data Documentation

LinkProgramMap Ogre::GLSLLinkProgramManager::LinkPrograms`[private]`

| container holding previously created program objects Definition at line 56 of file OgreGLSLLinkProgramManager.h. Referenced by getActiveLinkProgram(), and ~GLSLLinkProgramManager().

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

| Definition at line 60 of file OgreGLSLLinkProgramManager.h. Referenced by getActiveLinkProgram(), and setActiveFragmentShader().

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

| Definition at line 61 of file OgreGLSLLinkProgramManager.h. Referenced by getActiveLinkProgram(), setActiveFragmentShader(), and setActiveVertexShader().

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

| active objects defining the active rendering gpu state Definition at line 59 of file OgreGLSLLinkProgramManager.h. Referenced by getActiveLinkProgram(), and setActiveVertexShader().

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

| Definition at line 34 of file OgreGLSLLinkProgramManager.cpp. Referenced by getSingleton(), and getSingletonPtr().

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

- OgreGLSLLinkProgramManager.h
- OgreGLSLLinkProgramManager.cpp

Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:49:37 2004