8 #include "VectorMathDecl.h"
10 #include "VertexAttribs.h"
27 u32 GetId()
const {
return m_id; }
31 virtual void SetMVP(
const m44& mvp)
const = 0;
33 GLuint GetUniformLocation(
const std::string& uniformName)
const;
37 return m_vertexAttributes;
42 if (m_programHandle != 0)
44 Eegeo_GL(glDeleteProgram(m_programHandle));
50 Shader(
const TShaderId shaderId)
56 void CompileProgram(
const std::string& vertexShaderCode,
const std::string& fragmentShaderCode);
59 void SetUniformFloat(
const float value, GLuint uniformLocation)
const;
60 void SetUniformM44(
const m44& matrix, GLuint uniformLocation,
bool transpose)
const;
61 void SetUniformV2(
const v2& vec, GLuint uniformLocation)
const;
62 void SetUniformV3(
const v3& vec, GLuint uniformLocation)
const;
63 void SetUniformV4(
const v4& vec, GLuint uniformLocation)
const;
64 void SetUniformTextureSampler(
Rendering::GLState& glState, GLuint samplerId, GLuint uniformLocation)
const;
65 void SetUniformBool(
const bool value, GLuint uniformLocation)
const;
66 void SetUniformV4v(
const v4* vec, GLsizei count, GLuint uniformLocation)
const;
72 void DetectShaderUniforms();
73 std::map<std::string, GLuint> m_uniformsToUniformLocations;