|
| | Program (std::string p_vertexShaderCode, std::string p_fragmentShaderCode) |
| | Builds a shader program from vertex and fragment shader source code.
|
| | Program (const Program &p_other) |
| | Copies program sources and rebuilds the GL program id when needed.
|
| Program & | operator= (const Program &p_other) |
| | Assigns shader sources from another program instance.
|
|
| Program (Program &&)=delete |
|
Program & | operator= (Program &&)=delete |
| GLuint | id () const |
| | Returns the GL program id, building if needed.
|
| void | render (GLsizei p_nbIndexes, GLsizei p_nbInstance) |
| | Renders using glDrawElementsInstanced with the current program.
|
| void | renderIndirect (GLintptr p_commandOffset, GLsizei p_drawCount, GLsizei p_stride) |
| | Renders using glMultiDrawElementsIndirect with the current program.
|
|
| ActivableObject () |
| | Builds a deactivated object.
|
| | ActivableObject (ActivationStatus p_initial) |
| | Builds with a custom initial activation state.
|
|
void | activate () |
| | Sets the state to Activated.
|
|
void | deactivate () |
| | Sets the state to Deactivated.
|
|
void | toggle () |
| | Toggles between activated and deactivated states.
|
| bool | isActive () const |
| | Checks whether the object is currently activated.
|
| Contract | addActivationCallback (const Job &p_callback) |
| | Registers a callback executed when the object activates.
|
| Contract | addDeactivationCallback (const Job &p_callback) |
| | Registers a callback executed when the object deactivates.
|
| | StatefulObject (const ActivationStatus &p_initialState) |
| | Builds with an initial state.
|
|
StatefulObject & | operator= (const StatefulObject &p_other)=delete |
| void | setState (const ActivationStatus &p_newState) |
| | Sets a new state and triggers callbacks registered for it.
|
| ActivationStatus | state () const |
| | Returns the current state.
|
| Contract | addCallback (const ActivationStatus &p_state, const Job &p_callback) |
| | Subscribes a callback for a specific state.
|
Wraps an OpenGL shader program with lazy build and render helpers.
- See also
- spk::OpenGLUtils for raw utilities.
prog.activate();
prog.render(indexCount, instanceCount);
Wraps an OpenGL shader program with lazy build and render helpers.
Definition spk_program.hpp:27