Avogadro::Rendering::Shader#
-
class Shader#
Vertex or Fragment shader, combined into a ShaderProgram.
This class creates a Vertex or Fragment shader, that can be attached to a ShaderProgram in order to render geometry etc.
- Author
Marcus D. Hanwell
Public Types
Public Functions
-
~Shader()#
-
void setSource(const std::string &source)#
Set the shader source to the supplied string.
-
inline std::string source() const#
Get the source for the shader.
-
inline std::string error() const#
Get the error message (empty if none) for the shader.
-
inline Index handle() const#
Get the handle of the shader.
-
bool compile()#
Compile the shader.
Note
A valid context must to current in order to compile the shader.
-
void cleanup()#
Delete the shader.
Note
This should only be done once the ShaderProgram is done with the Shader.