glpp::core::object::shader_t class

class for creating and managing shaders in OpenGL

shader_t is a storage class for OpenGL shaders. It will load and compile the shader source on construction. The shader_t object can be destructed after the shader is linked into a shader_program_t to potentially save resources on the gpu.

Constructors, destructors, conversion operators

shader_t(shader_type_t type, const std::string& code)
constructor
shader_t(shader_type_t type, std::istream& code)
constructor
shader_t(shader_type_t type, std::istream&& code)
constructor

Function documentation

glpp::core::object::shader_t::shader_t(shader_type_t type, const std::string& code)

constructor

Parameters
type [in] shader type
code [in] shader code

Constructs a shader_t from shader_type_t and a const string reference. The constructor Will throw, if code is not valid GLSL.

glpp::core::object::shader_t::shader_t(shader_type_t type, std::istream& code)

constructor

Parameters
type [in] shader type
code [in] shader code

Constructs a shader_t from shader_type_t and a istream reference. The constructor Will throw, if the contents of code is not valid GLSL.

glpp::core::object::shader_t::shader_t(shader_type_t type, std::istream&& code)

constructor

Parameters
type [in] shader type
code [in] shader code

Constructs a shader_t from shader_type_t and a istream rvalue-reference. The constructor Will throw, if the contents of code is not valid GLSL.