GLShader Class Reference

#include <GLShader.h>

Inheritance diagram for GLShader:

GLNamedObject List of all members.

Detailed Description

The shader object class.

This is a generic shader class that is the backbone of this demo. The shader can be bound, updated, and unbound at any time.

Definition at line 22 of file GLShader.h.

Public Member Functions

void beginVertexAttrs (const GLVertex *vbuffer=0, size_t vstep=0) const
 Update the time and some standard variables. Make sure you call end().
virtual int bindBuffer (const GLVertex *Vertices) const
 Automatically bind a vertex buffer.
void bindBufferAttribF (uint Object, const void *Attrib, uint Size, uint Stride, boolean Normalised=true) const
 Bind a floating point buffer attribute.
void bindBufferAttribI (uint Object, const void *Attrib, uint Size, uint Stride, boolean Normalised=true) const
 Bind an integer buffer attribute.
void endVertexAttrs () const
 Unset any variables.
uint fragmentProgramID () const
 The fragment program handle.
int getAttribute (const char *name, uint &object) const
 Create an attribute.
int getUniform (const char *name, uint &object) const
 Create a uniform.
virtual void immediate (const GLVertex *Vertex) const
 Switch to immediate mode.
boolean isValid () const
 Valid?
const char * name () const
 Get the name.
uint programID () const
 The program ID handle.
void setUniform1f (uint location, float f) const
void setUniform1fv (uint location, const float *fv, uint count) const
void setUniform1i (uint location, int i) const
void setUniform1iv (uint location, const int *iv, uint count) const
void setUniform2f (uint location, float f0, float f1) const
void setUniform2fv (uint location, const float *fv, uint count) const
void setUniform2i (uint location, int i0, int i1) const
void setUniform2iv (uint location, const int *iv, uint count) const
void setUniform3f (uint location, float f0, float f1, float f2) const
void setUniform3fv (uint location, const float *fv, uint count) const
void setUniform3i (uint location, int i0, int i1, int i2) const
void setUniform3iv (uint location, const int *iv, uint count) const
void setUniform4f (uint location, float f0, float f1, float f2, float f3) const
void setUniform4fv (uint location, const float *fv, uint count) const
void setUniform4i (uint location, int i0, int i1, int i2, int i3) const
void setUniform4iv (uint location, const int *iv, uint count) const
void setUniformMatrix (uint location, const GLMatrix *matrix, boolean transpose=false) const
void setUniformMatrix2x2 (uint location, const float *fv, uint count=4, boolean transpose=false) const
void setUniformMatrix3x3 (uint location, const float *fv, uint count=9, boolean transpose=false) const
void setUniformMatrix4x4 (uint location, const float *fv, uint count=16, boolean transpose=false) const
virtual int unbindBuffer () const
 Automatically unbind a vertex buffer.
void update (float simTime, float deltaTime) const
 Update the time and some standard variables. Make sure you call end().
int useProgram () const
 Bind this object.
uint vertexProgramID () const
 The vertex program handle.

Static Public Member Functions

static void DisableVertexAttribute (uint attrib)
 Disable a vertex attribute (global change!).
static void EnableVertexAttribute (uint attrib)
 Enable a vertex attribute (global change!).
static uint GetInfo (uint object, echar *buffer, uint size)
 Get info about a handle.
static GLShaderLoad (const char *szName, const char *vp, const char *fp)
 Load a shader.
static void UnbindAll ()
 Unbind all shaders.

Protected Member Functions

 GLShader (const char *szName, uint prog, uint vp, uint fp)
 Constructor.
virtual ~GLShader ()
 Destructor.

Protected Attributes

std::string m_Name
 The name.


Member Function Documentation

int GLShader::bindBuffer ( const GLVertex Vertices  )  const [virtual]

Automatically bind a vertex buffer.

This is for overloaded shaders. Automatically bind attributes that this shader will require. This should not be used if the vertex buffer client states are not used.

Definition at line 316 of file GLShader.cpp.

Referenced by GLMesh::render().

00317 {
00318     return 0;
00319 }

void GLShader::immediate ( const GLVertex Vertex  )  const [virtual]

Switch to immediate mode.

This is for overloaded shaders. Automatically bind attributes that this shader will require. this should not be used if the vertex buffer client states are used.

Definition at line 329 of file GLShader.cpp.

00330 {
00331 }


The documentation for this class was generated from the following files:
Generated on Fri Mar 23 12:55:04 2007 for glsldemo by  doxygen 1.5.1-p1