[current-matrix] Adds texture matrix stacks + removes GL matrix API usage

This relates back to an earlier commitment to stop using the OpenGL matrix
API which is considered deprecated. (ref 54159f5a1d)

The new texture matrix stacks are hung from a list of (internal only)
CoglTextureUnit structures which the CoglMaterial code internally references
via _cogl_get_texure_unit ().

So we would be left with only the cogl-matrix-stack code being responsible
for glMatrixMode, glLoadMatrix and glLoadIdentity this commit updates the
journal code so it now uses the matrix-stack API instead of GL directly.
This commit is contained in:
Robert Bragg
2009-09-29 02:58:27 +01:00
parent d8107c5ef5
commit 1402d1eb3c
8 changed files with 174 additions and 212 deletions

View File

@ -335,15 +335,28 @@ _cogl_matrix_stack_set (CoglMatrixStack *stack,
void
_cogl_matrix_stack_flush_to_gl (CoglMatrixStack *stack,
GLenum gl_mode)
CoglMatrixMode mode)
{
CoglMatrixState *state;
GLenum gl_mode;
state = _cogl_matrix_stack_top (stack);
if (stack->flushed_state == state)
return;
switch (mode)
{
case COGL_MATRIX_MODELVIEW:
gl_mode = GL_MODELVIEW;
break;
case COGL_MATRIX_PROJECTION:
gl_mode = GL_PROJECTION;
break;
case COGL_MATRIX_TEXTURE:
gl_mode = GL_TEXTURE;
break;
}
GE (glMatrixMode (gl_mode));
/* In theory it might help the GL implementation if we used our