diff --git a/uppsrc/GLDraw/Code.cpp b/uppsrc/GLDraw/Code.cpp index 3116bd4fc..32540e2f2 100644 --- a/uppsrc/GLDraw/Code.cpp +++ b/uppsrc/GLDraw/Code.cpp @@ -114,7 +114,6 @@ GLCode& GLCode::Uniform(const char *id, double a, double b, double c, double d) return *this; } - GLCode& GLCode::operator()(const char *id, Color c, double alpha) { return Uniform(GetUniform(id), c, alpha); @@ -125,4 +124,15 @@ GLCode& GLCode::operator()(int i, Color c, double alpha) return Uniform(i, c.GetR() / 255.0f, c.GetG() / 255.0f, c.GetB() / 255.0f, alpha); } +GLCode& GLCode::Mat4(int i, float *mat4) +{ + glUniformMatrix4fv(i, 1, GL_FALSE, mat4); + return *this; +} + +GLCode& GLCode::Mat4(const char *id, float *mat4) +{ + return Mat4(GetUniform(id), mat4); +} + }; diff --git a/uppsrc/GLDraw/GLPainter.h b/uppsrc/GLDraw/GLPainter.h index 39bf24791..a627baebc 100644 --- a/uppsrc/GLDraw/GLPainter.h +++ b/uppsrc/GLDraw/GLPainter.h @@ -58,6 +58,9 @@ struct GLCode : GLProgram { GLCode& operator()(int i, Sizef sz) { return Uniform(i, sz.cx, sz.cy); } GLCode& operator()(const char *id, Color c, double alpha = 1); GLCode& operator()(int i, Color c, double alpha = 1); + + GLCode& Mat4(int i, float *mat4); + GLCode& Mat4(const char *id, float *mat4); }; class GLTexture {