Ogre::RTShader::Program Class Reference
RTShader

A class that represents a shader based program. More...

`#include <OgreShaderProgram.h>`

Inheritance diagram for Ogre::RTShader::Program:
[legend]

List of all members.

## Public Member Functions

GpuProgramType | getType () const
| Get the type of this program.
UniformParameterPtr | resolveAutoParameterReal (GpuProgramParameters::AutoConstantType autoType, Real data, size_t size=0)
| Resolve uniform auto constant parameter with associated real data of this program.
UniformParameterPtr | resolveAutoParameterReal (GpuProgramParameters::AutoConstantType autoType, GpuConstantType type, Real data, size_t size=0)
| Resolve uniform auto constant parameter with associated real data of this program.
UniformParameterPtr | resolveAutoParameterInt (GpuProgramParameters::AutoConstantType autoType, size_t data, size_t size=0)
| Resolve uniform auto constant parameter with associated int data of this program.
UniformParameterPtr | resolveAutoParameterInt (GpuProgramParameters::AutoConstantType autoType, GpuConstantType type, size_t data, size_t size=0)
| Resolve uniform auto constant parameter with associated int data of this program.
UniformParameterPtr | resolveParameter (GpuConstantType type, int index, uint16 variability, const String &suggestedName, size_t size=0)
| Resolve uniform parameter of this program.
UniformParameterPtr | getParameterByName (const String &name)
| Get parameter by a given name.
UniformParameterPtr | getParameterByAutoType (GpuProgramParameters::AutoConstantType autoType)
| Get parameter by a given auto constant type.
UniformParameterPtr | getParameterByType (GpuConstantType type, int index)
| Get parameter by a given type and index.
const UniformParameterList & | getParameters () const
| Get the list of uniform parameters of this program.
Function * | createFunction (const String &name, const String &desc, const Function::FunctionType functionType)
| Create new function in this program.
Function * | getFunctionByName (const String &name)
| Get a function by a given name.
const ShaderFunctionList & | getFunctions () const
| Get the function list of this program.
void | setEntryPointFunction (Function *function)
| Set the entry point function.
Function * | getEntryPointFunction ()
| Get the entry point function of this program.
void | addDependency (const String &libFileName)
| Add dependency for this program.
size_t | getDependencyCount () const
| Get the number of external libs this program depends on.
const String & | getDependency (unsigned int index) const
| Get the library name of the given index dependency.
void | setSkeletalAnimationIncluded (bool value)
| Sets whether a vertex program includes the required instructions to perform skeletal animation.
bool | getSkeletalAnimationIncluded () const
| Returns whether a vertex program includes the required instructions to perform skeletal animation.
void * | operator new (size_t sz, const char *file, int line, const char *func)
| operator new, with debug line info
void * | operator new (size_t sz)
void * | operator new (size_t sz, void *ptr)
| placement operator new
void * | operator new[] (size_t sz, const char *file, int line, const char *func)
| array operator new, with debug line info
void * | operator new[] (size_t sz)
void | operator delete (void *ptr)
void | operator delete (void *ptr, void *)
void | operator delete (void *ptr, const char *, int, const char *)
void | operator delete[] (void *ptr)
void | operator delete[] (void *ptr, const char *, int, const char *)

## Protected Member Functions

| Program (GpuProgramType type)
| Class constructor.
| ~Program ()
| Class destructor.
void | destroyParameters ()
| Destroy all parameters of this program.
void | destroyFunctions ()
| Destroy all functions of this program.
void | addParameter (UniformParameterPtr parameter)
| Add parameter to this program.
void | removeParameter (UniformParameterPtr parameter)
| Remove parameter from this program.

## Protected Attributes

GpuProgramType | mType
UniformParameterList | mParameters
ShaderFunctionList | mFunctions
Function * | mEntryPointFunction
StringVector | mDependencies
bool | mSkeletalAnimation

## Friends

class | ProgramManager

## Detailed Description

A class that represents a shader based program.

Definition at line 50 of file OgreShaderProgram.h.

## Constructor & Destructor Documentation

Ogre::RTShader::Program::Program | ( | GpuProgramType | type | ) | `[protected]`

Class constructor.

Parameters:

  type | The type of this program.

