more rendering speed

This commit is contained in:
ssshumakov3@gmail.com
2021-10-16 16:53:07 +03:00
parent e891a58ac4
commit 907801baf4
8 changed files with 82 additions and 3 deletions

View File

@@ -264,6 +264,14 @@ namespace opengl
gl.uniform1iv (loc, size, data);
}
void use_program::uniform (std::string const& name, math::vector_3d const* data, std::size_t size)
{
GLuint loc = uniform_location (name);
if (loc < 0)
return;
gl.uniform3fv (loc, size, reinterpret_cast<const GLfloat*>(data));
}
void use_program::uniform (GLint pos, std::vector<int> const& value)
{
gl.uniform1iv (pos, value.size(), value.data());