X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fmatrix.h;h=b574c7359506bf05e9cecc46fd9f4593f721bab2;hb=b617c5d7b5283ad260a77f01e42e6170cabbc03d;hp=fe67ad7e4bf749693eedae982a2cbb0d10b40884;hpb=a4ec5410595ddf37bfbc0e85ad87d31a9cbf94f1;p=libs%2Fgl.git diff --git a/source/matrix.h b/source/matrix.h index fe67ad7e..b574c735 100644 --- a/source/matrix.h +++ b/source/matrix.h @@ -15,18 +15,32 @@ namespace GL { enum MatrixMode { - MODELVIEW=GL_MODELVIEW, - PROJECTION=GL_PROJECTION, - TEXTURE=GL_TEXTURE + MODELVIEW = GL_MODELVIEW, + PROJECTION = GL_PROJECTION, + TEXTURE = GL_TEXTURE }; void matrix_mode(MatrixMode); void load_identity(); +void load_matrix(const float *); +void load_matrix(const double *); void mult_matrix(const float *); void mult_matrix(const double *); void push_matrix(); void pop_matrix(); +/// RAII object - pushes matrix when constructed and pops when destroyed +struct PushMatrix +{ + PushMatrix() { push_matrix(); } + ~PushMatrix() { pop_matrix(); } +}; + +void translate(float, float, float); +void rotate(float, float, float, float); +void scale(float, float, float); +void scale_uniform(float); + } // namespace GL } // namespace Msp