OpenCPN Partial API docs
Loading...
Searching...
No Matches
GLShaderProgram Class Reference

Wrapper class for OpenGL shader programs. More...

#include <shaders.h>

Public Member Functions

bool addShaderFromSource (std::string const &shaderSource, GLenum shaderType)
 
bool linkProgram ()
 
void Bind ()
 
void UnBind ()
 
void SetUniform1f (const std::string &name, float value)
 
void SetUniform2fv (const std::string &name, float *value)
 
void SetUniform4fv (const std::string &name, float *value)
 
void SetUniform1i (const std::string &name, GLint value)
 
void SetUniformMatrix4fv (const std::string &name, float *value)
 
void SetAttributePointerf (const char *name, float *value)
 
GLuint programId () const
 
bool isOK () const
 

Detailed Description

Wrapper class for OpenGL shader programs.

Encapsulates an OpenGL shader program, providing methods for compiling shaders, linking the program, and setting uniform variables.

Definition at line 57 of file shaders.h.

Constructor & Destructor Documentation

◆ GLShaderProgram()

GLShaderProgram::GLShaderProgram ( )
inline

Definition at line 59 of file shaders.h.

◆ ~GLShaderProgram()

GLShaderProgram::~GLShaderProgram ( )
inline

Definition at line 62 of file shaders.h.

Member Function Documentation

◆ addShaderFromSource()

bool GLShaderProgram::addShaderFromSource ( std::string const &  shaderSource,
GLenum  shaderType 
)
inline

Definition at line 64 of file shaders.h.

◆ Bind()

void GLShaderProgram::Bind ( )
inline

Definition at line 112 of file shaders.h.

◆ isOK()

bool GLShaderProgram::isOK ( ) const
inline

Definition at line 151 of file shaders.h.

◆ linkProgram()

bool GLShaderProgram::linkProgram ( )
inline

Definition at line 94 of file shaders.h.

◆ programId()

GLuint GLShaderProgram::programId ( ) const
inline

Definition at line 150 of file shaders.h.

◆ SetAttributePointerf()

void GLShaderProgram::SetAttributePointerf ( const char *  name,
float *  value 
)
inline

Definition at line 139 of file shaders.h.

◆ SetUniform1f()

void GLShaderProgram::SetUniform1f ( const std::string &  name,
float  value 
)
inline

Definition at line 118 of file shaders.h.

◆ SetUniform1i()

void GLShaderProgram::SetUniform1i ( const std::string &  name,
GLint  value 
)
inline

Definition at line 130 of file shaders.h.

◆ SetUniform2fv()

void GLShaderProgram::SetUniform2fv ( const std::string &  name,
float *  value 
)
inline

Definition at line 122 of file shaders.h.

◆ SetUniform4fv()

void GLShaderProgram::SetUniform4fv ( const std::string &  name,
float *  value 
)
inline

Definition at line 126 of file shaders.h.

◆ SetUniformMatrix4fv()

void GLShaderProgram::SetUniformMatrix4fv ( const std::string &  name,
float *  value 
)
inline

Definition at line 134 of file shaders.h.

◆ UnBind()

void GLShaderProgram::UnBind ( )
inline

Definition at line 113 of file shaders.h.


The documentation for this class was generated from the following file: