Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Class Members

Shader Class Reference
[Scene Graph]

#include <lvt/Shader.h>

Inheritance diagram for Shader:

Inheritance graph
[legend]
List of all members.

Detailed Description

A GLSL shader program.

To compile a shader, first attach source files to the object with AddVertexSource() and AddFragmentSource(), then compile and link the program with Compile(). If there are errors, use GetInfoLog() to retrieve the compilation log.

A Shader is a State. Shader::Disable will disable the programmable pipeline, and enable the fixed-function pipeline.


Public Member Functions

void AddFragmentSource (const std::string &fileName)
 Adds a fragment program source file to the list of files to be compiled.
void AddVertexSource (const std::string &fileName)
 Adds a vertex program source file to the list of files to be compiled.
virtual bool Compile ()
 Compiles the fragment and vertex source files into a shader program.
virtual std::string GetInfoLog ()
 Returns the info log with the results of shader compilation.
virtual void Render ()
 Disables the fixed-function pipeline and makes this Shader object the active shader program.
virtual void SetUniform (const char *name, int p1, int p2, int p3, int p4)
 Sets the value of a uniform variable.
virtual void SetUniform (const char *name, int p1, int p2, int p3)
 Sets the value of a uniform variable.
virtual void SetUniform (const char *name, int p1, int p2)
 Sets the value of a uniform variable.
virtual void SetUniform (const char *name, int p1)
 Sets the value of a uniform variable.
virtual void SetUniform (const char *name, float p1, float p2, float p3, float p4)
 Sets the value of a uniform variable.
virtual void SetUniform (const char *name, float p1, float p2, float p3)
 Sets the value of a uniform variable.
virtual void SetUniform (const char *name, float p1, float p2)
 Sets the value of a uniform variable.
virtual void SetUniform (const char *name, float p1)
 Sets the value of a uniform variable.


Member Function Documentation

void AddFragmentSource const std::string &  fileName  )  [inline]
 

Adds a fragment program source file to the list of files to be compiled.

void AddVertexSource const std::string &  fileName  )  [inline]
 

Adds a vertex program source file to the list of files to be compiled.

virtual bool Compile  )  [virtual]
 

Compiles the fragment and vertex source files into a shader program.

Returns true if the compilation and linking was successful.

virtual std::string GetInfoLog  )  [virtual]
 

Returns the info log with the results of shader compilation.

virtual void Render  )  [virtual]
 

Disables the fixed-function pipeline and makes this Shader object the active shader program.

Implements State.

virtual void SetUniform const char *  name,
int  p1,
int  p2,
int  p3,
int  p4
[virtual]
 

Sets the value of a uniform variable.

virtual void SetUniform const char *  name,
int  p1,
int  p2,
int  p3
[virtual]
 

Sets the value of a uniform variable.

virtual void SetUniform const char *  name,
int  p1,
int  p2
[virtual]
 

Sets the value of a uniform variable.

virtual void SetUniform const char *  name,
int  p1
[virtual]
 

Sets the value of a uniform variable.

virtual void SetUniform const char *  name,
float  p1,
float  p2,
float  p3,
float  p4
[virtual]
 

Sets the value of a uniform variable.

virtual void SetUniform const char *  name,
float  p1,
float  p2,
float  p3
[virtual]
 

Sets the value of a uniform variable.

virtual void SetUniform const char *  name,
float  p1,
float  p2
[virtual]
 

Sets the value of a uniform variable.

virtual void SetUniform const char *  name,
float  p1
[virtual]
 

Sets the value of a uniform variable.


Generated on Thu Feb 17 09:45:47 2005 for liblvt by  doxygen 1.4.1