4#include "VertexBuffer.h"
5#include "common/maths/Vec.h"
7#include <unordered_map>
13 std::string VertexSource;
14 std::string PixelSource;
27 std::string m_FilePathVS;
28 std::string m_FilePathPS;
29 unsigned int m_RendererID;
30 std::unordered_map<std::string, int> m_UniformLocationCache;
33 Shader(
const String& filepathVertexShader,
const String& filepathPixelShader);
36 static Ref<Shader> Create(
const std::string& filepathVertexShader,
const std::string& filepathPixelShader);
42 void SetUniform4f(
const std::string& name,
float f0,
float f1,
float f2,
float f3);
43 void SetUniform4f(
const std::string& name,
const glm::vec4& matrix);
44 void SetUniform3f(
const std::string& name,
float f0,
float f1,
float f2);
45 void SetUniform3f(
const std::string& name,
Maths::Vec3& value);
46 void SetUniform1f(
const std::string& name,
float value);
47 void SetUniform1i(
const std::string& name,
int value);
48 void SetUniformMat4f(
const std::string& name,
const glm::mat4& matrix);
50 String GetVertexShaderPath() {
return m_FilePathVS; }
51 String GetPixelShaderPath() {
return m_FilePathPS; }
53 unsigned int GetRendererID() {
return m_RendererID; }
56 int getUniformLocation(
const std::string& name);
57 struct ShaderProgramSource parseShader(const std::string& filepathVertexShader, const std::string& filepathPixelShader);
58 unsigned int compileShader(unsigned int type, const std::string& source);
59 unsigned int createShader(const std::string& vertexShader, const std::string& fragmentShader);