Shader program which can be linked to shader objects and executed.
More...
#include <shader-program.hpp>
Shader program which can be linked to shader objects and executed.
- See also
- gl::shader_object
Definition at line 40 of file shader-program.hpp.
◆ shader_program() [1/3]
gl::shader_program::shader_program |
( |
| ) |
|
Creates an empty shader program.
- Exceptions
-
std::runtime_error | An error occurred while creating an OpenGL shader program. |
Definition at line 29 of file shader-program.cpp.
◆ ~shader_program()
gl::shader_program::~shader_program |
( |
| ) |
|
◆ shader_program() [2/3]
◆ shader_program() [3/3]
◆ attach()
Attaches a shader object to the shader program.
Attaching a shader object has no effect on a shader program until shader_program::link() is called.
- Parameters
-
object | Shader object to attach. |
- Exceptions
-
std::runtime_error | Shader object is already attached to the shader program. |
std::runtime_error | OpenGL shader program is not a valid program object. |
std::runtime_error | OpenGL shader object is not a valid shader object. |
std::runtime_error | OpenGL shader object is already attached to the shader program. |
- See also
- shader_program::link()
Definition at line 50 of file shader-program.cpp.
◆ detach()
Detaches a shader object from the shader program.
Detaching a shader object has no effect on a shader program until shader_program::link() is called.
- Parameters
-
object | Shader object to detach. |
- Exceptions
-
std::runtime_error | Shader object is not attached to the shader program. |
std::runtime_error | OpenGL shader program is not a valid program object. |
std::runtime_error | OpenGL shader object is not a valid shader object. |
std::runtime_error | OpenGL shader object is not attached to the shader program. |
- See also
- shader_program::link()
Definition at line 76 of file shader-program.cpp.
◆ detach_all()
void gl::shader_program::detach_all |
( |
| ) |
|
Detaches all shader objects from the shader program.
- Exceptions
-
std::runtime_error | Shader object is not attached to the shader program. |
std::runtime_error | OpenGL shader program is not a valid program object. |
std::runtime_error | OpenGL shader object is not a valid shader object. |
std::runtime_error | OpenGL shader object is not attached to the shader program. |
- See also
- shader_program::detach(const shader_object*)
Definition at line 102 of file shader-program.cpp.
◆ info()
const std::string& gl::shader_program::info |
( |
| ) |
const |
|
inlinenoexcept |
Returns the info log that contains debug information when linking fails.
Definition at line 145 of file shader-program.hpp.
◆ link()
bool gl::shader_program::link |
( |
| ) |
|
Links all attached shader objects to create an executable shader program.
- Returns
true
if the attached shader objects were successfully linked into the shader program, false
otherwise.
- Warning
- All existing of the shader program's variables will be invalidated if the program is re-linked.
Definition at line 110 of file shader-program.cpp.
◆ linked()
bool gl::shader_program::linked |
( |
| ) |
const |
|
inlinenoexcept |
Returns true
if the shader program has been successfully linked, false
otherwise.
Definition at line 110 of file shader-program.hpp.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ variable()
Returns a pointer to an active shader variable with the given name, or nullptr
if not found.
- Parameters
-
key | 32-bit FNV-1a hash value of a shader variable name. |
- Returns
- Pointer to the active shader variable with the given name, or
nullptr
if not found.
Definition at line 132 of file shader-program.hpp.
◆ variables()
Returns all active shader variables in the shader program.
- Returns
- Map of 32-bit FNV-1a hash values of shader variable names to shader variables.
Definition at line 120 of file shader-program.hpp.
◆ pipeline
The documentation for this class was generated from the following files: