state_texdiff.c revision 0bebd3a2671042901f1fcceff14f8c58dd397478
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster/* Copyright (c) 2001, Stanford University
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * All rights reserved
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * See the file LICENSE.txt for information on redistributing this software.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#define UNIMPLEMENTED() crStateError(__LINE__,__FILE__,GL_INVALID_OPERATION, "Unimplemented something or other" )
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#if 0 /* NOT USED??? */
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fostervoid crStateTextureObjSwitchCallback( unsigned long key, void *data1, void *data2 )
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster unsigned int i = 0;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster unsigned int j = 0;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster for (j=0;j<CR_MAX_BITARRAY;j++)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster if (!tobj) return;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster for (i = 0; i < fromCtx->limits.maxTextureUnits; i++)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster for (j = 0; j <= fromCtx->texture.maxLevel; j++)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster for (j = 0; j <= fromCtx->texture.max3DLevel; j++)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster for (j = 0; j <= fromCtx->texture.maxCubeMapLevel; j++)
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster /* Positive X */
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster /* Negative X */
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster /* Positive Y */
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster /* Negative Y */
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster /* Positive Z */
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster /* Negative Z */
for (j=0;j<CR_MAX_BITARRAY;j++)
if (activeUnit != i) {
activeUnit = i;
#ifdef CR_OPENGL_VERSION_1_2
#ifdef CR_ARB_texture_cube_map
#ifdef CR_NV_texture_rectangle
if (activeUnit != i) {
activeUnit = i;
#ifdef CR_OPENGL_VERSION_1_2
#ifdef CR_ARB_texture_cube_map
#ifdef CR_NV_texture_rectangle
if (activeUnit != i) {
activeUnit = i;
if (activeUnit != i) {
activeUnit = i;
if (activeUnit != i) {
activeUnit = i;
if (activeUnit != i) {
activeUnit = i;
int maxLevel = 0, i;
switch(target)
case GL_TEXTURE_1D:
case GL_TEXTURE_2D:
#ifdef CR_OPENGL_VERSION_1_2
case GL_TEXTURE_3D:
#ifdef CR_ARB_texture_cube_map
case GL_TEXTURE_CUBE_MAP:
#ifdef CR_NV_texture_rectangle
case GL_TEXTURE_RECTANGLE_NV:
if (!tobj)
for (i = 0; i < maxLevel; i++) {
#ifdef CR_OPENGL_VERSION_1_2
#ifdef CR_ARB_depth_texture
#ifdef CR_ARB_shadow
#ifdef CR_ARB_shadow_ambient
#ifdef CR_SGIS_generate_mipmap
if (!alwaysDirty)
int lvl;
int face;
case GL_TEXTURE_1D:
if (!alwaysDirty)
case GL_TEXTURE_2D:
if (!alwaysDirty)
#ifdef CR_OPENGL_VERSION_1_2
case GL_TEXTURE_3D:
if (!alwaysDirty)
#ifdef CR_NV_texture_rectangle
case GL_TEXTURE_RECTANGLE_NV:
if (!alwaysDirty)
#ifdef CR_ARB_texture_cube_map
case GL_TEXTURE_CUBE_MAP_ARB:
if (!alwaysDirty)
const GLboolean haveFragProg = fromCtx->extensions.ARB_fragment_program || fromCtx->extensions.NV_fragment_program;
for (j=0;j<CR_MAX_BITARRAY;j++)
#ifdef CR_OPENGL_VERSION_1_2
#ifdef CR_ARB_texture_cube_map
#ifdef CR_NV_texture_rectangle
#ifdef CR_ARB_texture_env_combine
#ifdef CR_OPENGL_VERSION_1_2
#ifdef CR_ARB_texture_cube_map
#ifdef CR_NV_texture_rectangle
if (!tobj) {
struct callback_info
CRContext *g;
for (j = 0; j < CR_MAX_BITARRAY; j++)
info.g = g;
#ifdef CR_ARB_texture_cube_map
#ifdef CR_NV_texture_rectangle
#ifdef CR_ARB_texture_cube_map
#ifdef CR_NV_texture_rectangle
#ifdef CR_ARB_texture_cube_map
#ifdef CR_NV_texture_rectangle