Add bool uniforms

This commit is contained in:
Nikita Lisitsa 2020-10-23 17:12:38 +03:00
parent ec36942f7d
commit 9cea478859
2 changed files with 6 additions and 0 deletions

View file

@ -34,6 +34,7 @@ namespace psemek::gfx
GLint location() const { return location_; }
void operator = (bool b);
void operator = (int i);
void operator = (unsigned int i);
void operator = (float f);

View file

@ -9,6 +9,11 @@
namespace psemek::gfx
{
void program::uniform_proxy::operator = (bool b)
{
gl::Uniform1i(location_, b ? 1 : 0);
}
void program::uniform_proxy::operator = (int i)
{
gl::Uniform1i(location_, i);