Acheron
Loading...
Searching...
No Matches
acheron::renderer::Shader Struct Reference

Wrapper for OpenGL shaders. More...

#include <shader.hpp>

Public Member Functions

void Compile (std::string vsSrc, std::string fsSrc)
 Compile a shader with the source.
void Bind ()
 Bind the shader.
void SetUniform (const char *name, float value[4])
 Sets a vec4 uniform.
void SetUniformMat4 (const char *name, const float mat[16]) const
 Set a mat4 uniform.
bool IsCompiled ()
 Returns if the Shader was compiled.

Public Attributes

unsigned int id

Detailed Description

Wrapper for OpenGL shaders.

Member Function Documentation

◆ Compile()

void acheron::renderer::Shader::Compile ( std::string vsSrc,
std::string fsSrc )
inline

Compile a shader with the source.

Parameters
vsSrcVertex Shader Source
fsSrcFragment Shader Source
Exceptions
Runtimeerorr if shader didnt compile properly

◆ SetUniform()

void acheron::renderer::Shader::SetUniform ( const char * name,
float value[4] )
inline

Sets a vec4 uniform.

Parameters
nameName of the uniform
valueValue of the uniform

◆ SetUniformMat4()

void acheron::renderer::Shader::SetUniformMat4 ( const char * name,
const float mat[16] ) const
inline

Set a mat4 uniform.

Parameters
nameName of the uniform
valueValue of the uniform

The documentation for this struct was generated from the following file: