#include <PropaneShader.h>
Public Member Functions | |
| void | loadVertexShader (const std::string &filename) |
| Load a vertex shader from a source file and attach it to this program. | |
| void | loadFragmentShader (const std::string &filename) |
| Load a fragment shader from a source file and attach it to this program. | |
| bool | compile () |
| Compile the shader (must be done after loading all necessary attached programs). Returns false on compile failure. | |
| void | turnOn () |
| Turn on the shader. | |
| void | turnOff () |
| Turn off the shader. | |
| bool | isReady () |
| Returns true if the shader is ready to use. | |
| bool | isSupported () |
| Returns true if the shader can be used on this computer. | |
| GLint | getUniformLocation (const std::string &uniformName) |
| Get the handle for a uniform in the shader program. | |
| void | passToUniform (GLint uniformHandle, float value) |
| Pass a floating-point number to a uniform value in the program. | |
| void | passVectorToUniform (GLint uniformHandle, const Propane::Math::Vector3 &theVector) |
| Pass a floating-point Propane::Math::Vector3 to the program as a uniform vec3. | |
| std::string | getInfoLog () |
| Return the info log from program compilation (if any). | |
| Program () | |
| Basic constructor that tests for hardware compatibility. | |
| virtual | ~Program () |
| Basic destructor that turns off the shader and deletes all attached programs. | |
|
|
Basic constructor that tests for hardware compatibility. Basic constructor for the program. Checks for hardware support, sets initial values. Emits warnings to stderr if not hardware supported. Checks pointers and process addresses for Linux and Windows NT, and enables the program object. Will assert if a GL error is thrown beforehand. |
|
|
Basic destructor that turns off the shader and deletes all attached programs. Basic deconstructor for the program. Turns off the shader, frees all attached shaders, then the program object itself. |
|
|
Compile the shader (must be done after loading all necessary attached programs). Returns false on compile failure. Compile a program, once you have added whatever shaders you want to it. Emits a warning to stderr if the shader did not validate.
|
|
|
Return the info log from program compilation (if any). Returns the info log for the main program. Uses getShaderInfoLog internally.
|
|
|
Get the handle for a uniform in the shader program. Returns a handle to a shader program's named uniform value
|
|
|
Returns true if the shader is ready to use. Checks if the program is ready. A program is only "ready" if the compile step has completed. If programs are not ready, most of the calls that use them will abort.
|
|
|
Returns true if the shader can be used on this computer. Checks if the program is supported by the current hardware. This value is set by the program constructor. Almost all functions in this class will fail if the shader functions are not supported, for safety reasons. It is in your best interest to check this method before trying to load or use shaders, and select an alternate path if shader functionality is not available on this card.
|
|
|
Load a fragment shader from a source file and attach it to this program. Loads a fragment shader from disk and attaches it to the program. If the shader is not supported, the function exits silently. If the file is not found, it returns an error to stderr. If the compile fails, it returns an error to stderr.
|
|
|
Load a vertex shader from a source file and attach it to this program. Loads a vertex shader from disk and attaches it to the program. If the shader is not supported, the function exits silently. If the file is not found, it returns an error to stderr. If the compile fails, it returns an error to stderr.
|
|
||||||||||||
|
Pass a floating-point number to a uniform value in the program. Set the value of a given uniform from its handle. Fails silently if the shader is not ready, or not supported.
|
|
||||||||||||
|
Pass a floating-point Propane::Math::Vector3 to the program as a uniform vec3. Pass a Propane::Math::Vector3 to the program through a given handle. The handle must represent uniform vec3; check the OpenGL documentation for what happens when you have a uniform type mismatch. Fails silently if the shader is not ready, or not supported.
|
|
|
Turn off the shader. Stop using the shader. Fails silently if isSupported() is false. Uses glUseProgramObjectARB.
|
|
|
Turn on the shader. Start using the shader. Fails silently if isSupported() is false. Uses glUseProgramObjectARB.
|
1.4.6