Shader object which can be compiled and linked to a shader program.
More...
#include <shader-object.hpp>
Shader object which can be compiled and linked to a shader program.
- See also
- gl::shader_program
-
gl::shader_stage
Definition at line 38 of file shader-object.hpp.
◆ shader_object() [1/2]
Creates an empty shader object for the specified shader stage.
- Parameters
-
stage | Shader stage in which this shader object will be used. |
- Exceptions
-
std::runtime_error | An error occurred while creating an OpenGL shader object. |
Definition at line 33 of file shader-object.cpp.
◆ ~shader_object()
gl::shader_object::~shader_object |
( |
| ) |
|
◆ shader_object() [2/2]
◆ compile()
bool gl::shader_object::compile |
( |
| ) |
|
Compiles the shader object.
- Returns
true
if the shader object was compiled successfully, false
otherwise. If compilation fails, check the info log via shader_object::get_info_log() for more information.
- Exceptions
-
std::runtime_error | Shader object handle is not a value generated by OpenGL. |
std::runtime_error | Shader object handle is not a shader object. |
- See also
- shader_object::get_info_log()
Definition at line 60 of file shader-object.cpp.
◆ compiled()
bool gl::shader_object::compiled |
( |
| ) |
const |
|
inlinenoexcept |
Returns true
if the shader object has been successfully compiled, false
otherwise.
Definition at line 90 of file shader-object.hpp.
◆ info()
const std::string& gl::shader_object::info |
( |
| ) |
const |
|
inlinenoexcept |
Returns the shader object info log, which is updated when the shader object is compiled.
Definition at line 84 of file shader-object.hpp.
◆ operator=()
◆ source()
void gl::shader_object::source |
( |
std::string_view |
source_code | ) |
|
Replaces the source code of the shader object.
- Parameters
-
source_code | String containing shader object source code. |
- Exceptions
-
std::runtime_error | Shader object handle is not a value generated by OpenGL. |
std::runtime_error | Shader object handle is not a shader object. |
Definition at line 52 of file shader-object.cpp.
◆ stage()
Returns the shader stage of this shader object.
Definition at line 78 of file shader-object.hpp.
◆ shader_program
The documentation for this class was generated from the following files: