Add new uniform type for shader
This commit is contained in:
@@ -278,6 +278,14 @@ namespace OpenGL
|
|||||||
|
|
||||||
gl.uniform3fv (loc, value.size(), glm::value_ptr(value[0]));
|
gl.uniform3fv (loc, value.size(), glm::value_ptr(value[0]));
|
||||||
}
|
}
|
||||||
|
void use_program::uniform(std::string const& name, std::vector<glm::vec4> const& value)
|
||||||
|
{
|
||||||
|
GLuint loc = uniform_location(name);
|
||||||
|
if (loc < 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
gl.uniform4fv(loc, value.size(), glm::value_ptr(value[0]));
|
||||||
|
}
|
||||||
void use_program::uniform_chunk_textures (std::string const& name, std::array<std::array<std::array<int, 2>, 4>, 256> const& value)
|
void use_program::uniform_chunk_textures (std::string const& name, std::array<std::array<std::array<int, 2>, 4>, 256> const& value)
|
||||||
{
|
{
|
||||||
GLuint loc = uniform_location (name);
|
GLuint loc = uniform_location (name);
|
||||||
@@ -290,6 +298,10 @@ namespace OpenGL
|
|||||||
{
|
{
|
||||||
gl.uniform3fv (pos, value.size(),glm::value_ptr(value[0]));
|
gl.uniform3fv (pos, value.size(),glm::value_ptr(value[0]));
|
||||||
}
|
}
|
||||||
|
void use_program::uniform(GLint pos, std::vector<glm::vec4> const& value)
|
||||||
|
{
|
||||||
|
gl.uniform4fv(pos, value.size(), glm::value_ptr(value[0]));
|
||||||
|
}
|
||||||
void use_program::uniform (std::string const& name, glm::vec2 const& value)
|
void use_program::uniform (std::string const& name, glm::vec2 const& value)
|
||||||
{
|
{
|
||||||
GLuint loc = uniform_location (name);
|
GLuint loc = uniform_location (name);
|
||||||
|
|||||||
@@ -106,6 +106,8 @@ namespace OpenGL
|
|||||||
void uniform (GLint pos, bool);
|
void uniform (GLint pos, bool);
|
||||||
void uniform (std::string const& name, std::vector<glm::vec3> const& value);
|
void uniform (std::string const& name, std::vector<glm::vec3> const& value);
|
||||||
void uniform (GLint pos, std::vector<glm::vec3> const& value);
|
void uniform (GLint pos, std::vector<glm::vec3> const& value);
|
||||||
|
void uniform(std::string const& name, std::vector<glm::vec4> const& value);
|
||||||
|
void uniform(GLint pos, std::vector<glm::vec4> const& value);
|
||||||
void uniform (std::string const& name, glm::vec2 const&);
|
void uniform (std::string const& name, glm::vec2 const&);
|
||||||
void uniform (GLint pos, glm::vec2 const&);
|
void uniform (GLint pos, glm::vec2 const&);
|
||||||
void uniform (std::string const& name, glm::vec3 const&);
|
void uniform (std::string const& name, glm::vec3 const&);
|
||||||
|
|||||||
Reference in New Issue
Block a user