Ogre::GpuNamedConstants Struct Reference

Struct collecting together the information for named constants. More...

#include <OgreGpuProgram.h>

List of all members.

Public Member Functions

void generateConstantDefinitionArrayEntries (const String &paramName, const GpuConstantDefinition &baseDef)
 Generate additional constant entries for arrays based on a base definition.
void save (const String &filename) const
 Saves constant definitions to a file, compatible with GpuProgram::setManualNamedConstantsFile.
void load (DataStreamPtr &stream)
 Loads constant definitions from a stream, compatible with GpuProgram::setManualNamedConstantsFile.

Static Public Member Functions

static bool getGenerateAllConstantDefinitionArrayEntries ()
 Indicates whether all array entries will be generated and added to the definitions map.
static void setGenerateAllConstantDefinitionArrayEntries (bool generateAll)
 Sets whether all array entries will be generated and added to the definitions map.

Public Attributes

size_t floatBufferSize
 Total size of the float buffer required.
size_t intBufferSize
 Total size of the int buffer required.
GpuConstantDefinitionMap map
 Map of parameter names to GpuConstantDefinition.

Static Protected Attributes

static bool msGenerateAllConstantDefinitionArrayEntries
 Indicates whether all array entries will be generated and added to the definitions map.


Detailed Description

Struct collecting together the information for named constants.

Definition at line 149 of file OgreGpuProgram.h.


Member Function Documentation

void Ogre::GpuNamedConstants::generateConstantDefinitionArrayEntries ( const String paramName,
const GpuConstantDefinition baseDef 
)

Generate additional constant entries for arrays based on a base definition.

Remarks:
Array uniforms will be added just with their base name with no array suffix. This method will add named entries for array suffixes too so individual array entries can be addressed. Note that we only individually index array elements if the array size is up to 16 entries in size. Anything larger than that only gets a [0] entry as well as the main entry, to save cluttering up the name map. After all, you can address the larger arrays in a bulk fashion much more easily anyway.

static bool Ogre::GpuNamedConstants::getGenerateAllConstantDefinitionArrayEntries (  )  [static]

Indicates whether all array entries will be generated and added to the definitions map.

static void Ogre::GpuNamedConstants::setGenerateAllConstantDefinitionArrayEntries ( bool  generateAll  )  [static]

Sets whether all array entries will be generated and added to the definitions map.

Remarks:
Usually, array entries can only be individually indexed if they're up to 16 entries long, to save memory - arrays larger than that can be set but only via the bulk setting methods. This option allows you to choose to individually index every array entry.

void Ogre::GpuNamedConstants::save ( const String filename  )  const

Saves constant definitions to a file, compatible with GpuProgram::setManualNamedConstantsFile.

See also:
GpuProgram::setManualNamedConstantsFile

void Ogre::GpuNamedConstants::load ( DataStreamPtr stream  ) 

Loads constant definitions from a stream, compatible with GpuProgram::setManualNamedConstantsFile.

See also:
GpuProgram::setManualNamedConstantsFile


Member Data Documentation

Total size of the float buffer required.

Definition at line 152 of file OgreGpuProgram.h.

Total size of the int buffer required.

Definition at line 154 of file OgreGpuProgram.h.

Map of parameter names to GpuConstantDefinition.

Definition at line 156 of file OgreGpuProgram.h.

Indicates whether all array entries will be generated and added to the definitions map.

Remarks:
Normally, the number of array entries added to the definitions map is capped at 16 to save memory. Setting this value to true allows all of the entries to be generated and added to the map.

Definition at line 199 of file OgreGpuProgram.h.


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

Copyright © 2008 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Sep 27 22:03:26 2009