1
0
Fork 0

Finish GLES{1,2} support for client side matrix stacks

Adds glFrustum wrappers (GLES only accepts floats not doubles, and GLES2
needs to use our internal cogl_wrap_glFrustumf)

Adds GL_TEXTURE_MATRIX getter code in cogl_wrap_glGetFloatv

Adds a GL_TEXTURE_MATRIX define for GLES2
This commit is contained in:
Robert Bragg 2009-03-12 13:34:36 +00:00
parent 17f19c2bb8
commit dc94a11963
3 changed files with 24 additions and 0 deletions

View file

@ -33,6 +33,19 @@
#include "cogl-current-matrix.h"
#include "cogl-matrix-stack.h"
#ifdef HAVE_COGL_GLES2
#include "cogl-gles2-wrapper.h"
#define glFrustum(L,R,B,T,N,F) \
cogl_wrap_glFrustumf((GLfloat)L, (GLfloat)R, (GLfloat)B, \
(GLfloat)T, (GLfloat)N, (GLfloat)F)
#elif defined (HAVE_COGL_GLES)
#define glFrustum(L,R,B,T,N,F) \
glFrustumf((GLfloat)L, (GLfloat)R, (GLfloat)B, \
(GLfloat)T, (GLfloat)N, (GLfloat)F)
#endif
#include <string.h>
#include <math.h>

View file

@ -1505,6 +1505,8 @@ cogl_wrap_glGetIntegerv (GLenum pname, GLint *params)
void
cogl_wrap_glGetFloatv (GLenum pname, GLfloat *params)
{
CoglGles2WrapperTextureUnit *texture_unit;
_COGL_GET_GLES2_WRAPPER (w, NO_RETVAL);
switch (pname)
@ -1519,6 +1521,14 @@ cogl_wrap_glGetFloatv (GLenum pname, GLfloat *params)
sizeof (GLfloat) * 16);
break;
case GL_TEXTURE_MATRIX:
texture_unit = w->texture_units + w->active_texture_unit;
memcpy (params,
texture_unit->texture_stack
+ texture_unit->texture_stack_pos * 16,
sizeof (GLfloat) * 16);
break;
case GL_VIEWPORT:
glGetFloatv (GL_VIEWPORT, params);
break;

View file

@ -255,6 +255,7 @@ struct _CoglGles2WrapperShader
#define GL_MODELVIEW_MATRIX 0x0BA6
#define GL_PROJECTION_MATRIX 0x0BA7
#define GL_TEXTURE_MATRIX 0x0BA8
#define GL_GENERATE_MIPMAP 0x8191