PlottingOpenGL::GLShaderProgram
PlottingOpenGL::GLShaderProgram
Wrapper for QOpenGLShaderProgram with convenience methods.
#include <GLContext.hpp>
Public Functions
| Name | |
|---|---|
| GLShaderProgram() | |
| ~GLShaderProgram() | |
| GLShaderProgram(GLShaderProgram const & ) =delete | |
| GLShaderProgram & | operator=(GLShaderProgram const & ) =delete |
| GLShaderProgram(GLShaderProgram && other) | |
| GLShaderProgram & | operator=(GLShaderProgram && other) |
| bool | createFromSource(std::string const & vertex_source, std::string const & fragment_source) Compile and link a vertex/fragment shader pair from source strings. |
| bool | createFromSource(std::string const & vertex_source, std::string const & geometry_source, std::string const & fragment_source) Compile and link with an optional geometry shader. |
| void | destroy() |
| bool | bind() |
| void | release() |
| void | setUniformValue(char const * name, int value) |
| void | setUniformValue(char const * name, float value) |
| void | setUniformValue(char const * name, float x, float y) |
| void | setUniformValue(char const * name, float x, float y, float z, float w) |
| void | setUniformMatrix4(char const * name, float const * values) Set a 4x4 matrix uniform from a glm::mat4. |
| int | attributeLocation(char const * name) const |
| int | uniformLocation(char const * name) const |
| bool | isLinked() const |
| QOpenGLShaderProgram * | native() const |
Public Functions Documentation
function GLShaderProgram
GLShaderProgram()function ~GLShaderProgram
~GLShaderProgram()function GLShaderProgram
GLShaderProgram(
GLShaderProgram const &
) =deletefunction operator=
GLShaderProgram & operator=(
GLShaderProgram const &
) =deletefunction GLShaderProgram
GLShaderProgram(
GLShaderProgram && other
)function operator=
GLShaderProgram & operator=(
GLShaderProgram && other
)function createFromSource
bool createFromSource(
std::string const & vertex_source,
std::string const & fragment_source
)Compile and link a vertex/fragment shader pair from source strings.
Return: true if compilation and linking succeeded
function createFromSource
bool createFromSource(
std::string const & vertex_source,
std::string const & geometry_source,
std::string const & fragment_source
)Compile and link with an optional geometry shader.
function destroy
void destroy()function bind
bool bind()function release
void release()function setUniformValue
void setUniformValue(
char const * name,
int value
)function setUniformValue
void setUniformValue(
char const * name,
float value
)function setUniformValue
void setUniformValue(
char const * name,
float x,
float y
)function setUniformValue
void setUniformValue(
char const * name,
float x,
float y,
float z,
float w
)function setUniformMatrix4
void setUniformMatrix4(
char const * name,
float const * values
)Set a 4x4 matrix uniform from a glm::mat4.
GLM stores matrices in column-major order, which matches OpenGL’s expectation, so we can pass the data pointer directly.
function attributeLocation
int attributeLocation(
char const * name
) constfunction uniformLocation
int uniformLocation(
char const * name
) constfunction isLinked
bool isLinked() constfunction native
inline QOpenGLShaderProgram * native() constUpdated on 2026-11-13 at 20:25:41 +0000