![]() |
LibCarna Version 3.4.0
|
Maintains an OpenGL shader object. Realizes the RAII-idiom. More...
#include <Shader.hpp>
Public Member Functions | |
Shader (unsigned int type, const std::string &src) | |
Compiles src and creates new OpenGL shader object of type. | |
~Shader () | |
Deletes the maintained OpenGL shader object. | |
Public Attributes | |
const unsigned int | id |
Identifies the maintained OpenGL shader object. | |
const unsigned int | type |
Holds the type of the maintained OpenGL shader object. This is TYPE_VERTEX_SHADER , TYPE_GEOMETRY_SHADER or TYPE_FRAGMENT_SHADER usually. | |
Static Public Attributes | |
static const unsigned int | TYPE_VERTEX_SHADER |
Indicates shader object of GL_VERTEX_SHADER type. | |
static const unsigned int | TYPE_FRAGMENT_SHADER |
Indicates shader object of GL_FRAGMENT_SHADER type. | |
static const unsigned int | TYPE_GEOMETRY_SHADER |
Indicates shader object of GL_GEOMETRY_SHADER type. | |
Maintains an OpenGL shader object. Realizes the RAII-idiom.
Definition at line 47 of file Shader.hpp.
Compiles src and creates new OpenGL shader object of type.
type | is usually TYPE_VERTEX_SHADER , TYPE_GEOMETRY_SHADER or TYPE_FRAGMENT_SHADER . |
src | references the shader source code. |
AssertionFailure | thrown when creation of OpenGL shader object fails. |
ShaderCompilationError | thrown when shader compilation fails. |
Identifies the maintained OpenGL shader object.
Definition at line 91 of file Shader.hpp.
Holds the type of the maintained OpenGL shader object. This is TYPE_VERTEX_SHADER
, TYPE_GEOMETRY_SHADER
or TYPE_FRAGMENT_SHADER
usually.
Definition at line 98 of file Shader.hpp.
Indicates shader object of GL_FRAGMENT_SHADER
type.
Definition at line 65 of file Shader.hpp.
Indicates shader object of GL_GEOMETRY_SHADER
type.
Definition at line 66 of file Shader.hpp.
Indicates shader object of GL_VERTEX_SHADER
type.
Definition at line 64 of file Shader.hpp.
Written by Leonid Kostrykin © 2021–2025. Based on Carna (© 2010-2016).
Documentation generated by Doxygen