/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
}
break;
case GL_OPERAND2_RGB:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
+ if (ctx->Extensions.ARB_texture_env_combine) {
const GLenum operand = (GLenum) (GLint) *param;
if (texUnit->Combine.OperandRGB[2] == operand)
return;
return;
}
}
+ else if (ctx->Extensions.EXT_texture_env_combine) {
+ const GLenum operand = (GLenum) (GLint) *param;
+ if (texUnit->Combine.OperandRGB[2] == operand)
+ return;
+ /* operand must be GL_SRC_ALPHA which is the initial value - thus
+ don't need to actually compare the operand to the possible value */
+ else {
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand);
+ return;
+ }
+ }
else {
TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
return;
}
break;
case GL_OPERAND2_ALPHA:
- if (ctx->Extensions.EXT_texture_env_combine ||
- ctx->Extensions.ARB_texture_env_combine) {
+ if (ctx->Extensions.ARB_texture_env_combine) {
const GLenum operand = (GLenum) (GLint) *param;
if (texUnit->Combine.OperandA[2] == operand)
return;
return;
}
}
+ else if (ctx->Extensions.EXT_texture_env_combine) {
+ const GLenum operand = (GLenum) (GLint) *param;
+ if (texUnit->Combine.OperandA[2] == operand)
+ return;
+ /* operand must be GL_SRC_ALPHA which is the initial value - thus
+ don't need to actually compare the operand to the possible value */
+ else {
+ TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand);
+ return;
+ }
+ }
else {
TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
return;
*params = img->Depth;
return;
case GL_TEXTURE_INTERNAL_FORMAT:
- *params = img->IntFormat;
+ *params = img->InternalFormat;
return;
case GL_TEXTURE_BORDER:
*params = img->Border;
return;
case GL_TEXTURE_RED_SIZE:
- if (img->Format == GL_RGB || img->Format == GL_RGBA)
+ if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA)
*params = img->TexFormat->RedBits;
else
*params = 0;
return;
case GL_TEXTURE_GREEN_SIZE:
- if (img->Format == GL_RGB || img->Format == GL_RGBA)
+ if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA)
*params = img->TexFormat->GreenBits;
else
*params = 0;
return;
case GL_TEXTURE_BLUE_SIZE:
- if (img->Format == GL_RGB || img->Format == GL_RGBA)
+ if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA)
*params = img->TexFormat->BlueBits;
else
*params = 0;
return;
case GL_TEXTURE_ALPHA_SIZE:
- if (img->Format == GL_ALPHA || img->Format == GL_LUMINANCE_ALPHA ||
- img->Format == GL_RGBA)
+ if (img->_BaseFormat == GL_ALPHA ||
+ img->_BaseFormat == GL_LUMINANCE_ALPHA ||
+ img->_BaseFormat == GL_RGBA)
*params = img->TexFormat->AlphaBits;
else
*params = 0;
return;
case GL_TEXTURE_INTENSITY_SIZE:
- if (img->Format != GL_INTENSITY)
+ if (img->_BaseFormat != GL_INTENSITY)
*params = 0;
else if (img->TexFormat->IntensityBits > 0)
*params = img->TexFormat->IntensityBits;
*params = MIN2(img->TexFormat->RedBits, img->TexFormat->GreenBits);
return;
case GL_TEXTURE_LUMINANCE_SIZE:
- if (img->Format != GL_LUMINANCE &&
- img->Format != GL_LUMINANCE_ALPHA)
+ if (img->_BaseFormat != GL_LUMINANCE &&
+ img->_BaseFormat != GL_LUMINANCE_ALPHA)
*params = 0;
else if (img->TexFormat->LuminanceBits > 0)
*params = img->TexFormat->LuminanceBits;
*params = MIN2(img->TexFormat->RedBits, img->TexFormat->GreenBits);
return;
case GL_TEXTURE_INDEX_SIZE_EXT:
- if (img->Format == GL_COLOR_INDEX)
+ if (img->_BaseFormat == GL_COLOR_INDEX)
*params = img->TexFormat->IndexBits;
else
*params = 0;
return;
- case GL_DEPTH_BITS:
- /* XXX this isn't in the GL_SGIX_depth_texture spec
- * but seems appropriate.
- */
- if (ctx->Extensions.SGIX_depth_texture)
+ case GL_TEXTURE_DEPTH_SIZE_ARB:
+ if (ctx->Extensions.SGIX_depth_texture ||
+ ctx->Extensions.ARB_depth_texture)
*params = img->TexFormat->DepthBits;
else
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetTexLevelParameter[if]v(pname)");
return;
+ case GL_TEXTURE_STENCIL_SIZE_EXT:
+ if (ctx->Extensions.EXT_packed_depth_stencil) {
+ *params = img->TexFormat->StencilBits;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetTexLevelParameter[if]v(pname)");
+ }
+ return;
/* GL_ARB_texture_compression */
case GL_TEXTURE_COMPRESSED_IMAGE_SIZE:
"glGetTexLevelParameter[if]v(pname)");
}
return;
+
default:
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetTexLevelParameter[if]v(pname)");
case GL_S:
if (pname==GL_TEXTURE_GEN_MODE) {
GLenum mode = (GLenum) (GLint) *params;
- GLuint bits;
+ GLbitfield bits;
switch (mode) {
case GL_OBJECT_LINEAR:
bits = TEXGEN_OBJ_LINEAR;
case GL_T:
if (pname==GL_TEXTURE_GEN_MODE) {
GLenum mode = (GLenum) (GLint) *params;
- GLuint bitt;
+ GLbitfield bitt;
switch (mode) {
case GL_OBJECT_LINEAR:
bitt = TEXGEN_OBJ_LINEAR;
case GL_R:
if (pname==GL_TEXTURE_GEN_MODE) {
GLenum mode = (GLenum) (GLint) *params;
- GLuint bitr;
+ GLbitfield bitr;
switch (mode) {
case GL_OBJECT_LINEAR:
bitr = TEXGEN_OBJ_LINEAR;
case GL_Q:
if (pname==GL_TEXTURE_GEN_MODE) {
GLenum mode = (GLenum) (GLint) *params;
- GLuint bitq;
+ GLbitfield bitq;
switch (mode) {
case GL_OBJECT_LINEAR:
bitq = TEXGEN_OBJ_LINEAR;
*/
for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
- GLuint enableBits;
+ GLbitfield enableBits;
texUnit->_Current = NULL;
texUnit->_ReallyEnabled = 0;
texUnit->_CurrentCombine = & texUnit->Combine;
}
else {
- GLenum format = texUnit->_Current->Image[0][0]->Format;
+ GLenum format = texUnit->_Current->Image[0][0]->_BaseFormat;
if (format == GL_COLOR_INDEX) {
format = GL_RGBA; /* a bit of a hack */
}
- else if (format == GL_DEPTH_COMPONENT) {
+ else if (format == GL_DEPTH_COMPONENT
+ || format == GL_DEPTH_STENCIL_EXT) {
format = texUnit->_Current->DepthMode;
}
calculate_derived_texenv(&texUnit->_EnvMode, texUnit->EnvMode, format);