e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* Copyright (c) 2001, Stanford University
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * All rights reserved.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync *
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * See the file LICENSE.txt for information on redistributing this software.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#ifndef CR_STATE_TEXTURE_H
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define CR_STATE_TEXTURE_H
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#include "cr_hash.h"
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#include "state/cr_statetypes.h"
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#include "state/cr_limits.h"
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#include <iprt/cdefs.h>
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#ifdef __cplusplus
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern "C" {
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
0bebd3a2671042901f1fcceff14f8c58dd397478vboxsync/* Tells state tracker to rely on diff_api to store/load texture images
0bebd3a2671042901f1fcceff14f8c58dd397478vboxsync * and avoid host memory allocation.
0bebd3a2671042901f1fcceff14f8c58dd397478vboxsync */
0bebd3a2671042901f1fcceff14f8c58dd397478vboxsync#define CR_STATE_NO_TEXTURE_IMAGE_STORE
0bebd3a2671042901f1fcceff14f8c58dd397478vboxsync
af8d59d05d72f134aeea62712f1286b369807d52vboxsync#if defined(CR_ARB_pixel_buffer_object) && !defined(CR_STATE_NO_TEXTURE_IMAGE_STORE)
af8d59d05d72f134aeea62712f1286b369807d52vboxsync#error CR_ARB_pixel_buffer_object not supported without CR_STATE_NO_TEXTURE_IMAGE_STORE
af8d59d05d72f134aeea62712f1286b369807d52vboxsync#endif
af8d59d05d72f134aeea62712f1286b369807d52vboxsync
51e7ffc68ae0a6122fcfdc746905b6c7dae2c610vboxsync#define CR_MAX_MIPMAP_LEVELS 20
51e7ffc68ae0a6122fcfdc746905b6c7dae2c610vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef struct {
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLubyte redbits;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLubyte greenbits;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLubyte bluebits;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLubyte alphabits;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLubyte luminancebits;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLubyte intensitybits;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLubyte indexbits;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync} CRTextureFormat;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef struct {
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLubyte *img;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync int bytes;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLint width; /* width, height, depth includes the border */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLint height;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLint depth;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLint internalFormat;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLint border;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLenum format;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLenum type;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync int bytesPerPixel;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#if CR_ARB_texture_compression
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLboolean compressed;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLboolean generateMipmap;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync const CRTextureFormat *texFormat;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRbitvalue dirty[CR_MAX_BITARRAY];
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync} CRTextureLevel;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef struct {
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLenum target;
c62d2520ac91e12cf4665c936f490dd2064152d3vboxsync GLuint id;
c62d2520ac91e12cf4665c936f490dd2064152d3vboxsync GLuint hwid;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* The mipmap levels */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRTextureLevel *level[6]; /* 6 cube faces */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLcolorf borderColor;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLenum minFilter, magFilter;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLenum wrapS, wrapT;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#ifdef CR_OPENGL_VERSION_1_2
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLenum wrapR;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLfloat priority;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLfloat minLod;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLfloat maxLod;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLint baseLevel;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLint maxLevel;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#ifdef CR_EXT_texture_filter_anisotropic
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLfloat maxAnisotropy;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#ifdef CR_ARB_depth_texture
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLenum depthMode;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#ifdef CR_ARB_shadow
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLenum compareMode;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLenum compareFunc;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#ifdef CR_ARB_shadow_ambient
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLfloat compareFailValue;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#ifdef CR_SGIS_generate_mipmap
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLboolean generateMipmap;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif
4bf357e9215bcc257ba2a5e13ef1f083053cfeb9vboxsync GLboolean pinned; /* <- keep the texture alive if its ctxUsage reaches zero */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRbitvalue dirty[CR_MAX_BITARRAY];
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRbitvalue imageBit[CR_MAX_BITARRAY];
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRbitvalue paramsBit[CR_MAX_TEXTURE_UNITS][CR_MAX_BITARRAY];
7f3bb583c97fd6f88c66f0047f1cd465afffefb4vboxsync /* bitfield representing the object usage. 1 means the object is used by the context with the given bitid */
7f3bb583c97fd6f88c66f0047f1cd465afffefb4vboxsync CRbitvalue ctxUsage[CR_MAX_BITARRAY];
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync} CRTextureObj;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef struct {
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRbitvalue dirty[CR_MAX_BITARRAY];
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRbitvalue enable[CR_MAX_TEXTURE_UNITS][CR_MAX_BITARRAY];
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRbitvalue current[CR_MAX_TEXTURE_UNITS][CR_MAX_BITARRAY];
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRbitvalue objGen[CR_MAX_TEXTURE_UNITS][CR_MAX_BITARRAY];
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRbitvalue eyeGen[CR_MAX_TEXTURE_UNITS][CR_MAX_BITARRAY];
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRbitvalue genMode[CR_MAX_TEXTURE_UNITS][CR_MAX_BITARRAY];
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* XXX someday create more bits for texture env state */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRbitvalue envBit[CR_MAX_TEXTURE_UNITS][CR_MAX_BITARRAY];
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync} CRTextureBits;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef struct {
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* Current texture objects (in terms of glBindTexture and glActiveTexture) */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRTextureObj *currentTexture1D;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRTextureObj *currentTexture2D;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRTextureObj *currentTexture3D;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#ifdef CR_ARB_texture_cube_map
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRTextureObj *currentTextureCubeMap;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#ifdef CR_NV_texture_rectangle
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRTextureObj *currentTextureRect;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLboolean enabled1D;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLboolean enabled2D;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLboolean enabled3D;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#ifdef CR_ARB_texture_cube_map
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLboolean enabledCubeMap;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#ifdef CR_NV_texture_rectangle
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLboolean enabledRect;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#ifdef CR_EXT_texture_lod_bias
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLfloat lodBias;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLenum envMode;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLcolorf envColor;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* GL_ARB_texture_env_combine */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLenum combineModeRGB; /* GL_REPLACE, GL_DECAL, GL_ADD, etc. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLenum combineModeA; /* GL_REPLACE, GL_DECAL, GL_ADD, etc. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLenum combineSourceRGB[3]; /* GL_PRIMARY_COLOR, GL_TEXTURE, etc. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLenum combineSourceA[3]; /* GL_PRIMARY_COLOR, GL_TEXTURE, etc. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLenum combineOperandRGB[3]; /* SRC_COLOR, ONE_MINUS_SRC_COLOR, etc */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLenum combineOperandA[3]; /* SRC_ALPHA, ONE_MINUS_SRC_ALPHA, etc */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLfloat combineScaleRGB; /* 1 or 2 or 4 */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLfloat combineScaleA; /* 1 or 2 or 4 */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLtexcoordb textureGen;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLvectorf objSCoeff;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLvectorf objTCoeff;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLvectorf objRCoeff;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLvectorf objQCoeff;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLvectorf eyeSCoeff;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLvectorf eyeTCoeff;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLvectorf eyeRCoeff;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLvectorf eyeQCoeff;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLtexcoorde gen;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* These are only used for glPush/PopAttrib */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRTextureObj Saved1D;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRTextureObj Saved2D;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRTextureObj Saved3D;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#ifdef CR_ARB_texture_cube_map
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRTextureObj SavedCubeMap;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#ifdef CR_NV_texture_rectangle
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRTextureObj SavedRect;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync} CRTextureUnit;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef struct {
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* Default texture objects (name = 0) */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRTextureObj base1D;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRTextureObj base2D;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRTextureObj base3D;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#ifdef CR_ARB_texture_cube_map
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRTextureObj baseCubeMap;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#ifdef CR_NV_texture_rectangle
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRTextureObj baseRect;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* Proxy texture objects */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRTextureObj proxy1D;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRTextureObj proxy2D;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRTextureObj proxy3D;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#ifdef CR_ARB_texture_cube_map
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRTextureObj proxyCubeMap;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#ifdef CR_NV_texture_rectangle
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRTextureObj proxyRect;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLuint curTextureUnit; /* GL_ACTIVE_TEXTURE */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLint maxLevel; /* number of mipmap levels possible: [0..max] */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLint max3DLevel;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLint maxCubeMapLevel;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLint maxRectLevel;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync GLboolean broadcastTextures; /*@todo what is it for?*/
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /* Per-texture unit state: */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRTextureUnit unit[CR_MAX_TEXTURE_UNITS];
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync} CRTextureState;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncDECLEXPORT(void) crStateTextureInit(CRContext *ctx);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncDECLEXPORT(void) crStateTextureDestroy(CRContext *ctx);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncDECLEXPORT(void) crStateTextureFree(CRContext *ctx);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncDECLEXPORT(void) crStateTextureInitTexture(GLuint name);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncDECLEXPORT(CRTextureObj *) crStateTextureAllocate(GLuint name);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /*void crStateTextureDelete(GLuint name);*/
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncDECLEXPORT(CRTextureObj *) crStateTextureGet(GLenum target, GLuint textureid);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncDECLEXPORT(int) crStateTextureGetSize(GLenum target, GLenum level);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncDECLEXPORT(const GLvoid *) crStateTextureGetData(GLenum target, GLenum level);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncDECLEXPORT(int) crStateTextureCheckDirtyImages(CRContext *from, CRContext *to, GLenum target, int textureUnit);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncDECLEXPORT(void) crStateTextureDiff(CRTextureBits *t, CRbitvalue *bitID,
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRContext *fromCtx, CRContext *toCtx);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncDECLEXPORT(void) crStateTextureSwitch(CRTextureBits *t, CRbitvalue *bitID,
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRContext *fromCtx, CRContext *toCtx);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncDECLEXPORT(void) crStateTextureObjectDiff(CRContext *fromCtx,
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync const CRbitvalue *bitID,
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync const CRbitvalue *nbitID,
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync CRTextureObj *tobj, GLboolean alwaysDirty);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncDECLEXPORT(void) crStateDiffAllTextureObjects( CRContext *g, CRbitvalue *bitID, GLboolean bForceUpdate );
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncDECLEXPORT(void) crStateDeleteTextureObjectData(CRTextureObj *tobj);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncDECLEXPORT(void) crStateDeleteTextureObject(CRTextureObj *tobj);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
c62d2520ac91e12cf4665c936f490dd2064152d3vboxsyncDECLEXPORT(GLuint) STATE_APIENTRY crStateTextureHWIDtoID(GLuint hwid);
c62d2520ac91e12cf4665c936f490dd2064152d3vboxsyncDECLEXPORT(GLuint) STATE_APIENTRY crStateGetTextureHWID(GLuint id);
c62d2520ac91e12cf4665c936f490dd2064152d3vboxsyncDECLEXPORT(GLuint) STATE_APIENTRY crStateGetTextureObjHWID(CRTextureObj *tobj);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
abc5a9d44919bf36945b8d7909125bf4dc62c58cvboxsyncvoid crStateRegTextures(GLsizei n, GLuint *names);
abc5a9d44919bf36945b8d7909125bf4dc62c58cvboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#ifdef __cplusplus
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync}
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif /* CR_STATE_TEXTURE_H */