Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Ogre::GLSLESCgProgram Class Reference

Specialisation of HighLevelGpuProgram to provide support for CG. More...

#include <OgreGLSLESCgProgram.h>

Inheritance diagram for Ogre::GLSLESCgProgram:
Inheritance graph
[legend]

Classes

class  CmdEntryPoint
 Command object for setting entry point. More...
 
class  CmdProfiles
 Command object for setting profiles. More...
 

Public Member Functions

 GLSLESCgProgram (ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual, ManualResourceLoader *loader)
 
 ~GLSLESCgProgram ()
 
void attachToProgramObject (const GLuint programObject)
 
bool compile (const bool checkErrors=false)
 compile source into shader object More...
 
GpuProgramParametersSharedPtr createParameters (void)
 Overridden from GpuProgram. More...
 
void detachFromProgramObject (const GLuint programObject)
 
const StringgetEntryPoint (void) const
 Gets the entry point defined for this program. More...
 
GLuint getGLProgramHandle () const
 
GLuint getGLShaderHandle () const
 GL Shader Handle. More...
 
bool getIsOptimised (void)
 Gets if the GLSL source has been optimised successfully. More...
 
const StringgetLanguage (void) const
 Overridden from GLSLESProgram. More...
 
String getOptimisedSource (void)
 Gets he optimised GLSL source. More...
 
bool getOptimiserEnabled (void) const
 Gets if the GLSL optimiser is enabled. More...
 
bool getPassFogStates (void) const
 
bool getPassSurfaceAndLightStates (void) const
 
bool getPassTransformStates (void) const
 Overridden. More...
 
const StringgetPreprocessorDefines (void) const
 Sets the preprocessor defines use to compile the program. More...
 
const StringVectorgetProfiles (void) const
 Gets the Cg profiles which can be supported by the program. More...
 
void loadFromSource (void)
 Overridden from GLSLESProgram. More...
 
void setEntryPoint (const String &entryPoint)
 Sets the entry point for this program ie the first method called. More...
 
void setIsOptimised (bool flag)
 Sets if the GLSL source has been optimised successfully. More...
 
void setOptimisedSource (const String &src)
 Sets the optimised GLSL source. More...
 
void setOptimiserEnabled (bool enabled)
 Sets if the GLSL optimiser is enabled. More...
 
void setPreprocessorDefines (const String &defines)
 Sets the preprocessor defines use to compile the program. More...
 
void setProfiles (const StringVector &profiles)
 Sets the Cg profiles which can be supported by the program. More...
 

Protected Member Functions

void buildConstantDefinitions () const
 Populate the passed parameters with name->index map, must be overridden. More...
 
void checkAndFixInvalidDefaultPrecisionError (String &message)
 check the compile result for an error with default precision - and recompile if needed. More...
 
void createLowLevelImpl (void)
 Internal method for creating a dummy low-level program for this high-level program. More...
 
String deleteRegisterFromCg (const String &inSource)
 
bool isSyntaxSupported ()
 
virtual void notifyOnContextLost ()
 See AndroidResource. More...
 
void populateParameterNames (GpuProgramParametersSharedPtr params)
 Populate the passed parameters with name->index map. More...
 
String resolveCgIncludes (const String &inSource, Resource *resourceBeingLoaded, const String &fileName)
 scan the file for #include and replace with source from the OGRE resources More...
 
void unloadHighLevelImpl (void)
 Internal unload implementation, must be implemented by subclasses. More...
 
void unloadImpl (void)
 Overridden from HighLevelGpuProgram. More...
 

Protected Attributes

String mEntryPoint
 
StringVector mProfiles
 

Static Protected Attributes

static CmdEntryPoint msCmdEntryPoint
 
static CmdOptimisation msCmdOptimisation
 
static CmdPreprocessorDefines msCmdPreprocessorDefines
 
static CmdProfiles msCmdProfiles
 

Detailed Description

Specialisation of HighLevelGpuProgram to provide support for CG.

Remarks
Cg programs will be converted to GLSL

Definition at line 39 of file OgreGLSLESCgProgram.h.

Constructor & Destructor Documentation

◆ GLSLESCgProgram()

Ogre::GLSLESCgProgram::GLSLESCgProgram ( ResourceManager creator,
const String name,
ResourceHandle  handle,
const String group,
bool  isManual,
ManualResourceLoader loader 
)

◆ ~GLSLESCgProgram()

Ogre::GLSLESCgProgram::~GLSLESCgProgram ( )

Member Function Documentation

◆ attachToProgramObject()

void Ogre::GLSLESProgram::attachToProgramObject ( const GLuint  programObject)
inherited

◆ buildConstantDefinitions()

void Ogre::GLSLESProgram::buildConstantDefinitions ( ) const
protectedinherited

Populate the passed parameters with name->index map, must be overridden.

◆ checkAndFixInvalidDefaultPrecisionError()

void Ogre::GLSLESProgram::checkAndFixInvalidDefaultPrecisionError ( String message)
protectedinherited

check the compile result for an error with default precision - and recompile if needed.

some glsl compilers return an error default precision is set to types other then int or float, this function test a failed compile result for the error, delete the needed lines from the source if needed then try to re-compile.

◆ compile()

bool Ogre::GLSLESProgram::compile ( const bool  checkErrors = false)
inherited

compile source into shader object

◆ createLowLevelImpl()

void Ogre::GLSLESProgram::createLowLevelImpl ( void  )
protectedinherited

Internal method for creating a dummy low-level program for this high-level program.

GLSL ES does not give access to the low level implementation of the shader so this method creates an object sub-classed from GLES2GpuProgram just to be compatible with GLES2RenderSystem.

◆ createParameters()

GpuProgramParametersSharedPtr Ogre::GLSLESProgram::createParameters ( void  )
inherited

Overridden from GpuProgram.

◆ deleteRegisterFromCg()

String Ogre::GLSLESCgProgram::deleteRegisterFromCg ( const String inSource)
protected

◆ detachFromProgramObject()

void Ogre::GLSLESProgram::detachFromProgramObject ( const GLuint  programObject)
inherited

◆ getEntryPoint()

const String& Ogre::GLSLESCgProgram::getEntryPoint ( void  ) const

Gets the entry point defined for this program.

Definition at line 72 of file OgreGLSLESCgProgram.h.

◆ getGLProgramHandle()

GLuint Ogre::GLSLESProgram::getGLProgramHandle ( ) const
inherited

Definition at line 79 of file OgreGLSLESProgram.h.

◆ getGLShaderHandle()

GLuint Ogre::GLSLESProgram::getGLShaderHandle ( ) const
inherited

GL Shader Handle.

Definition at line 76 of file OgreGLSLESProgram.h.

◆ getIsOptimised()

bool Ogre::GLSLESProgram::getIsOptimised ( void  )
inherited

Gets if the GLSL source has been optimised successfully.

Definition at line 100 of file OgreGLSLESProgram.h.

◆ getLanguage()

const String& Ogre::GLSLESCgProgram::getLanguage ( void  ) const

Overridden from GLSLESProgram.

◆ getOptimisedSource()

String Ogre::GLSLESProgram::getOptimisedSource ( void  )
inherited

Gets he optimised GLSL source.

Definition at line 105 of file OgreGLSLESProgram.h.

◆ getOptimiserEnabled()

bool Ogre::GLSLESProgram::getOptimiserEnabled ( void  ) const
inherited

Gets if the GLSL optimiser is enabled.

Definition at line 95 of file OgreGLSLESProgram.h.

◆ getPassFogStates()

bool Ogre::GLSLESProgram::getPassFogStates ( void  ) const
inherited

◆ getPassSurfaceAndLightStates()

bool Ogre::GLSLESProgram::getPassSurfaceAndLightStates ( void  ) const
inherited

◆ getPassTransformStates()

bool Ogre::GLSLESProgram::getPassTransformStates ( void  ) const
inherited

Overridden.

◆ getPreprocessorDefines()

const String& Ogre::GLSLESProgram::getPreprocessorDefines ( void  ) const
inherited

Sets the preprocessor defines use to compile the program.

Definition at line 89 of file OgreGLSLESProgram.h.

◆ getProfiles()

const StringVector& Ogre::GLSLESCgProgram::getProfiles ( void  ) const

Gets the Cg profiles which can be supported by the program.

Definition at line 76 of file OgreGLSLESCgProgram.h.

◆ isSyntaxSupported()

bool Ogre::GLSLESCgProgram::isSyntaxSupported ( )
protected

◆ loadFromSource()

void Ogre::GLSLESCgProgram::loadFromSource ( void  )

Overridden from GLSLESProgram.

◆ notifyOnContextLost()

virtual void Ogre::GLSLESProgram::notifyOnContextLost ( )
protectedvirtualinherited

◆ populateParameterNames()

void Ogre::GLSLESProgram::populateParameterNames ( GpuProgramParametersSharedPtr  params)
protectedinherited

Populate the passed parameters with name->index map.

◆ resolveCgIncludes()

String Ogre::GLSLESCgProgram::resolveCgIncludes ( const String inSource,
Resource resourceBeingLoaded,
const String fileName 
)
protected

scan the file for #include and replace with source from the OGRE resources

◆ setEntryPoint()

void Ogre::GLSLESCgProgram::setEntryPoint ( const String entryPoint)

Sets the entry point for this program ie the first method called.

Definition at line 70 of file OgreGLSLESCgProgram.h.

◆ setIsOptimised()

void Ogre::GLSLESProgram::setIsOptimised ( bool  flag)
inherited

Sets if the GLSL source has been optimised successfully.

Definition at line 98 of file OgreGLSLESProgram.h.

◆ setOptimisedSource()

void Ogre::GLSLESProgram::setOptimisedSource ( const String src)
inherited

Sets the optimised GLSL source.

Definition at line 103 of file OgreGLSLESProgram.h.

◆ setOptimiserEnabled()

void Ogre::GLSLESProgram::setOptimiserEnabled ( bool  enabled)
inherited

Sets if the GLSL optimiser is enabled.

◆ setPreprocessorDefines()

void Ogre::GLSLESProgram::setPreprocessorDefines ( const String defines)
inherited

Sets the preprocessor defines use to compile the program.

Definition at line 87 of file OgreGLSLESProgram.h.

◆ setProfiles()

void Ogre::GLSLESCgProgram::setProfiles ( const StringVector profiles)

Sets the Cg profiles which can be supported by the program.

◆ unloadHighLevelImpl()

void Ogre::GLSLESProgram::unloadHighLevelImpl ( void  )
protectedinherited

Internal unload implementation, must be implemented by subclasses.

◆ unloadImpl()

void Ogre::GLSLESProgram::unloadImpl ( void  )
protectedinherited

Overridden from HighLevelGpuProgram.

Member Data Documentation

◆ mEntryPoint

String Ogre::GLSLESCgProgram::mEntryPoint
protected

Definition at line 80 of file OgreGLSLESCgProgram.h.

◆ mProfiles

StringVector Ogre::GLSLESCgProgram::mProfiles
protected

Definition at line 81 of file OgreGLSLESCgProgram.h.

◆ msCmdEntryPoint

CmdEntryPoint Ogre::GLSLESCgProgram::msCmdEntryPoint
staticprotected

Definition at line 78 of file OgreGLSLESCgProgram.h.

◆ msCmdOptimisation

CmdOptimisation Ogre::GLSLESProgram::msCmdOptimisation
staticprotectedinherited

Definition at line 119 of file OgreGLSLESProgram.h.

◆ msCmdPreprocessorDefines

CmdPreprocessorDefines Ogre::GLSLESProgram::msCmdPreprocessorDefines
staticprotectedinherited

Definition at line 117 of file OgreGLSLESProgram.h.

◆ msCmdProfiles

CmdProfiles Ogre::GLSLESCgProgram::msCmdProfiles
staticprotected

Definition at line 79 of file OgreGLSLESCgProgram.h.


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

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Sun Oct 22 2017 04:04:15