C++ wrapper for an OpenGL shader object.
More...
#include <Shader.hpp>
|
void | allocate () |
| Allocate the OpenGL shader object.
|
|
C++ wrapper for an OpenGL shader object.
glcxx::Shader::Shader |
( |
GLenum |
shader_type | ) |
|
Create and allocate an OpenGL shader object.
- Parameters
-
shader_type | OpenGL shader type (e.g. GL_VERTEX_SHADER). |
static std::shared_ptr<Shader> glcxx::Shader::create |
( |
GLenum |
shader_type, |
|
|
const char * |
source, |
|
|
int |
length = -1 |
|
) |
| |
|
inlinestatic |
Factory method to construct a Shader object.
- Parameters
-
shader_type | OpenGL shader type (e.g. GL_VERTEX_SHADER). |
source | Pointer to the shader source. |
length | Length of the shader source. If unspecified, the shader source must be NULL-terminated. |
static std::shared_ptr<Shader> glcxx::Shader::create_from_file |
( |
GLenum |
shader_type, |
|
|
const char * |
filename |
|
) |
| |
|
inlinestatic |
Factory method to construct a Shader object.
- Parameters
-
shader_type | OpenGL shader type (e.g. GL_VERTEX_SHADER). |
filename | Name of the file to load. |
GLuint glcxx::Shader::id |
( |
| ) |
const |
|
inline |
Get the shader object's ID.
- Returns
- The shader object's ID.
void glcxx::Shader::set_source |
( |
const char * |
source, |
|
|
int |
length = -1 |
|
) |
| |
Load shader source from memory.
- Parameters
-
source | Pointer to the shader source. |
length | Length of the shader source. If unspecified, the shader source must be NULL-terminated. |
void glcxx::Shader::set_source_from_file |
( |
const char * |
filename | ) |
|
Load shader source from a file.
- Parameters
-
filename | Name of the file to load. |
The documentation for this class was generated from the following files: