Propane::Material::ShaderMaterial Class Reference

A shader-based material that automatically passes useCoordinate vectors to a vec3 uniform named v_in. More...

#include <ShaderMaterial.h>

Inheritance diagram for Propane::Material::ShaderMaterial:

Propane::Material::BaseMaterial List of all members.

Public Member Functions

 ShaderMaterial (Propane::Shader::Program *newProgram)
virtual ~ShaderMaterial ()
virtual void apply ()
virtual void unApply ()
virtual bool canUse ()
virtual void useCoordinate (const Propane::Vector3 &xyz)

Detailed Description

A shader-based material that automatically passes useCoordinate vectors to a vec3 uniform named v_in.


Constructor & Destructor Documentation

Propane::Material::ShaderMaterial::ShaderMaterial Propane::Shader::Program newProgram  )  [inline]
 

Basic constructor that takes a Propane::Shader::Program and acquires the v_in uniform for it. If that uniform is not found, it will not be used in useCoordinate() but all other shader operations will continue normally.

Errors are emitted to stderr.

Parameters:
newProgram A pointer to the Propane::Shader::Program we will use.

virtual Propane::Material::ShaderMaterial::~ShaderMaterial  )  [inline, virtual]
 

Basic destructor that deletes the program


Member Function Documentation

virtual void Propane::Material::ShaderMaterial::apply  )  [inline, virtual]
 

Turns the shader on, disabling fixed function pipeline.

Implements Propane::Material::BaseMaterial.

virtual bool Propane::Material::ShaderMaterial::canUse  )  [inline, virtual]
 

Uses the shader's isSupported and isReady methods to check for hardware compatibility.

Returns:
True if you can use shaders, false otherwise.

Implements Propane::Material::BaseMaterial.

virtual void Propane::Material::ShaderMaterial::unApply  )  [inline, virtual]
 

Turns the shader off and returns to fixed function mode

Implements Propane::Material::BaseMaterial.

virtual void Propane::Material::ShaderMaterial::useCoordinate const Propane::Vector3 &  xyz  )  [inline, virtual]
 

If present, passes the vector to uniform vector3 v_in in the shader

Parameters:
xyz The vector to pass to the shader programs

Implements Propane::Material::BaseMaterial.


The documentation for this class was generated from the following file:
Generated on Sun Jan 14 16:49:12 2007 for Propane Injector by  doxygen 1.4.6