PropaneShader Class Reference

A cross platform GLSL shader object. More...

#include <PropaneShader.h>

List of all members.

Public Member Functions

bool hasExtensionsInstalled ()
 Returns true if the fragment and vertex shader extensions are enabled.
bool hasMultitexture ()
 Returns true if the device has multitexture support.
bool functional () const
 Returns true if the shader functionality is usable.
void configureGL (int width, int height)
 Sets up OpenGL for your platform to use shaders.
 ~PropaneShader ()
 Destroy the shader and free the temporary texture.
 PropaneShader (int t_width, int t_height, bool disableRTT=false)
 Load the shader from a vertex and fragment source code file.
bool load (char *vertexfile, char *fragmentfile)
 Load the shader from a vertex and fragment source code file.
int loadShaderFile (char *vertexfile, char *fragmentfile)
 Loads the shader from file.
int compileShader (const std::string &vertexProgram, const std::string &fragmentProgram)
 Loads the shader from a character buffer, made by first running loadShaderFile.
void dumpLog (char *filename)
 Drops the compile log to file.
void passTexture (GLuint *mtexture)
 Passes a texture to the shader.
GLint getUniformLocation (const std::string &name)
 Gets the value for a uniform from the shader.
void passUniform (GLint location, GLfloat value)
 Passes a value to the shader.
void turnOn ()
 Enables the shader.
void turnOff ()
 Disables the shader.
void beginRenderToTexture ()
 Starts rendering to texture.
void endRenderToTexture ()
 Stops rendering to texture.
GLuint * getRenderTexture ()
 Allows you to get a pointer to the render texture.
void initRenderToTexture (int t_width, int t_height)
 Clears the render target texture.

Protected Attributes

GLhandleARB v
 Handles to the vertex shader, fragment shader, and program.
GLuint * texture
 The render-target texture.
GLuint * framebuffer
 The FBO framebuffer texture.
int iWidth
 The width and height of the render-target.
bool hasFBO
 If the machine has the Frame Buffer Object extension installed, otherwise put them in "dumb" RTT mode.
bool hasNonPow2
 If the machine has non-power of 2 extension installed.
bool shaderCapable
 An internal variable if the current machine is shader capable.


Detailed Description

A cross platform GLSL shader object.


Member Function Documentation

GLint PropaneShader::getUniformLocation const std::string &  name  ) 
 

Gets the value for a uniform from the shader.

Get a uniform's location from the video card using glGetUniformLocation

Parameters:
name The name of the uniform (for example, "time")
Returns:
The handle to the uniform's address

void PropaneShader::passUniform GLint  location,
GLfloat  value
 

Passes a value to the shader.

Passes a floating point value to a uniform using glUniform1f

Parameters:
location The handle to the uniform (obtained from PropaneShader::getUniformLocation)
value The floating point value to pass to the shader


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