TeaPacket v0.0.1
Multiplatform Game Engine
Loading...
Searching...
No Matches
Shader.hpp
Go to the documentation of this file.
1#pragma once
2#include <string>
3#include <vector>
4#include "Platform/Graphics/PlatformShader.hpp"
6
8{
9
11 class Shader
12 {
13 public:
15 PlatformShader platformShader;
16
21 void Initialize(const std::string& vertexShaderCode, const std::string& fragmentShaderCode,
22 const std::vector<ShaderVariableType>& inputAttributes, const std::vector<ShaderVariableType>& uniforms);
24 void UseShader();
25
29 void SetParameter(unsigned char index, ShaderVariableValue value);
30 private:
31 std::vector<ShaderVariable> shaderUniforms = {};
32
33 void Pl_Initialize(const std::string& vertexShaderCode, const std::string& fragmentShaderCode, const std::vector<ShaderVariableType>& inputAttributes);
34 void Pl_UseShader();
35 public:
38 static Shader CreateShader(const std::string& vertexShaderCode, const std::string& fragmentShaderCode, const std::vector<ShaderVariableType>&
39 inputAttributes, const std::vector<ShaderVariableType>& uniforms);
45 static Shader CreateShaderFromFiles(const std::string& vertexShaderPath, const std::string& fragmentShaderPath,
46 const std::vector<ShaderVariableType>& inputAttributes, const std::vector<ShaderVariableType>& uniforms);
47 private:
48
49 };
50}
A combined shader (or program) in the rendering pipeline. Used to interpret and render Model data.
Definition Shader.hpp:12
void UseShader()
Bind the shader for rendering. Every Model drawn after this call to UseShader() will use this shader ...
static Shader CreateShaderFromFiles(const std::string &vertexShaderPath, const std::string &fragmentShaderPath, const std::vector< ShaderVariableType > &inputAttributes, const std::vector< ShaderVariableType > &uniforms)
PlatformShader platformShader
Platform data.
Definition Shader.hpp:15
void Initialize(const std::string &vertexShaderCode, const std::string &fragmentShaderCode, const std::vector< ShaderVariableType > &inputAttributes, const std::vector< ShaderVariableType > &uniforms)
static Shader CreateShader(const std::string &vertexShaderCode, const std::string &fragmentShaderCode, const std::vector< ShaderVariableType > &inputAttributes, const std::vector< ShaderVariableType > &uniforms)
void SetParameter(unsigned char index, ShaderVariableValue value)
Functionality relating to drawing graphics to the screen.
Definition Display.hpp:9
Definition ShaderVariable.hpp:19