Ogre::RTShader::Program::~Program | ( |  | ) | `[protected]`

Class destructor.

## Member Function Documentation

void Ogre::RTShader::Program::addDependency | ( | const String & | libFileName | ) |

Add dependency for this program.

Basically a filename that will be included in this program and provide predefined shader functions code. One should verify that the given library file he provides can be reached by the resource manager. This step can be achieved using the ResourceGroupManager::addResourceLocation method.

void Ogre::RTShader::Program::addParameter | ( | UniformParameterPtr | parameter | ) | `[protected]`

Add parameter to this program.

Function* Ogre::RTShader::Program::createFunction | ( | const String & | name,
|  | const String & | desc,
|  | const Function::FunctionType | functionType
| ) |  |

Create new function in this program.

Return the newly created function instance.

Parameters:

  name | The name of the function to create.
  desc | The description of the function.

void Ogre::RTShader::Program::destroyFunctions | ( |  | ) | `[protected]`

Destroy all functions of this program.

void Ogre::RTShader::Program::destroyParameters | ( |  | ) | `[protected]`

Destroy all parameters of this program.

const String& Ogre::RTShader::Program::getDependency | ( | unsigned int | index | ) | const

Get the library name of the given index dependency.

Parameters:

  index | The index of the dependecy.

size_t Ogre::RTShader::Program::getDependencyCount | ( |  | ) | const

Get the number of external libs this program depends on.

Function* Ogre::RTShader::Program::getEntryPointFunction | ( |  | ) |

Get the entry point function of this program.

Definition at line 147 of file OgreShaderProgram.h.

Function* Ogre::RTShader::Program::getFunctionByName | ( | const String & | name | ) |

Get a function by a given name.

Return NULL if no matching function found.

Parameters:

  name | The name of the function to search for.

const ShaderFunctionList& Ogre::RTShader::Program::getFunctions | ( |  | ) | const

Get the function list of this program.

Definition at line 139 of file OgreShaderProgram.h.

UniformParameterPtr Ogre::RTShader::Program::getParameterByAutoType | ( | GpuProgramParameters::AutoConstantType | autoType | ) |

Get parameter by a given auto constant type.

Parameters:

  autoType | The auto type of the parameter to search for.

Remarks:
  Return NULL if no matching parameter found.

UniformParameterPtr Ogre::RTShader::Program::getParameterByName | ( | const String & | name | ) |

Get parameter by a given name.

Parameters:

  name | The name of the parameter to search for.

Remarks:
  Return NULL if no matching parameter found.

UniformParameterPtr Ogre::RTShader::Program::getParameterByType | ( | GpuConstantType | type,
|  | int | index
| ) |  |

Get parameter by a given type and index.

Parameters:

  type | The type of the parameter to search for.
  index | The index of the parameter to search for.

Remarks:
  Return NULL if no matching parameter found.

const UniformParameterList& Ogre::RTShader::Program::getParameters | ( |  | ) | const

Get the list of uniform parameters of this program.

Definition at line 124 of file OgreShaderProgram.h.

bool Ogre::RTShader::Program::getSkeletalAnimationIncluded | ( |  | ) | const

Returns whether a vertex program includes the required instructions to perform skeletal animation.

Definition at line 173 of file OgreShaderProgram.h.

GpuProgramType Ogre::RTShader::Program::getType | ( |  | ) | const

Get the type of this program.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr | ) | `[inherited]`

Definition at line 95 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | void * |
| ) |  | `[inherited]`

Definition at line 101 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |
| ) |  | `[inherited]`

Definition at line 107 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr | ) | `[inherited]`

Definition at line 112 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |
| ) |  | `[inherited]`

Definition at line 118 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func
| ) |  | `[inherited]`

operator new, with debug line info

Definition at line 67 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz | ) | `[inherited]`

Definition at line 72 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | void * | ptr
| ) |  | `[inherited]`

placement operator new

Definition at line 78 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func
| ) |  | `[inherited]`

array operator new, with debug line info

Definition at line 85 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz | ) | `[inherited]`

Definition at line 90 of file OgreMemoryAllocatedObject.h.

void Ogre::RTShader::Program::removeParameter | ( | UniformParameterPtr | parameter | ) | `[protected]`

Remove parameter from this program.

UniformParameterPtr Ogre::RTShader::Program::resolveAutoParameterInt | ( | GpuProgramParameters::AutoConstantType | autoType,
|  | size_t | data,
|  | size_t | size = `0`
| ) |  |

Resolve uniform auto constant parameter with associated int data of this program.

Parameters:

  autoType | The auto type of the desired parameter.
  data | The data to associate with the auto parameter.
  size | number of elements in the parameter. Return parameter instance in case of that resolve operation succeeded.

UniformParameterPtr Ogre::RTShader::Program::resolveAutoParameterInt | ( | GpuProgramParameters::AutoConstantType | autoType,
|  | GpuConstantType | type,
|  | size_t | data,
|  | size_t | size = `0`
| ) |  |

Resolve uniform auto constant parameter with associated int data of this program.

Parameters:

  autoType | The auto type of the desired parameter.
  type | The desired data type of the auto parameter.
  data | The data to associate with the auto parameter.
  size | number of elements in the parameter. Return parameter instance in case of that resolve operation succeeded.

UniformParameterPtr Ogre::RTShader::Program::resolveAutoParameterReal | ( | GpuProgramParameters::AutoConstantType | autoType,
|  | Real | data,
|  | size_t | size = `0`
| ) |  |

Resolve uniform auto constant parameter with associated real data of this program.

Parameters:

  autoType | The auto type of the desired parameter.
  data | The data to associate with the auto parameter.
  size | number of elements in the parameter. Return parameter instance in case of that resolve operation succeeded.

UniformParameterPtr Ogre::RTShader::Program::resolveAutoParameterReal | ( | GpuProgramParameters::AutoConstantType | autoType,
|  | GpuConstantType | type,
|  | Real | data,
|  | size_t | size = `0`
| ) |  |

Resolve uniform auto constant parameter with associated real data of this program.

Parameters:

  autoType | The auto type of the desired parameter.
  type | The desired data type of the auto parameter.
  data | The data to associate with the auto parameter.
  size | number of elements in the parameter. Return parameter instance in case of that resolve operation succeeded.

UniformParameterPtr Ogre::RTShader::Program::resolveParameter | ( | GpuConstantType | type,
|  | int | index,
|  | uint16 | variability,
|  | const String & | suggestedName,
|  | size_t | size = `0`
| ) |  |

Resolve uniform parameter of this program.

Parameters:

  type | The type of the desired parameter.
  index | The index of the desired parameter.
  suggestedName | The suggested name for the parameter in case new one should be create.
  variability | How this parameter varies (bitwise combination of GpuProgramVariability).
  size | number of elements in the parameter. Return parameter instance in case of that resolve operation succeeded.

Remarks:
  Pass -1 as index parameter to create a new parameter with the desired type and index.

void Ogre::RTShader::Program::setEntryPointFunction | ( | Function * | function | ) |

Set the entry point function.

Parameters:

  function | The function that will use as entry point of this program.

Definition at line 144 of file OgreShaderProgram.h.

void Ogre::RTShader::Program::setSkeletalAnimationIncluded | ( | bool | value | ) |

Sets whether a vertex program includes the required instructions to perform skeletal animation.

Definition at line 168 of file OgreShaderProgram.h.

## Friends And Related Function Documentation

friend class ProgramManager `[friend]`

Definition at line 214 of file OgreShaderProgram.h.

## Member Data Documentation

StringVector Ogre::RTShader::Program::mDependencies `[protected]`

Definition at line 210 of file OgreShaderProgram.h.

Function* Ogre::RTShader::Program::mEntryPointFunction `[protected]`

Definition at line 208 of file OgreShaderProgram.h.

ShaderFunctionList Ogre::RTShader::Program::mFunctions `[protected]`

Definition at line 206 of file OgreShaderProgram.h.

UniformParameterList Ogre::RTShader::Program::mParameters `[protected]`

Definition at line 204 of file OgreShaderProgram.h.

bool Ogre::RTShader::Program::mSkeletalAnimation `[protected]`

Definition at line 212 of file OgreShaderProgram.h.

GpuProgramType Ogre::RTShader::Program::mType `[protected]`

Definition at line 202 of file OgreShaderProgram.h.

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

- OgreShaderProgram.h

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Sun Sep 2 2012 07:28:06