#include <PropaneShader.h>
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. | |
|
|
Gets the value for a uniform from the shader. Get a uniform's location from the video card using glGetUniformLocation
|
|
||||||||||||
|
Passes a value to the shader. Passes a floating point value to a uniform using glUniform1f
|
1.4.6