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

# Ogre::GLSLLinkProgram Class Reference

C++ encapsulation of GLSL Program Object. More...

`#include <OgreGLSLLinkProgram.h>`

List of all members.

## Public Methods

| GLSLLinkProgram (void)
| constructor should only be used by GLSLLinkProgramManager
| ~GLSLLinkProgram (void)
void | activate (void)
| Makes a program object active by making sure it is linked and then putting it in use.
void | updateUniforms (GpuProgramParametersSharedPtr params)
| updates program object uniforms using data from GpuProgramParamters.
GLhandleARB | getGLHandle (void) const
| get the GL Handle for the program object

## Private Types

typedef std::vector< UniformReference > | UniformReferenceList
typedef UniformReferenceList::iterator | UniformReferenceIterator

## Private Methods

void | buildUniformReferences (void)
| build uniform references from active named uniforms

## Private Attributes

UniformReferenceList | mUniformReferences
| container of uniform references that are active in the program object
bool | mUniformRefsBuilt
| flag to indicate that uniform references have already been built
GLhandleARB | mGLHandle
| GL handle for the program object.
GLint | mLinked
| flag indicating that the program object has been successfully linked

## Detailed Description

C++ encapsulation of GLSL Program Object.

Definition at line 37 of file OgreGLSLLinkProgram.h.

## Member Typedef Documentation

typedef UniformReferenceList::iterator Ogre::GLSLLinkProgram::UniformReferenceIterator`[private]`

| Definition at line 51 of file OgreGLSLLinkProgram.h. Referenced by updateUniforms().

typedef std::vector<UniformReference> Ogre::GLSLLinkProgram::UniformReferenceList`[private]`

| Definition at line 50 of file OgreGLSLLinkProgram.h.

## Constructor & Destructor Documentation

Ogre::GLSLLinkProgram::GLSLLinkProgram | ( | void |  | ) |

| constructor should only be used by GLSLLinkProgramManager Definition at line 34 of file OgreGLSLLinkProgram.cpp. References Ogre::checkForGLSLError(), Ogre::glCreateProgramObjectARB_ptr, and mGLHandle.

Ogre::GLSLLinkProgram::~GLSLLinkProgram | ( | void |  | ) |

| Definition at line 44 of file OgreGLSLLinkProgram.cpp. References Ogre::glDeleteObjectARB_ptr, and mGLHandle.

## Member Function Documentation

void Ogre::GLSLLinkProgram::activate | ( | void |  | ) |

Makes a program object active by making sure it is linked and then putting it in use.

Definition at line 51 of file OgreGLSLLinkProgram.cpp.

References buildUniformReferences(), Ogre::checkForGLSLError(), Ogre::glGetObjectParameterivARB_ptr, Ogre::glLinkProgramARB_ptr, Ogre::glUseProgramObjectARB_ptr, Ogre::logObjectInfo(), mGLHandle, mLinked, and Ogre::String.

Referenced by Ogre::GLSLLinkProgramManager::getActiveLinkProgram().

void Ogre::GLSLLinkProgram::buildUniformReferences | ( | void |  | ) | `[private]`

build uniform references from active named uniforms

Definition at line 75 of file OgreGLSLLinkProgram.cpp.

References Ogre::glGetActiveUniformARB_ptr, Ogre::glGetObjectParameterivARB_ptr, Ogre::glGetUniformLocationARB_ptr, GLint, Ogre::GLSLLinkProgram::UniformReference::isReal, Ogre::GLSLLinkProgram::UniformReference::mElementCount, mGLHandle, Ogre::GLSLLinkProgram::UniformReference::mLocation, Ogre::GLSLLinkProgram::UniformReference::mName, Ogre::GLSLLinkProgram::UniformReference::mType, mUniformReferences, mUniformRefsBuilt, and Ogre::String.

Referenced by activate().

GLhandleARB Ogre::GLSLLinkProgram::getGLHandle | ( | void |  | ) | const

| get the GL Handle for the program object Definition at line 79 of file OgreGLSLLinkProgram.h. References mGLHandle. Referenced by Ogre::GLSLLinkProgramManager::getActiveLinkProgram().

void Ogre::GLSLLinkProgram::updateUniforms | ( | GpuProgramParametersSharedPtr | params | ) |

updates program object uniforms using data from GpuProgramParamters.

normally called by GLSLGpuProgram::bindParameters() just before rendering occurs.

Definition at line 161 of file OgreGLSLLinkProgram.cpp.

References Ogre::glUniform1fvARB_ptr, Ogre::glUniform1ivARB_ptr, Ogre::glUniform2fvARB_ptr, Ogre::glUniform2ivARB_ptr, Ogre::glUniform3fvARB_ptr, Ogre::glUniform3ivARB_ptr, Ogre::glUniform4fvARB_ptr, Ogre::glUniform4ivARB_ptr, Ogre::GpuProgramParametersSharedPtr, Ogre::GpuProgramParameters::IntConstantEntry::isSet, Ogre::GpuProgramParameters::RealConstantEntry::isSet, mUniformReferences, params, UniformReferenceIterator, Ogre::GpuProgramParameters::IntConstantEntry::val, and Ogre::GpuProgramParameters::RealConstantEntry::val.

Referenced by Ogre::GLSLGpuProgram::bindProgramParameters().

## Member Data Documentation

GLhandleARB Ogre::GLSLLinkProgram::mGLHandle`[private]`

| GL handle for the program object. Definition at line 58 of file OgreGLSLLinkProgram.h. Referenced by activate(), buildUniformReferences(), getGLHandle(), GLSLLinkProgram(), and ~GLSLLinkProgram().

GLint Ogre::GLSLLinkProgram::mLinked`[private]`

| flag indicating that the program object has been successfully linked Definition at line 60 of file OgreGLSLLinkProgram.h. Referenced by activate().

UniformReferenceList Ogre::GLSLLinkProgram::mUniformReferences`[private]`

| container of uniform references that are active in the program object Definition at line 53 of file OgreGLSLLinkProgram.h. Referenced by buildUniformReferences(), and updateUniforms().

bool Ogre::GLSLLinkProgram::mUniformRefsBuilt`[private]`

| flag to indicate that uniform references have already been built Definition at line 56 of file OgreGLSLLinkProgram.h. Referenced by buildUniformReferences().

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

- OgreGLSLLinkProgram.h
- OgreGLSLLinkProgram.cpp

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