GFXGLShader Class Reference

#include <gfxGLShader.h>

Inheritance diagram for GFXGLShader:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 GFXGLShader ()
virtual ~GFXGLShader ()
GFXShader interface
virtual bool init (const Torque::Path &vertFile, const Torque::Path &pixFile, F32 pixVersion, const Vector< GFXShaderMacro > &macros)
virtual GFXShaderConstHandlegetShaderConstHandle (const String &name)
 Returns a shader constant handle for name, if the variable doesn't exist NULL is returned.
virtual const Vector< GFXShaderConstDesc > & getShaderConstDesc () const
 Returns our list of shader constants, the material can get this and just set the constants it knows about.
virtual U32 getAlignmentValue (const GFXShaderConstType constType) const
 Returns the alignment value for constType.
virtual GFXShaderConstBufferRef allocConstBuffer ()
 Allocate a constant buffer.
virtual void process ()
 Set this as the active shader.
GFXResource interface
virtual void zombify ()
 When called the resource should destroy all device sensitive information (e.g. D3D resources in D3DPOOL_DEFAULT.
virtual void resurrect ()
 When called the resource should restore all device sensitive information destroyed by zombify().
virtual const String describeSelf () const
 The resource should put a description of itself (number of vertices, size/width of texture, etc.) in buffer.

Protected Member Functions

virtual void initShader (const Torque::Path &file, bool isVertex)
void clearShaders ()
void initConstantDescs ()
void initHandles ()
void setConstantsFromBuffer (GFXGLShaderConstBuffer *buffer)

Protected Attributes

Torque::Path mVertexFile
 Path to vertex file (used in resurrect).
Torque::Path mPixelFile
 Path to pixel file (used in resurrect).
Vector< GFXShaderMacromMacros
 Shader preprocessor macros (used in resurrect).
Vector< GFXShaderConstDescmConstants
U32 mConstBufferSize
U8mConstBuffer
HandleMap mHandles
Internal GL handles
GLuint mVertexShader
GLuint mPixelShader
GLuint mProgram

Private Types

typedef Map< String, GFXGLShaderConstHandle * > HandleMap

Friends

class GFXGLShaderConstBuffer
class GFXGLShaderConstHandle

Member Typedef Documentation

typedef Map<String, GFXGLShaderConstHandle*> GFXGLShader::HandleMap [private]


Constructor & Destructor Documentation

GFXGLShader::GFXGLShader (  ) 

virtual GFXGLShader::~GFXGLShader (  )  [virtual]


Member Function Documentation

virtual bool GFXGLShader::init ( const Torque::Path vertFile,
const Torque::Path pixFile,
F32  pixVersion,
const Vector< GFXShaderMacro > &  macros 
) [virtual]

Implements GFXShader.

virtual GFXShaderConstHandle* GFXGLShader::getShaderConstHandle ( const String name  )  [virtual]

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

Implements GFXShader.

virtual const Vector<GFXShaderConstDesc>& GFXGLShader::getShaderConstDesc (  )  const [virtual]

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

Implements GFXShader.

virtual U32 GFXGLShader::getAlignmentValue ( const GFXShaderConstType  constType  )  const [virtual]

Returns the alignment value for constType.

Implements GFXShader.

virtual GFXShaderConstBufferRef GFXGLShader::allocConstBuffer (  )  [virtual]

Allocate a constant buffer.

Implements GFXShader.

virtual void GFXGLShader::process (  )  [virtual]

Set this as the active shader.

Reimplemented from GFXShader.

virtual void GFXGLShader::zombify (  )  [virtual]

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

Implements GFXResource.

virtual void GFXGLShader::resurrect (  )  [virtual]

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

Implements GFXResource.

virtual const String GFXGLShader::describeSelf (  )  const [virtual]

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

Reimplemented from GFXShader.

virtual void GFXGLShader::initShader ( const Torque::Path file,
bool  isVertex 
) [protected, virtual]

void GFXGLShader::clearShaders (  )  [protected]

void GFXGLShader::initConstantDescs (  )  [protected]

void GFXGLShader::initHandles (  )  [protected]

void GFXGLShader::setConstantsFromBuffer ( GFXGLShaderConstBuffer buffer  )  [protected]


Friends And Related Function Documentation

friend class GFXGLShaderConstBuffer [friend]

friend class GFXGLShaderConstHandle [friend]


Member Data Documentation

Path to vertex file (used in resurrect).

Path to pixel file (used in resurrect).

Shader preprocessor macros (used in resurrect).