diff options
Diffstat (limited to 'src/RenderBackend/OpenGL/Uniform.cpp')
-rw-r--r-- | src/RenderBackend/OpenGL/Uniform.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/RenderBackend/OpenGL/Uniform.cpp b/src/RenderBackend/OpenGL/Uniform.cpp index 67cf3c6..5f68bc6 100644 --- a/src/RenderBackend/OpenGL/Uniform.cpp +++ b/src/RenderBackend/OpenGL/Uniform.cpp @@ -4,6 +4,11 @@ namespace amalgine { Uniform::~Uniform() {} + void Uniform::set(float value) { + use(); + glUniform1f(uniform_id, value); + } + void Uniform::set(const vec3f &value) { use(); glUniform3f(uniform_id, value.x, value.y, value.z); @@ -14,6 +19,11 @@ namespace amalgine { glUniformMatrix4fv(uniform_id, 1, GL_FALSE, glm::value_ptr(value)); } + void Uniform::set(const Texture2D &texture) { + use(); + glUniform1i(uniform_id, texture.get_texture_id()); + } + Uniform::Uniform(i32 uniform_id, u32 shader_program_id) : uniform_id(uniform_id), program_id(shader_program_id) { } |