7#include <Common/Container/TStdUnorderedStringMap.h>
8#include <Utility/utility.h>
23 const std::shared_ptr<Shader>& vertexShader,
24 const std::shared_ptr<Shader>& fragmentShader);
30 void setInt32(std::string_view name, int32 value)
override;
31 void setFloat32(std::string_view name, float32 value)
override;
32 void setVector3F(std::string_view name,
const math::Vector3F& value)
override;
33 void setVector4F(std::string_view name,
const math::Vector4F& value)
override;
34 void setMatrix4F(std::string_view name,
const math::Matrix4F& value)
override;
40 GLsizei arraySize = 0;
41 GLenum type = GL_NONE;
44 static GLuint getOpenglHandle(
Shader& shader);
45 void checkLinkStatus(
const Shader& vertexShader,
const Shader& fragmentShader)
const;
46 void validateProgram(
const Shader& vertexShader,
const Shader& fragmentShader)
const;
47 void collectProgramUniforms();
48 const Uniform* getUniform(GLenum type, std::string_view name)
const;
49 void warnUniformNotFound(
const Uniform* uniform, GLenum intendedType, std::string_view intendedName)
const;
50 std::string getInfoLog()
const;
53 TStdUnorderedStringMap<Uniform> m_nameToUniform;
56inline auto OpenglShaderProgram::getUniform(
const GLenum type, std::string_view name)
const
59 const auto& iter = m_nameToUniform.find(name);
60 const Uniform* uniform =
nullptr;
61 if(iter != m_nameToUniform.cend() && iter->second.type == type)
63 uniform = &(iter->second);
68 warnUniformNotFound(uniform, type, name);
Definition OpenglShaderProgram.h:19
OpenglShaderProgram(std::string name, const std::shared_ptr< Shader > &vertexShader, const std::shared_ptr< Shader > &fragmentShader)
Definition OpenglShaderProgram.cpp:17
void setInt32(std::string_view name, int32 value) override
Definition OpenglShaderProgram.cpp:55
void bind() override
Definition OpenglShaderProgram.cpp:50
void setVector3F(std::string_view name, const math::Vector3F &value) override
Definition OpenglShaderProgram.cpp:73
void setFloat32(std::string_view name, float32 value) override
Definition OpenglShaderProgram.cpp:64
void setMatrix4F(std::string_view name, const math::Matrix4F &value) override
Definition OpenglShaderProgram.cpp:100
void setVector4F(std::string_view name, const math::Vector4F &value) override
Definition OpenglShaderProgram.cpp:86
~OpenglShaderProgram() override
Definition OpenglShaderProgram.cpp:45
Definition ShaderProgram.h:15
Definition PlatformDisplay.h:13