state_transform.c revision e0e0c19eefceaf5d4ec40f9466b58a771f50e799
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* Copyright (c) 2001, Stanford University
45e9809aff7304721fddb95654901b32195c9c7avboxsync * All rights reserved
45e9809aff7304721fddb95654901b32195c9c7avboxsync * See the file LICENSE.txt for information on redistributing this software.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * This used to be a macro.
45e9809aff7304721fddb95654901b32195c9c7avboxsync if (a->m00 == 1.0F && a->m01 == 0.0F && a->m02 == 0.0F && a->m03 == 0.0F &&
45e9809aff7304721fddb95654901b32195c9c7avboxsync a->m10 == 0.0F && a->m11 == 1.0F && a->m12 == 0.0F && a->m13 == 0.0F &&
45e9809aff7304721fddb95654901b32195c9c7avboxsync a->m20 == 0.0F && a->m21 == 0.0F && a->m22 == 1.0F && a->m23 == 0.0F &&
45e9809aff7304721fddb95654901b32195c9c7avboxsync a->m30 == 0.0F && a->m31 == 0.0F && a->m32 == 0.0F && a->m33 == 1.0F) {
45e9809aff7304721fddb95654901b32195c9c7avboxsync f[0] = a->m00; f[1] = a->m01; f[2] = a->m02; f[3] = a->m03;
45e9809aff7304721fddb95654901b32195c9c7avboxsync f[4] = a->m10; f[5] = a->m11; f[6] = a->m12; f[7] = a->m13;
45e9809aff7304721fddb95654901b32195c9c7avboxsync f[8] = a->m20; f[9] = a->m21; f[10] = a->m22; f[11] = a->m23;
45e9809aff7304721fddb95654901b32195c9c7avboxsync f[12] = a->m30; f[13] = a->m31; f[14] = a->m32; f[15] = a->m33;
45e9809aff7304721fddb95654901b32195c9c7avboxsyncstatic void _math_transposef( GLfloat to[16], const GLfloat from[16] )
45e9809aff7304721fddb95654901b32195c9c7avboxsyncstatic void _math_transposed( GLdouble to[16], const GLdouble from[16] )
45e9809aff7304721fddb95654901b32195c9c7avboxsynccrStateInitMatrixStack(CRMatrixStack *stack, int maxDepth)
45e9809aff7304721fddb95654901b32195c9c7avboxsync stack->stack = crAlloc(maxDepth * sizeof(CRmatrix));
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned int i;
45e9809aff7304721fddb95654901b32195c9c7avboxsync for (i = 0; i < CR_MAX_PROGRAM_MATRICES; i++)
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned int i;
45e9809aff7304721fddb95654901b32195c9c7avboxsync crStateInitMatrixStack(&t->modelViewStack, CR_MAX_MODELVIEW_STACK_DEPTH);
45e9809aff7304721fddb95654901b32195c9c7avboxsync crStateInitMatrixStack(&t->projectionStack, CR_MAX_PROJECTION_STACK_DEPTH);
45e9809aff7304721fddb95654901b32195c9c7avboxsync crStateInitMatrixStack(&t->colorStack, CR_MAX_COLOR_STACK_DEPTH);
45e9809aff7304721fddb95654901b32195c9c7avboxsync crStateInitMatrixStack(&t->textureStack[i], CR_MAX_TEXTURE_STACK_DEPTH);
45e9809aff7304721fddb95654901b32195c9c7avboxsync for (i = 0 ; i < CR_MAX_PROGRAM_MATRICES ; i++)
45e9809aff7304721fddb95654901b32195c9c7avboxsync crStateInitMatrixStack(&t->programStack[i], CR_MAX_PROGRAM_MATRIX_STACK_DEPTH);
45e9809aff7304721fddb95654901b32195c9c7avboxsync /* dirty bits */
45e9809aff7304721fddb95654901b32195c9c7avboxsync t->clipPlane = (GLvectord *) crCalloc (sizeof (GLvectord) * CR_MAX_CLIP_PLANES);
45e9809aff7304721fddb95654901b32195c9c7avboxsync t->clip = (GLboolean *) crCalloc (sizeof (GLboolean) * CR_MAX_CLIP_PLANES);
45e9809aff7304721fddb95654901b32195c9c7avboxsync for (i = 0; i < CR_MAX_CLIP_PLANES; i++)
#ifdef CR_OPENGL_VERSION_1_2
#ifdef CR_IBM_rasterpos_clip
t->modelViewProjectionValid = 0;
if (!t->modelViewProjectionValid)
GLfloat x = p->x;
GLfloat y = p->y;
GLfloat z = p->z;
GLfloat w = p->w;
GLdouble x = p->x;
GLdouble y = p->y;
GLdouble z = p->z;
GLdouble w = p->w;
GLvectord e;
e.x = equation[0];
FLUSH();
t->clipPlane[i] = e;
FLUSH();
case GL_MODELVIEW:
case GL_PROJECTION:
case GL_TEXTURE:
case GL_COLOR:
case GL_MATRIX0_NV:
case GL_MATRIX1_NV:
case GL_MATRIX2_NV:
case GL_MATRIX3_NV:
case GL_MATRIX4_NV:
case GL_MATRIX5_NV:
case GL_MATRIX6_NV:
case GL_MATRIX7_NV:
t->matrixMode = e;
case GL_MATRIX0_ARB:
case GL_MATRIX1_ARB:
case GL_MATRIX2_ARB:
case GL_MATRIX3_ARB:
case GL_MATRIX4_ARB:
case GL_MATRIX5_ARB:
case GL_MATRIX6_ARB:
case GL_MATRIX7_ARB:
t->matrixMode = e;
FLUSH();
t->modelViewProjectionValid = 0;
FLUSH();
t->modelViewProjectionValid = 0;
FLUSH();
FLUSH();
t->modelViewProjectionValid = 0;
FLUSH();
t->modelViewProjectionValid = 0;
FLUSH();
t->modelViewProjectionValid = 0;
if (!m1) return;
if (!m1) return;
FLUSH();
t->modelViewProjectionValid = 0;
FLUSH();
t->modelViewProjectionValid = 0;
if (!m1) return;
if (!m1) return;
FLUSH();
t->modelViewProjectionValid = 0;
FLUSH();
t->modelViewProjectionValid = 0;
FLUSH();
t->modelViewProjectionValid = 0;
FLUSH();
t->modelViewProjectionValid = 0;
FLUSH();
t->modelViewProjectionValid = 0;
FLUSH();
t->modelViewProjectionValid = 0;
FLUSH();
crMatrixFrustum(t->currentStack->top, (float)left, (float)right, (float)bottom, (float)top, (float)zNear, (float)zFar);
t->modelViewProjectionValid = 0;
FLUSH();
crMatrixOrtho(t->currentStack->top, (float)left, (float)right, (float)bottom, (float)top, (float)zNear, (float)zFar);
t->modelViewProjectionValid = 0;
GLuint i, j;
unsigned int checktex = 0;
for (j=0;j<CR_MAX_BITARRAY;j++)
#ifdef CR_OPENGL_VERSION_1_2
(void) able;
#ifdef CR_IBM_rasterpos_clip
for (i=0; i<CR_MAX_CLIP_PLANES; i++) {
for (i = 0 ; i < maxTextureUnits ; i++)
for (j = 0 ; j < maxTextureUnits ; j++)
GLuint i, j;
unsigned int checktex = 0;
for (j=0;j<CR_MAX_BITARRAY;j++)
for (i=0; i<CR_MAX_CLIP_PLANES; i++) {
#ifdef CR_OPENGL_VERSION_1_2
(void) able;
#ifdef CR_IBM_rasterpos_clip
for (i=0; i<CR_MAX_CLIP_PLANES; i++) {
for (i = 0 ; i < maxTextureUnits ; i++)
for (j = 0 ; j < maxTextureUnits; j++)