3#include "structure/design_pattern/spk_activable_object.hpp"
4#include "structure/design_pattern/spk_cached_data.hpp"
5#include "structure/opengl/spk_opengl_includes.hpp"
6#include "utils/spk_opengl_utils.hpp"
30 std::string _vertexShaderCode;
31 std::string _fragmentShaderCode;
33 void _registerCallbacks();
34 GLuint _buildProgram()
const;
43 Program(std::string p_vertexShaderCode, std::string p_fragmentShaderCode);
49 Program(
const Program &p_other);
55 Program &
operator=(
const Program &p_other);
56 Program(Program &&) =
delete;
70 void render(GLsizei p_nbIndexes, GLsizei p_nbInstance);
77 void renderIndirect(GLintptr p_commandOffset, GLsizei p_drawCount, GLsizei p_stride);
Stateful helper toggling between activated/deactivated states.
Definition spk_activable_object.hpp:20
Lazily generates and caches a value with optional custom destructor.
Definition spk_cached_data.hpp:26
GLuint id() const
Returns the GL program id, building if needed.
Definition spk_program.cpp:96
Program & operator=(const Program &p_other)
Assigns shader sources from another program instance.
Definition spk_program.cpp:70
void render(GLsizei p_nbIndexes, GLsizei p_nbInstance)
Renders using glDrawElementsInstanced with the current program.
Definition spk_program.cpp:101
void renderIndirect(GLintptr p_commandOffset, GLsizei p_drawCount, GLsizei p_stride)
Renders using glMultiDrawElementsIndirect with the current program.
Definition spk_program.cpp:110