-/* $Id: get.c,v 1.54 2001/02/27 22:33:59 brianp Exp $ */
+/**
+ * \file get.c
+ * State query functions.
+ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 6.0
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+/*
+ * Regarding GL_NV_light_max_exponent:
+ *
+ * Portions of this software may use or implement intellectual
+ * property owned and licensed by NVIDIA Corporation. NVIDIA disclaims
+ * any and all warranties with respect to such intellectual property,
+ * including any use thereof or modifications thereto.
+ */
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
#include "colormac.h"
#include "context.h"
#include "extensions.h"
#include "get.h"
#include "macros.h"
-#include "mmath.h"
#include "mtypes.h"
-
+#include "texcompress.h"
+#include "version.h"
#include "math/m_matrix.h"
-#endif
-
#define FLOAT_TO_BOOL(X) ( (X)==0.0F ? GL_FALSE : GL_TRUE )
#endif
+/* Check if named extension is enabled, if not generate error and return */
+
+#define CHECK1(E1, str, PNAME) \
+ if (!ctx->Extensions.E1) { \
+ _mesa_error(ctx, GL_INVALID_VALUE, \
+ "glGet" str "v(0x%x)", (int) PNAME); \
+ return; \
+ }
+
+#define CHECK2(E1, E2, str, PNAME) \
+ if (!ctx->Extensions.E1 && !ctx->Extensions.E2) { \
+ _mesa_error(ctx, GL_INVALID_VALUE, \
+ "glGet" str "v(0x%x)", (int) PNAME); \
+ return; \
+ }
+
+#define CHECK_EXTENSION_B(EXTNAME, PNAME) \
+ CHECK1(EXTNAME, "Boolean", PNAME )
+
+#define CHECK_EXTENSION_I(EXTNAME, PNAME) \
+ CHECK1(EXTNAME, "Integer", PNAME )
+
+#define CHECK_EXTENSION_F(EXTNAME, PNAME) \
+ CHECK1(EXTNAME, "Float", PNAME )
+
+#define CHECK_EXTENSION_D(EXTNAME, PNAME) \
+ CHECK1(EXTNAME, "Double", PNAME )
+
+#define CHECK_EXTENSION2_B(EXT1, EXT2, PNAME) \
+ CHECK2(EXT1, EXT2, "Boolean", PNAME)
+
+#define CHECK_EXTENSION2_I(EXT1, EXT2, PNAME) \
+ CHECK2(EXT1, EXT2, "Integer", PNAME)
+
+#define CHECK_EXTENSION2_F(EXT1, EXT2, PNAME) \
+ CHECK2(EXT1, EXT2, "Float", PNAME)
+
+#define CHECK_EXTENSION2_D(EXT1, EXT2, PNAME) \
+ CHECK2(EXT1, EXT2, "Double", PNAME)
+
+
static GLenum
pixel_texgen_mode(const GLcontext *ctx)
}
-
-void
+/**
+ * Get the value(s) of a selected parameter.
+ *
+ * \param pname parameter to be returned.
+ * \param params will hold the value(s) of the speficifed parameter.
+ *
+ * \sa glGetBooleanv().
+ *
+ * Tries to get the specified parameter via dd_function_table::GetBooleanv,
+ * otherwise gets the specified parameter from the current context, converting
+ * it value into GLboolean.
+ */
+void GLAPIENTRY
_mesa_GetBooleanv( GLenum pname, GLboolean *params )
{
GET_CURRENT_CONTEXT(ctx);
GLuint i;
- GLuint texUnit = ctx->Texture.CurrentUnit;
- GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit;
+ const GLuint clientUnit = ctx->Array.ActiveTexture;
+ const GLuint texUnit = ctx->Texture.CurrentUnit;
const struct gl_texture_unit *textureUnit = &ctx->Texture.Unit[texUnit];
ASSERT_OUTSIDE_BEGIN_END(ctx);
return;
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glGetBooleanv %s\n", gl_lookup_enum_by_nr(pname));
+ _mesa_debug(ctx, "glGetBooleanv %s\n", _mesa_lookup_enum_by_nr(pname));
+
+ if (!ctx->_CurrentProgram) {
+ /* We need this in order to get correct results for
+ * GL_OCCLUSION_TEST_RESULT_HP. There might be other important cases.
+ */
+ FLUSH_VERTICES(ctx, 0);
+ }
if (ctx->Driver.GetBooleanv
&& (*ctx->Driver.GetBooleanv)(ctx, pname, params))
*params = ENUM_TO_BOOL(ctx->Color.AlphaFunc);
break;
case GL_ALPHA_TEST_REF:
- *params = FLOAT_TO_BOOL((GLfloat) ctx->Color.AlphaRef / CHAN_MAXF);
+ *params = ctx->Color.AlphaRef ? GL_TRUE : GL_FALSE;
break;
case GL_ATTRIB_STACK_DEPTH:
*params = INT_TO_BOOL(ctx->AttribStackDepth);
case GL_CLIP_PLANE3:
case GL_CLIP_PLANE4:
case GL_CLIP_PLANE5:
- *params = ctx->Transform.ClipEnabled[pname-GL_CLIP_PLANE0];
+ if (ctx->Transform.ClipPlanesEnabled & (1 << (pname - GL_CLIP_PLANE0)))
+ *params = GL_TRUE;
+ else
+ *params = GL_FALSE;
break;
case GL_COLOR_CLEAR_VALUE:
params[0] = ctx->Color.ClearColor[0] ? GL_TRUE : GL_FALSE;
break;
case GL_CURRENT_COLOR:
FLUSH_CURRENT(ctx, 0);
- params[0] = INT_TO_BOOL(ctx->Current.Color[0]);
- params[1] = INT_TO_BOOL(ctx->Current.Color[1]);
- params[2] = INT_TO_BOOL(ctx->Current.Color[2]);
- params[3] = INT_TO_BOOL(ctx->Current.Color[3]);
+ params[0] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]);
+ params[1] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]);
+ params[2] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]);
+ params[3] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]);
break;
case GL_CURRENT_INDEX:
FLUSH_CURRENT(ctx, 0);
- *params = INT_TO_BOOL(ctx->Current.Index);
+ *params = FLOAT_TO_BOOL(ctx->Current.Index);
break;
case GL_CURRENT_NORMAL:
FLUSH_CURRENT(ctx, 0);
- params[0] = FLOAT_TO_BOOL(ctx->Current.Normal[0]);
- params[1] = FLOAT_TO_BOOL(ctx->Current.Normal[1]);
- params[2] = FLOAT_TO_BOOL(ctx->Current.Normal[2]);
+ params[0] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0]);
+ params[1] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1]);
+ params[2] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2]);
break;
case GL_CURRENT_RASTER_COLOR:
params[0] = FLOAT_TO_BOOL(ctx->Current.RasterColor[0]);
params[3] = FLOAT_TO_BOOL(ctx->Current.RasterPos[3]);
break;
case GL_CURRENT_RASTER_TEXTURE_COORDS:
- params[0] = FLOAT_TO_BOOL(ctx->Current.RasterMultiTexCoord[texTransformUnit][0]);
- params[1] = FLOAT_TO_BOOL(ctx->Current.RasterMultiTexCoord[texTransformUnit][1]);
- params[2] = FLOAT_TO_BOOL(ctx->Current.RasterMultiTexCoord[texTransformUnit][2]);
- params[3] = FLOAT_TO_BOOL(ctx->Current.RasterMultiTexCoord[texTransformUnit][3]);
+ params[0] = FLOAT_TO_BOOL(ctx->Current.RasterTexCoords[texUnit][0]);
+ params[1] = FLOAT_TO_BOOL(ctx->Current.RasterTexCoords[texUnit][1]);
+ params[2] = FLOAT_TO_BOOL(ctx->Current.RasterTexCoords[texUnit][2]);
+ params[3] = FLOAT_TO_BOOL(ctx->Current.RasterTexCoords[texUnit][3]);
break;
case GL_CURRENT_RASTER_POSITION_VALID:
*params = ctx->Current.RasterPosValid;
break;
case GL_CURRENT_TEXTURE_COORDS:
FLUSH_CURRENT(ctx, 0);
- params[0] = FLOAT_TO_BOOL(ctx->Current.Texcoord[texTransformUnit][0]);
- params[1] = FLOAT_TO_BOOL(ctx->Current.Texcoord[texTransformUnit][1]);
- params[2] = FLOAT_TO_BOOL(ctx->Current.Texcoord[texTransformUnit][2]);
- params[3] = FLOAT_TO_BOOL(ctx->Current.Texcoord[texTransformUnit][3]);
+ params[0] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][0]);
+ params[1] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][1]);
+ params[2] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][2]);
+ params[3] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3]);
break;
case GL_DEPTH_BIAS:
*params = FLOAT_TO_BOOL(ctx->Pixel.DepthBias);
case GL_GREEN_SCALE:
*params = FLOAT_TO_BOOL(ctx->Pixel.GreenScale);
break;
- case GL_HISTOGRAM:
- if (ctx->Extensions.EXT_histogram) {
- *params = ctx->Pixel.HistogramEnabled;
- }
- else {
- gl_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
- return;
- }
- break;
case GL_INDEX_BITS:
*params = INT_TO_BOOL( ctx->Visual.indexBits );
break;
*params = INT_TO_BOOL(ctx->List.ListBase);
break;
case GL_LIST_INDEX:
- *params = INT_TO_BOOL( ctx->CurrentListNum );
+ *params = INT_TO_BOOL( ctx->ListState.CurrentListNum );
break;
case GL_LIST_MODE:
- *params = ENUM_TO_BOOL( ctx->ExecuteFlag
- ? GL_COMPILE_AND_EXECUTE : GL_COMPILE );
+ if (!ctx->CompileFlag)
+ *params = 0;
+ else if (ctx->ExecuteFlag)
+ *params = ENUM_TO_BOOL(GL_COMPILE_AND_EXECUTE);
+ else
+ *params = ENUM_TO_BOOL(GL_COMPILE);
break;
case GL_INDEX_LOGIC_OP:
*params = ctx->Color.IndexLogicOpEnabled;
*params = INT_TO_BOOL(MAX_PROJECTION_STACK_DEPTH);
break;
case GL_MAX_TEXTURE_SIZE:
+ *params = INT_TO_BOOL(1 << (ctx->Const.MaxTextureLevels - 1));
+ break;
case GL_MAX_3D_TEXTURE_SIZE:
- *params = INT_TO_BOOL(ctx->Const.MaxTextureSize);
+ *params = INT_TO_BOOL(1 << (ctx->Const.Max3DTextureLevels - 1));
break;
case GL_MAX_TEXTURE_STACK_DEPTH:
*params = INT_TO_BOOL(MAX_TEXTURE_STACK_DEPTH);
params[0] = INT_TO_BOOL(MAX_WIDTH);
params[1] = INT_TO_BOOL(MAX_HEIGHT);
break;
- case GL_MINMAX:
- *params = ctx->Pixel.MinMaxEnabled;
- break;
case GL_MODELVIEW_MATRIX:
for (i=0;i<16;i++) {
- params[i] = FLOAT_TO_BOOL(ctx->ModelView.m[i]);
+ params[i] = FLOAT_TO_BOOL(ctx->ModelviewMatrixStack.Top->m[i]);
}
break;
case GL_MODELVIEW_STACK_DEPTH:
- *params = INT_TO_BOOL(ctx->ModelViewStackDepth + 1);
+ *params = INT_TO_BOOL(ctx->ModelviewMatrixStack.Depth + 1);
break;
case GL_NAME_STACK_DEPTH:
*params = INT_TO_BOOL(ctx->Select.NameStackDepth);
case GL_PACK_IMAGE_HEIGHT_EXT:
*params = ctx->Pack.ImageHeight;
break;
+ case GL_PACK_INVERT_MESA:
+ *params = ctx->Pack.Invert;
+ break;
case GL_PERSPECTIVE_CORRECTION_HINT:
*params = ENUM_TO_BOOL(ctx->Hint.PerspectiveCorrection);
break;
break;
case GL_PROJECTION_MATRIX:
for (i=0;i<16;i++) {
- params[i] = FLOAT_TO_BOOL(ctx->ProjectionMatrix.m[i]);
+ params[i] = FLOAT_TO_BOOL(ctx->ProjectionMatrixStack.Top->m[i]);
}
break;
case GL_PROJECTION_STACK_DEPTH:
- *params = INT_TO_BOOL(ctx->ProjectionStackDepth + 1);
+ *params = INT_TO_BOOL(ctx->ProjectionMatrixStack.Depth + 1);
break;
case GL_READ_BUFFER:
*params = ENUM_TO_BOOL(ctx->Pixel.ReadBuffer);
*params = INT_TO_BOOL(ctx->Stencil.Clear);
break;
case GL_STENCIL_FAIL:
- *params = ENUM_TO_BOOL(ctx->Stencil.FailFunc);
+ *params = ENUM_TO_BOOL(ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_FUNC:
- *params = ENUM_TO_BOOL(ctx->Stencil.Function);
+ *params = ENUM_TO_BOOL(ctx->Stencil.Function[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_PASS_DEPTH_FAIL:
- *params = ENUM_TO_BOOL(ctx->Stencil.ZFailFunc);
+ *params = ENUM_TO_BOOL(ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_PASS_DEPTH_PASS:
- *params = ENUM_TO_BOOL(ctx->Stencil.ZPassFunc);
+ *params = ENUM_TO_BOOL(ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_REF:
- *params = INT_TO_BOOL(ctx->Stencil.Ref);
+ *params = INT_TO_BOOL(ctx->Stencil.Ref[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_TEST:
*params = ctx->Stencil.Enabled;
break;
case GL_STENCIL_VALUE_MASK:
- *params = INT_TO_BOOL(ctx->Stencil.ValueMask);
+ *params = INT_TO_BOOL(ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_WRITEMASK:
- *params = INT_TO_BOOL(ctx->Stencil.WriteMask);
+ *params = INT_TO_BOOL(ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]);
break;
case GL_STEREO:
*params = ctx->Visual.stereoMode;
case GL_TEXTURE_MATRIX:
for (i=0;i<16;i++) {
params[i] =
- FLOAT_TO_BOOL(ctx->TextureMatrix[texTransformUnit].m[i]);
+ FLOAT_TO_BOOL(ctx->TextureMatrixStack[texUnit].Top->m[i]);
}
break;
case GL_TEXTURE_STACK_DEPTH:
- *params = INT_TO_BOOL(ctx->TextureStackDepth[texTransformUnit] + 1);
+ *params = INT_TO_BOOL(ctx->TextureMatrixStack[texUnit].Depth + 1);
break;
case GL_UNPACK_ALIGNMENT:
*params = INT_TO_BOOL(ctx->Unpack.Alignment);
case GL_UNPACK_IMAGE_HEIGHT_EXT:
*params = ctx->Unpack.ImageHeight;
break;
+ case GL_UNPACK_CLIENT_STORAGE_APPLE:
+ *params = ctx->Unpack.ClientStorage;
+ break;
case GL_VIEWPORT:
params[0] = INT_TO_BOOL(ctx->Viewport.X);
params[1] = INT_TO_BOOL(ctx->Viewport.Y);
*params = INT_TO_BOOL(0);
break;
case GL_TEXTURE_COORD_ARRAY:
- *params = ctx->Array.TexCoord[texUnit].Enabled;
+ *params = ctx->Array.TexCoord[clientUnit].Enabled;
break;
case GL_TEXTURE_COORD_ARRAY_SIZE:
- *params = INT_TO_BOOL(ctx->Array.TexCoord[texUnit].Size);
+ *params = INT_TO_BOOL(ctx->Array.TexCoord[clientUnit].Size);
break;
case GL_TEXTURE_COORD_ARRAY_TYPE:
- *params = ENUM_TO_BOOL(ctx->Array.TexCoord[texUnit].Type);
+ *params = ENUM_TO_BOOL(ctx->Array.TexCoord[clientUnit].Type);
break;
case GL_TEXTURE_COORD_ARRAY_STRIDE:
- *params = INT_TO_BOOL(ctx->Array.TexCoord[texUnit].Stride);
+ *params = INT_TO_BOOL(ctx->Array.TexCoord[clientUnit].Stride);
break;
case GL_TEXTURE_COORD_ARRAY_COUNT_EXT:
*params = INT_TO_BOOL(0);
case GL_EDGE_FLAG_ARRAY_STRIDE:
*params = INT_TO_BOOL(ctx->Array.EdgeFlag.Stride);
break;
+ case GL_EDGE_FLAG_ARRAY_COUNT_EXT:
+ *params = INT_TO_BOOL(0);
+ break;
/* GL_ARB_multitexture */
case GL_MAX_TEXTURE_UNITS_ARB:
- *params = ctx->Const.MaxTextureUnits;
+ CHECK_EXTENSION_B(ARB_multitexture, pname);
+ *params = INT_TO_BOOL(MIN2(ctx->Const.MaxTextureImageUnits,
+ ctx->Const.MaxTextureCoordUnits));
break;
case GL_ACTIVE_TEXTURE_ARB:
+ CHECK_EXTENSION_B(ARB_multitexture, pname);
*params = INT_TO_BOOL(GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit);
break;
case GL_CLIENT_ACTIVE_TEXTURE_ARB:
- *params = INT_TO_BOOL(GL_TEXTURE0_ARB + ctx->Array.ActiveTexture);
+ CHECK_EXTENSION_B(ARB_multitexture, pname);
+ *params = INT_TO_BOOL(GL_TEXTURE0_ARB + clientUnit);
break;
/* GL_ARB_texture_cube_map */
case GL_TEXTURE_CUBE_MAP_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- *params = _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
- else
- gl_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
- return;
+ CHECK_EXTENSION_B(ARB_texture_cube_map, pname);
+ *params = _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
+ break;
case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- *params = INT_TO_BOOL(textureUnit->CurrentCubeMap->Name);
- else
- gl_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
- return;
+ CHECK_EXTENSION_B(ARB_texture_cube_map, pname);
+ *params = INT_TO_BOOL(textureUnit->CurrentCubeMap->Name);
+ break;
case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- *params = INT_TO_BOOL(ctx->Const.MaxCubeTextureSize);
- else
- gl_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
+ CHECK_EXTENSION_B(ARB_texture_cube_map, pname);
+ *params = INT_TO_BOOL(1 << (ctx->Const.MaxCubeTextureLevels - 1));
break;
/* GL_ARB_texture_compression */
case GL_TEXTURE_COMPRESSION_HINT_ARB:
- if (ctx->Extensions.ARB_texture_compression) {
- *params = INT_TO_BOOL(ctx->Hint.TextureCompression);
- }
- else
- gl_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
+ CHECK_EXTENSION_B(ARB_texture_compression, pname);
+ *params = INT_TO_BOOL(ctx->Hint.TextureCompression);
break;
case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
- if (ctx->Extensions.ARB_texture_compression) {
- *params = INT_TO_BOOL(ctx->Const.NumCompressedTextureFormats);
- }
- else
- gl_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
+ CHECK_EXTENSION_B(ARB_texture_compression, pname);
+ *params = INT_TO_BOOL(_mesa_get_compressed_formats(ctx, NULL));
break;
case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
- if (ctx->Extensions.ARB_texture_compression) {
- GLuint i;
- for (i = 0; i < ctx->Const.NumCompressedTextureFormats; i++)
- params[i] = INT_TO_BOOL(ctx->Const.CompressedTextureFormats[i]);
+ CHECK_EXTENSION_B(ARB_texture_compression, pname);
+ {
+ GLint formats[100];
+ GLuint i, n;
+ n = _mesa_get_compressed_formats(ctx, formats);
+ for (i = 0; i < n; i++)
+ params[i] = INT_TO_BOOL(formats[i]);
}
- else
- gl_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
break;
/* GL_EXT_compiled_vertex_array */
{
GLfloat tm[16];
GLuint i;
- _math_transposef(tm, ctx->ColorMatrix.m);
+ _math_transposef(tm, ctx->ColorMatrixStack.Top->m);
for (i=0;i<16;i++) {
params[i] = FLOAT_TO_BOOL(tm[i]);
}
{
GLfloat tm[16];
GLuint i;
- _math_transposef(tm, ctx->ModelView.m);
+ _math_transposef(tm, ctx->ModelviewMatrixStack.Top->m);
for (i=0;i<16;i++) {
params[i] = FLOAT_TO_BOOL(tm[i]);
}
{
GLfloat tm[16];
GLuint i;
- _math_transposef(tm, ctx->ProjectionMatrix.m);
+ _math_transposef(tm, ctx->ProjectionMatrixStack.Top->m);
for (i=0;i<16;i++) {
params[i] = FLOAT_TO_BOOL(tm[i]);
}
{
GLfloat tm[16];
GLuint i;
- _math_transposef(tm, ctx->TextureMatrix[texTransformUnit].m);
+ _math_transposef(tm, ctx->TextureMatrixStack[texUnit].Top->m);
for (i=0;i<16;i++) {
params[i] = FLOAT_TO_BOOL(tm[i]);
}
/* GL_HP_occlusion_test */
case GL_OCCLUSION_TEST_HP:
- if (ctx->Extensions.HP_occlusion_test) {
- *params = ctx->Depth.OcclusionTest;
- }
- else {
- gl_error( ctx, GL_INVALID_ENUM, "glGetBooleanv" );
- }
+ CHECK_EXTENSION_B(HP_occlusion_test, pname);
+ *params = ctx->Depth.OcclusionTest;
return;
case GL_OCCLUSION_TEST_RESULT_HP:
- if (ctx->Extensions.HP_occlusion_test) {
- if (ctx->Depth.OcclusionTest)
- *params = ctx->OcclusionResult;
- else
- *params = ctx->OcclusionResultSaved;
- /* reset flag now */
- ctx->OcclusionResult = GL_FALSE;
- ctx->OcclusionResultSaved = GL_FALSE;
- }
- else {
- gl_error( ctx, GL_INVALID_ENUM, "glGetBooleanv" );
- }
+ CHECK_EXTENSION_B(HP_occlusion_test, pname);
+ if (ctx->Depth.OcclusionTest)
+ *params = ctx->OcclusionResult;
+ else
+ *params = ctx->OcclusionResultSaved;
+ /* reset flag now */
+ ctx->OcclusionResult = GL_FALSE;
+ ctx->OcclusionResultSaved = GL_FALSE;
return;
/* GL_SGIS_pixel_texture */
/* GL_SGI_color_matrix (also in 1.2 imaging) */
case GL_COLOR_MATRIX_SGI:
for (i=0;i<16;i++) {
- params[i] = FLOAT_TO_BOOL(ctx->ColorMatrix.m[i]);
+ params[i] = FLOAT_TO_BOOL(ctx->ColorMatrixStack.Top->m[i]);
}
break;
case GL_COLOR_MATRIX_STACK_DEPTH_SGI:
- *params = INT_TO_BOOL(ctx->ColorStackDepth + 1);
+ *params = INT_TO_BOOL(ctx->ColorMatrixStack.Depth + 1);
break;
case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI:
*params = FLOAT_TO_BOOL(MAX_COLOR_STACK_DEPTH);
/* GL_EXT_convolution (also in 1.2 imaging) */
case GL_CONVOLUTION_1D_EXT:
- if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) {
- *params = ctx->Pixel.Convolution1DEnabled;
- }
- else {
- gl_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
- return;
- }
+ CHECK_EXTENSION_B(EXT_convolution, pname);
+ *params = ctx->Pixel.Convolution1DEnabled;
break;
case GL_CONVOLUTION_2D:
- if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) {
- *params = ctx->Pixel.Convolution2DEnabled;
- }
- else {
- gl_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
- return;
- }
+ CHECK_EXTENSION_B(EXT_convolution, pname);
+ *params = ctx->Pixel.Convolution2DEnabled;
break;
case GL_SEPARABLE_2D:
- if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) {
- *params = ctx->Pixel.Separable2DEnabled;
- }
- else {
- gl_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
- return;
- }
- break;
- case GL_MAX_CONVOLUTION_WIDTH:
- *params = INT_TO_BOOL(ctx->Const.MaxConvolutionWidth);
- break;
- case GL_MAX_CONVOLUTION_HEIGHT:
- *params = INT_TO_BOOL(ctx->Const.MaxConvolutionHeight);
+ CHECK_EXTENSION_B(EXT_convolution, pname);
+ *params = ctx->Pixel.Separable2DEnabled;
break;
case GL_POST_CONVOLUTION_RED_SCALE_EXT:
+ CHECK_EXTENSION_B(EXT_convolution, pname);
*params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionScale[0]);
break;
case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:
+ CHECK_EXTENSION_B(EXT_convolution, pname);
*params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionScale[1]);
break;
case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:
+ CHECK_EXTENSION_B(EXT_convolution, pname);
*params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionScale[2]);
break;
case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:
+ CHECK_EXTENSION_B(EXT_convolution, pname);
*params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionScale[3]);
break;
case GL_POST_CONVOLUTION_RED_BIAS_EXT:
+ CHECK_EXTENSION_B(EXT_convolution, pname);
*params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionBias[0]);
break;
case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:
+ CHECK_EXTENSION_B(EXT_convolution, pname);
*params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionBias[1]);
break;
case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:
+ CHECK_EXTENSION_B(EXT_convolution, pname);
*params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionBias[2]);
break;
case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:
+ CHECK_EXTENSION_B(EXT_convolution, pname);
*params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionBias[2]);
break;
+ /* GL_EXT_histogram (also in 1.2 imaging) */
+ case GL_HISTOGRAM:
+ CHECK_EXTENSION_B(EXT_histogram, pname);
+ *params = ctx->Pixel.HistogramEnabled;
+ break;
+ case GL_MINMAX:
+ CHECK_EXTENSION_B(EXT_histogram, pname);
+ *params = ctx->Pixel.MinMaxEnabled;
+ break;
+
/* GL_SGI_color_table (also in 1.2 imaging */
case GL_COLOR_TABLE_SGI:
*params = ctx->Pixel.ColorTableEnabled;
case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
*params = ctx->Pixel.PostColorMatrixColorTableEnabled;
break;
-
+
+ /* GL_SGI_texture_color_table */
+ case GL_TEXTURE_COLOR_TABLE_SGI:
+ CHECK_EXTENSION_B(SGI_texture_color_table, pname);
+ *params = textureUnit->ColorTableEnabled;
+ break;
+
/* GL_EXT_secondary_color */
case GL_COLOR_SUM_EXT:
+ CHECK_EXTENSION_B(EXT_secondary_color, pname);
*params = ctx->Fog.ColorSumEnabled;
break;
case GL_CURRENT_SECONDARY_COLOR_EXT:
+ CHECK_EXTENSION_B(EXT_secondary_color, pname);
FLUSH_CURRENT(ctx, 0);
- params[0] = INT_TO_BOOL(ctx->Current.SecondaryColor[0]);
- params[1] = INT_TO_BOOL(ctx->Current.SecondaryColor[1]);
- params[2] = INT_TO_BOOL(ctx->Current.SecondaryColor[2]);
+ params[0] = INT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0]);
+ params[1] = INT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1]);
+ params[2] = INT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2]);
+ params[3] = INT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3]);
break;
case GL_SECONDARY_COLOR_ARRAY_EXT:
+ CHECK_EXTENSION_B(EXT_secondary_color, pname);
*params = ctx->Array.SecondaryColor.Enabled;
break;
case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT:
+ CHECK_EXTENSION_B(EXT_secondary_color, pname);
*params = ENUM_TO_BOOL(ctx->Array.SecondaryColor.Type);
break;
case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT:
+ CHECK_EXTENSION_B(EXT_secondary_color, pname);
*params = INT_TO_BOOL(ctx->Array.SecondaryColor.Stride);
break;
case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT:
- *params = INT_TO_BOOL(ctx->Array.SecondaryColor.Stride);
+ CHECK_EXTENSION_B(EXT_secondary_color, pname);
+ *params = INT_TO_BOOL(ctx->Array.SecondaryColor.Size);
break;
/* GL_EXT_fog_coord */
case GL_CURRENT_FOG_COORDINATE_EXT:
+ CHECK_EXTENSION_B(EXT_fog_coord, pname);
FLUSH_CURRENT(ctx, 0);
- *params = FLOAT_TO_BOOL(ctx->Current.FogCoord);
+ *params = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_FOG][0]);
break;
case GL_FOG_COORDINATE_ARRAY_EXT:
+ CHECK_EXTENSION_B(EXT_fog_coord, pname);
*params = ctx->Array.FogCoord.Enabled;
break;
case GL_FOG_COORDINATE_ARRAY_TYPE_EXT:
+ CHECK_EXTENSION_B(EXT_fog_coord, pname);
*params = ENUM_TO_BOOL(ctx->Array.FogCoord.Type);
break;
case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT:
+ CHECK_EXTENSION_B(EXT_fog_coord, pname);
*params = INT_TO_BOOL(ctx->Array.FogCoord.Stride);
break;
+ case GL_FOG_COORDINATE_SOURCE_EXT:
+ CHECK_EXTENSION_B(EXT_fog_coord, pname);
+ *params = ENUM_TO_BOOL(ctx->Fog.FogCoordinateSource);
+ break;
+
+ /* GL_EXT_texture_lod_bias */
+ case GL_MAX_TEXTURE_LOD_BIAS_EXT:
+ *params = FLOAT_TO_BOOL(ctx->Const.MaxTextureLodBias);
+ break;
+
+ /* GL_EXT_texture_filter_anisotropic */
+ case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
+ CHECK_EXTENSION_B(EXT_texture_filter_anisotropic, pname);
+ *params = FLOAT_TO_BOOL(ctx->Const.MaxTextureMaxAnisotropy);
+ break;
+
+ /* GL_ARB_multisample */
+ case GL_MULTISAMPLE_ARB:
+ CHECK_EXTENSION_B(ARB_multisample, pname);
+ *params = ctx->Multisample.Enabled;
+ break;
+ case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
+ CHECK_EXTENSION_B(ARB_multisample, pname);
+ *params = ctx->Multisample.SampleAlphaToCoverage;
+ break;
+ case GL_SAMPLE_ALPHA_TO_ONE_ARB:
+ CHECK_EXTENSION_B(ARB_multisample, pname);
+ *params = ctx->Multisample.SampleAlphaToOne;
+ break;
+ case GL_SAMPLE_COVERAGE_ARB:
+ CHECK_EXTENSION_B(ARB_multisample, pname);
+ *params = ctx->Multisample.SampleCoverage;
+ break;
+ case GL_SAMPLE_COVERAGE_VALUE_ARB:
+ CHECK_EXTENSION_B(ARB_multisample, pname);
+ *params = FLOAT_TO_BOOL(ctx->Multisample.SampleCoverageValue);
+ break;
+ case GL_SAMPLE_COVERAGE_INVERT_ARB:
+ CHECK_EXTENSION_B(ARB_multisample, pname);
+ *params = ctx->Multisample.SampleCoverageInvert;
+ break;
+ case GL_SAMPLE_BUFFERS_ARB:
+ CHECK_EXTENSION_B(ARB_multisample, pname);
+ *params = 0; /* XXX fix someday */
+ break;
+ case GL_SAMPLES_ARB:
+ CHECK_EXTENSION_B(ARB_multisample, pname);
+ *params = 0; /* XXX fix someday */
+ break;
+
+ /* GL_IBM_rasterpos_clip */
+ case GL_RASTER_POSITION_UNCLIPPED_IBM:
+ CHECK_EXTENSION_B(IBM_rasterpos_clip, pname);
+ *params = ctx->Transform.RasterPositionUnclipped;
+ break;
+
+ /* GL_NV_point_sprite */
+ case GL_POINT_SPRITE_NV:
+ CHECK_EXTENSION2_B(NV_point_sprite, ARB_point_sprite, pname);
+ *params = ctx->Point.PointSprite;
+ break;
+ case GL_POINT_SPRITE_R_MODE_NV:
+ CHECK_EXTENSION_B(NV_point_sprite, pname);
+ *params = ENUM_TO_BOOL(ctx->Point.SpriteRMode);
+ break;
+
+ /* GL_SGIS_generate_mipmap */
+ case GL_GENERATE_MIPMAP_HINT_SGIS:
+ CHECK_EXTENSION_B(SGIS_generate_mipmap, pname);
+ *params = ENUM_TO_BOOL(ctx->Hint.GenerateMipmap);
+ break;
- /* GL_MESA_sprite_point */
- case GL_SPRITE_POINT_MESA:
- if (ctx->Extensions.MESA_sprite_point) {
- *params = ctx->Point.SpriteMode;
+#if FEATURE_NV_vertex_program
+ case GL_VERTEX_PROGRAM_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ *params = ctx->VertexProgram.Enabled;
+ break;
+ case GL_VERTEX_PROGRAM_POINT_SIZE_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ *params = ctx->VertexProgram.PointSizeEnabled;
+ break;
+ case GL_VERTEX_PROGRAM_TWO_SIDE_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ *params = ctx->VertexProgram.TwoSideEnabled;
+ break;
+ case GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ *params = (ctx->Const.MaxProgramMatrixStackDepth > 0) ? GL_TRUE : GL_FALSE;
+ break;
+ case GL_MAX_TRACK_MATRICES_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ *params = (ctx->Const.MaxProgramMatrices > 0) ? GL_TRUE : GL_FALSE;
+ break;
+ case GL_CURRENT_MATRIX_STACK_DEPTH_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ *params = GL_TRUE;
+ break;
+ case GL_CURRENT_MATRIX_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ for (i = 0; i < 16; i++)
+ params[i] = FLOAT_TO_BOOL(ctx->CurrentStack->Top->m[i]);
+ break;
+ case GL_VERTEX_PROGRAM_BINDING_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ if (ctx->VertexProgram.Current &&
+ ctx->VertexProgram.Current->Base.Id != 0)
+ *params = GL_TRUE;
+ else
+ *params = GL_FALSE;
+ break;
+ case GL_PROGRAM_ERROR_POSITION_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ *params = (ctx->Program.ErrorPos != 0) ? GL_TRUE : GL_FALSE;
+ break;
+ case GL_VERTEX_ATTRIB_ARRAY0_NV:
+ case GL_VERTEX_ATTRIB_ARRAY1_NV:
+ case GL_VERTEX_ATTRIB_ARRAY2_NV:
+ case GL_VERTEX_ATTRIB_ARRAY3_NV:
+ case GL_VERTEX_ATTRIB_ARRAY4_NV:
+ case GL_VERTEX_ATTRIB_ARRAY5_NV:
+ case GL_VERTEX_ATTRIB_ARRAY6_NV:
+ case GL_VERTEX_ATTRIB_ARRAY7_NV:
+ case GL_VERTEX_ATTRIB_ARRAY8_NV:
+ case GL_VERTEX_ATTRIB_ARRAY9_NV:
+ case GL_VERTEX_ATTRIB_ARRAY10_NV:
+ case GL_VERTEX_ATTRIB_ARRAY11_NV:
+ case GL_VERTEX_ATTRIB_ARRAY12_NV:
+ case GL_VERTEX_ATTRIB_ARRAY13_NV:
+ case GL_VERTEX_ATTRIB_ARRAY14_NV:
+ case GL_VERTEX_ATTRIB_ARRAY15_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ {
+ GLuint n = (GLuint) pname - GL_VERTEX_ATTRIB_ARRAY0_NV;
+ *params = ctx->Array.VertexAttrib[n].Enabled;
}
- else {
- gl_error( ctx, GL_INVALID_ENUM, "glGetBooleanv" );
- return;
+ break;
+ case GL_MAP1_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB15_4_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ {
+ GLuint n = (GLuint) pname - GL_MAP1_VERTEX_ATTRIB0_4_NV;
+ *params = ctx->Eval.Map1Attrib[n];
+ }
+ break;
+ case GL_MAP2_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB15_4_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ {
+ GLuint n = (GLuint) pname - GL_MAP2_VERTEX_ATTRIB0_4_NV;
+ *params = ctx->Eval.Map2Attrib[n];
}
break;
+#endif /* FEATURE_NV_vertex_program */
+
+#if FEATURE_NV_fragment_program
+ case GL_FRAGMENT_PROGRAM_NV:
+ CHECK_EXTENSION_B(NV_fragment_program, pname);
+ *params = ctx->FragmentProgram.Enabled;
+ break;
+ case GL_MAX_TEXTURE_COORDS_NV:
+ CHECK_EXTENSION_B(NV_fragment_program, pname);
+ *params = INT_TO_BOOL(ctx->Const.MaxTextureCoordUnits);
+ break;
+ case GL_MAX_TEXTURE_IMAGE_UNITS_NV:
+ CHECK_EXTENSION_B(NV_fragment_program, pname);
+ *params = INT_TO_BOOL(ctx->Const.MaxTextureImageUnits);
+ break;
+ case GL_FRAGMENT_PROGRAM_BINDING_NV:
+ CHECK_EXTENSION_B(NV_fragment_program, pname);
+ if (ctx->VertexProgram.Current &&
+ ctx->VertexProgram.Current->Base.Id != 0)
+ *params = GL_TRUE;
+ else
+ *params = GL_FALSE;
+ break;
+ case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV:
+ CHECK_EXTENSION_B(NV_fragment_program, pname);
+ *params = MAX_NV_FRAGMENT_PROGRAM_PARAMS ? GL_TRUE : GL_FALSE;
+ break;
+#endif /* FEATURE_NV_fragment_program */
+
+ /* GL_NV_texture_rectangle */
+ case GL_TEXTURE_RECTANGLE_NV:
+ CHECK_EXTENSION_B(NV_texture_rectangle, pname);
+ *params = _mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV);
+ break;
+ case GL_TEXTURE_BINDING_RECTANGLE_NV:
+ CHECK_EXTENSION_B(NV_texture_rectangle, pname);
+ *params = INT_TO_BOOL(textureUnit->CurrentRect->Name);
+ break;
+ case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV:
+ CHECK_EXTENSION_B(NV_texture_rectangle, pname);
+ *params = INT_TO_BOOL(ctx->Const.MaxTextureRectSize);
+ break;
+
+ /* GL_EXT_stencil_two_side */
+ case GL_STENCIL_TEST_TWO_SIDE_EXT:
+ CHECK_EXTENSION_B(EXT_stencil_two_side, pname);
+ *params = ctx->Stencil.TestTwoSide;
+ break;
+ case GL_ACTIVE_STENCIL_FACE_EXT:
+ CHECK_EXTENSION_B(EXT_stencil_two_side, pname);
+ *params = ENUM_TO_BOOL(ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT);
+ break;
+
+ /* GL_NV_light_max_exponent */
+ case GL_MAX_SHININESS_NV:
+ *params = FLOAT_TO_BOOL(ctx->Const.MaxShininess);
+ break;
+ case GL_MAX_SPOT_EXPONENT_NV:
+ *params = FLOAT_TO_BOOL(ctx->Const.MaxSpotExponent);
+ break;
+
+#if FEATURE_ARB_vertex_buffer_object
+ case GL_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_B(ARB_vertex_buffer_object, pname);
+ *params = INT_TO_BOOL(ctx->Array.ArrayBufferObj->Name);
+ break;
+ case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_B(ARB_vertex_buffer_object, pname);
+ *params = INT_TO_BOOL(ctx->Array.Vertex.BufferObj->Name);
+ break;
+ case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_B(ARB_vertex_buffer_object, pname);
+ *params = INT_TO_BOOL(ctx->Array.Normal.BufferObj->Name);
+ break;
+ case GL_COLOR_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_B(ARB_vertex_buffer_object, pname);
+ *params = INT_TO_BOOL(ctx->Array.Color.BufferObj->Name);
+ break;
+ case GL_INDEX_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_B(ARB_vertex_buffer_object, pname);
+ *params = INT_TO_BOOL(ctx->Array.Index.BufferObj->Name);
+ break;
+ case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_B(ARB_vertex_buffer_object, pname);
+ *params = INT_TO_BOOL(ctx->Array.TexCoord[clientUnit].BufferObj->Name);
+ break;
+ case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_B(ARB_vertex_buffer_object, pname);
+ *params = INT_TO_BOOL(ctx->Array.EdgeFlag.BufferObj->Name);
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_B(ARB_vertex_buffer_object, pname);
+ *params = INT_TO_BOOL(ctx->Array.SecondaryColor.BufferObj->Name);
+ break;
+ case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_B(ARB_vertex_buffer_object, pname);
+ *params = INT_TO_BOOL(ctx->Array.FogCoord.BufferObj->Name);
+ break;
+ /*case GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB: - not supported */
+ case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_B(ARB_vertex_buffer_object, pname);
+ *params = INT_TO_BOOL(ctx->Array.ElementArrayBufferObj->Name);
+ break;
+#endif
+
+#if FEATURE_ARB_fragment_program
+ case GL_FRAGMENT_PROGRAM_ARB:
+ CHECK_EXTENSION_B(ARB_fragment_program, pname);
+ *params = ctx->FragmentProgram.Enabled;
+ break;
+ case GL_TRANSPOSE_CURRENT_MATRIX_ARB:
+ CHECK_EXTENSION_B(ARB_fragment_program, pname);
+ params[0] = FLOAT_TO_BOOL(ctx->CurrentStack->Top->m[0]);
+ params[1] = FLOAT_TO_BOOL(ctx->CurrentStack->Top->m[4]);
+ params[2] = FLOAT_TO_BOOL(ctx->CurrentStack->Top->m[8]);
+ params[3] = FLOAT_TO_BOOL(ctx->CurrentStack->Top->m[12]);
+ params[4] = FLOAT_TO_BOOL(ctx->CurrentStack->Top->m[1]);
+ params[5] = FLOAT_TO_BOOL(ctx->CurrentStack->Top->m[5]);
+ params[6] = FLOAT_TO_BOOL(ctx->CurrentStack->Top->m[9]);
+ params[7] = FLOAT_TO_BOOL(ctx->CurrentStack->Top->m[13]);
+ params[8] = FLOAT_TO_BOOL(ctx->CurrentStack->Top->m[2]);
+ params[9] = FLOAT_TO_BOOL(ctx->CurrentStack->Top->m[6]);
+ params[10] = FLOAT_TO_BOOL(ctx->CurrentStack->Top->m[10]);
+ params[11] = FLOAT_TO_BOOL(ctx->CurrentStack->Top->m[14]);
+ params[12] = FLOAT_TO_BOOL(ctx->CurrentStack->Top->m[3]);
+ params[13] = FLOAT_TO_BOOL(ctx->CurrentStack->Top->m[7]);
+ params[14] = FLOAT_TO_BOOL(ctx->CurrentStack->Top->m[11]);
+ params[15] = FLOAT_TO_BOOL(ctx->CurrentStack->Top->m[15]);
+ break;
+ /* Remaining ARB_fragment_program queries alias with
+ * the GL_NV_fragment_program queries.
+ */
+#endif
+
+ /* GL_EXT_depth_bounds_test */
+ case GL_DEPTH_BOUNDS_TEST_EXT:
+ CHECK_EXTENSION_B(EXT_depth_bounds_test, pname);
+ params[0] = ctx->Depth.BoundsTest;
+ break;
+ case GL_DEPTH_BOUNDS_EXT:
+ CHECK_EXTENSION_B(EXT_depth_bounds_test, pname);
+ params[0] = FLOAT_TO_BOOL(ctx->Depth.BoundsMin);
+ params[1] = FLOAT_TO_BOOL(ctx->Depth.BoundsMax);
+ break;
+
+#if FEATURE_MESA_program_debug
+ case GL_FRAGMENT_PROGRAM_CALLBACK_MESA:
+ CHECK_EXTENSION_B(MESA_program_debug, pname);
+ *params = ctx->FragmentProgram.CallbackEnabled;
+ break;
+ case GL_VERTEX_PROGRAM_CALLBACK_MESA:
+ CHECK_EXTENSION_B(MESA_program_debug, pname);
+ *params = ctx->VertexProgram.CallbackEnabled;
+ break;
+ case GL_FRAGMENT_PROGRAM_POSITION_MESA:
+ CHECK_EXTENSION_B(MESA_program_debug, pname);
+ *params = INT_TO_BOOL(ctx->FragmentProgram.CurrentPosition);
+ break;
+ case GL_VERTEX_PROGRAM_POSITION_MESA:
+ CHECK_EXTENSION_B(MESA_program_debug, pname);
+ *params = INT_TO_BOOL(ctx->VertexProgram.CurrentPosition);
+ break;
+#endif
default:
- gl_error( ctx, GL_INVALID_ENUM, "glGetBooleanv" );
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv(pname=0x%x)", pname);
}
}
-
-
-void
+/**
+ * Get the value(s) of a selected parameter.
+ *
+ * \param pname parameter to be returned.
+ * \param params will hold the value(s) of the speficifed parameter.
+ *
+ * \sa glGetDoublev().
+ *
+ * Tries to get the specified parameter via dd_function_table::GetDoublev,
+ * otherwise gets the specified parameter from the current context, converting
+ * it value into GLdouble.
+ */
+void GLAPIENTRY
_mesa_GetDoublev( GLenum pname, GLdouble *params )
{
GET_CURRENT_CONTEXT(ctx);
GLuint i;
- GLuint texUnit = ctx->Texture.CurrentUnit;
- GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit;
+ const GLuint clientUnit = ctx->Array.ActiveTexture;
+ const GLuint texUnit = ctx->Texture.CurrentUnit;
const struct gl_texture_unit *textureUnit = &ctx->Texture.Unit[texUnit];
ASSERT_OUTSIDE_BEGIN_END(ctx);
return;
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glGetDoublev %s\n", gl_lookup_enum_by_nr(pname));
+ _mesa_debug(ctx, "glGetDoublev %s\n", _mesa_lookup_enum_by_nr(pname));
+
+ if (!ctx->_CurrentProgram) {
+ /* We need this in order to get correct results for
+ * GL_OCCLUSION_TEST_RESULT_HP. There might be other important cases.
+ */
+ FLUSH_VERTICES(ctx, 0);
+ }
if (ctx->Driver.GetDoublev && (*ctx->Driver.GetDoublev)(ctx, pname, params))
return;
*params = ENUM_TO_DOUBLE(ctx->Color.AlphaFunc);
break;
case GL_ALPHA_TEST_REF:
- *params = (GLdouble) ctx->Color.AlphaRef / CHAN_MAXF;
+ *params = (GLdouble) ctx->Color.AlphaRef;
break;
case GL_ATTRIB_STACK_DEPTH:
*params = (GLdouble ) (ctx->AttribStackDepth);
case GL_CLIP_PLANE3:
case GL_CLIP_PLANE4:
case GL_CLIP_PLANE5:
- *params = (GLdouble) ctx->Transform.ClipEnabled[pname-GL_CLIP_PLANE0];
+ if (ctx->Transform.ClipPlanesEnabled & (1 << (pname - GL_CLIP_PLANE0)))
+ *params = 1.0;
+ else
+ *params = 0.0;
break;
case GL_COLOR_CLEAR_VALUE:
- params[0] = (GLdouble) CHAN_TO_FLOAT(ctx->Color.ClearColor[0]);
- params[1] = (GLdouble) CHAN_TO_FLOAT(ctx->Color.ClearColor[1]);
- params[2] = (GLdouble) CHAN_TO_FLOAT(ctx->Color.ClearColor[2]);
- params[3] = (GLdouble) CHAN_TO_FLOAT(ctx->Color.ClearColor[3]);
+ params[0] = (GLdouble) ctx->Color.ClearColor[0];
+ params[1] = (GLdouble) ctx->Color.ClearColor[1];
+ params[2] = (GLdouble) ctx->Color.ClearColor[2];
+ params[3] = (GLdouble) ctx->Color.ClearColor[3];
break;
case GL_COLOR_MATERIAL:
*params = (GLdouble) ctx->Light.ColorMaterialEnabled;
break;
case GL_CURRENT_COLOR:
FLUSH_CURRENT(ctx, 0);
- params[0] = CHAN_TO_FLOAT(ctx->Current.Color[0]);
- params[1] = CHAN_TO_FLOAT(ctx->Current.Color[1]);
- params[2] = CHAN_TO_FLOAT(ctx->Current.Color[2]);
- params[3] = CHAN_TO_FLOAT(ctx->Current.Color[3]);
+ params[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0];
+ params[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1];
+ params[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2];
+ params[3] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3];
break;
case GL_CURRENT_INDEX:
FLUSH_CURRENT(ctx, 0);
break;
case GL_CURRENT_NORMAL:
FLUSH_CURRENT(ctx, 0);
- params[0] = (GLdouble) ctx->Current.Normal[0];
- params[1] = (GLdouble) ctx->Current.Normal[1];
- params[2] = (GLdouble) ctx->Current.Normal[2];
+ params[0] = (GLdouble) ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0];
+ params[1] = (GLdouble) ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1];
+ params[2] = (GLdouble) ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2];
break;
case GL_CURRENT_RASTER_COLOR:
params[0] = (GLdouble) ctx->Current.RasterColor[0];
params[3] = (GLdouble) ctx->Current.RasterPos[3];
break;
case GL_CURRENT_RASTER_TEXTURE_COORDS:
- params[0] = (GLdouble) ctx->Current.RasterMultiTexCoord[texTransformUnit][0];
- params[1] = (GLdouble) ctx->Current.RasterMultiTexCoord[texTransformUnit][1];
- params[2] = (GLdouble) ctx->Current.RasterMultiTexCoord[texTransformUnit][2];
- params[3] = (GLdouble) ctx->Current.RasterMultiTexCoord[texTransformUnit][3];
+ params[0] = (GLdouble) ctx->Current.RasterTexCoords[texUnit][0];
+ params[1] = (GLdouble) ctx->Current.RasterTexCoords[texUnit][1];
+ params[2] = (GLdouble) ctx->Current.RasterTexCoords[texUnit][2];
+ params[3] = (GLdouble) ctx->Current.RasterTexCoords[texUnit][3];
break;
case GL_CURRENT_RASTER_POSITION_VALID:
*params = (GLdouble) ctx->Current.RasterPosValid;
break;
case GL_CURRENT_TEXTURE_COORDS:
FLUSH_CURRENT(ctx, 0);
- params[0] = (GLdouble) ctx->Current.Texcoord[texTransformUnit][0];
- params[1] = (GLdouble) ctx->Current.Texcoord[texTransformUnit][1];
- params[2] = (GLdouble) ctx->Current.Texcoord[texTransformUnit][2];
- params[3] = (GLdouble) ctx->Current.Texcoord[texTransformUnit][3];
+ params[0] = (GLdouble) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][0];
+ params[1] = (GLdouble) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][1];
+ params[2] = (GLdouble) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][2];
+ params[3] = (GLdouble) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3];
break;
case GL_DEPTH_BIAS:
*params = (GLdouble) ctx->Pixel.DepthBias;
case GL_GREEN_SCALE:
*params = (GLdouble) ctx->Pixel.GreenScale;
break;
- case GL_HISTOGRAM:
- if (ctx->Extensions.EXT_histogram || ctx->Extensions.ARB_imaging) {
- *params = (GLdouble) ctx->Pixel.HistogramEnabled;
- }
- else {
- gl_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
- return;
- }
- break;
case GL_INDEX_BITS:
*params = (GLdouble) ctx->Visual.indexBits;
break;
*params = (GLdouble) ctx->List.ListBase;
break;
case GL_LIST_INDEX:
- *params = (GLdouble) ctx->CurrentListNum;
+ *params = (GLdouble) ctx->ListState.CurrentListNum;
break;
case GL_LIST_MODE:
- *params = ctx->ExecuteFlag ? ENUM_TO_DOUBLE(GL_COMPILE_AND_EXECUTE)
- : ENUM_TO_DOUBLE(GL_COMPILE);
+ if (!ctx->CompileFlag)
+ *params = 0.0;
+ else if (ctx->ExecuteFlag)
+ *params = ENUM_TO_DOUBLE(GL_COMPILE_AND_EXECUTE);
+ else
+ *params = ENUM_TO_DOUBLE(GL_COMPILE);
break;
case GL_INDEX_LOGIC_OP:
*params = (GLdouble) ctx->Color.IndexLogicOpEnabled;
*params = (GLdouble) MAX_PROJECTION_STACK_DEPTH;
break;
case GL_MAX_TEXTURE_SIZE:
+ *params = (GLdouble) (1 << (ctx->Const.MaxTextureLevels - 1));
+ break;
case GL_MAX_3D_TEXTURE_SIZE:
- *params = (GLdouble) ctx->Const.MaxTextureSize;
+ *params = (GLdouble) (1 << (ctx->Const.Max3DTextureLevels - 1));
break;
case GL_MAX_TEXTURE_STACK_DEPTH:
*params = (GLdouble) MAX_TEXTURE_STACK_DEPTH;
params[0] = (GLdouble) MAX_WIDTH;
params[1] = (GLdouble) MAX_HEIGHT;
break;
- case GL_MINMAX:
- *params = (GLdouble) ctx->Pixel.MinMaxEnabled;
- break;
case GL_MODELVIEW_MATRIX:
for (i=0;i<16;i++) {
- params[i] = (GLdouble) ctx->ModelView.m[i];
+ params[i] = (GLdouble) ctx->ModelviewMatrixStack.Top->m[i];
}
break;
case GL_MODELVIEW_STACK_DEPTH:
- *params = (GLdouble) (ctx->ModelViewStackDepth + 1);
+ *params = (GLdouble) (ctx->ModelviewMatrixStack.Depth + 1);
break;
case GL_NAME_STACK_DEPTH:
*params = (GLdouble) ctx->Select.NameStackDepth;
case GL_PACK_IMAGE_HEIGHT_EXT:
*params = (GLdouble) ctx->Pack.ImageHeight;
break;
+ case GL_PACK_INVERT_MESA:
+ *params = (GLdouble) ctx->Pack.Invert;
+ break;
case GL_PERSPECTIVE_CORRECTION_HINT:
*params = ENUM_TO_DOUBLE(ctx->Hint.PerspectiveCorrection);
break;
break;
case GL_PROJECTION_MATRIX:
for (i=0;i<16;i++) {
- params[i] = (GLdouble) ctx->ProjectionMatrix.m[i];
+ params[i] = (GLdouble) ctx->ProjectionMatrixStack.Top->m[i];
}
break;
case GL_PROJECTION_STACK_DEPTH:
- *params = (GLdouble) (ctx->ProjectionStackDepth + 1);
+ *params = (GLdouble) (ctx->ProjectionMatrixStack.Depth + 1);
break;
case GL_READ_BUFFER:
*params = ENUM_TO_DOUBLE(ctx->Pixel.ReadBuffer);
*params = (GLdouble) ctx->Stencil.Clear;
break;
case GL_STENCIL_FAIL:
- *params = ENUM_TO_DOUBLE(ctx->Stencil.FailFunc);
+ *params = ENUM_TO_DOUBLE(ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_FUNC:
- *params = ENUM_TO_DOUBLE(ctx->Stencil.Function);
+ *params = ENUM_TO_DOUBLE(ctx->Stencil.Function[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_PASS_DEPTH_FAIL:
- *params = ENUM_TO_DOUBLE(ctx->Stencil.ZFailFunc);
+ *params = ENUM_TO_DOUBLE(ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_PASS_DEPTH_PASS:
- *params = ENUM_TO_DOUBLE(ctx->Stencil.ZPassFunc);
+ *params = ENUM_TO_DOUBLE(ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_REF:
- *params = (GLdouble) ctx->Stencil.Ref;
+ *params = (GLdouble) ctx->Stencil.Ref[ctx->Stencil.ActiveFace];
break;
case GL_STENCIL_TEST:
*params = (GLdouble) ctx->Stencil.Enabled;
break;
case GL_STENCIL_VALUE_MASK:
- *params = (GLdouble) ctx->Stencil.ValueMask;
+ *params = (GLdouble) ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace];
break;
case GL_STENCIL_WRITEMASK:
- *params = (GLdouble) ctx->Stencil.WriteMask;
+ *params = (GLdouble) ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace];
break;
case GL_STEREO:
*params = (GLdouble) ctx->Visual.stereoMode;
break;
case GL_TEXTURE_MATRIX:
for (i=0;i<16;i++) {
- params[i] = (GLdouble) ctx->TextureMatrix[texTransformUnit].m[i];
+ params[i] = (GLdouble) ctx->TextureMatrixStack[texUnit].Top->m[i];
}
break;
case GL_TEXTURE_STACK_DEPTH:
- *params = (GLdouble) (ctx->TextureStackDepth[texTransformUnit] + 1);
+ *params = (GLdouble) (ctx->TextureMatrixStack[texUnit].Depth + 1);
break;
case GL_UNPACK_ALIGNMENT:
*params = (GLdouble) ctx->Unpack.Alignment;
case GL_UNPACK_IMAGE_HEIGHT_EXT:
*params = (GLdouble) ctx->Unpack.ImageHeight;
break;
+ case GL_UNPACK_CLIENT_STORAGE_APPLE:
+ *params = (GLdouble) ctx->Unpack.ClientStorage;
+ break;
case GL_VIEWPORT:
params[0] = (GLdouble) ctx->Viewport.X;
params[1] = (GLdouble) ctx->Viewport.Y;
*params = 0.0;
break;
case GL_TEXTURE_COORD_ARRAY:
- *params = (GLdouble) ctx->Array.TexCoord[texUnit].Enabled;
+ *params = (GLdouble) ctx->Array.TexCoord[clientUnit].Enabled;
break;
case GL_TEXTURE_COORD_ARRAY_SIZE:
- *params = (GLdouble) ctx->Array.TexCoord[texUnit].Size;
+ *params = (GLdouble) ctx->Array.TexCoord[clientUnit].Size;
break;
case GL_TEXTURE_COORD_ARRAY_TYPE:
- *params = ENUM_TO_DOUBLE(ctx->Array.TexCoord[texUnit].Type);
+ *params = ENUM_TO_DOUBLE(ctx->Array.TexCoord[clientUnit].Type);
break;
case GL_TEXTURE_COORD_ARRAY_STRIDE:
- *params = (GLdouble) ctx->Array.TexCoord[texUnit].Stride;
+ *params = (GLdouble) ctx->Array.TexCoord[clientUnit].Stride;
break;
case GL_TEXTURE_COORD_ARRAY_COUNT_EXT:
*params = 0.0;
/* GL_ARB_multitexture */
case GL_MAX_TEXTURE_UNITS_ARB:
- *params = (GLdouble) ctx->Const.MaxTextureUnits;
+ CHECK_EXTENSION_D(ARB_multitexture, pname);
+ *params = (GLdouble) MIN2(ctx->Const.MaxTextureImageUnits,
+ ctx->Const.MaxTextureCoordUnits);
break;
case GL_ACTIVE_TEXTURE_ARB:
+ CHECK_EXTENSION_D(ARB_multitexture, pname);
*params = (GLdouble) (GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit);
break;
case GL_CLIENT_ACTIVE_TEXTURE_ARB:
- *params = (GLdouble) (GL_TEXTURE0_ARB + ctx->Array.ActiveTexture);
+ CHECK_EXTENSION_D(ARB_multitexture, pname);
+ *params = (GLdouble) (GL_TEXTURE0_ARB + clientUnit);
break;
/* GL_ARB_texture_cube_map */
case GL_TEXTURE_CUBE_MAP_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- *params = (GLdouble) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
- else
- gl_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
- return;
+ CHECK_EXTENSION_D(ARB_texture_cube_map, pname);
+ *params = (GLdouble) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
+ break;
case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- *params = (GLdouble) textureUnit->CurrentCubeMap->Name;
- else
- gl_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
- return;
+ CHECK_EXTENSION_D(ARB_texture_cube_map, pname);
+ *params = (GLdouble) textureUnit->CurrentCubeMap->Name;
+ break;
case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- *params = (GLdouble) ctx->Const.MaxCubeTextureSize;
- else
- gl_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
- return;
+ CHECK_EXTENSION_D(ARB_texture_cube_map, pname);
+ *params = (GLdouble) (1 << (ctx->Const.MaxCubeTextureLevels - 1));
+ break;
/* GL_ARB_texture_compression */
case GL_TEXTURE_COMPRESSION_HINT_ARB:
- if (ctx->Extensions.ARB_texture_compression) {
- *params = (GLdouble) ctx->Hint.TextureCompression;
- }
- else
- gl_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
+ CHECK_EXTENSION_D(ARB_texture_compression, pname);
+ *params = (GLdouble) ctx->Hint.TextureCompression;
break;
case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
- if (ctx->Extensions.ARB_texture_compression) {
- *params = (GLdouble) ctx->Const.NumCompressedTextureFormats;
- }
- else
- gl_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
+ CHECK_EXTENSION_D(ARB_texture_compression, pname);
+ *params = (GLdouble) _mesa_get_compressed_formats(ctx, NULL);
break;
case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
- if (ctx->Extensions.ARB_texture_compression) {
- GLuint i;
- for (i = 0; i < ctx->Const.NumCompressedTextureFormats; i++)
- params[i] = (GLdouble) ctx->Const.CompressedTextureFormats[i];
+ CHECK_EXTENSION_D(ARB_texture_compression, pname);
+ {
+ GLint formats[100];
+ GLuint i, n;
+ n = _mesa_get_compressed_formats(ctx, formats);
+ for (i = 0; i < n; i++)
+ params[i] = (GLdouble) formats[i];
}
- else
- gl_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
break;
/* GL_EXT_compiled_vertex_array */
{
GLfloat tm[16];
GLuint i;
- _math_transposef(tm, ctx->ColorMatrix.m);
+ _math_transposef(tm, ctx->ColorMatrixStack.Top->m);
for (i=0;i<16;i++) {
params[i] = (GLdouble) tm[i];
}
{
GLfloat tm[16];
GLuint i;
- _math_transposef(tm, ctx->ModelView.m);
+ _math_transposef(tm, ctx->ModelviewMatrixStack.Top->m);
for (i=0;i<16;i++) {
params[i] = (GLdouble) tm[i];
}
{
GLfloat tm[16];
GLuint i;
- _math_transposef(tm, ctx->ProjectionMatrix.m);
+ _math_transposef(tm, ctx->ProjectionMatrixStack.Top->m);
for (i=0;i<16;i++) {
params[i] = (GLdouble) tm[i];
}
{
GLfloat tm[16];
GLuint i;
- _math_transposef(tm, ctx->TextureMatrix[texTransformUnit].m);
+ _math_transposef(tm, ctx->TextureMatrixStack[texUnit].Top->m);
for (i=0;i<16;i++) {
params[i] = (GLdouble) tm[i];
}
/* GL_HP_occlusion_test */
case GL_OCCLUSION_TEST_HP:
- if (ctx->Extensions.HP_occlusion_test) {
- *params = (GLdouble) ctx->Depth.OcclusionTest;
- }
- else {
- gl_error( ctx, GL_INVALID_ENUM, "glGetDoublev" );
- }
- return;
+ CHECK_EXTENSION_D(HP_occlusion_test, pname);
+ *params = (GLdouble) ctx->Depth.OcclusionTest;
+ break;
case GL_OCCLUSION_TEST_RESULT_HP:
- if (ctx->Extensions.HP_occlusion_test) {
- if (ctx->Depth.OcclusionTest)
- *params = (GLdouble) ctx->OcclusionResult;
- else
- *params = (GLdouble) ctx->OcclusionResultSaved;
- /* reset flag now */
- ctx->OcclusionResult = GL_FALSE;
- ctx->OcclusionResultSaved = GL_FALSE;
- }
- else {
- gl_error( ctx, GL_INVALID_ENUM, "glGetDoublev" );
- }
- return;
+ CHECK_EXTENSION_D(HP_occlusion_test, pname);
+ if (ctx->Depth.OcclusionTest)
+ *params = (GLdouble) ctx->OcclusionResult;
+ else
+ *params = (GLdouble) ctx->OcclusionResultSaved;
+ /* reset flag now */
+ ctx->OcclusionResult = GL_FALSE;
+ ctx->OcclusionResultSaved = GL_FALSE;
+ break;
/* GL_SGIS_pixel_texture */
case GL_PIXEL_TEXTURE_SGIS:
/* GL_SGI_color_matrix (also in 1.2 imaging) */
case GL_COLOR_MATRIX_SGI:
for (i=0;i<16;i++) {
- params[i] = (GLdouble) ctx->ColorMatrix.m[i];
+ params[i] = (GLdouble) ctx->ColorMatrixStack.Top->m[i];
}
break;
case GL_COLOR_MATRIX_STACK_DEPTH_SGI:
- *params = (GLdouble) (ctx->ColorStackDepth + 1);
+ *params = (GLdouble) (ctx->ColorMatrixStack.Depth + 1);
break;
case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI:
*params = (GLdouble) MAX_COLOR_STACK_DEPTH;
/* GL_EXT_convolution (also in 1.2 imaging) */
case GL_CONVOLUTION_1D_EXT:
- if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) {
- *params = (GLdouble) ctx->Pixel.Convolution1DEnabled;
- }
- else {
- gl_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
- return;
- }
+ CHECK_EXTENSION_D(EXT_convolution, pname);
+ *params = (GLdouble) ctx->Pixel.Convolution1DEnabled;
break;
case GL_CONVOLUTION_2D:
- if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) {
- *params = (GLdouble) ctx->Pixel.Convolution2DEnabled;
- }
- else {
- gl_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
- return;
- }
+ CHECK_EXTENSION_D(EXT_convolution, pname);
+ *params = (GLdouble) ctx->Pixel.Convolution2DEnabled;
break;
case GL_SEPARABLE_2D:
- if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) {
- *params = (GLdouble) ctx->Pixel.Separable2DEnabled;
- }
- else {
- gl_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
- return;
- }
- break;
- case GL_MAX_CONVOLUTION_WIDTH:
- *params = (GLdouble) ctx->Const.MaxConvolutionWidth;
- break;
- case GL_MAX_CONVOLUTION_HEIGHT:
- *params = (GLdouble) ctx->Const.MaxConvolutionHeight;
+ CHECK_EXTENSION_D(EXT_convolution, pname);
+ *params = (GLdouble) ctx->Pixel.Separable2DEnabled;
break;
case GL_POST_CONVOLUTION_RED_SCALE_EXT:
+ CHECK_EXTENSION_D(EXT_convolution, pname);
*params = (GLdouble) ctx->Pixel.PostConvolutionScale[0];
break;
case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:
+ CHECK_EXTENSION_D(EXT_convolution, pname);
*params = (GLdouble) ctx->Pixel.PostConvolutionScale[1];
break;
case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:
+ CHECK_EXTENSION_D(EXT_convolution, pname);
*params = (GLdouble) ctx->Pixel.PostConvolutionScale[2];
break;
case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:
+ CHECK_EXTENSION_D(EXT_convolution, pname);
*params = (GLdouble) ctx->Pixel.PostConvolutionScale[3];
break;
case GL_POST_CONVOLUTION_RED_BIAS_EXT:
+ CHECK_EXTENSION_D(EXT_convolution, pname);
*params = (GLdouble) ctx->Pixel.PostConvolutionBias[0];
break;
case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:
+ CHECK_EXTENSION_D(EXT_convolution, pname);
*params = (GLdouble) ctx->Pixel.PostConvolutionBias[1];
break;
case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:
+ CHECK_EXTENSION_D(EXT_convolution, pname);
*params = (GLdouble) ctx->Pixel.PostConvolutionBias[2];
break;
case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:
+ CHECK_EXTENSION_D(EXT_convolution, pname);
*params = (GLdouble) ctx->Pixel.PostConvolutionBias[2];
break;
+ /* GL_EXT_histogram (also in 1.2 imaging) */
+ case GL_HISTOGRAM:
+ CHECK_EXTENSION_D(EXT_histogram, pname);
+ *params = (GLdouble) ctx->Pixel.HistogramEnabled;
+ break;
+ case GL_MINMAX:
+ CHECK_EXTENSION_D(EXT_histogram, pname);
+ *params = (GLdouble) ctx->Pixel.MinMaxEnabled;
+ break;
+
/* GL_SGI_color_table (also in 1.2 imaging */
case GL_COLOR_TABLE_SGI:
*params = (GLdouble) ctx->Pixel.ColorTableEnabled;
*params = (GLdouble) ctx->Pixel.PostColorMatrixColorTableEnabled;
break;
+ /* GL_SGI_texture_color_table */
+ case GL_TEXTURE_COLOR_TABLE_SGI:
+ CHECK_EXTENSION_D(SGI_texture_color_table, pname);
+ *params = (GLdouble) textureUnit->ColorTableEnabled;
+ break;
+
/* GL_EXT_secondary_color */
case GL_COLOR_SUM_EXT:
+ CHECK_EXTENSION_D(EXT_secondary_color, pname);
*params = (GLdouble) ctx->Fog.ColorSumEnabled;
break;
case GL_CURRENT_SECONDARY_COLOR_EXT:
+ CHECK_EXTENSION_D(EXT_secondary_color, pname);
FLUSH_CURRENT(ctx, 0);
- params[0] = CHAN_TO_FLOAT(ctx->Current.SecondaryColor[0]);
- params[1] = CHAN_TO_FLOAT(ctx->Current.SecondaryColor[1]);
- params[2] = CHAN_TO_FLOAT(ctx->Current.SecondaryColor[2]);
+ params[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0];
+ params[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1];
+ params[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2];
+ params[3] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3];
break;
case GL_SECONDARY_COLOR_ARRAY_EXT:
+ CHECK_EXTENSION_D(EXT_secondary_color, pname);
*params = (GLdouble) ctx->Array.SecondaryColor.Enabled;
break;
case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT:
+ CHECK_EXTENSION_D(EXT_secondary_color, pname);
*params = (GLdouble) ctx->Array.SecondaryColor.Type;
break;
case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT:
+ CHECK_EXTENSION_D(EXT_secondary_color, pname);
*params = (GLdouble) ctx->Array.SecondaryColor.Stride;
break;
case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT:
- *params = (GLdouble) ctx->Array.SecondaryColor.Stride;
+ CHECK_EXTENSION_D(EXT_secondary_color, pname);
+ *params = (GLdouble) ctx->Array.SecondaryColor.Size;
break;
/* GL_EXT_fog_coord */
case GL_CURRENT_FOG_COORDINATE_EXT:
+ CHECK_EXTENSION_D(EXT_fog_coord, pname);
FLUSH_CURRENT(ctx, 0);
- *params = (GLdouble) ctx->Current.FogCoord;
+ *params = (GLdouble) ctx->Current.Attrib[VERT_ATTRIB_FOG][0];
break;
case GL_FOG_COORDINATE_ARRAY_EXT:
+ CHECK_EXTENSION_D(EXT_fog_coord, pname);
*params = (GLdouble) ctx->Array.FogCoord.Enabled;
break;
case GL_FOG_COORDINATE_ARRAY_TYPE_EXT:
+ CHECK_EXTENSION_D(EXT_fog_coord, pname);
*params = (GLdouble) ctx->Array.FogCoord.Type;
break;
case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT:
+ CHECK_EXTENSION_D(EXT_fog_coord, pname);
*params = (GLdouble) ctx->Array.FogCoord.Stride;
break;
+ case GL_FOG_COORDINATE_SOURCE_EXT:
+ CHECK_EXTENSION_D(EXT_fog_coord, pname);
+ *params = (GLdouble) ctx->Fog.FogCoordinateSource;
+ break;
- /* GL_MESA_sprite_point */
- case GL_SPRITE_POINT_MESA:
- if (ctx->Extensions.MESA_sprite_point) {
- *params = (GLdouble) ctx->Point.SpriteMode;
- }
- else {
- gl_error( ctx, GL_INVALID_ENUM, "glGetDoublev" );
- return;
- }
+ /* GL_EXT_texture_lod_bias */
+ case GL_MAX_TEXTURE_LOD_BIAS_EXT:
+ *params = (GLdouble) ctx->Const.MaxTextureLodBias;
break;
- default:
- gl_error( ctx, GL_INVALID_ENUM, "glGetDoublev" );
- }
-}
-
-
-
-
-void
-_mesa_GetFloatv( GLenum pname, GLfloat *params )
-{
- GET_CURRENT_CONTEXT(ctx);
- GLuint i;
- GLuint texUnit = ctx->Texture.CurrentUnit;
- GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit;
- const struct gl_texture_unit *textureUnit = &ctx->Texture.Unit[texUnit];
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (!params)
- return;
-
- if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glGetFloatv %s\n", gl_lookup_enum_by_nr(pname));
-
- if (ctx->Driver.GetFloatv && (*ctx->Driver.GetFloatv)(ctx, pname, params))
- return;
+ /* GL_EXT_texture_filter_anisotropic */
+ case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
+ CHECK_EXTENSION_D(EXT_texture_filter_anisotropic, pname);
+ *params = (GLdouble) ctx->Const.MaxTextureMaxAnisotropy;
+ break;
- switch (pname) {
- case GL_ACCUM_RED_BITS:
- *params = (GLfloat) ctx->Visual.accumRedBits;
+ /* GL_ARB_multisample */
+ case GL_MULTISAMPLE_ARB:
+ CHECK_EXTENSION_D(ARB_multisample, pname);
+ *params = (GLdouble) ctx->Multisample.Enabled;
break;
- case GL_ACCUM_GREEN_BITS:
- *params = (GLfloat) ctx->Visual.accumGreenBits;
+ case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
+ CHECK_EXTENSION_D(ARB_multisample, pname);
+ *params = (GLdouble) ctx->Multisample.SampleAlphaToCoverage;
break;
- case GL_ACCUM_BLUE_BITS:
- *params = (GLfloat) ctx->Visual.accumBlueBits;
+ case GL_SAMPLE_ALPHA_TO_ONE_ARB:
+ CHECK_EXTENSION_D(ARB_multisample, pname);
+ *params = (GLdouble) ctx->Multisample.SampleAlphaToOne;
break;
- case GL_ACCUM_ALPHA_BITS:
- *params = (GLfloat) ctx->Visual.accumAlphaBits;
+ case GL_SAMPLE_COVERAGE_ARB:
+ CHECK_EXTENSION_D(ARB_multisample, pname);
+ *params = (GLdouble) ctx->Multisample.SampleCoverage;
break;
- case GL_ACCUM_CLEAR_VALUE:
- params[0] = ctx->Accum.ClearColor[0];
- params[1] = ctx->Accum.ClearColor[1];
- params[2] = ctx->Accum.ClearColor[2];
- params[3] = ctx->Accum.ClearColor[3];
+ case GL_SAMPLE_COVERAGE_VALUE_ARB:
+ CHECK_EXTENSION_D(ARB_multisample, pname);
+ *params = ctx->Multisample.SampleCoverageValue;
break;
- case GL_ALPHA_BIAS:
- *params = ctx->Pixel.AlphaBias;
+ case GL_SAMPLE_COVERAGE_INVERT_ARB:
+ CHECK_EXTENSION_D(ARB_multisample, pname);
+ *params = (GLdouble) ctx->Multisample.SampleCoverageInvert;
+ break;
+ case GL_SAMPLE_BUFFERS_ARB:
+ CHECK_EXTENSION_D(ARB_multisample, pname);
+ *params = 0.0; /* XXX fix someday */
+ break;
+ case GL_SAMPLES_ARB:
+ CHECK_EXTENSION_D(ARB_multisample, pname);
+ *params = 0.0; /* XXX fix someday */
+ break;
+
+ /* GL_IBM_rasterpos_clip */
+ case GL_RASTER_POSITION_UNCLIPPED_IBM:
+ CHECK_EXTENSION_D(IBM_rasterpos_clip, pname);
+ *params = (GLdouble) ctx->Transform.RasterPositionUnclipped;
+ break;
+
+ /* GL_NV_point_sprite */
+ case GL_POINT_SPRITE_NV:
+ CHECK_EXTENSION2_D(NV_point_sprite, ARB_point_sprite, pname);
+ *params = (GLdouble) ctx->Point.PointSprite;
+ break;
+ case GL_POINT_SPRITE_R_MODE_NV:
+ CHECK_EXTENSION_D(NV_point_sprite, pname);
+ *params = (GLdouble) ctx->Point.SpriteRMode;
+ break;
+
+ /* GL_SGIS_generate_mipmap */
+ case GL_GENERATE_MIPMAP_HINT_SGIS:
+ CHECK_EXTENSION_D(SGIS_generate_mipmap, pname);
+ *params = (GLdouble) ctx->Hint.GenerateMipmap;
+ break;
+
+#if FEATURE_NV_vertex_program
+ case GL_VERTEX_PROGRAM_NV:
+ CHECK_EXTENSION_D(NV_vertex_program, pname);
+ *params = (GLdouble) ctx->VertexProgram.Enabled;
+ break;
+ case GL_VERTEX_PROGRAM_POINT_SIZE_NV:
+ CHECK_EXTENSION_D(NV_vertex_program, pname);
+ *params = (GLdouble) ctx->VertexProgram.PointSizeEnabled;
+ break;
+ case GL_VERTEX_PROGRAM_TWO_SIDE_NV:
+ CHECK_EXTENSION_D(NV_vertex_program, pname);
+ *params = (GLdouble) ctx->VertexProgram.TwoSideEnabled;
+ break;
+ case GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV:
+ CHECK_EXTENSION_D(NV_vertex_program, pname);
+ *params = (GLdouble) ctx->Const.MaxProgramMatrixStackDepth;
+ break;
+ case GL_MAX_TRACK_MATRICES_NV:
+ CHECK_EXTENSION_D(NV_vertex_program, pname);
+ *params = (GLdouble) ctx->Const.MaxProgramMatrices;
+ break;
+ case GL_CURRENT_MATRIX_STACK_DEPTH_NV:
+ CHECK_EXTENSION_D(NV_vertex_program, pname);
+ *params = (GLdouble) ctx->CurrentStack->Depth + 1;
+ break;
+ case GL_CURRENT_MATRIX_NV:
+ CHECK_EXTENSION_D(NV_vertex_program, pname);
+ for (i = 0; i < 16; i++)
+ params[i] = (GLdouble) ctx->CurrentStack->Top->m[i];
+ break;
+ case GL_VERTEX_PROGRAM_BINDING_NV:
+ CHECK_EXTENSION_D(NV_vertex_program, pname);
+ if (ctx->VertexProgram.Current)
+ *params = (GLdouble) ctx->VertexProgram.Current->Base.Id;
+ else
+ *params = 0.0;
+ break;
+ case GL_PROGRAM_ERROR_POSITION_NV:
+ CHECK_EXTENSION_D(NV_vertex_program, pname);
+ *params = (GLdouble) ctx->Program.ErrorPos;
+ break;
+ case GL_VERTEX_ATTRIB_ARRAY0_NV:
+ case GL_VERTEX_ATTRIB_ARRAY1_NV:
+ case GL_VERTEX_ATTRIB_ARRAY2_NV:
+ case GL_VERTEX_ATTRIB_ARRAY3_NV:
+ case GL_VERTEX_ATTRIB_ARRAY4_NV:
+ case GL_VERTEX_ATTRIB_ARRAY5_NV:
+ case GL_VERTEX_ATTRIB_ARRAY6_NV:
+ case GL_VERTEX_ATTRIB_ARRAY7_NV:
+ case GL_VERTEX_ATTRIB_ARRAY8_NV:
+ case GL_VERTEX_ATTRIB_ARRAY9_NV:
+ case GL_VERTEX_ATTRIB_ARRAY10_NV:
+ case GL_VERTEX_ATTRIB_ARRAY11_NV:
+ case GL_VERTEX_ATTRIB_ARRAY12_NV:
+ case GL_VERTEX_ATTRIB_ARRAY13_NV:
+ case GL_VERTEX_ATTRIB_ARRAY14_NV:
+ case GL_VERTEX_ATTRIB_ARRAY15_NV:
+ CHECK_EXTENSION_D(NV_vertex_program, pname);
+ {
+ GLuint n = (GLuint) pname - GL_VERTEX_ATTRIB_ARRAY0_NV;
+ *params = (GLdouble) ctx->Array.VertexAttrib[n].Enabled;
+ }
+ break;
+ case GL_MAP1_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB15_4_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ {
+ GLuint n = (GLuint) pname - GL_MAP1_VERTEX_ATTRIB0_4_NV;
+ *params = (GLdouble) ctx->Eval.Map1Attrib[n];
+ }
+ break;
+ case GL_MAP2_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB15_4_NV:
+ CHECK_EXTENSION_B(NV_vertex_program, pname);
+ {
+ GLuint n = (GLuint) pname - GL_MAP2_VERTEX_ATTRIB0_4_NV;
+ *params = (GLdouble) ctx->Eval.Map2Attrib[n];
+ }
+ break;
+#endif /* FEATURE_NV_vertex_program */
+
+#if FEATURE_NV_fragment_program
+ case GL_FRAGMENT_PROGRAM_NV:
+ CHECK_EXTENSION_D(NV_fragment_program, pname);
+ *params = (GLdouble) ctx->FragmentProgram.Enabled;
+ break;
+ case GL_MAX_TEXTURE_COORDS_NV:
+ CHECK_EXTENSION_B(NV_fragment_program, pname);
+ *params = (GLdouble) ctx->Const.MaxTextureCoordUnits;
+ break;
+ case GL_MAX_TEXTURE_IMAGE_UNITS_NV:
+ CHECK_EXTENSION_B(NV_fragment_program, pname);
+ *params = (GLdouble) ctx->Const.MaxTextureImageUnits;
+ break;
+ case GL_FRAGMENT_PROGRAM_BINDING_NV:
+ CHECK_EXTENSION_D(NV_fragment_program, pname);
+ if (ctx->FragmentProgram.Current)
+ *params = (GLdouble) ctx->FragmentProgram.Current->Base.Id;
+ else
+ *params = 0.0;
+ break;
+ case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV:
+ CHECK_EXTENSION_D(NV_fragment_program, pname);
+ *params = (GLdouble) MAX_NV_FRAGMENT_PROGRAM_PARAMS;
+ break;
+#endif /* FEATURE_NV_fragment_program */
+
+ /* GL_NV_texture_rectangle */
+ case GL_TEXTURE_RECTANGLE_NV:
+ CHECK_EXTENSION_D(NV_texture_rectangle, pname);
+ *params = (GLdouble) _mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV);
+ break;
+ case GL_TEXTURE_BINDING_RECTANGLE_NV:
+ CHECK_EXTENSION_D(NV_texture_rectangle, pname);
+ *params = (GLdouble) textureUnit->CurrentRect->Name;
+ break;
+ case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV:
+ CHECK_EXTENSION_D(NV_texture_rectangle, pname);
+ *params = (GLdouble) ctx->Const.MaxTextureRectSize;
+ break;
+
+ /* GL_EXT_stencil_two_side */
+ case GL_STENCIL_TEST_TWO_SIDE_EXT:
+ CHECK_EXTENSION_D(EXT_stencil_two_side, pname);
+ *params = (GLdouble) ctx->Stencil.TestTwoSide;
+ break;
+ case GL_ACTIVE_STENCIL_FACE_EXT:
+ CHECK_EXTENSION_D(EXT_stencil_two_side, pname);
+ *params = (GLdouble) (ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT);
+ break;
+
+ /* GL_NV_light_max_exponent */
+ case GL_MAX_SHININESS_NV:
+ *params = (GLdouble) ctx->Const.MaxShininess;
+ break;
+ case GL_MAX_SPOT_EXPONENT_NV:
+ *params = (GLdouble) ctx->Const.MaxSpotExponent;
+ break;
+
+#if FEATURE_ARB_vertex_buffer_object
+ case GL_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_D(ARB_vertex_buffer_object, pname);
+ *params = (GLdouble) ctx->Array.ArrayBufferObj->Name;
+ break;
+ case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_D(ARB_vertex_buffer_object, pname);
+ *params = (GLdouble) ctx->Array.Vertex.BufferObj->Name;
+ break;
+ case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_D(ARB_vertex_buffer_object, pname);
+ *params = (GLdouble) ctx->Array.Normal.BufferObj->Name;
+ break;
+ case GL_COLOR_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_D(ARB_vertex_buffer_object, pname);
+ *params = (GLdouble) ctx->Array.Color.BufferObj->Name;
+ break;
+ case GL_INDEX_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_D(ARB_vertex_buffer_object, pname);
+ *params = (GLdouble) ctx->Array.Index.BufferObj->Name;
+ break;
+ case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_D(ARB_vertex_buffer_object, pname);
+ *params = (GLdouble) ctx->Array.TexCoord[clientUnit].BufferObj->Name;
+ break;
+ case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_D(ARB_vertex_buffer_object, pname);
+ *params = (GLdouble) ctx->Array.EdgeFlag.BufferObj->Name;
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_D(ARB_vertex_buffer_object, pname);
+ *params = (GLdouble) ctx->Array.SecondaryColor.BufferObj->Name;
+ break;
+ case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_D(ARB_vertex_buffer_object, pname);
+ *params = (GLdouble) ctx->Array.FogCoord.BufferObj->Name;
+ break;
+ /*case GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB: - not supported */
+ case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_D(ARB_vertex_buffer_object, pname);
+ *params = (GLdouble) ctx->Array.ElementArrayBufferObj->Name;
+ break;
+#endif
+
+#if FEATURE_ARB_fragment_program
+ case GL_FRAGMENT_PROGRAM_ARB:
+ CHECK_EXTENSION_D(ARB_fragment_program, pname);
+ *params = (GLdouble) ctx->FragmentProgram.Enabled;
+ break;
+ case GL_TRANSPOSE_CURRENT_MATRIX_ARB:
+ CHECK_EXTENSION_D(ARB_fragment_program, pname);
+ params[0] = ctx->CurrentStack->Top->m[0];
+ params[1] = ctx->CurrentStack->Top->m[4];
+ params[2] = ctx->CurrentStack->Top->m[8];
+ params[3] = ctx->CurrentStack->Top->m[12];
+ params[4] = ctx->CurrentStack->Top->m[1];
+ params[5] = ctx->CurrentStack->Top->m[5];
+ params[6] = ctx->CurrentStack->Top->m[9];
+ params[7] = ctx->CurrentStack->Top->m[13];
+ params[8] = ctx->CurrentStack->Top->m[2];
+ params[9] = ctx->CurrentStack->Top->m[6];
+ params[10] = ctx->CurrentStack->Top->m[10];
+ params[11] = ctx->CurrentStack->Top->m[14];
+ params[12] = ctx->CurrentStack->Top->m[3];
+ params[13] = ctx->CurrentStack->Top->m[7];
+ params[14] = ctx->CurrentStack->Top->m[11];
+ params[15] = ctx->CurrentStack->Top->m[15];
+ break;
+ /* Remaining ARB_fragment_program queries alias with
+ * the GL_NV_fragment_program queries.
+ */
+#endif
+
+ /* GL_EXT_depth_bounds_test */
+ case GL_DEPTH_BOUNDS_TEST_EXT:
+ CHECK_EXTENSION_D(EXT_depth_bounds_test, pname);
+ params[0] = (GLdouble) ctx->Depth.BoundsTest;
+ break;
+ case GL_DEPTH_BOUNDS_EXT:
+ CHECK_EXTENSION_D(EXT_depth_bounds_test, pname);
+ params[0] = ctx->Depth.BoundsMin;
+ params[1] = ctx->Depth.BoundsMax;
+ break;
+
+#if FEATURE_MESA_program_debug
+ case GL_FRAGMENT_PROGRAM_CALLBACK_MESA:
+ CHECK_EXTENSION_D(MESA_program_debug, pname);
+ *params = (GLdouble) ctx->FragmentProgram.CallbackEnabled;
+ break;
+ case GL_VERTEX_PROGRAM_CALLBACK_MESA:
+ CHECK_EXTENSION_D(MESA_program_debug, pname);
+ *params = (GLdouble) ctx->VertexProgram.CallbackEnabled;
+ break;
+ case GL_FRAGMENT_PROGRAM_POSITION_MESA:
+ CHECK_EXTENSION_D(MESA_program_debug, pname);
+ *params = (GLdouble) ctx->FragmentProgram.CurrentPosition;
+ break;
+ case GL_VERTEX_PROGRAM_POSITION_MESA:
+ CHECK_EXTENSION_D(MESA_program_debug, pname);
+ *params = (GLdouble) ctx->VertexProgram.CurrentPosition;
+ break;
+#endif
+
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev(pname=0x%x)", pname);
+ }
+}
+
+
+/**
+ * Get the value(s) of a selected parameter.
+ *
+ * \param pname parameter to be returned.
+ * \param params will hold the value(s) of the speficifed parameter.
+ *
+ * \sa glGetFloatv().
+ *
+ * Tries to get the specified parameter via dd_function_table::GetFloatv,
+ * otherwise gets the specified parameter from the current context, converting
+ * it value into GLfloat.
+ */
+void GLAPIENTRY
+_mesa_GetFloatv( GLenum pname, GLfloat *params )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLuint i;
+ const GLuint clientUnit = ctx->Array.ActiveTexture;
+ const GLuint texUnit = ctx->Texture.CurrentUnit;
+ const struct gl_texture_unit *textureUnit = &ctx->Texture.Unit[texUnit];
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (!params)
+ return;
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glGetFloatv %s\n", _mesa_lookup_enum_by_nr(pname));
+
+ if (!ctx->_CurrentProgram) {
+ /* We need this in order to get correct results for
+ * GL_OCCLUSION_TEST_RESULT_HP. There might be other important cases.
+ */
+ FLUSH_VERTICES(ctx, 0);
+ }
+
+ if (ctx->Driver.GetFloatv && (*ctx->Driver.GetFloatv)(ctx, pname, params))
+ return;
+
+ switch (pname) {
+ case GL_ACCUM_RED_BITS:
+ *params = (GLfloat) ctx->Visual.accumRedBits;
+ break;
+ case GL_ACCUM_GREEN_BITS:
+ *params = (GLfloat) ctx->Visual.accumGreenBits;
+ break;
+ case GL_ACCUM_BLUE_BITS:
+ *params = (GLfloat) ctx->Visual.accumBlueBits;
+ break;
+ case GL_ACCUM_ALPHA_BITS:
+ *params = (GLfloat) ctx->Visual.accumAlphaBits;
+ break;
+ case GL_ACCUM_CLEAR_VALUE:
+ params[0] = ctx->Accum.ClearColor[0];
+ params[1] = ctx->Accum.ClearColor[1];
+ params[2] = ctx->Accum.ClearColor[2];
+ params[3] = ctx->Accum.ClearColor[3];
+ break;
+ case GL_ALPHA_BIAS:
+ *params = ctx->Pixel.AlphaBias;
break;
case GL_ALPHA_BITS:
*params = (GLfloat) ctx->Visual.alphaBits;
*params = ENUM_TO_FLOAT(ctx->Color.AlphaFunc);
break;
case GL_ALPHA_TEST_REF:
- *params = (GLfloat) ctx->Color.AlphaRef / CHAN_MAXF;
+ *params = (GLfloat) ctx->Color.AlphaRef;
break;
case GL_ATTRIB_STACK_DEPTH:
*params = (GLfloat) (ctx->AttribStackDepth);
case GL_CLIP_PLANE3:
case GL_CLIP_PLANE4:
case GL_CLIP_PLANE5:
- *params = (GLfloat) ctx->Transform.ClipEnabled[pname-GL_CLIP_PLANE0];
+ if (ctx->Transform.ClipPlanesEnabled & (1 << (pname - GL_CLIP_PLANE0)))
+ *params = 1.0;
+ else
+ *params = 0.0;
break;
case GL_COLOR_CLEAR_VALUE:
- params[0] = CHAN_TO_FLOAT(ctx->Color.ClearColor[0]);
- params[1] = CHAN_TO_FLOAT(ctx->Color.ClearColor[1]);
- params[2] = CHAN_TO_FLOAT(ctx->Color.ClearColor[2]);
- params[3] = CHAN_TO_FLOAT(ctx->Color.ClearColor[3]);
+ params[0] = ctx->Color.ClearColor[0];
+ params[1] = ctx->Color.ClearColor[1];
+ params[2] = ctx->Color.ClearColor[2];
+ params[3] = ctx->Color.ClearColor[3];
break;
case GL_COLOR_MATERIAL:
*params = (GLfloat) ctx->Light.ColorMaterialEnabled;
break;
case GL_CURRENT_COLOR:
FLUSH_CURRENT(ctx, 0);
- params[0] = CHAN_TO_FLOAT(ctx->Current.Color[0]);
- params[1] = CHAN_TO_FLOAT(ctx->Current.Color[1]);
- params[2] = CHAN_TO_FLOAT(ctx->Current.Color[2]);
- params[3] = CHAN_TO_FLOAT(ctx->Current.Color[3]);
+ params[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0];
+ params[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1];
+ params[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2];
+ params[3] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3];
break;
case GL_CURRENT_INDEX:
FLUSH_CURRENT(ctx, 0);
break;
case GL_CURRENT_NORMAL:
FLUSH_CURRENT(ctx, 0);
- params[0] = ctx->Current.Normal[0];
- params[1] = ctx->Current.Normal[1];
- params[2] = ctx->Current.Normal[2];
+ params[0] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0];
+ params[1] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1];
+ params[2] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2];
break;
case GL_CURRENT_RASTER_COLOR:
params[0] = ctx->Current.RasterColor[0];
params[0] = ctx->Current.RasterDistance;
break;
case GL_CURRENT_RASTER_INDEX:
- *params = (GLfloat) ctx->Current.RasterIndex;
+ *params = ctx->Current.RasterIndex;
break;
case GL_CURRENT_RASTER_POSITION:
params[0] = ctx->Current.RasterPos[0];
params[3] = ctx->Current.RasterPos[3];
break;
case GL_CURRENT_RASTER_TEXTURE_COORDS:
- params[0] = ctx->Current.RasterMultiTexCoord[texTransformUnit][0];
- params[1] = ctx->Current.RasterMultiTexCoord[texTransformUnit][1];
- params[2] = ctx->Current.RasterMultiTexCoord[texTransformUnit][2];
- params[3] = ctx->Current.RasterMultiTexCoord[texTransformUnit][3];
+ params[0] = ctx->Current.RasterTexCoords[texUnit][0];
+ params[1] = ctx->Current.RasterTexCoords[texUnit][1];
+ params[2] = ctx->Current.RasterTexCoords[texUnit][2];
+ params[3] = ctx->Current.RasterTexCoords[texUnit][3];
break;
case GL_CURRENT_RASTER_POSITION_VALID:
*params = (GLfloat) ctx->Current.RasterPosValid;
break;
case GL_CURRENT_TEXTURE_COORDS:
FLUSH_CURRENT(ctx, 0);
- params[0] = (GLfloat) ctx->Current.Texcoord[texTransformUnit][0];
- params[1] = (GLfloat) ctx->Current.Texcoord[texTransformUnit][1];
- params[2] = (GLfloat) ctx->Current.Texcoord[texTransformUnit][2];
- params[3] = (GLfloat) ctx->Current.Texcoord[texTransformUnit][3];
+ params[0] = (GLfloat) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][0];
+ params[1] = (GLfloat) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][1];
+ params[2] = (GLfloat) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][2];
+ params[3] = (GLfloat) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3];
break;
case GL_DEPTH_BIAS:
*params = (GLfloat) ctx->Pixel.DepthBias;
case GL_GREEN_SCALE:
*params = (GLfloat) ctx->Pixel.GreenScale;
break;
- case GL_HISTOGRAM:
- if (ctx->Extensions.EXT_histogram || ctx->Extensions.ARB_imaging) {
- *params = (GLfloat) ctx->Pixel.HistogramEnabled;
- }
- else {
- gl_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
- return;
- }
- break;
case GL_INDEX_BITS:
*params = (GLfloat) ctx->Visual.indexBits;
break;
*params = (GLfloat) ctx->List.ListBase;
break;
case GL_LIST_INDEX:
- *params = (GLfloat) ctx->CurrentListNum;
+ *params = (GLfloat) ctx->ListState.CurrentListNum;
break;
case GL_LIST_MODE:
- *params = ctx->ExecuteFlag ? ENUM_TO_FLOAT(GL_COMPILE_AND_EXECUTE)
- : ENUM_TO_FLOAT(GL_COMPILE);
+ if (!ctx->CompileFlag)
+ *params = 0.0F;
+ else if (ctx->ExecuteFlag)
+ *params = ENUM_TO_FLOAT(GL_COMPILE_AND_EXECUTE);
+ else
+ *params = ENUM_TO_FLOAT(GL_COMPILE);
break;
case GL_INDEX_LOGIC_OP:
*params = (GLfloat) ctx->Color.IndexLogicOpEnabled;
*params = (GLfloat) MAX_PROJECTION_STACK_DEPTH;
break;
case GL_MAX_TEXTURE_SIZE:
+ *params = (GLfloat) (1 << (ctx->Const.MaxTextureLevels - 1));
+ break;
case GL_MAX_3D_TEXTURE_SIZE:
- *params = (GLfloat) ctx->Const.MaxTextureSize;
+ *params = (GLfloat) (1 << (ctx->Const.Max3DTextureLevels - 1));
break;
case GL_MAX_TEXTURE_STACK_DEPTH:
*params = (GLfloat) MAX_TEXTURE_STACK_DEPTH;
params[0] = (GLfloat) MAX_WIDTH;
params[1] = (GLfloat) MAX_HEIGHT;
break;
- case GL_MINMAX:
- *params = (GLfloat) ctx->Pixel.MinMaxEnabled;
- break;
case GL_MODELVIEW_MATRIX:
for (i=0;i<16;i++) {
- params[i] = ctx->ModelView.m[i];
+ params[i] = ctx->ModelviewMatrixStack.Top->m[i];
}
break;
case GL_MODELVIEW_STACK_DEPTH:
- *params = (GLfloat) (ctx->ModelViewStackDepth + 1);
+ *params = (GLfloat) (ctx->ModelviewMatrixStack.Depth + 1);
break;
case GL_NAME_STACK_DEPTH:
*params = (GLfloat) ctx->Select.NameStackDepth;
case GL_PACK_IMAGE_HEIGHT_EXT:
*params = (GLfloat) ctx->Pack.ImageHeight;
break;
+ case GL_PACK_INVERT_MESA:
+ *params = (GLfloat) ctx->Pack.Invert;
+ break;
case GL_PERSPECTIVE_CORRECTION_HINT:
*params = ENUM_TO_FLOAT(ctx->Hint.PerspectiveCorrection);
break;
break;
case GL_PROJECTION_MATRIX:
for (i=0;i<16;i++) {
- params[i] = ctx->ProjectionMatrix.m[i];
+ params[i] = ctx->ProjectionMatrixStack.Top->m[i];
}
break;
case GL_PROJECTION_STACK_DEPTH:
- *params = (GLfloat) (ctx->ProjectionStackDepth + 1);
+ *params = (GLfloat) (ctx->ProjectionMatrixStack.Depth + 1);
break;
case GL_READ_BUFFER:
*params = ENUM_TO_FLOAT(ctx->Pixel.ReadBuffer);
*params = (GLfloat) ctx->Stencil.Clear;
break;
case GL_STENCIL_FAIL:
- *params = ENUM_TO_FLOAT(ctx->Stencil.FailFunc);
+ *params = ENUM_TO_FLOAT(ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_FUNC:
- *params = ENUM_TO_FLOAT(ctx->Stencil.Function);
+ *params = ENUM_TO_FLOAT(ctx->Stencil.Function[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_PASS_DEPTH_FAIL:
- *params = ENUM_TO_FLOAT(ctx->Stencil.ZFailFunc);
+ *params = ENUM_TO_FLOAT(ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_PASS_DEPTH_PASS:
- *params = ENUM_TO_FLOAT(ctx->Stencil.ZPassFunc);
+ *params = ENUM_TO_FLOAT(ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]);
break;
case GL_STENCIL_REF:
- *params = (GLfloat) ctx->Stencil.Ref;
+ *params = (GLfloat) ctx->Stencil.Ref[ctx->Stencil.ActiveFace];
break;
case GL_STENCIL_TEST:
*params = (GLfloat) ctx->Stencil.Enabled;
break;
case GL_STENCIL_VALUE_MASK:
- *params = (GLfloat) ctx->Stencil.ValueMask;
+ *params = (GLfloat) ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace];
break;
case GL_STENCIL_WRITEMASK:
- *params = (GLfloat) ctx->Stencil.WriteMask;
+ *params = (GLfloat) ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace];
break;
case GL_STEREO:
*params = (GLfloat) ctx->Visual.stereoMode;
*params = (GLfloat) ctx->Const.SubPixelBits;
break;
case GL_TEXTURE_1D:
- *params = _mesa_IsEnabled(GL_TEXTURE_1D) ? 1.0 : 0.0;
+ *params = _mesa_IsEnabled(GL_TEXTURE_1D) ? 1.0F : 0.0F;
break;
case GL_TEXTURE_2D:
- *params = _mesa_IsEnabled(GL_TEXTURE_2D) ? 1.0 : 0.0;
+ *params = _mesa_IsEnabled(GL_TEXTURE_2D) ? 1.0F : 0.0F;
break;
case GL_TEXTURE_3D:
- *params = _mesa_IsEnabled(GL_TEXTURE_3D) ? 1.0 : 0.0;
+ *params = _mesa_IsEnabled(GL_TEXTURE_3D) ? 1.0F : 0.0F;
break;
case GL_TEXTURE_BINDING_1D:
*params = (GLfloat) textureUnit->Current1D->Name;
*params = ENUM_TO_FLOAT(textureUnit->EnvMode);
break;
case GL_TEXTURE_GEN_S:
- *params = (textureUnit->TexGenEnabled & S_BIT) ? 1.0 : 0.0;
+ *params = (textureUnit->TexGenEnabled & S_BIT) ? 1.0F : 0.0F;
break;
case GL_TEXTURE_GEN_T:
- *params = (textureUnit->TexGenEnabled & T_BIT) ? 1.0 : 0.0;
+ *params = (textureUnit->TexGenEnabled & T_BIT) ? 1.0F : 0.0F;
break;
case GL_TEXTURE_GEN_R:
- *params = (textureUnit->TexGenEnabled & R_BIT) ? 1.0 : 0.0;
+ *params = (textureUnit->TexGenEnabled & R_BIT) ? 1.0F : 0.0F;
break;
case GL_TEXTURE_GEN_Q:
- *params = (textureUnit->TexGenEnabled & Q_BIT) ? 1.0 : 0.0;
+ *params = (textureUnit->TexGenEnabled & Q_BIT) ? 1.0F : 0.0F;
break;
case GL_TEXTURE_MATRIX:
for (i=0;i<16;i++) {
- params[i] = ctx->TextureMatrix[texTransformUnit].m[i];
+ params[i] = ctx->TextureMatrixStack[texUnit].Top->m[i];
}
break;
case GL_TEXTURE_STACK_DEPTH:
- *params = (GLfloat) (ctx->TextureStackDepth[texTransformUnit] + 1);
+ *params = (GLfloat) (ctx->TextureMatrixStack[texUnit].Depth + 1);
break;
case GL_UNPACK_ALIGNMENT:
*params = (GLfloat) ctx->Unpack.Alignment;
case GL_UNPACK_IMAGE_HEIGHT_EXT:
*params = (GLfloat) ctx->Unpack.ImageHeight;
break;
+ case GL_UNPACK_CLIENT_STORAGE_APPLE:
+ *params = (GLfloat) ctx->Unpack.ClientStorage;
+ break;
case GL_VIEWPORT:
params[0] = (GLfloat) ctx->Viewport.X;
params[1] = (GLfloat) ctx->Viewport.Y;
*params = 0.0;
break;
case GL_TEXTURE_COORD_ARRAY:
- *params = (GLfloat) ctx->Array.TexCoord[texUnit].Enabled;
+ *params = (GLfloat) ctx->Array.TexCoord[clientUnit].Enabled;
break;
case GL_TEXTURE_COORD_ARRAY_SIZE:
- *params = (GLfloat) ctx->Array.TexCoord[texUnit].Size;
+ *params = (GLfloat) ctx->Array.TexCoord[clientUnit].Size;
break;
case GL_TEXTURE_COORD_ARRAY_TYPE:
- *params = ENUM_TO_FLOAT(ctx->Array.TexCoord[texUnit].Type);
+ *params = ENUM_TO_FLOAT(ctx->Array.TexCoord[clientUnit].Type);
break;
case GL_TEXTURE_COORD_ARRAY_STRIDE:
- *params = (GLfloat) ctx->Array.TexCoord[texUnit].Stride;
+ *params = (GLfloat) ctx->Array.TexCoord[clientUnit].Stride;
break;
case GL_TEXTURE_COORD_ARRAY_COUNT_EXT:
*params = 0.0;
/* GL_ARB_multitexture */
case GL_MAX_TEXTURE_UNITS_ARB:
- *params = (GLfloat) ctx->Const.MaxTextureUnits;
+ CHECK_EXTENSION_F(ARB_multitexture, pname);
+ *params = (GLfloat) MIN2(ctx->Const.MaxTextureImageUnits,
+ ctx->Const.MaxTextureCoordUnits);
break;
case GL_ACTIVE_TEXTURE_ARB:
+ CHECK_EXTENSION_F(ARB_multitexture, pname);
*params = (GLfloat) (GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit);
break;
case GL_CLIENT_ACTIVE_TEXTURE_ARB:
- *params = (GLfloat) (GL_TEXTURE0_ARB + ctx->Array.ActiveTexture);
+ CHECK_EXTENSION_F(ARB_multitexture, pname);
+ *params = (GLfloat) (GL_TEXTURE0_ARB + clientUnit);
break;
/* GL_ARB_texture_cube_map */
case GL_TEXTURE_CUBE_MAP_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- *params = (GLfloat) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
- else
- gl_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
- return;
+ CHECK_EXTENSION_F(ARB_texture_cube_map, pname);
+ *params = (GLfloat) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
+ break;
case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- *params = (GLfloat) textureUnit->CurrentCubeMap->Name;
- else
- gl_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
- return;
+ CHECK_EXTENSION_F(ARB_texture_cube_map, pname);
+ *params = (GLfloat) textureUnit->CurrentCubeMap->Name;
+ break;
case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- *params = (GLfloat) ctx->Const.MaxCubeTextureSize;
- else
- gl_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
- return;
+ CHECK_EXTENSION_F(ARB_texture_cube_map, pname);
+ *params = (GLfloat) (1 << (ctx->Const.MaxCubeTextureLevels - 1));
+ break;
/* GL_ARB_texture_compression */
case GL_TEXTURE_COMPRESSION_HINT_ARB:
- if (ctx->Extensions.ARB_texture_compression) {
- *params = (GLfloat) ctx->Hint.TextureCompression;
- }
- else
- gl_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
+ CHECK_EXTENSION_F(ARB_texture_compression, pname);
+ *params = (GLfloat) ctx->Hint.TextureCompression;
break;
case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
- if (ctx->Extensions.ARB_texture_compression) {
- *params = (GLfloat) ctx->Const.NumCompressedTextureFormats;
- }
- else
- gl_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
+ CHECK_EXTENSION_F(ARB_texture_compression, pname);
+ *params = (GLfloat) _mesa_get_compressed_formats(ctx, NULL);
break;
case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
- if (ctx->Extensions.ARB_texture_compression) {
- GLuint i;
- for (i = 0; i < ctx->Const.NumCompressedTextureFormats; i++)
- params[i] = (GLfloat) ctx->Const.CompressedTextureFormats[i];
+ CHECK_EXTENSION_F(ARB_texture_compression, pname);
+ {
+ GLint formats[100];
+ GLuint i, n;
+ n = _mesa_get_compressed_formats(ctx, formats);
+ for (i = 0; i < n; i++)
+ params[i] = (GLfloat) formats[i];
}
- else
- gl_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
break;
/* GL_EXT_compiled_vertex_array */
case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT:
+ CHECK_EXTENSION_F(EXT_compiled_vertex_array, pname);
*params = (GLfloat) ctx->Array.LockFirst;
break;
case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT:
+ CHECK_EXTENSION_F(EXT_compiled_vertex_array, pname);
*params = (GLfloat) ctx->Array.LockCount;
break;
/* GL_ARB_transpose_matrix */
case GL_TRANSPOSE_COLOR_MATRIX_ARB:
- _math_transposef(params, ctx->ColorMatrix.m);
+ _math_transposef(params, ctx->ColorMatrixStack.Top->m);
break;
case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB:
- _math_transposef(params, ctx->ModelView.m);
+ _math_transposef(params, ctx->ModelviewMatrixStack.Top->m);
break;
case GL_TRANSPOSE_PROJECTION_MATRIX_ARB:
- _math_transposef(params, ctx->ProjectionMatrix.m);
+ _math_transposef(params, ctx->ProjectionMatrixStack.Top->m);
break;
case GL_TRANSPOSE_TEXTURE_MATRIX_ARB:
- _math_transposef(params, ctx->TextureMatrix[texTransformUnit].m);
+ _math_transposef(params, ctx->TextureMatrixStack[texUnit].Top->m);
break;
/* GL_HP_occlusion_test */
case GL_OCCLUSION_TEST_HP:
- if (ctx->Extensions.HP_occlusion_test) {
- *params = (GLfloat) ctx->Depth.OcclusionTest;
- }
- else {
- gl_error( ctx, GL_INVALID_ENUM, "glGetFloatv" );
- }
- return;
+ CHECK_EXTENSION_F(HP_occlusion_test, pname);
+ *params = (GLfloat) ctx->Depth.OcclusionTest;
+ break;
case GL_OCCLUSION_TEST_RESULT_HP:
- if (ctx->Extensions.HP_occlusion_test) {
- if (ctx->Depth.OcclusionTest)
- *params = (GLfloat) ctx->OcclusionResult;
- else
- *params = (GLfloat) ctx->OcclusionResultSaved;
- /* reset flag now */
- ctx->OcclusionResult = GL_FALSE;
- ctx->OcclusionResultSaved = GL_FALSE;
- }
- else {
- gl_error( ctx, GL_INVALID_ENUM, "glGetFloatv" );
- }
- return;
+ CHECK_EXTENSION_F(HP_occlusion_test, pname);
+ if (ctx->Depth.OcclusionTest)
+ *params = (GLfloat) ctx->OcclusionResult;
+ else
+ *params = (GLfloat) ctx->OcclusionResultSaved;
+ /* reset flag now */
+ ctx->OcclusionResult = GL_FALSE;
+ ctx->OcclusionResultSaved = GL_FALSE;
+ break;
/* GL_SGIS_pixel_texture */
case GL_PIXEL_TEXTURE_SGIS:
/* GL_SGI_color_matrix (also in 1.2 imaging) */
case GL_COLOR_MATRIX_SGI:
for (i=0;i<16;i++) {
- params[i] = ctx->ColorMatrix.m[i];
+ params[i] = ctx->ColorMatrixStack.Top->m[i];
}
break;
case GL_COLOR_MATRIX_STACK_DEPTH_SGI:
- *params = (GLfloat) (ctx->ColorStackDepth + 1);
+ *params = (GLfloat) (ctx->ColorMatrixStack.Depth + 1);
break;
case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI:
*params = (GLfloat) MAX_COLOR_STACK_DEPTH;
/* GL_EXT_convolution (also in 1.2 imaging) */
case GL_CONVOLUTION_1D_EXT:
- if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) {
- *params = (GLfloat) ctx->Pixel.Convolution1DEnabled;
- }
- else {
- gl_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
- return;
- }
+ CHECK_EXTENSION_F(EXT_convolution, pname);
+ *params = (GLfloat) ctx->Pixel.Convolution1DEnabled;
break;
case GL_CONVOLUTION_2D:
- if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) {
- *params = (GLfloat) ctx->Pixel.Convolution2DEnabled;
- }
- else {
- gl_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
- return;
- }
+ CHECK_EXTENSION_F(EXT_convolution, pname);
+ *params = (GLfloat) ctx->Pixel.Convolution2DEnabled;
break;
case GL_SEPARABLE_2D:
- if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) {
- *params = (GLfloat) ctx->Pixel.Separable2DEnabled;
- }
- else {
- gl_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
- return;
- }
- break;
- case GL_MAX_CONVOLUTION_WIDTH:
- *params = (GLfloat) ctx->Const.MaxConvolutionWidth;
- break;
- case GL_MAX_CONVOLUTION_HEIGHT:
- *params = (GLfloat) ctx->Const.MaxConvolutionHeight;
+ CHECK_EXTENSION_F(EXT_convolution, pname);
+ *params = (GLfloat) ctx->Pixel.Separable2DEnabled;
break;
case GL_POST_CONVOLUTION_RED_SCALE_EXT:
+ CHECK_EXTENSION_F(EXT_convolution, pname);
*params = ctx->Pixel.PostConvolutionScale[0];
break;
case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:
+ CHECK_EXTENSION_F(EXT_convolution, pname);
*params = ctx->Pixel.PostConvolutionScale[1];
break;
case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:
+ CHECK_EXTENSION_F(EXT_convolution, pname);
*params = ctx->Pixel.PostConvolutionScale[2];
break;
case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:
+ CHECK_EXTENSION_F(EXT_convolution, pname);
*params = ctx->Pixel.PostConvolutionScale[3];
break;
case GL_POST_CONVOLUTION_RED_BIAS_EXT:
+ CHECK_EXTENSION_F(EXT_convolution, pname);
*params = ctx->Pixel.PostConvolutionBias[0];
break;
case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:
+ CHECK_EXTENSION_F(EXT_convolution, pname);
*params = ctx->Pixel.PostConvolutionBias[1];
break;
case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:
+ CHECK_EXTENSION_F(EXT_convolution, pname);
*params = ctx->Pixel.PostConvolutionBias[2];
break;
case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:
+ CHECK_EXTENSION_F(EXT_convolution, pname);
*params = ctx->Pixel.PostConvolutionBias[2];
break;
+ /* GL_EXT_histogram (also in 1.2 imaging) */
+ case GL_HISTOGRAM:
+ CHECK_EXTENSION_F(EXT_histogram, pname);
+ *params = (GLfloat) ctx->Pixel.HistogramEnabled;
+ break;
+ case GL_MINMAX:
+ CHECK_EXTENSION_F(EXT_histogram, pname);
+ *params = (GLfloat) ctx->Pixel.MinMaxEnabled;
+ break;
+
/* GL_SGI_color_table (also in 1.2 imaging */
case GL_COLOR_TABLE_SGI:
*params = (GLfloat) ctx->Pixel.ColorTableEnabled;
*params = (GLfloat) ctx->Pixel.PostColorMatrixColorTableEnabled;
break;
+ /* GL_SGI_texture_color_table */
+ case GL_TEXTURE_COLOR_TABLE_SGI:
+ CHECK_EXTENSION_F(SGI_texture_color_table, pname);
+ *params = (GLfloat) textureUnit->ColorTableEnabled;
+ break;
+
/* GL_EXT_secondary_color */
case GL_COLOR_SUM_EXT:
+ CHECK_EXTENSION_F(EXT_secondary_color, pname);
*params = (GLfloat) ctx->Fog.ColorSumEnabled;
break;
case GL_CURRENT_SECONDARY_COLOR_EXT:
+ CHECK_EXTENSION_F(EXT_secondary_color, pname);
FLUSH_CURRENT(ctx, 0);
- params[0] = CHAN_TO_FLOAT(ctx->Current.SecondaryColor[0]);
- params[1] = CHAN_TO_FLOAT(ctx->Current.SecondaryColor[1]);
- params[2] = CHAN_TO_FLOAT(ctx->Current.SecondaryColor[2]);
+ params[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0];
+ params[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1];
+ params[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2];
+ params[3] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3];
break;
case GL_SECONDARY_COLOR_ARRAY_EXT:
+ CHECK_EXTENSION_F(EXT_secondary_color, pname);
*params = (GLfloat) ctx->Array.SecondaryColor.Enabled;
break;
case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT:
+ CHECK_EXTENSION_F(EXT_secondary_color, pname);
*params = (GLfloat) ctx->Array.SecondaryColor.Type;
break;
case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT:
+ CHECK_EXTENSION_F(EXT_secondary_color, pname);
*params = (GLfloat) ctx->Array.SecondaryColor.Stride;
break;
case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT:
- *params = (GLfloat) ctx->Array.SecondaryColor.Stride;
+ CHECK_EXTENSION_F(EXT_secondary_color, pname);
+ *params = (GLfloat) ctx->Array.SecondaryColor.Size;
break;
/* GL_EXT_fog_coord */
case GL_CURRENT_FOG_COORDINATE_EXT:
+ CHECK_EXTENSION_F(EXT_fog_coord, pname);
FLUSH_CURRENT(ctx, 0);
- *params = (GLfloat) ctx->Current.FogCoord;
+ *params = (GLfloat) ctx->Current.Attrib[VERT_ATTRIB_FOG][0];
break;
case GL_FOG_COORDINATE_ARRAY_EXT:
+ CHECK_EXTENSION_F(EXT_fog_coord, pname);
*params = (GLfloat) ctx->Array.FogCoord.Enabled;
break;
case GL_FOG_COORDINATE_ARRAY_TYPE_EXT:
+ CHECK_EXTENSION_F(EXT_fog_coord, pname);
*params = (GLfloat) ctx->Array.FogCoord.Type;
break;
case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT:
+ CHECK_EXTENSION_F(EXT_fog_coord, pname);
*params = (GLfloat) ctx->Array.FogCoord.Stride;
break;
+ case GL_FOG_COORDINATE_SOURCE_EXT:
+ CHECK_EXTENSION_F(EXT_fog_coord, pname);
+ *params = (GLfloat) ctx->Fog.FogCoordinateSource;
+ break;
+
+ /* GL_EXT_texture_lod_bias */
+ case GL_MAX_TEXTURE_LOD_BIAS_EXT:
+ *params = ctx->Const.MaxTextureLodBias;
+ break;
- /* GL_MESA_sprite_point */
- case GL_SPRITE_POINT_MESA:
- if (ctx->Extensions.MESA_sprite_point) {
- *params = (GLfloat) ctx->Point.SpriteMode;
+ /* GL_EXT_texture_filter_anisotropic */
+ case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
+ CHECK_EXTENSION_F(EXT_texture_filter_anisotropic, pname);
+ *params = ctx->Const.MaxTextureMaxAnisotropy;
+ break;
+
+ /* GL_ARB_multisample */
+ case GL_MULTISAMPLE_ARB:
+ CHECK_EXTENSION_F(ARB_multisample, pname);
+ *params = (GLfloat) ctx->Multisample.Enabled;
+ break;
+ case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
+ CHECK_EXTENSION_F(ARB_multisample, pname);
+ *params = (GLfloat) ctx->Multisample.SampleAlphaToCoverage;
+ break;
+ case GL_SAMPLE_ALPHA_TO_ONE_ARB:
+ CHECK_EXTENSION_F(ARB_multisample, pname);
+ *params = (GLfloat) ctx->Multisample.SampleAlphaToOne;
+ break;
+ case GL_SAMPLE_COVERAGE_ARB:
+ CHECK_EXTENSION_F(ARB_multisample, pname);
+ *params = (GLfloat) ctx->Multisample.SampleCoverage;
+ break;
+ case GL_SAMPLE_COVERAGE_VALUE_ARB:
+ CHECK_EXTENSION_F(ARB_multisample, pname);
+ *params = ctx->Multisample.SampleCoverageValue;
+ break;
+ case GL_SAMPLE_COVERAGE_INVERT_ARB:
+ CHECK_EXTENSION_F(ARB_multisample, pname);
+ *params = (GLfloat) ctx->Multisample.SampleCoverageInvert;
+ break;
+ case GL_SAMPLE_BUFFERS_ARB:
+ CHECK_EXTENSION_F(ARB_multisample, pname);
+ *params = 0.0; /* XXX fix someday */
+ break;
+ case GL_SAMPLES_ARB:
+ CHECK_EXTENSION_F(ARB_multisample, pname);
+ *params = 0.0; /* XXX fix someday */
+ break;
+
+ /* GL_IBM_rasterpos_clip */
+ case GL_RASTER_POSITION_UNCLIPPED_IBM:
+ CHECK_EXTENSION_F(IBM_rasterpos_clip, pname);
+ *params = (GLfloat) ctx->Transform.RasterPositionUnclipped;
+ break;
+
+ /* GL_NV_point_sprite */
+ case GL_POINT_SPRITE_NV:
+ CHECK_EXTENSION2_F(NV_point_sprite, ARB_point_sprite, pname);
+ *params = (GLfloat) ctx->Point.PointSprite;
+ break;
+ case GL_POINT_SPRITE_R_MODE_NV:
+ CHECK_EXTENSION_F(NV_point_sprite, pname);
+ *params = (GLfloat) ctx->Point.SpriteRMode;
+ break;
+
+ /* GL_SGIS_generate_mipmap */
+ case GL_GENERATE_MIPMAP_HINT_SGIS:
+ CHECK_EXTENSION_F(SGIS_generate_mipmap, pname);
+ *params = (GLfloat) ctx->Hint.GenerateMipmap;
+ break;
+
+#if FEATURE_NV_vertex_program
+ case GL_VERTEX_PROGRAM_NV:
+ CHECK_EXTENSION_F(NV_vertex_program, pname);
+ *params = (GLfloat) ctx->VertexProgram.Enabled;
+ break;
+ case GL_VERTEX_PROGRAM_POINT_SIZE_NV:
+ CHECK_EXTENSION_F(NV_vertex_program, pname);
+ *params = (GLfloat) ctx->VertexProgram.PointSizeEnabled;
+ break;
+ case GL_VERTEX_PROGRAM_TWO_SIDE_NV:
+ CHECK_EXTENSION_F(NV_vertex_program, pname);
+ *params = (GLfloat) ctx->VertexProgram.TwoSideEnabled;
+ break;
+ case GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV:
+ CHECK_EXTENSION_F(NV_vertex_program, pname);
+ *params = (GLfloat) ctx->Const.MaxProgramMatrixStackDepth;
+ break;
+ case GL_MAX_TRACK_MATRICES_NV:
+ CHECK_EXTENSION_F(NV_vertex_program, pname);
+ *params = (GLfloat) ctx->Const.MaxProgramMatrices;
+ break;
+ case GL_CURRENT_MATRIX_STACK_DEPTH_NV:
+ CHECK_EXTENSION_F(NV_vertex_program, pname);
+ *params = (GLfloat) ctx->CurrentStack->Depth + 1;
+ break;
+ case GL_CURRENT_MATRIX_NV:
+ CHECK_EXTENSION_F(NV_vertex_program, pname);
+ for (i = 0; i < 16; i++)
+ params[i] = ctx->CurrentStack->Top->m[i];
+ break;
+ case GL_VERTEX_PROGRAM_BINDING_NV:
+ CHECK_EXTENSION_F(NV_vertex_program, pname);
+ if (ctx->VertexProgram.Current)
+ *params = (GLfloat) ctx->VertexProgram.Current->Base.Id;
+ else
+ *params = 0.0;
+ break;
+ case GL_PROGRAM_ERROR_POSITION_NV:
+ CHECK_EXTENSION_F(NV_vertex_program, pname);
+ *params = (GLfloat) ctx->Program.ErrorPos;
+ break;
+ case GL_VERTEX_ATTRIB_ARRAY0_NV:
+ case GL_VERTEX_ATTRIB_ARRAY1_NV:
+ case GL_VERTEX_ATTRIB_ARRAY2_NV:
+ case GL_VERTEX_ATTRIB_ARRAY3_NV:
+ case GL_VERTEX_ATTRIB_ARRAY4_NV:
+ case GL_VERTEX_ATTRIB_ARRAY5_NV:
+ case GL_VERTEX_ATTRIB_ARRAY6_NV:
+ case GL_VERTEX_ATTRIB_ARRAY7_NV:
+ case GL_VERTEX_ATTRIB_ARRAY8_NV:
+ case GL_VERTEX_ATTRIB_ARRAY9_NV:
+ case GL_VERTEX_ATTRIB_ARRAY10_NV:
+ case GL_VERTEX_ATTRIB_ARRAY11_NV:
+ case GL_VERTEX_ATTRIB_ARRAY12_NV:
+ case GL_VERTEX_ATTRIB_ARRAY13_NV:
+ case GL_VERTEX_ATTRIB_ARRAY14_NV:
+ case GL_VERTEX_ATTRIB_ARRAY15_NV:
+ CHECK_EXTENSION_F(NV_vertex_program, pname);
+ {
+ GLuint n = (GLuint) pname - GL_VERTEX_ATTRIB_ARRAY0_NV;
+ *params = (GLfloat) ctx->Array.VertexAttrib[n].Enabled;
}
- else {
- gl_error( ctx, GL_INVALID_ENUM, "glGetFloatv" );
- return;
+ break;
+ case GL_MAP1_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB15_4_NV:
+ CHECK_EXTENSION_F(NV_vertex_program, pname);
+ {
+ GLuint n = (GLuint) pname - GL_MAP1_VERTEX_ATTRIB0_4_NV;
+ *params = (GLfloat) ctx->Eval.Map1Attrib[n];
+ }
+ break;
+ case GL_MAP2_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB15_4_NV:
+ CHECK_EXTENSION_F(NV_vertex_program, pname);
+ {
+ GLuint n = (GLuint) pname - GL_MAP2_VERTEX_ATTRIB0_4_NV;
+ *params = (GLfloat) ctx->Eval.Map2Attrib[n];
}
break;
+#endif /* FEATURE_NV_vertex_program */
+
+#if FEATURE_NV_fragment_program
+ case GL_FRAGMENT_PROGRAM_NV:
+ CHECK_EXTENSION_F(NV_fragment_program, pname);
+ *params = (GLfloat) ctx->FragmentProgram.Enabled;
+ break;
+ case GL_MAX_TEXTURE_COORDS_NV:
+ CHECK_EXTENSION_F(NV_fragment_program, pname);
+ *params = (GLfloat) ctx->Const.MaxTextureCoordUnits;
+ break;
+ case GL_MAX_TEXTURE_IMAGE_UNITS_NV:
+ CHECK_EXTENSION_F(NV_fragment_program, pname);
+ *params = (GLfloat) ctx->Const.MaxTextureImageUnits;
+ break;
+ case GL_FRAGMENT_PROGRAM_BINDING_NV:
+ CHECK_EXTENSION_F(NV_fragment_program, pname);
+ if (ctx->FragmentProgram.Current)
+ *params = (GLfloat) ctx->FragmentProgram.Current->Base.Id;
+ else
+ *params = 0.0;
+ break;
+ case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV:
+ CHECK_EXTENSION_F(NV_fragment_program, pname);
+ *params = (GLfloat) MAX_NV_FRAGMENT_PROGRAM_PARAMS;
+ break;
+#endif /* FEATURE_NV_fragment_program */
+
+ /* GL_NV_texture_rectangle */
+ case GL_TEXTURE_RECTANGLE_NV:
+ CHECK_EXTENSION_F(NV_texture_rectangle, pname);
+ *params = (GLfloat) _mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV);
+ break;
+ case GL_TEXTURE_BINDING_RECTANGLE_NV:
+ CHECK_EXTENSION_F(NV_texture_rectangle, pname);
+ *params = (GLfloat) textureUnit->CurrentRect->Name;
+ break;
+ case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV:
+ CHECK_EXTENSION_F(NV_texture_rectangle, pname);
+ *params = (GLfloat) ctx->Const.MaxTextureRectSize;
+ break;
+
+ /* GL_EXT_stencil_two_side */
+ case GL_STENCIL_TEST_TWO_SIDE_EXT:
+ CHECK_EXTENSION_F(EXT_stencil_two_side, pname);
+ *params = (GLfloat) ctx->Stencil.TestTwoSide;
+ break;
+ case GL_ACTIVE_STENCIL_FACE_EXT:
+ CHECK_EXTENSION_F(EXT_stencil_two_side, pname);
+ *params = (GLfloat) (ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT);
+ break;
+
+ /* GL_NV_light_max_exponent */
+ case GL_MAX_SHININESS_NV:
+ *params = ctx->Const.MaxShininess;
+ break;
+ case GL_MAX_SPOT_EXPONENT_NV:
+ *params = ctx->Const.MaxSpotExponent;
+ break;
+
+#if FEATURE_ARB_vertex_buffer_object
+ case GL_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_F(ARB_vertex_buffer_object, pname);
+ *params = (GLfloat) ctx->Array.ArrayBufferObj->Name;
+ break;
+ case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_F(ARB_vertex_buffer_object, pname);
+ *params = (GLfloat) ctx->Array.Vertex.BufferObj->Name;
+ break;
+ case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_F(ARB_vertex_buffer_object, pname);
+ *params = (GLfloat) ctx->Array.Normal.BufferObj->Name;
+ break;
+ case GL_COLOR_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_F(ARB_vertex_buffer_object, pname);
+ *params = (GLfloat) ctx->Array.Color.BufferObj->Name;
+ break;
+ case GL_INDEX_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_F(ARB_vertex_buffer_object, pname);
+ *params = (GLfloat) ctx->Array.Index.BufferObj->Name;
+ break;
+ case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_F(ARB_vertex_buffer_object, pname);
+ *params = (GLfloat) ctx->Array.TexCoord[clientUnit].BufferObj->Name;
+ break;
+ case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_F(ARB_vertex_buffer_object, pname);
+ *params = (GLfloat) ctx->Array.EdgeFlag.BufferObj->Name;
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_F(ARB_vertex_buffer_object, pname);
+ *params = (GLfloat) ctx->Array.SecondaryColor.BufferObj->Name;
+ break;
+ case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_F(ARB_vertex_buffer_object, pname);
+ *params = (GLfloat) ctx->Array.FogCoord.BufferObj->Name;
+ break;
+ /*case GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB: - not supported */
+ case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_F(ARB_vertex_buffer_object, pname);
+ *params = (GLfloat) ctx->Array.ElementArrayBufferObj->Name;
+ break;
+#endif
+
+#if FEATURE_ARB_fragment_program
+ case GL_FRAGMENT_PROGRAM_ARB:
+ CHECK_EXTENSION_F(ARB_fragment_program, pname);
+ *params = (GLfloat) ctx->FragmentProgram.Enabled;
+ break;
+ case GL_TRANSPOSE_CURRENT_MATRIX_ARB:
+ CHECK_EXTENSION_F(ARB_fragment_program, pname);
+ params[0] = ctx->CurrentStack->Top->m[0];
+ params[1] = ctx->CurrentStack->Top->m[4];
+ params[2] = ctx->CurrentStack->Top->m[8];
+ params[3] = ctx->CurrentStack->Top->m[12];
+ params[4] = ctx->CurrentStack->Top->m[1];
+ params[5] = ctx->CurrentStack->Top->m[5];
+ params[6] = ctx->CurrentStack->Top->m[9];
+ params[7] = ctx->CurrentStack->Top->m[13];
+ params[8] = ctx->CurrentStack->Top->m[2];
+ params[9] = ctx->CurrentStack->Top->m[6];
+ params[10] = ctx->CurrentStack->Top->m[10];
+ params[11] = ctx->CurrentStack->Top->m[14];
+ params[12] = ctx->CurrentStack->Top->m[3];
+ params[13] = ctx->CurrentStack->Top->m[7];
+ params[14] = ctx->CurrentStack->Top->m[11];
+ params[15] = ctx->CurrentStack->Top->m[15];
+ break;
+ /* Remaining ARB_fragment_program queries alias with
+ * the GL_NV_fragment_program queries.
+ */
+#endif
+
+ /* GL_EXT_depth_bounds_test */
+ case GL_DEPTH_BOUNDS_TEST_EXT:
+ CHECK_EXTENSION_F(EXT_depth_bounds_test, pname);
+ params[0] = (GLfloat) ctx->Depth.BoundsTest;
+ break;
+ case GL_DEPTH_BOUNDS_EXT:
+ CHECK_EXTENSION_F(EXT_depth_bounds_test, pname);
+ params[0] = ctx->Depth.BoundsMin;
+ params[1] = ctx->Depth.BoundsMax;
+ break;
+
+#if FEATURE_MESA_program_debug
+ case GL_FRAGMENT_PROGRAM_CALLBACK_MESA:
+ CHECK_EXTENSION_F(MESA_program_debug, pname);
+ *params = (GLfloat) ctx->FragmentProgram.CallbackEnabled;
+ break;
+ case GL_VERTEX_PROGRAM_CALLBACK_MESA:
+ CHECK_EXTENSION_F(MESA_program_debug, pname);
+ *params = (GLfloat) ctx->VertexProgram.CallbackEnabled;
+ break;
+ case GL_FRAGMENT_PROGRAM_POSITION_MESA:
+ CHECK_EXTENSION_F(MESA_program_debug, pname);
+ *params = (GLfloat) ctx->FragmentProgram.CurrentPosition;
+ break;
+ case GL_VERTEX_PROGRAM_POSITION_MESA:
+ CHECK_EXTENSION_F(MESA_program_debug, pname);
+ *params = (GLfloat) ctx->VertexProgram.CurrentPosition;
+ break;
+#endif
default:
- gl_error( ctx, GL_INVALID_ENUM, "glGetFloatv" );
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv(0x%x)", pname);
}
}
-
-
-void
+/**
+ * Get the value(s) of a selected parameter.
+ *
+ * \param pname parameter to be returned.
+ * \param params will hold the value(s) of the speficifed parameter.
+ *
+ * \sa glGetIntegerv().
+ *
+ * Tries to get the specified parameter via dd_function_table::GetIntegerv,
+ * otherwise gets the specified parameter from the current context, converting
+ * it value into GLinteger.
+ */
+void GLAPIENTRY
_mesa_GetIntegerv( GLenum pname, GLint *params )
{
GET_CURRENT_CONTEXT(ctx);
GLuint i;
- GLuint texUnit = ctx->Texture.CurrentUnit;
- GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit;
+ const GLuint clientUnit = ctx->Array.ActiveTexture;
+ const GLuint texUnit = ctx->Texture.CurrentUnit;
const struct gl_texture_unit *textureUnit = &ctx->Texture.Unit[texUnit];
ASSERT_OUTSIDE_BEGIN_END(ctx);
return;
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glGetIntegerv %s\n", gl_lookup_enum_by_nr(pname));
+ _mesa_debug(ctx, "glGetIntegerv %s\n", _mesa_lookup_enum_by_nr(pname));
+
+ if (!ctx->_CurrentProgram) {
+ /* We need this in order to get correct results for
+ * GL_OCCLUSION_TEST_RESULT_HP. There might be other important cases.
+ */
+ FLUSH_VERTICES(ctx, 0);
+ }
if (ctx->Driver.GetIntegerv
&& (*ctx->Driver.GetIntegerv)(ctx, pname, params))
*params = (GLint) ctx->Color.AlphaEnabled;
break;
case GL_ALPHA_TEST_REF:
- *params = FLOAT_TO_INT( (GLfloat) ctx->Color.AlphaRef / CHAN_MAXF );
+ *params = FLOAT_TO_INT(ctx->Color.AlphaRef);
break;
case GL_ALPHA_TEST_FUNC:
*params = (GLint) ctx->Color.AlphaFunc;
case GL_CLIP_PLANE3:
case GL_CLIP_PLANE4:
case GL_CLIP_PLANE5:
- i = (GLint) (pname - GL_CLIP_PLANE0);
- *params = (GLint) ctx->Transform.ClipEnabled[i];
+ if (ctx->Transform.ClipPlanesEnabled & (1 << (pname - GL_CLIP_PLANE0)))
+ *params = 1;
+ else
+ *params = 0;
break;
case GL_COLOR_CLEAR_VALUE:
- params[0] = FLOAT_TO_INT( CHAN_TO_FLOAT(ctx->Color.ClearColor[0]) );
- params[1] = FLOAT_TO_INT( CHAN_TO_FLOAT(ctx->Color.ClearColor[1]) );
- params[2] = FLOAT_TO_INT( CHAN_TO_FLOAT(ctx->Color.ClearColor[2]) );
- params[3] = FLOAT_TO_INT( CHAN_TO_FLOAT(ctx->Color.ClearColor[3]) );
+ params[0] = FLOAT_TO_INT( (ctx->Color.ClearColor[0]) );
+ params[1] = FLOAT_TO_INT( (ctx->Color.ClearColor[1]) );
+ params[2] = FLOAT_TO_INT( (ctx->Color.ClearColor[2]) );
+ params[3] = FLOAT_TO_INT( (ctx->Color.ClearColor[3]) );
break;
case GL_COLOR_MATERIAL:
*params = (GLint) ctx->Light.ColorMaterialEnabled;
break;
case GL_CURRENT_COLOR:
FLUSH_CURRENT(ctx, 0);
- params[0] = FLOAT_TO_INT( CHAN_TO_FLOAT( ctx->Current.Color[0] ) );
- params[1] = FLOAT_TO_INT( CHAN_TO_FLOAT( ctx->Current.Color[1] ) );
- params[2] = FLOAT_TO_INT( CHAN_TO_FLOAT( ctx->Current.Color[2] ) );
- params[3] = FLOAT_TO_INT( CHAN_TO_FLOAT( ctx->Current.Color[3] ) );
+ params[0] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]);
+ params[1] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]);
+ params[2] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]);
+ params[3] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]);
break;
case GL_CURRENT_INDEX:
FLUSH_CURRENT(ctx, 0);
break;
case GL_CURRENT_NORMAL:
FLUSH_CURRENT(ctx, 0);
- params[0] = FLOAT_TO_INT( ctx->Current.Normal[0] );
- params[1] = FLOAT_TO_INT( ctx->Current.Normal[1] );
- params[2] = FLOAT_TO_INT( ctx->Current.Normal[2] );
+ params[0] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0]);
+ params[1] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1]);
+ params[2] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2]);
break;
case GL_CURRENT_RASTER_COLOR:
params[0] = FLOAT_TO_INT( ctx->Current.RasterColor[0] );
params[3] = (GLint) ctx->Current.RasterPos[3];
break;
case GL_CURRENT_RASTER_TEXTURE_COORDS:
- params[0] = (GLint) ctx->Current.RasterMultiTexCoord[texTransformUnit][0];
- params[1] = (GLint) ctx->Current.RasterMultiTexCoord[texTransformUnit][1];
- params[2] = (GLint) ctx->Current.RasterMultiTexCoord[texTransformUnit][2];
- params[3] = (GLint) ctx->Current.RasterMultiTexCoord[texTransformUnit][3];
+ params[0] = (GLint) ctx->Current.RasterTexCoords[texUnit][0];
+ params[1] = (GLint) ctx->Current.RasterTexCoords[texUnit][1];
+ params[2] = (GLint) ctx->Current.RasterTexCoords[texUnit][2];
+ params[3] = (GLint) ctx->Current.RasterTexCoords[texUnit][3];
break;
case GL_CURRENT_RASTER_POSITION_VALID:
*params = (GLint) ctx->Current.RasterPosValid;
break;
case GL_CURRENT_TEXTURE_COORDS:
FLUSH_CURRENT(ctx, 0);
- params[0] = (GLint) ctx->Current.Texcoord[texTransformUnit][0];
- params[1] = (GLint) ctx->Current.Texcoord[texTransformUnit][1];
- params[2] = (GLint) ctx->Current.Texcoord[texTransformUnit][2];
- params[3] = (GLint) ctx->Current.Texcoord[texTransformUnit][3];
+ params[0] = (GLint) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][0];
+ params[1] = (GLint) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][1];
+ params[2] = (GLint) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][2];
+ params[3] = (GLint) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3];
break;
case GL_DEPTH_BIAS:
*params = (GLint) ctx->Pixel.DepthBias;
case GL_GREEN_SCALE:
*params = (GLint) ctx->Pixel.GreenScale;
break;
- case GL_HISTOGRAM:
- if (ctx->Extensions.EXT_histogram || ctx->Extensions.ARB_imaging) {
- *params = (GLint) ctx->Pixel.HistogramEnabled;
- }
- else {
- gl_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
- return;
- }
- break;
case GL_INDEX_BITS:
*params = (GLint) ctx->Visual.indexBits;
break;
*params = (GLint) ctx->List.ListBase;
break;
case GL_LIST_INDEX:
- *params = (GLint) ctx->CurrentListNum;
+ *params = (GLint) ctx->ListState.CurrentListNum;
break;
case GL_LIST_MODE:
- *params = ctx->ExecuteFlag ? (GLint) GL_COMPILE_AND_EXECUTE
- : (GLint) GL_COMPILE;
+ if (!ctx->CompileFlag)
+ *params = 0;
+ else if (ctx->ExecuteFlag)
+ *params = (GLint) GL_COMPILE_AND_EXECUTE;
+ else
+ *params = (GLint) GL_COMPILE;
break;
case GL_INDEX_LOGIC_OP:
*params = (GLint) ctx->Color.IndexLogicOpEnabled;
*params = (GLint) MAX_PROJECTION_STACK_DEPTH;
break;
case GL_MAX_TEXTURE_SIZE:
+ *params = (1 << (ctx->Const.MaxTextureLevels - 1));
+ break;
case GL_MAX_3D_TEXTURE_SIZE:
- *params = ctx->Const.MaxTextureSize;
+ *params = (1 << (ctx->Const.Max3DTextureLevels - 1));
break;
case GL_MAX_TEXTURE_STACK_DEPTH:
*params = (GLint) MAX_TEXTURE_STACK_DEPTH;
params[0] = (GLint) MAX_WIDTH;
params[1] = (GLint) MAX_HEIGHT;
break;
- case GL_MINMAX:
- *params = (GLint) ctx->Pixel.MinMaxEnabled;
- break;
case GL_MODELVIEW_MATRIX:
for (i=0;i<16;i++) {
- params[i] = (GLint) ctx->ModelView.m[i];
+ params[i] = (GLint) ctx->ModelviewMatrixStack.Top->m[i];
}
break;
case GL_MODELVIEW_STACK_DEPTH:
- *params = (GLint) (ctx->ModelViewStackDepth + 1);
+ *params = (GLint) (ctx->ModelviewMatrixStack.Depth + 1);
break;
case GL_NAME_STACK_DEPTH:
*params = (GLint) ctx->Select.NameStackDepth;
case GL_PACK_IMAGE_HEIGHT_EXT:
*params = ctx->Pack.ImageHeight;
break;
+ case GL_PACK_INVERT_MESA:
+ *params = ctx->Pack.Invert;
+ break;
case GL_PERSPECTIVE_CORRECTION_HINT:
*params = (GLint) ctx->Hint.PerspectiveCorrection;
break;
break;
case GL_PROJECTION_MATRIX:
for (i=0;i<16;i++) {
- params[i] = (GLint) ctx->ProjectionMatrix.m[i];
+ params[i] = (GLint) ctx->ProjectionMatrixStack.Top->m[i];
}
break;
case GL_PROJECTION_STACK_DEPTH:
- *params = (GLint) (ctx->ProjectionStackDepth + 1);
+ *params = (GLint) (ctx->ProjectionMatrixStack.Depth + 1);
break;
case GL_READ_BUFFER:
*params = (GLint) ctx->Pixel.ReadBuffer;
*params = (GLint) ctx->Stencil.Clear;
break;
case GL_STENCIL_FAIL:
- *params = (GLint) ctx->Stencil.FailFunc;
+ *params = (GLint) ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace];
break;
case GL_STENCIL_FUNC:
- *params = (GLint) ctx->Stencil.Function;
+ *params = (GLint) ctx->Stencil.Function[ctx->Stencil.ActiveFace];
break;
case GL_STENCIL_PASS_DEPTH_FAIL:
- *params = (GLint) ctx->Stencil.ZFailFunc;
+ *params = (GLint) ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace];
break;
case GL_STENCIL_PASS_DEPTH_PASS:
- *params = (GLint) ctx->Stencil.ZPassFunc;
+ *params = (GLint) ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace];
break;
case GL_STENCIL_REF:
- *params = (GLint) ctx->Stencil.Ref;
+ *params = (GLint) ctx->Stencil.Ref[ctx->Stencil.ActiveFace];
break;
case GL_STENCIL_TEST:
*params = (GLint) ctx->Stencil.Enabled;
break;
case GL_STENCIL_VALUE_MASK:
- *params = (GLint) ctx->Stencil.ValueMask;
+ *params = (GLint) ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace];
break;
case GL_STENCIL_WRITEMASK:
- *params = (GLint) ctx->Stencil.WriteMask;
+ *params = (GLint) ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace];
break;
case GL_STEREO:
*params = (GLint) ctx->Visual.stereoMode;
break;
case GL_TEXTURE_MATRIX:
for (i=0;i<16;i++) {
- params[i] = (GLint) ctx->TextureMatrix[texTransformUnit].m[i];
+ params[i] = (GLint) ctx->TextureMatrixStack[texUnit].Top->m[i];
}
break;
case GL_TEXTURE_STACK_DEPTH:
- *params = (GLint) (ctx->TextureStackDepth[texTransformUnit] + 1);
+ *params = (GLint) (ctx->TextureMatrixStack[texUnit].Depth + 1);
break;
case GL_UNPACK_ALIGNMENT:
*params = ctx->Unpack.Alignment;
case GL_UNPACK_IMAGE_HEIGHT_EXT:
*params = ctx->Unpack.ImageHeight;
break;
+ case GL_UNPACK_CLIENT_STORAGE_APPLE:
+ *params = ctx->Unpack.ClientStorage;
+ break;
case GL_VIEWPORT:
params[0] = (GLint) ctx->Viewport.X;
params[1] = (GLint) ctx->Viewport.Y;
*params = 0;
break;
case GL_TEXTURE_COORD_ARRAY:
- *params = (GLint) ctx->Array.TexCoord[texUnit].Enabled;
+ *params = (GLint) ctx->Array.TexCoord[clientUnit].Enabled;
break;
case GL_TEXTURE_COORD_ARRAY_SIZE:
- *params = ctx->Array.TexCoord[texUnit].Size;
+ *params = ctx->Array.TexCoord[clientUnit].Size;
break;
case GL_TEXTURE_COORD_ARRAY_TYPE:
- *params = ctx->Array.TexCoord[texUnit].Type;
+ *params = ctx->Array.TexCoord[clientUnit].Type;
break;
case GL_TEXTURE_COORD_ARRAY_STRIDE:
- *params = ctx->Array.TexCoord[texUnit].Stride;
+ *params = ctx->Array.TexCoord[clientUnit].Stride;
break;
case GL_TEXTURE_COORD_ARRAY_COUNT_EXT:
*params = 0;
/* GL_ARB_multitexture */
case GL_MAX_TEXTURE_UNITS_ARB:
- *params = ctx->Const.MaxTextureUnits;
+ CHECK_EXTENSION_I(ARB_multitexture, pname);
+ *params = MIN2(ctx->Const.MaxTextureImageUnits,
+ ctx->Const.MaxTextureCoordUnits);
break;
case GL_ACTIVE_TEXTURE_ARB:
+ CHECK_EXTENSION_I(ARB_multitexture, pname);
*params = GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit;
break;
case GL_CLIENT_ACTIVE_TEXTURE_ARB:
- *params = GL_TEXTURE0_ARB + ctx->Array.ActiveTexture;
+ CHECK_EXTENSION_I(ARB_multitexture, pname);
+ *params = GL_TEXTURE0_ARB + clientUnit;
break;
/* GL_ARB_texture_cube_map */
case GL_TEXTURE_CUBE_MAP_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- *params = (GLint) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
- else
- gl_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
- return;
+ CHECK_EXTENSION_I(ARB_texture_cube_map, pname);
+ *params = (GLint) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
+ break;
case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- *params = textureUnit->CurrentCubeMap->Name;
- else
- gl_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
- return;
+ CHECK_EXTENSION_I(ARB_texture_cube_map, pname);
+ *params = textureUnit->CurrentCubeMap->Name;
+ break;
case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- *params = ctx->Const.MaxCubeTextureSize;
- else
- gl_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
- return;
+ CHECK_EXTENSION_I(ARB_texture_cube_map, pname);
+ *params = (1 << (ctx->Const.MaxCubeTextureLevels - 1));
+ break;
/* GL_ARB_texture_compression */
case GL_TEXTURE_COMPRESSION_HINT_ARB:
- if (ctx->Extensions.ARB_texture_compression) {
- *params = (GLint) ctx->Hint.TextureCompression;
- }
- else
- gl_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
+ CHECK_EXTENSION_I(ARB_texture_compression, pname);
+ *params = (GLint) ctx->Hint.TextureCompression;
break;
case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
- if (ctx->Extensions.ARB_texture_compression) {
- *params = (GLint) ctx->Const.NumCompressedTextureFormats;
- }
- else
- gl_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
+ CHECK_EXTENSION_I(ARB_texture_compression, pname);
+ *params = (GLint) _mesa_get_compressed_formats(ctx, NULL);
break;
case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
- if (ctx->Extensions.ARB_texture_compression) {
- GLuint i;
- for (i = 0; i < ctx->Const.NumCompressedTextureFormats; i++)
- params[i] = (GLint) ctx->Const.CompressedTextureFormats[i];
- }
- else
- gl_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
+ CHECK_EXTENSION_I(ARB_texture_compression, pname);
+ (void) _mesa_get_compressed_formats(ctx, params);
break;
/* GL_EXT_compiled_vertex_array */
case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT:
+ CHECK_EXTENSION_I(EXT_compiled_vertex_array, pname);
*params = ctx->Array.LockFirst;
break;
case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT:
+ CHECK_EXTENSION_I(EXT_compiled_vertex_array, pname);
*params = ctx->Array.LockCount;
break;
-
+
/* GL_ARB_transpose_matrix */
case GL_TRANSPOSE_COLOR_MATRIX_ARB:
{
GLfloat tm[16];
GLuint i;
- _math_transposef(tm, ctx->ColorMatrix.m);
+ _math_transposef(tm, ctx->ColorMatrixStack.Top->m);
for (i=0;i<16;i++) {
params[i] = (GLint) tm[i];
}
{
GLfloat tm[16];
GLuint i;
- _math_transposef(tm, ctx->ModelView.m);
+ _math_transposef(tm, ctx->ModelviewMatrixStack.Top->m);
for (i=0;i<16;i++) {
params[i] = (GLint) tm[i];
}
{
GLfloat tm[16];
GLuint i;
- _math_transposef(tm, ctx->ProjectionMatrix.m);
+ _math_transposef(tm, ctx->ProjectionMatrixStack.Top->m);
for (i=0;i<16;i++) {
params[i] = (GLint) tm[i];
}
{
GLfloat tm[16];
GLuint i;
- _math_transposef(tm, ctx->TextureMatrix[texTransformUnit].m);
+ _math_transposef(tm, ctx->TextureMatrixStack[texUnit].Top->m);
for (i=0;i<16;i++) {
params[i] = (GLint) tm[i];
}
/* GL_HP_occlusion_test */
case GL_OCCLUSION_TEST_HP:
- if (ctx->Extensions.HP_occlusion_test) {
- *params = (GLint) ctx->Depth.OcclusionTest;
- }
- else {
- gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
- }
- return;
+ CHECK_EXTENSION_I(HP_occlusion_test, pname);
+ *params = (GLint) ctx->Depth.OcclusionTest;
+ break;
case GL_OCCLUSION_TEST_RESULT_HP:
- if (ctx->Extensions.HP_occlusion_test) {
- if (ctx->Depth.OcclusionTest)
- *params = (GLint) ctx->OcclusionResult;
- else
- *params = (GLint) ctx->OcclusionResultSaved;
- /* reset flag now */
- ctx->OcclusionResult = GL_FALSE;
- ctx->OcclusionResultSaved = GL_FALSE;
- }
- else {
- gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
- }
- return;
+ CHECK_EXTENSION_I(HP_occlusion_test, pname);
+ if (ctx->Depth.OcclusionTest)
+ *params = (GLint) ctx->OcclusionResult;
+ else
+ *params = (GLint) ctx->OcclusionResultSaved;
+ /* reset flag now */
+ ctx->OcclusionResult = GL_FALSE;
+ ctx->OcclusionResultSaved = GL_FALSE;
+ break;
/* GL_SGIS_pixel_texture */
case GL_PIXEL_TEXTURE_SGIS:
+ CHECK_EXTENSION_I(SGIS_pixel_texture, pname);
*params = (GLint) ctx->Pixel.PixelTextureEnabled;
break;
/* GL_SGIX_pixel_texture */
case GL_PIXEL_TEX_GEN_SGIX:
+ CHECK_EXTENSION_I(SGIX_pixel_texture, pname);
*params = (GLint) ctx->Pixel.PixelTextureEnabled;
break;
case GL_PIXEL_TEX_GEN_MODE_SGIX:
+ CHECK_EXTENSION_I(SGIX_pixel_texture, pname);
*params = (GLint) pixel_texgen_mode(ctx);
break;
/* GL_SGI_color_matrix (also in 1.2 imaging) */
case GL_COLOR_MATRIX_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix, pname);
for (i=0;i<16;i++) {
- params[i] = (GLint) ctx->ColorMatrix.m[i];
+ params[i] = (GLint) ctx->ColorMatrixStack.Top->m[i];
}
break;
case GL_COLOR_MATRIX_STACK_DEPTH_SGI:
- *params = ctx->ColorStackDepth + 1;
+ CHECK_EXTENSION_I(SGI_color_matrix, pname);
+ *params = ctx->ColorMatrixStack.Depth + 1;
break;
case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix, pname);
*params = MAX_COLOR_STACK_DEPTH;
break;
case GL_POST_COLOR_MATRIX_RED_SCALE_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix, pname);
*params = (GLint) ctx->Pixel.PostColorMatrixScale[0];
break;
case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix, pname);
*params = (GLint) ctx->Pixel.PostColorMatrixScale[1];
break;
case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix, pname);
*params = (GLint) ctx->Pixel.PostColorMatrixScale[2];
break;
case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix, pname);
*params = (GLint) ctx->Pixel.PostColorMatrixScale[3];
break;
case GL_POST_COLOR_MATRIX_RED_BIAS_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix, pname);
*params = (GLint) ctx->Pixel.PostColorMatrixBias[0];
break;
case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix, pname);
*params = (GLint) ctx->Pixel.PostColorMatrixBias[1];
break;
case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix, pname);
*params = (GLint) ctx->Pixel.PostColorMatrixBias[2];
break;
case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix, pname);
*params = (GLint) ctx->Pixel.PostColorMatrixBias[3];
break;
/* GL_EXT_convolution (also in 1.2 imaging) */
case GL_CONVOLUTION_1D_EXT:
- if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) {
- *params = (GLint) ctx->Pixel.Convolution1DEnabled;
- }
- else {
- gl_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
- return;
- }
+ CHECK_EXTENSION_I(EXT_convolution, pname);
+ *params = (GLint) ctx->Pixel.Convolution1DEnabled;
break;
case GL_CONVOLUTION_2D:
- if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) {
- *params = (GLint) ctx->Pixel.Convolution2DEnabled;
- }
- else {
- gl_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
- return;
- }
+ CHECK_EXTENSION_I(EXT_convolution, pname);
+ *params = (GLint) ctx->Pixel.Convolution2DEnabled;
break;
case GL_SEPARABLE_2D:
- if (ctx->Extensions.EXT_convolution || ctx->Extensions.ARB_imaging) {
- *params = (GLint) ctx->Pixel.Separable2DEnabled;
- }
- else {
- gl_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
- return;
- }
- break;
- case GL_MAX_CONVOLUTION_WIDTH:
- *params = ctx->Const.MaxConvolutionWidth;
- break;
- case GL_MAX_CONVOLUTION_HEIGHT:
- *params = ctx->Const.MaxConvolutionHeight;
+ CHECK_EXTENSION_I(EXT_convolution, pname);
+ *params = (GLint) ctx->Pixel.Separable2DEnabled;
break;
case GL_POST_CONVOLUTION_RED_SCALE_EXT:
+ CHECK_EXTENSION_I(EXT_convolution, pname);
*params = (GLint) ctx->Pixel.PostConvolutionScale[0];
break;
case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:
+ CHECK_EXTENSION_I(EXT_convolution, pname);
*params = (GLint) ctx->Pixel.PostConvolutionScale[1];
break;
case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:
+ CHECK_EXTENSION_I(EXT_convolution, pname);
*params = (GLint) ctx->Pixel.PostConvolutionScale[2];
break;
case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:
+ CHECK_EXTENSION_I(EXT_convolution, pname);
*params = (GLint) ctx->Pixel.PostConvolutionScale[3];
break;
case GL_POST_CONVOLUTION_RED_BIAS_EXT:
+ CHECK_EXTENSION_I(EXT_convolution, pname);
*params = (GLint) ctx->Pixel.PostConvolutionBias[0];
break;
case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:
+ CHECK_EXTENSION_I(EXT_convolution, pname);
*params = (GLint) ctx->Pixel.PostConvolutionBias[1];
break;
case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:
+ CHECK_EXTENSION_I(EXT_convolution, pname);
*params = (GLint) ctx->Pixel.PostConvolutionBias[2];
break;
case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:
+ CHECK_EXTENSION_I(EXT_convolution, pname);
*params = (GLint) ctx->Pixel.PostConvolutionBias[2];
break;
+ /* GL_EXT_histogram (also in 1.2 imaging) */
+ case GL_HISTOGRAM:
+ CHECK_EXTENSION_I(EXT_histogram, pname);
+ *params = (GLint) ctx->Pixel.HistogramEnabled;
+ break;
+ case GL_MINMAX:
+ CHECK_EXTENSION_I(EXT_histogram, pname);
+ *params = (GLint) ctx->Pixel.MinMaxEnabled;
+ break;
+
/* GL_SGI_color_table (also in 1.2 imaging */
case GL_COLOR_TABLE_SGI:
+ CHECK_EXTENSION_I(SGI_color_table, pname);
*params = (GLint) ctx->Pixel.ColorTableEnabled;
break;
case GL_POST_CONVOLUTION_COLOR_TABLE_SGI:
+ CHECK_EXTENSION_I(SGI_color_table, pname);
*params = (GLint) ctx->Pixel.PostConvolutionColorTableEnabled;
break;
case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
+ CHECK_EXTENSION_I(SGI_color_table, pname);
*params = (GLint) ctx->Pixel.PostColorMatrixColorTableEnabled;
break;
+ /* GL_SGI_texture_color_table */
+ case GL_TEXTURE_COLOR_TABLE_SGI:
+ CHECK_EXTENSION_I(SGI_texture_color_table, pname);
+ *params = (GLint) textureUnit->ColorTableEnabled;
+ break;
/* GL_EXT_secondary_color */
case GL_COLOR_SUM_EXT:
+ CHECK_EXTENSION_I(EXT_secondary_color, pname);
*params = (GLint) ctx->Fog.ColorSumEnabled;
break;
case GL_CURRENT_SECONDARY_COLOR_EXT:
+ CHECK_EXTENSION_I(EXT_secondary_color, pname);
FLUSH_CURRENT(ctx, 0);
- params[0] = FLOAT_TO_INT( CHAN_TO_FLOAT(ctx->Current.SecondaryColor[0]) );
- params[1] = FLOAT_TO_INT( CHAN_TO_FLOAT(ctx->Current.SecondaryColor[1]) );
- params[2] = FLOAT_TO_INT( CHAN_TO_FLOAT(ctx->Current.SecondaryColor[2]) );
+ params[0] = FLOAT_TO_INT( (ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0]) );
+ params[1] = FLOAT_TO_INT( (ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1]) );
+ params[2] = FLOAT_TO_INT( (ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2]) );
+ params[3] = FLOAT_TO_INT( (ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3]) );
break;
case GL_SECONDARY_COLOR_ARRAY_EXT:
+ CHECK_EXTENSION_I(EXT_secondary_color, pname);
*params = (GLint) ctx->Array.SecondaryColor.Enabled;
break;
case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT:
+ CHECK_EXTENSION_I(EXT_secondary_color, pname);
*params = (GLint) ctx->Array.SecondaryColor.Type;
break;
case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT:
+ CHECK_EXTENSION_I(EXT_secondary_color, pname);
*params = (GLint) ctx->Array.SecondaryColor.Stride;
break;
case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT:
- *params = (GLint) ctx->Array.SecondaryColor.Stride;
+ CHECK_EXTENSION_I(EXT_secondary_color, pname);
+ *params = (GLint) ctx->Array.SecondaryColor.Size;
break;
/* GL_EXT_fog_coord */
case GL_CURRENT_FOG_COORDINATE_EXT:
- if (ctx->Extensions.EXT_fog_coord) {
- FLUSH_CURRENT(ctx, 0);
- *params = (GLint) ctx->Current.FogCoord;
- }
- else {
- gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
- }
+ CHECK_EXTENSION_I(EXT_fog_coord, pname);
+ FLUSH_CURRENT(ctx, 0);
+ *params = (GLint) ctx->Current.Attrib[VERT_ATTRIB_FOG][0];
break;
case GL_FOG_COORDINATE_ARRAY_EXT:
- if (ctx->Extensions.EXT_fog_coord) {
- *params = (GLint) ctx->Array.FogCoord.Enabled;
- }
- else {
- gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
- }
+ CHECK_EXTENSION_I(EXT_fog_coord, pname);
+ *params = (GLint) ctx->Array.FogCoord.Enabled;
break;
case GL_FOG_COORDINATE_ARRAY_TYPE_EXT:
- if (ctx->Extensions.EXT_fog_coord) {
- *params = (GLint) ctx->Array.FogCoord.Type;
- }
- else {
- gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
- }
+ CHECK_EXTENSION_I(EXT_fog_coord, pname);
+ *params = (GLint) ctx->Array.FogCoord.Type;
break;
case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT:
- if (ctx->Extensions.EXT_fog_coord) {
- *params = (GLint) ctx->Array.FogCoord.Stride;
- }
- else {
- gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
- }
+ CHECK_EXTENSION_I(EXT_fog_coord, pname);
+ *params = (GLint) ctx->Array.FogCoord.Stride;
+ break;
+ case GL_FOG_COORDINATE_SOURCE_EXT:
+ CHECK_EXTENSION_I(EXT_fog_coord, pname);
+ *params = (GLint) ctx->Fog.FogCoordinateSource;
break;
- /* GL_MESA_sprite_point */
- case GL_SPRITE_POINT_MESA:
- if (ctx->Extensions.MESA_sprite_point) {
- *params = (GLint) ctx->Point.SpriteMode;
+ /* GL_EXT_texture_lod_bias */
+ case GL_MAX_TEXTURE_LOD_BIAS_EXT:
+ *params = (GLint) ctx->Const.MaxTextureLodBias;
+ break;
+
+ /* GL_EXT_texture_filter_anisotropic */
+ case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
+ CHECK_EXTENSION_I(EXT_texture_filter_anisotropic, pname);
+ *params = (GLint) ctx->Const.MaxTextureMaxAnisotropy;
+ break;
+
+ /* GL_ARB_multisample */
+ case GL_MULTISAMPLE_ARB:
+ CHECK_EXTENSION_I(ARB_multisample, pname);
+ *params = (GLint) ctx->Multisample.Enabled;
+ break;
+ case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
+ CHECK_EXTENSION_I(ARB_multisample, pname);
+ *params = (GLint) ctx->Multisample.SampleAlphaToCoverage;
+ break;
+ case GL_SAMPLE_ALPHA_TO_ONE_ARB:
+ CHECK_EXTENSION_I(ARB_multisample, pname);
+ *params = (GLint) ctx->Multisample.SampleAlphaToOne;
+ break;
+ case GL_SAMPLE_COVERAGE_ARB:
+ CHECK_EXTENSION_I(ARB_multisample, pname);
+ *params = (GLint) ctx->Multisample.SampleCoverage;
+ break;
+ case GL_SAMPLE_COVERAGE_VALUE_ARB:
+ CHECK_EXTENSION_I(ARB_multisample, pname);
+ *params = (GLint) ctx->Multisample.SampleCoverageValue;
+ break;
+ case GL_SAMPLE_COVERAGE_INVERT_ARB:
+ CHECK_EXTENSION_I(ARB_multisample, pname);
+ *params = (GLint) ctx->Multisample.SampleCoverageInvert;
+ break;
+ case GL_SAMPLE_BUFFERS_ARB:
+ CHECK_EXTENSION_I(ARB_multisample, pname);
+ *params = 0; /* XXX fix someday */
+ break;
+ case GL_SAMPLES_ARB:
+ CHECK_EXTENSION_I(ARB_multisample, pname);
+ *params = 0; /* XXX fix someday */
+ break;
+
+ /* GL_IBM_rasterpos_clip */
+ case GL_RASTER_POSITION_UNCLIPPED_IBM:
+ CHECK_EXTENSION_I(IBM_rasterpos_clip, pname);
+ *params = (GLint) ctx->Transform.RasterPositionUnclipped;
+ break;
+
+ /* GL_NV_point_sprite */
+ case GL_POINT_SPRITE_NV:
+ CHECK_EXTENSION2_I(NV_point_sprite, ARB_point_sprite, pname);
+ *params = (GLint) ctx->Point.PointSprite;
+ break;
+ case GL_POINT_SPRITE_R_MODE_NV:
+ CHECK_EXTENSION_I(NV_point_sprite, pname);
+ *params = (GLint) ctx->Point.SpriteRMode;
+ break;
+
+ /* GL_SGIS_generate_mipmap */
+ case GL_GENERATE_MIPMAP_HINT_SGIS:
+ CHECK_EXTENSION_I(SGIS_generate_mipmap, pname);
+ *params = (GLint) ctx->Hint.GenerateMipmap;
+ break;
+
+#if FEATURE_NV_vertex_program
+ case GL_VERTEX_PROGRAM_NV:
+ CHECK_EXTENSION_I(NV_vertex_program, pname);
+ *params = (GLint) ctx->VertexProgram.Enabled;
+ break;
+ case GL_VERTEX_PROGRAM_POINT_SIZE_NV:
+ CHECK_EXTENSION_I(NV_vertex_program, pname);
+ *params = (GLint) ctx->VertexProgram.PointSizeEnabled;
+ break;
+ case GL_VERTEX_PROGRAM_TWO_SIDE_NV:
+ CHECK_EXTENSION_I(NV_vertex_program, pname);
+ *params = (GLint) ctx->VertexProgram.TwoSideEnabled;
+ break;
+ case GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV:
+ CHECK_EXTENSION_I(NV_vertex_program, pname);
+ *params = ctx->Const.MaxProgramMatrixStackDepth;
+ break;
+ case GL_MAX_TRACK_MATRICES_NV:
+ CHECK_EXTENSION_I(NV_vertex_program, pname);
+ *params = ctx->Const.MaxProgramMatrices;
+ break;
+ case GL_CURRENT_MATRIX_STACK_DEPTH_NV:
+ CHECK_EXTENSION_I(NV_vertex_program, pname);
+ *params = ctx->CurrentStack->Depth + 1;
+ break;
+ case GL_CURRENT_MATRIX_NV:
+ CHECK_EXTENSION_I(NV_vertex_program, pname);
+ for (i = 0; i < 16; i++)
+ params[i] = (GLint) ctx->CurrentStack->Top->m[i];
+ break;
+ case GL_VERTEX_PROGRAM_BINDING_NV:
+ CHECK_EXTENSION_I(NV_vertex_program, pname);
+ if (ctx->VertexProgram.Current)
+ *params = (GLint) ctx->VertexProgram.Current->Base.Id;
+ else
+ *params = 0;
+ break;
+ case GL_PROGRAM_ERROR_POSITION_NV:
+ CHECK_EXTENSION_I(NV_vertex_program, pname);
+ *params = (GLint) ctx->Program.ErrorPos;
+ break;
+ case GL_VERTEX_ATTRIB_ARRAY0_NV:
+ case GL_VERTEX_ATTRIB_ARRAY1_NV:
+ case GL_VERTEX_ATTRIB_ARRAY2_NV:
+ case GL_VERTEX_ATTRIB_ARRAY3_NV:
+ case GL_VERTEX_ATTRIB_ARRAY4_NV:
+ case GL_VERTEX_ATTRIB_ARRAY5_NV:
+ case GL_VERTEX_ATTRIB_ARRAY6_NV:
+ case GL_VERTEX_ATTRIB_ARRAY7_NV:
+ case GL_VERTEX_ATTRIB_ARRAY8_NV:
+ case GL_VERTEX_ATTRIB_ARRAY9_NV:
+ case GL_VERTEX_ATTRIB_ARRAY10_NV:
+ case GL_VERTEX_ATTRIB_ARRAY11_NV:
+ case GL_VERTEX_ATTRIB_ARRAY12_NV:
+ case GL_VERTEX_ATTRIB_ARRAY13_NV:
+ case GL_VERTEX_ATTRIB_ARRAY14_NV:
+ case GL_VERTEX_ATTRIB_ARRAY15_NV:
+ CHECK_EXTENSION_I(NV_vertex_program, pname);
+ {
+ GLuint n = (GLuint) pname - GL_VERTEX_ATTRIB_ARRAY0_NV;
+ *params = (GLint) ctx->Array.VertexAttrib[n].Enabled;
}
- else {
- gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
- return;
+ break;
+ case GL_MAP1_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP1_VERTEX_ATTRIB15_4_NV:
+ CHECK_EXTENSION_I(NV_vertex_program, pname);
+ {
+ GLuint n = (GLuint) pname - GL_MAP1_VERTEX_ATTRIB0_4_NV;
+ *params = (GLint) ctx->Eval.Map1Attrib[n];
}
break;
+ case GL_MAP2_VERTEX_ATTRIB0_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB1_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB2_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB3_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB4_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB5_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB6_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB7_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB8_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB9_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB10_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB11_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB12_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB13_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB14_4_NV:
+ case GL_MAP2_VERTEX_ATTRIB15_4_NV:
+ CHECK_EXTENSION_I(NV_vertex_program, pname);
+ {
+ GLuint n = (GLuint) pname - GL_MAP2_VERTEX_ATTRIB0_4_NV;
+ *params = (GLint) ctx->Eval.Map2Attrib[n];
+ }
+ break;
+#endif /* FEATURE_NV_vertex_program */
+
+#if FEATURE_NV_fragment_program
+ case GL_FRAGMENT_PROGRAM_NV:
+ CHECK_EXTENSION_I(NV_fragment_program, pname);
+ *params = (GLint) ctx->FragmentProgram.Enabled;
+ break;
+ case GL_MAX_TEXTURE_COORDS_NV:
+ CHECK_EXTENSION_I(NV_fragment_program, pname);
+ *params = (GLint) ctx->Const.MaxTextureCoordUnits;
+ break;
+ case GL_MAX_TEXTURE_IMAGE_UNITS_NV:
+ CHECK_EXTENSION_I(NV_fragment_program, pname);
+ *params = (GLint) ctx->Const.MaxTextureImageUnits;
+ break;
+ case GL_FRAGMENT_PROGRAM_BINDING_NV:
+ CHECK_EXTENSION_I(NV_fragment_program, pname);
+ if (ctx->FragmentProgram.Current)
+ *params = (GLint) ctx->FragmentProgram.Current->Base.Id;
+ else
+ *params = 0;
+ break;
+ case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV:
+ CHECK_EXTENSION_I(NV_fragment_program, pname);
+ *params = MAX_NV_FRAGMENT_PROGRAM_PARAMS;
+ break;
+#endif /* FEATURE_NV_fragment_program */
+
+ /* GL_NV_texture_rectangle */
+ case GL_TEXTURE_RECTANGLE_NV:
+ CHECK_EXTENSION_I(NV_texture_rectangle, pname);
+ *params = (GLint) _mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV);
+ break;
+ case GL_TEXTURE_BINDING_RECTANGLE_NV:
+ CHECK_EXTENSION_I(NV_texture_rectangle, pname);
+ *params = (GLint) textureUnit->CurrentRect->Name;
+ break;
+ case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV:
+ CHECK_EXTENSION_I(NV_texture_rectangle, pname);
+ *params = (GLint) ctx->Const.MaxTextureRectSize;
+ break;
+
+ /* GL_EXT_stencil_two_side */
+ case GL_STENCIL_TEST_TWO_SIDE_EXT:
+ CHECK_EXTENSION_I(EXT_stencil_two_side, pname);
+ *params = (GLint) ctx->Stencil.TestTwoSide;
+ break;
+ case GL_ACTIVE_STENCIL_FACE_EXT:
+ CHECK_EXTENSION_I(EXT_stencil_two_side, pname);
+ *params = (GLint) (ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT);
+ break;
+
+ /* GL_NV_light_max_exponent */
+ case GL_MAX_SHININESS_NV:
+ *params = (GLint) ctx->Const.MaxShininess;
+ break;
+ case GL_MAX_SPOT_EXPONENT_NV:
+ *params = (GLint) ctx->Const.MaxSpotExponent;
+ break;
+
+#if FEATURE_ARB_vertex_buffer_object
+ case GL_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_I(ARB_vertex_buffer_object, pname);
+ *params = (GLint) ctx->Array.ArrayBufferObj->Name;
+ break;
+ case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_I(ARB_vertex_buffer_object, pname);
+ *params = (GLint) ctx->Array.Vertex.BufferObj->Name;
+ break;
+ case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_I(ARB_vertex_buffer_object, pname);
+ *params = (GLint) ctx->Array.Normal.BufferObj->Name;
+ break;
+ case GL_COLOR_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_I(ARB_vertex_buffer_object, pname);
+ *params = (GLint) ctx->Array.Color.BufferObj->Name;
+ break;
+ case GL_INDEX_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_I(ARB_vertex_buffer_object, pname);
+ *params = (GLint) ctx->Array.Index.BufferObj->Name;
+ break;
+ case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_I(ARB_vertex_buffer_object, pname);
+ *params = (GLint) ctx->Array.TexCoord[clientUnit].BufferObj->Name;
+ break;
+ case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_I(ARB_vertex_buffer_object, pname);
+ *params = (GLint) ctx->Array.EdgeFlag.BufferObj->Name;
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_I(ARB_vertex_buffer_object, pname);
+ *params = (GLint) ctx->Array.SecondaryColor.BufferObj->Name;
+ break;
+ case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_I(ARB_vertex_buffer_object, pname);
+ *params = (GLint) ctx->Array.FogCoord.BufferObj->Name;
+ break;
+ /*case GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB: - not supported */
+ case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB:
+ CHECK_EXTENSION_I(ARB_vertex_buffer_object, pname);
+ *params = (GLint) ctx->Array.ElementArrayBufferObj->Name;
+ break;
+#endif
+
+#if FEATURE_ARB_fragment_program
+ case GL_FRAGMENT_PROGRAM_ARB:
+ CHECK_EXTENSION_I(ARB_fragment_program, pname);
+ *params = ctx->FragmentProgram.Enabled;
+ break;
+ case GL_TRANSPOSE_CURRENT_MATRIX_ARB:
+ CHECK_EXTENSION_I(ARB_fragment_program, pname);
+ params[0] = (GLint) ctx->CurrentStack->Top->m[0];
+ params[1] = (GLint) ctx->CurrentStack->Top->m[4];
+ params[2] = (GLint) ctx->CurrentStack->Top->m[8];
+ params[3] = (GLint) ctx->CurrentStack->Top->m[12];
+ params[4] = (GLint) ctx->CurrentStack->Top->m[1];
+ params[5] = (GLint) ctx->CurrentStack->Top->m[5];
+ params[6] = (GLint) ctx->CurrentStack->Top->m[9];
+ params[7] = (GLint) ctx->CurrentStack->Top->m[13];
+ params[8] = (GLint) ctx->CurrentStack->Top->m[2];
+ params[9] = (GLint) ctx->CurrentStack->Top->m[6];
+ params[10] = (GLint) ctx->CurrentStack->Top->m[10];
+ params[11] = (GLint) ctx->CurrentStack->Top->m[14];
+ params[12] = (GLint) ctx->CurrentStack->Top->m[3];
+ params[13] = (GLint) ctx->CurrentStack->Top->m[7];
+ params[14] = (GLint) ctx->CurrentStack->Top->m[11];
+ params[15] = (GLint) ctx->CurrentStack->Top->m[15];
+ break;
+ /* Remaining ARB_fragment_program queries alias with
+ * the GL_NV_fragment_program queries.
+ */
+#endif
+
+ /* GL_EXT_depth_bounds_test */
+ case GL_DEPTH_BOUNDS_TEST_EXT:
+ CHECK_EXTENSION_I(EXT_depth_bounds_test, pname);
+ params[0] = ctx->Depth.BoundsTest;
+ break;
+ case GL_DEPTH_BOUNDS_EXT:
+ CHECK_EXTENSION_I(EXT_depth_bounds_test, pname);
+ params[0] = (GLint) ctx->Depth.BoundsMin;
+ params[1] = (GLint) ctx->Depth.BoundsMax;
+ break;
+
+#if FEATURE_MESA_program_debug
+ case GL_FRAGMENT_PROGRAM_CALLBACK_MESA:
+ CHECK_EXTENSION_I(MESA_program_debug, pname);
+ *params = (GLint) ctx->FragmentProgram.CallbackEnabled;
+ break;
+ case GL_VERTEX_PROGRAM_CALLBACK_MESA:
+ CHECK_EXTENSION_I(MESA_program_debug, pname);
+ *params = (GLint) ctx->VertexProgram.CallbackEnabled;
+ break;
+ case GL_FRAGMENT_PROGRAM_POSITION_MESA:
+ CHECK_EXTENSION_I(MESA_program_debug, pname);
+ *params = (GLint) ctx->FragmentProgram.CurrentPosition;
+ break;
+ case GL_VERTEX_PROGRAM_POSITION_MESA:
+ CHECK_EXTENSION_I(MESA_program_debug, pname);
+ *params = (GLint) ctx->VertexProgram.CurrentPosition;
+ break;
+#endif
default:
- gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv(pname=0x%x)", pname);
}
}
-
-void
+/**
+ * Get the address of a selected pointer.
+ *
+ * \param pname array or buffer to be returned.
+ * \param params will hold the pointer speficifed by \p pname.
+ *
+ * \sa glGetPointerv().
+ *
+ * Tries to get the specified pointer via dd_function_table::GetPointerv,
+ * otherwise gets the specified pointer from the current context.
+ */
+void GLAPIENTRY
_mesa_GetPointerv( GLenum pname, GLvoid **params )
{
GET_CURRENT_CONTEXT(ctx);
- GLuint texUnit = ctx->Texture.CurrentUnit;
+ const GLuint clientUnit = ctx->Array.ActiveTexture;
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (!params)
return;
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glGetPointerv %s\n", gl_lookup_enum_by_nr(pname));
+ _mesa_debug(ctx, "glGetPointerv %s\n", _mesa_lookup_enum_by_nr(pname));
if (ctx->Driver.GetPointerv
&& (*ctx->Driver.GetPointerv)(ctx, pname, params))
switch (pname) {
case GL_VERTEX_ARRAY_POINTER:
- *params = ctx->Array.Vertex.Ptr;
+ *params = (GLvoid *) ctx->Array.Vertex.Ptr;
break;
case GL_NORMAL_ARRAY_POINTER:
- *params = ctx->Array.Normal.Ptr;
+ *params = (GLvoid *) ctx->Array.Normal.Ptr;
break;
case GL_COLOR_ARRAY_POINTER:
- *params = ctx->Array.Color.Ptr;
+ *params = (GLvoid *) ctx->Array.Color.Ptr;
break;
case GL_SECONDARY_COLOR_ARRAY_POINTER_EXT:
- *params = ctx->Array.SecondaryColor.Ptr;
+ *params = (GLvoid *) ctx->Array.SecondaryColor.Ptr;
break;
case GL_FOG_COORDINATE_ARRAY_POINTER_EXT:
- *params = ctx->Array.FogCoord.Ptr;
+ *params = (GLvoid *) ctx->Array.FogCoord.Ptr;
break;
case GL_INDEX_ARRAY_POINTER:
- *params = ctx->Array.Index.Ptr;
+ *params = (GLvoid *) ctx->Array.Index.Ptr;
break;
case GL_TEXTURE_COORD_ARRAY_POINTER:
- *params = ctx->Array.TexCoord[texUnit].Ptr;
+ *params = (GLvoid *) ctx->Array.TexCoord[clientUnit].Ptr;
break;
case GL_EDGE_FLAG_ARRAY_POINTER:
- *params = ctx->Array.EdgeFlag.Ptr;
+ *params = (GLvoid *) ctx->Array.EdgeFlag.Ptr;
break;
case GL_FEEDBACK_BUFFER_POINTER:
*params = ctx->Feedback.Buffer;
case GL_SELECTION_BUFFER_POINTER:
*params = ctx->Select.Buffer;
break;
+#if FEATURE_MESA_program_debug
+ case GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA:
+ if (!ctx->Extensions.MESA_program_debug) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetPointerv");
+ return;
+ }
+ *params = (GLvoid *) ctx->FragmentProgram.Callback;
+ break;
+ case GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA:
+ if (!ctx->Extensions.MESA_program_debug) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetPointerv");
+ return;
+ }
+ *params = ctx->FragmentProgram.CallbackData;
+ break;
+ case GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA:
+ if (!ctx->Extensions.MESA_program_debug) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetPointerv");
+ return;
+ }
+ *params = (GLvoid *) ctx->VertexProgram.Callback;
+ break;
+ case GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA:
+ if (!ctx->Extensions.MESA_program_debug) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetPointerv");
+ return;
+ }
+ *params = ctx->VertexProgram.CallbackData;
+ break;
+#endif
default:
- gl_error( ctx, GL_INVALID_ENUM, "glGetPointerv" );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetPointerv" );
return;
}
}
-
-const GLubyte *
+/**
+ * Get a string describing the current GL connection.
+ *
+ * \param name name symbolic constant.
+ *
+ * \sa glGetString().
+ *
+ * Tries to get the string from dd_function_table::GetString, otherwise returns
+ * the hardcoded strings.
+ */
+const GLubyte * GLAPIENTRY
_mesa_GetString( GLenum name )
{
GET_CURRENT_CONTEXT(ctx);
static const char *vendor = "Brian Paul";
static const char *renderer = "Mesa";
- static const char *version = "1.2 Mesa 3.5 beta";
+ static const char *version_1_2 = "1.2 Mesa " MESA_VERSION_STRING;
+ static const char *version_1_3 = "1.3 Mesa " MESA_VERSION_STRING;
+ static const char *version_1_4 = "1.4 Mesa " MESA_VERSION_STRING;
+ static const char *version_1_5 = "1.5 Mesa " MESA_VERSION_STRING;
+
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
/* this is a required driver function */
if (str)
return str;
- switch (name) {
- case GL_VENDOR:
- return (const GLubyte *) vendor;
- case GL_RENDERER:
- return (const GLubyte *) renderer;
- case GL_VERSION:
- return (const GLubyte *) version;
- case GL_EXTENSIONS:
- return (const GLubyte *) _mesa_extensions_get_string(ctx);
- default:
- gl_error( ctx, GL_INVALID_ENUM, "glGetString" );
- return (const GLubyte *) 0;
- }
+ switch (name) {
+ case GL_VENDOR:
+ return (const GLubyte *) vendor;
+ case GL_RENDERER:
+ return (const GLubyte *) renderer;
+ case GL_VERSION:
+ if (ctx->Extensions.ARB_multisample &&
+ ctx->Extensions.ARB_multitexture &&
+ ctx->Extensions.ARB_texture_border_clamp &&
+ ctx->Extensions.ARB_texture_compression &&
+ ctx->Extensions.ARB_texture_cube_map &&
+ ctx->Extensions.EXT_texture_env_add &&
+ ctx->Extensions.ARB_texture_env_combine &&
+ ctx->Extensions.ARB_texture_env_dot3) {
+ if (ctx->Extensions.ARB_depth_texture &&
+ ctx->Extensions.ARB_shadow &&
+ ctx->Extensions.ARB_texture_env_crossbar &&
+ ctx->Extensions.ARB_texture_mirrored_repeat &&
+ ctx->Extensions.ARB_window_pos &&
+ ctx->Extensions.EXT_blend_color &&
+ ctx->Extensions.EXT_blend_func_separate &&
+ ctx->Extensions.EXT_blend_logic_op &&
+ ctx->Extensions.EXT_blend_minmax &&
+ ctx->Extensions.EXT_blend_subtract &&
+ ctx->Extensions.EXT_fog_coord &&
+ ctx->Extensions.EXT_multi_draw_arrays &&
+ ctx->Extensions.EXT_point_parameters && /*aka ARB*/
+ ctx->Extensions.EXT_secondary_color &&
+ ctx->Extensions.EXT_stencil_wrap &&
+ ctx->Extensions.EXT_texture_lod_bias &&
+ ctx->Extensions.SGIS_generate_mipmap) {
+ if (ctx->Extensions.ARB_occlusion_query &&
+ ctx->Extensions.ARB_vertex_buffer_object &&
+ ctx->Extensions.ARB_texture_non_power_of_two &&
+ ctx->Extensions.EXT_shadow_funcs) {
+ return (const GLubyte *) version_1_5;
+ }
+ else {
+ return (const GLubyte *) version_1_4;
+ }
+ }
+ else {
+ return (const GLubyte *) version_1_3;
+ }
+ }
+ else {
+ return (const GLubyte *) version_1_2;
+ }
+ case GL_EXTENSIONS:
+ if (!ctx->Extensions.String)
+ ctx->Extensions.String = _mesa_make_extension_string(ctx);
+ return (const GLubyte *) ctx->Extensions.String;
+#if FEATURE_NV_fragment_program
+ case GL_PROGRAM_ERROR_STRING_NV:
+ if (ctx->Extensions.NV_fragment_program) {
+ return (const GLubyte *) ctx->Program.ErrorString;
+ }
+ /* FALL-THROUGH */
+#endif
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetString" );
+ return (const GLubyte *) 0;
+ }
}
}
-/*
- * Execute a glGetError command
+/**
+ * Execute a glGetError() command.
+ *
+ * \return error number.
+ *
+ * Returns __GLcontextRec::ErrorValue.
*/
-GLenum
+GLenum GLAPIENTRY
_mesa_GetError( void )
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glGetError <-- %s\n", gl_lookup_enum_by_nr(e));
+ _mesa_debug(ctx, "glGetError <-- %s\n", _mesa_lookup_enum_by_nr(e));
ctx->ErrorValue = (GLenum) GL_NO_ERROR;
return e;
}
-