diff --git a/cogl.h b/cogl.h index 09c192326..1385e1243 100644 --- a/cogl.h +++ b/cogl.h @@ -198,6 +198,9 @@ cogl_get_projection_matrix (ClutterFixed m[16]); void cogl_get_viewport (ClutterFixed v[4]); +void +cogl_get_bitmasks (gint *red, gint *green, gint *blue, gint *alpha); + G_END_DECLS #endif /* __COGL_H__ */ diff --git a/gl/cogl.c b/gl/cogl.c index df3acb4a1..7800dc07e 100644 --- a/gl/cogl.c +++ b/gl/cogl.c @@ -636,3 +636,16 @@ cogl_get_viewport (ClutterFixed v[4]) v[2] = CLUTTER_FLOAT_TO_FIXED (vd[2]); v[3] = CLUTTER_FLOAT_TO_FIXED (vd[3]); } + +void +cogl_get_bitmasks (gint *red, gint *green, gint *blue, gint *alpha) +{ + if (red) + GE( glGetIntegerv(GL_RED_BITS, red) ); + if (green) + GE( glGetIntegerv(GL_GREEN_BITS, green) ); + if (blue) + GE( glGetIntegerv(GL_BLUE_BITS, blue) ); + if (alpha) + GE( glGetIntegerv(GL_ALPHA_BITS, alpha ) ); +} diff --git a/gles/cogl.c b/gles/cogl.c index 123fcdcc5..f7d874eac 100644 --- a/gles/cogl.c +++ b/gles/cogl.c @@ -566,3 +566,16 @@ cogl_get_viewport (ClutterFixed v[4]) { glGetFixedv(GL_VIEWPORT, &v[0]); } + +void +cogl_get_bitmasks (gint *red, gint *green, gint *blue, gint *alpha) +{ + if (red) + GE( glGetInteger(GL_RED_BITS, red) ); + if (green) + GE( glGetInteger(GL_GREEN_BITS, green) ); + if (blue) + GE( glGetInteger(GL_BLUE_BITS, blue) ); + if (alpha) + GE( glGetInteger(GL_ALPHA_BITS, alpha ) ); +}