GFXGLShader

Engine/source/gfx/gl/gfxGLShader.h

More...

GFXShader interface

Returns a shader constant handle for the name constant.

Returns a shader constant handle for the name constant, if the variable doesn't exist NULL is returned.

Returns our list of shader constants, the material can get this and just set the constants it knows about.

Returns the alignment value for constType.

Allocate a constant buffer.

GFXResource interface

When called the resource should destroy all device sensitive information (e.g. D3D resources in D3DPOOL_DEFAULT.

When called the resource should restore all device sensitive information destroyed by zombify()

The resource should put a description of itself (number of vertices, size/width of texture, etc.) in buffer.

Private Types

Public Functions

Activates this shader in the GL context.

Protected Functions

bool

Internal initialization function overloaded for each GFX device type.

bool
initShader(const Torque::Path & file, bool isVertex, const Vector< GFXShaderMacro > & macros)

Protected Static Functions

Detailed Description

Internal GL handles

GLuint mVertexShader 
GLuint mPixelShader 
GLuint mProgram 

GFXShader interface

getShaderConstHandle(const String & name)

Reimplemented from: GFXShader

findShaderConstHandle(const String & name)

Reimplemented from: GFXShader

getShaderConstDesc()

Reimplemented from: GFXShader

getAlignmentValue(const GFXShaderConstType constType)

Reimplemented from: GFXShader

allocConstBuffer()

Reimplemented from: GFXShader

GFXResource interface

zombify()

Reimplemented from: GFXResource

resurrect()

Reimplemented from: GFXResource

describeSelf()

Reimplemented from: GFXShader

Private Types

typedef Map< String, GFXGLShaderConstHandle * > HandleMap 

Public Friends

Protected Attributes

Vector< GFXShaderConstDesc > mConstants 
U8 * mConstBuffer 
U32 mConstBufferSize 
HandleMap mHandles 
Vector< GFXGLShaderConstHandle * > mValidHandles 

Public Functions

GFXGLShader()

~GFXGLShader()

useProgram()

Activates this shader in the GL context.

Protected Functions

_init()

Reimplemented from: GFXShader

clearShaders()

initConstantDescs()

initHandles()

initShader(const Torque::Path & file, bool isVertex, const Vector< GFXShaderMacro > & macros)

setConstantsFromBuffer(GFXGLShaderConstBuffer * buffer)

Protected Static Functions

_handleIncludes(const Torque::Path & path, FileStream * s)

_loadShaderFromStream(GLuint shader, const Torque::Path & path, FileStream * s, const Vector< GFXShaderMacro > & macros)