GFXGLShader
Engine/source/gfx/gl/gfxGLShader.h
Internal GL handles
GFXShader interface
getShaderConstHandle(const String & name)
Returns a shader constant handle for the name constant.
findShaderConstHandle(const String & name)
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.
getAlignmentValue(const GFXShaderConstType constType)
Returns the alignment value for constType.
Allocate a constant buffer.
GFXResource interface
zombify()
When called the resource should destroy all device sensitive information (e.g. D3D resources in D3DPOOL_DEFAULT.
The resource should put a description of itself (number of vertices, size/width of texture, etc.) in buffer.
Private Types
Map< String, GFXGLShaderConstHandle * >
HandleMap
Public Friends
class
class
Protected Attributes
Public Functions
Protected Functions
bool
_init()
Internal initialization function overloaded for each GFX device type.
bool
initShader(const Torque::Path & file, bool isVertex, const Vector< GFXShaderMacro > & macros)
setConstantsFromBuffer(GFXGLShaderConstBuffer * buffer)
Protected Static Functions
char *
_handleIncludes(const Torque::Path & path, FileStream * s)
bool
_loadShaderFromStream(GLuint shader, const Torque::Path & path, FileStream * s, const Vector< GFXShaderMacro > & macros)
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)