Shader Class Reference
[Basic]

GLSL shader with loading and compiling capabilities. More...

#include <Shader.hpp>

Inheritance diagram for Shader:
Node

List of all members.

Public Member Functions

 Shader (const Tag &tag)
 ~Shader ()
void associate ()
void finalize ()
string getFilename () const
GLuint getHandle () const
string getType () const
void list () const
void log () const
string toString () const

Protected Member Functions

void compile ()
void create ()
void load ()

Private Attributes

const char ** source
GLuint handle
int length
Preprocessor preprocessor
string filename
string type

Detailed Description

GLSL shader with loading and compiling capabilities.


Constructor & Destructor Documentation

Shader ( const Tag tag  ) 

Creates a new Shader from an XML tag.

Parameters:
tag XML tag with "type" and "file" attributes.
Exceptions:
NodeException if extension not recognized as a type.
~Shader (  ) 

Cleans up the source array allocated by the Shader object.


Member Function Documentation

void associate (  )  [virtual]

Attaches the shader to a program and compiles the shader.

Exceptions:
NodeException from create()
NodeException from load()
NodeException from compile()

Reimplemented from Node.

void compile (  )  [protected]

Compiles the shader and prints the log..

Exceptions:
NodeException if the shader doesn't compile.
void create (  )  [protected]

Requests a handle to a new GLSL shader of the correct type.

Exceptions:
NodeException if type is not supported.
void list (  )  const

Prints the file stored in the source array.

void load (  )  [protected]

Loads a file into the Shader's source array and passes it to OpenGL.

Exceptions:
NodeException if Preprocessor threw an exception.
void log (  )  const

Prints the log for this shader.

string toString (  )  const [virtual]

Forms a string from the object's attributes.

Reimplemented from Node.


The documentation for this class was generated from the following files:
Generated on Wed Jun 9 01:36:36 2010 for Gander by  doxygen 1.6.3