Carpenter Engine
A C++ game engine with a build once run anywhere solution
|
A class used to load and use shaders. More...
#include <Shader.hpp>
Public Member Functions | |
Shader () | |
Default constructor. | |
Shader (const char *frag) | |
Constructor with default vertex shader. | |
Shader (const char *frag, const char *vert) | |
Main constructor for a shader. | |
unsigned int | GetShaderProgram () |
Gets the shader program. | |
A class used to load and use shaders.
This class is used to load and use shaders in the game engine. The shader takes two files, one for the vertex shader and one for the fragment shader, and compiles them into a GPU program to be used by the game engine to render models. If no shader scripts are provided, it will use the default shader. A fragment shader will be required first.
Engine::Graphics::Shader::Shader | ( | ) |
Default constructor.
uses the default shader files
Engine::Graphics::Shader::Shader | ( | const char * | frag | ) |
Constructor with default vertex shader.
Shader program that uses the default vertex shader. Takes in a shader file for the fragment shader
frag | the path to the fragment shader |
Engine::Graphics::Shader::Shader | ( | const char * | frag, |
const char * | vert | ||
) |
Main constructor for a shader.
Take in a fragment and vertex shader file to construct a shader.
frag | the path to the fragment shader |
vert | the path to the vertex shader |
unsigned int Engine::Graphics::Shader::GetShaderProgram | ( | ) |
Gets the shader program.
Returns the shader program that was loaded into the GPU. If the shader is not compiled, it will compile the shaderand and then return the shader program.