| OGRE 1.10.8 Object-Oriented Graphics Rendering Engine

Public Member Functions | Static Public Member Functions | List of all members
Ogre::GLSLShader Class Reference

Specialisation of HighLevelGpuProgram to encapsulate shader objects obtained from compiled shaders written in the OpenGL Shader Language (GLSL). More...

`#include <OgreGLSLShader.h>`

Inheritance diagram for Ogre::GLSLShader:
[legend]

## Public Member Functions
| GLSLShader (ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual, ManualResourceLoader *loader)
| ~GLSLShader ()
GpuProgram * | _getBindingDelegate (void)
| Since GLSL has no assembly, use this shader for binding. More...
void | attachToProgramObject (const GLuint programObject)
void | bind (void)
| Bind the shader in OpenGL. More...
void | bindParameters (GpuProgramParametersSharedPtr params, uint16 mask)
| Execute the param binding functions for this shader. More...
void | bindPassIterationParameters (GpuProgramParametersSharedPtr params)
| Execute the pass iteration param binding functions for this shader. More...
void | bindSharedParameters (GpuProgramParametersSharedPtr params, uint16 mask)
| Execute the shared param binding functions for this shader. More...
size_t | calculateSize (void) const
| Calculate the size of a resource; this will only be called after 'load'. More...
bool | compile (bool checkErrors=false)
| Compile source into shader object. More...
GpuProgramParametersSharedPtr | createParameters (void)
| Overridden from GpuProgram. More...
void | detachFromProgramObject (const GLuint programObject)
GLuint | getGLProgramHandle ()
GLuint | getGLShaderHandle () const
const String & | getLanguage (void) const
| Overridden from GpuProgram. More...
void | unbind (void)
| Unbind the shader in OpenGL. More...

## Static Public Member Functions
static GLenum | getGLShaderType (GpuProgramType programType)
| Get OpenGL GLSL shader type from OGRE GPU program type. More...
static String | getShaderTypeLabel (GpuProgramType programType)
| Get a string containing the name of the GLSL shader type correspondening to the OGRE GPU program type. More...

## Detailed Description

Specialisation of HighLevelGpuProgram to encapsulate shader objects obtained from compiled shaders written in the OpenGL Shader Language (GLSL).

Remarks
  GLSL has no target assembler or entry point specification like DirectX 9 HLSL. Vertex and Fragment shaders only have one entry point called "main". When a shader is compiled, microcode is generated but can not be accessed by the application. GLSL also does not provide assembler low level output after compiling. The GL Render system assumes that the Gpu program is a GL GPU program so GLSLShader will create a GL3PlusShader for the low level implementation. The GLSLShader class will create a shader object and compile the source but will not create a program object. It's up to GL3PlusShader class to request a program object to link the shader object to.

Note
  GLSL supports multiple modular shader objects that can be attached to one program object to form a single shader. This is supported through the "attach" material script command. All the modules to be attached are listed on the same line as the attach command separated by white space.

## Constructor & Destructor Documentation

## ◆ GLSLShader()

Ogre::GLSLShader::GLSLShader | ( | ResourceManager * | creator,
|  | const String & | name,
|  | ResourceHandle | handle,
|  | const String & | group,
|  | bool | isManual,
|  | ManualResourceLoader * | loader
| ) |  |

## ◆ ~GLSLShader()

Ogre::GLSLShader::~GLSLShader | ( |  | ) |

## Member Function Documentation

## ◆ getGLShaderHandle()

GLuint Ogre::GLSLShader::getGLShaderHandle | ( |  | ) | const
| inline

## ◆ getGLProgramHandle()

GLuint Ogre::GLSLShader::getGLProgramHandle | ( |  | ) |

## ◆ attachToProgramObject()

void Ogre::GLSLShader::attachToProgramObject | ( | const GLuint | programObject | ) |

## ◆ detachFromProgramObject()

void Ogre::GLSLShader::detachFromProgramObject | ( | const GLuint | programObject | ) |

## ◆ getGLShaderType()

static GLenum Ogre::GLSLShader::getGLShaderType | ( | GpuProgramType | programType | ) |
| static

Get OpenGL GLSL shader type from OGRE GPU program type.

## ◆ getShaderTypeLabel()

static String Ogre::GLSLShader::getShaderTypeLabel | ( | GpuProgramType | programType | ) |
| static

Get a string containing the name of the GLSL shader type correspondening to the OGRE GPU program type.

## ◆ getLanguage()

const String& Ogre::GLSLShader::getLanguage | ( | void |  | ) | const

Overridden from GpuProgram.

## ◆ createParameters()

GpuProgramParametersSharedPtr Ogre::GLSLShader::createParameters | ( | void |  | ) |

Overridden from GpuProgram.

## ◆ compile()

bool Ogre::GLSLShader::compile | ( | bool | checkErrors = `false` | ) |

Compile source into shader object.

## ◆ bind()

void Ogre::GLSLShader::bind | ( | void |  | ) |

Bind the shader in OpenGL.

## ◆ unbind()

void Ogre::GLSLShader::unbind | ( | void |  | ) |

Unbind the shader in OpenGL.

## ◆ bindParameters()

void Ogre::GLSLShader::bindParameters | ( | GpuProgramParametersSharedPtr | params,
|  | uint16 | mask
| ) |  |

Execute the param binding functions for this shader.

## ◆ bindPassIterationParameters()

void Ogre::GLSLShader::bindPassIterationParameters | ( | GpuProgramParametersSharedPtr | params | ) |

Execute the pass iteration param binding functions for this shader.

## ◆ bindSharedParameters()

void Ogre::GLSLShader::bindSharedParameters | ( | GpuProgramParametersSharedPtr | params,
|  | uint16 | mask
| ) |  |

Execute the shared param binding functions for this shader.

## ◆ calculateSize()

size_t Ogre::GLSLShader::calculateSize | ( | void |  | ) | const

Calculate the size of a resource; this will only be called after 'load'.

## ◆ _getBindingDelegate()

GpuProgram* Ogre::GLSLShader::_getBindingDelegate | ( | void |  | ) |
| inline

Since GLSL has no assembly, use this shader for binding.

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

- OgreGLSLShader.h