-/* $Id: get.c,v 1.6 1999/11/11 01:22:26 brianp Exp $ */
+/* $Id: get.c,v 1.75 2001/12/18 04:06:45 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
- *
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
- *
+ * Version: 4.1
+ *
+ * Copyright (C) 1999-2001 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"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
#include "all.h"
#else
#include "glheader.h"
+#include "colormac.h"
#include "context.h"
#include "enable.h"
#include "enums.h"
#include "get.h"
#include "macros.h"
#include "mmath.h"
-#include "types.h"
-#include "vb.h"
+#include "mtypes.h"
+
+#include "math/m_matrix.h"
#endif
#endif
+/* Check if named extension is enabled, if not generate error and return */
+
+#define CHECK_EXTENSION_B(EXTNAME) \
+ if (!ctx->Extensions.EXTNAME) { \
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetBooleanv"); \
+ return; \
+ }
+
+#define CHECK_EXTENSION_I(EXTNAME) \
+ if (!ctx->Extensions.EXTNAME) { \
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetIntegerv"); \
+ return; \
+ }
+
+#define CHECK_EXTENSION_F(EXTNAME) \
+ if (!ctx->Extensions.EXTNAME) { \
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetFloatv"); \
+ return; \
+ }
+
+#define CHECK_EXTENSION_D(EXTNAME) \
+ if (!ctx->Extensions.EXTNAME) { \
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetDoublev"); \
+ return; \
+ }
+
+
+
+
+static GLenum
+pixel_texgen_mode(const GLcontext *ctx)
+{
+ if (ctx->Pixel.FragmentRgbSource == GL_CURRENT_RASTER_POSITION) {
+ if (ctx->Pixel.FragmentAlphaSource == GL_CURRENT_RASTER_POSITION) {
+ return GL_RGBA;
+ }
+ else {
+ return GL_RGB;
+ }
+ }
+ else {
+ if (ctx->Pixel.FragmentAlphaSource == GL_CURRENT_RASTER_POSITION) {
+ return GL_ALPHA;
+ }
+ else {
+ return GL_NONE;
+ }
+ }
+}
+
void
_mesa_GetBooleanv( GLenum pname, GLboolean *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);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetBooleanv");
+ if (!params)
+ return;
- if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glGetBooleanv %s\n", gl_lookup_enum_by_nr(pname));
+ /* 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 (MESA_VERBOSE & VERBOSE_API)
+ fprintf(stderr, "glGetBooleanv %s\n", _mesa_lookup_enum_by_nr(pname));
+
+ if (ctx->Driver.GetBooleanv
+ && (*ctx->Driver.GetBooleanv)(ctx, pname, params))
+ return;
switch (pname) {
case GL_ACCUM_RED_BITS:
+ *params = INT_TO_BOOL(ctx->Visual.accumRedBits);
+ break;
case GL_ACCUM_GREEN_BITS:
+ *params = INT_TO_BOOL(ctx->Visual.accumGreenBits);
+ break;
case GL_ACCUM_BLUE_BITS:
+ *params = INT_TO_BOOL(ctx->Visual.accumBlueBits);
+ break;
case GL_ACCUM_ALPHA_BITS:
- *params = INT_TO_BOOL(ctx->Visual->AccumBits);
+ *params = INT_TO_BOOL(ctx->Visual.accumAlphaBits);
break;
case GL_ACCUM_CLEAR_VALUE:
params[0] = FLOAT_TO_BOOL(ctx->Accum.ClearColor[0]);
*params = FLOAT_TO_BOOL(ctx->Pixel.AlphaBias);
break;
case GL_ALPHA_BITS:
- *params = INT_TO_BOOL(ctx->Visual->AlphaBits);
+ *params = INT_TO_BOOL(ctx->Visual.alphaBits);
break;
case GL_ALPHA_SCALE:
*params = FLOAT_TO_BOOL(ctx->Pixel.AlphaScale);
*params = ENUM_TO_BOOL(ctx->Color.AlphaFunc);
break;
case GL_ALPHA_TEST_REF:
- *params = FLOAT_TO_BOOL((GLfloat) ctx->Color.AlphaRef / 255.0);
+ *params = FLOAT_TO_BOOL((GLfloat) ctx->Color.AlphaRef / CHAN_MAXF);
break;
case GL_ATTRIB_STACK_DEPTH:
*params = INT_TO_BOOL(ctx->AttribStackDepth);
*params = ctx->Eval.AutoNormal;
break;
case GL_AUX_BUFFERS:
- *params = (NUM_AUX_BUFFERS) ? GL_TRUE : GL_FALSE;
+ *params = (ctx->Const.NumAuxBuffers) ? GL_TRUE : GL_FALSE;
break;
case GL_BLEND:
*params = ctx->Color.BlendEnabled;
case GL_BLEND_SRC:
*params = ENUM_TO_BOOL(ctx->Color.BlendSrcRGB);
break;
- case GL_BLEND_SRC_RGB_INGR:
+ case GL_BLEND_SRC_RGB_EXT:
*params = ENUM_TO_BOOL(ctx->Color.BlendSrcRGB);
break;
- case GL_BLEND_DST_RGB_INGR:
+ case GL_BLEND_DST_RGB_EXT:
*params = ENUM_TO_BOOL(ctx->Color.BlendDstRGB);
break;
- case GL_BLEND_SRC_ALPHA_INGR:
+ case GL_BLEND_SRC_ALPHA_EXT:
*params = ENUM_TO_BOOL(ctx->Color.BlendSrcA);
break;
- case GL_BLEND_DST_ALPHA_INGR:
+ case GL_BLEND_DST_ALPHA_EXT:
*params = ENUM_TO_BOOL(ctx->Color.BlendDstA);
break;
case GL_BLEND_EQUATION_EXT:
*params = FLOAT_TO_BOOL(ctx->Pixel.BlueBias);
break;
case GL_BLUE_BITS:
- *params = INT_TO_BOOL( ctx->Visual->BlueBits );
+ *params = INT_TO_BOOL( ctx->Visual.blueBits );
break;
case GL_BLUE_SCALE:
*params = FLOAT_TO_BOOL(ctx->Pixel.BlueScale);
*params = ctx->Transform.ClipEnabled[pname-GL_CLIP_PLANE0];
break;
case GL_COLOR_CLEAR_VALUE:
- params[0] = FLOAT_TO_BOOL(ctx->Color.ClearColor[0]);
- params[1] = FLOAT_TO_BOOL(ctx->Color.ClearColor[1]);
- params[2] = FLOAT_TO_BOOL(ctx->Color.ClearColor[2]);
- params[3] = FLOAT_TO_BOOL(ctx->Color.ClearColor[3]);
+ params[0] = ctx->Color.ClearColor[0] ? GL_TRUE : GL_FALSE;
+ params[1] = ctx->Color.ClearColor[1] ? GL_TRUE : GL_FALSE;
+ params[2] = ctx->Color.ClearColor[2] ? GL_TRUE : GL_FALSE;
+ params[3] = ctx->Color.ClearColor[3] ? GL_TRUE : GL_FALSE;
break;
case GL_COLOR_MATERIAL:
*params = ctx->Light.ColorMaterialEnabled;
*params = ENUM_TO_BOOL(ctx->Polygon.CullFaceMode);
break;
case GL_CURRENT_COLOR:
- params[0] = INT_TO_BOOL(ctx->Current.ByteColor[0]);
- params[1] = INT_TO_BOOL(ctx->Current.ByteColor[1]);
- params[2] = INT_TO_BOOL(ctx->Current.ByteColor[2]);
- params[3] = INT_TO_BOOL(ctx->Current.ByteColor[3]);
+ FLUSH_CURRENT(ctx, 0);
+ 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);
break;
case GL_CURRENT_NORMAL:
- 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]);
+ FLUSH_CURRENT(ctx, 0);
+ 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.RasterMultiTexCoord[texUnit][0]);
+ params[1] = FLOAT_TO_BOOL(ctx->Current.RasterMultiTexCoord[texUnit][1]);
+ params[2] = FLOAT_TO_BOOL(ctx->Current.RasterMultiTexCoord[texUnit][2]);
+ params[3] = FLOAT_TO_BOOL(ctx->Current.RasterMultiTexCoord[texUnit][3]);
break;
case GL_CURRENT_RASTER_POSITION_VALID:
*params = ctx->Current.RasterPosValid;
break;
case GL_CURRENT_TEXTURE_COORDS:
- 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]);
+ FLUSH_CURRENT(ctx, 0);
+ 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);
break;
case GL_DEPTH_BITS:
- *params = INT_TO_BOOL(ctx->Visual->DepthBits);
+ *params = INT_TO_BOOL(ctx->Visual.depthBits);
break;
case GL_DEPTH_CLEAR_VALUE:
*params = FLOAT_TO_BOOL(ctx->Depth.Clear);
*params = ctx->Color.DitherFlag;
break;
case GL_DOUBLEBUFFER:
- *params = ctx->Visual->DBflag;
+ *params = ctx->Visual.doubleBufferMode;
break;
case GL_DRAW_BUFFER:
*params = ENUM_TO_BOOL(ctx->Color.DrawBuffer);
break;
case GL_EDGE_FLAG:
+ FLUSH_CURRENT(ctx, 0);
*params = ctx->Current.EdgeFlag;
break;
case GL_FEEDBACK_BUFFER_SIZE:
- /* TODO: is this right? Or, return number of entries in buffer? */
*params = INT_TO_BOOL(ctx->Feedback.BufferSize);
break;
case GL_FEEDBACK_BUFFER_TYPE:
*params = FLOAT_TO_BOOL(ctx->Pixel.GreenBias);
break;
case GL_GREEN_BITS:
- *params = INT_TO_BOOL( ctx->Visual->GreenBits );
+ *params = INT_TO_BOOL( ctx->Visual.greenBits );
break;
case GL_GREEN_SCALE:
*params = FLOAT_TO_BOOL(ctx->Pixel.GreenScale);
break;
case GL_INDEX_BITS:
- *params = INT_TO_BOOL( ctx->Visual->IndexBits );
+ *params = INT_TO_BOOL( ctx->Visual.indexBits );
break;
case GL_INDEX_CLEAR_VALUE:
*params = INT_TO_BOOL(ctx->Color.ClearIndex);
break;
case GL_INDEX_MODE:
- *params = ctx->Visual->RGBAflag ? GL_FALSE : GL_TRUE;
+ *params = ctx->Visual.rgbMode ? GL_FALSE : GL_TRUE;
break;
case GL_INDEX_OFFSET:
*params = INT_TO_BOOL(ctx->Pixel.IndexOffset);
*params = FLOAT_TO_BOOL(ctx->Line.Width);
break;
case GL_LINE_WIDTH_GRANULARITY:
- *params = FLOAT_TO_BOOL(LINE_WIDTH_GRANULARITY);
+ *params = FLOAT_TO_BOOL(ctx->Const.LineWidthGranularity);
break;
case GL_LINE_WIDTH_RANGE:
- params[0] = FLOAT_TO_BOOL(MIN_LINE_WIDTH);
- params[1] = FLOAT_TO_BOOL(MAX_LINE_WIDTH);
+ params[0] = FLOAT_TO_BOOL(ctx->Const.MinLineWidthAA);
+ params[1] = FLOAT_TO_BOOL(ctx->Const.MaxLineWidthAA);
+ break;
+ case GL_ALIASED_LINE_WIDTH_RANGE:
+ params[0] = FLOAT_TO_BOOL(ctx->Const.MinLineWidth);
+ params[1] = FLOAT_TO_BOOL(ctx->Const.MaxLineWidth);
break;
case GL_LIST_BASE:
*params = INT_TO_BOOL(ctx->List.ListBase);
*params = INT_TO_BOOL( MAX_CLIENT_ATTRIB_STACK_DEPTH);
break;
case GL_MAX_CLIP_PLANES:
- *params = INT_TO_BOOL(MAX_CLIP_PLANES);
+ *params = INT_TO_BOOL(ctx->Const.MaxClipPlanes);
break;
case GL_MAX_ELEMENTS_VERTICES: /* GL_VERSION_1_2 */
- *params = INT_TO_BOOL(VB_MAX);
+ *params = INT_TO_BOOL(ctx->Const.MaxArrayLockSize);
break;
case GL_MAX_ELEMENTS_INDICES: /* GL_VERSION_1_2 */
- *params = INT_TO_BOOL(VB_MAX);
+ *params = INT_TO_BOOL(ctx->Const.MaxArrayLockSize);
break;
case GL_MAX_EVAL_ORDER:
*params = INT_TO_BOOL(MAX_EVAL_ORDER);
break;
case GL_MAX_LIGHTS:
- *params = INT_TO_BOOL(MAX_LIGHTS);
+ *params = INT_TO_BOOL(ctx->Const.MaxLights);
break;
case GL_MAX_LIST_NESTING:
*params = INT_TO_BOOL(MAX_LIST_NESTING);
*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);
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);
*params = INT_TO_BOOL(ctx->Pixel.MapStoSsize);
break;
case GL_POINT_SIZE:
- *params = FLOAT_TO_BOOL(ctx->Point.Size );
+ *params = FLOAT_TO_BOOL(ctx->Point.Size);
break;
case GL_POINT_SIZE_GRANULARITY:
- *params = FLOAT_TO_BOOL(POINT_SIZE_GRANULARITY );
+ *params = FLOAT_TO_BOOL(ctx->Const.PointSizeGranularity );
break;
case GL_POINT_SIZE_RANGE:
- params[0] = FLOAT_TO_BOOL(MIN_POINT_SIZE );
- params[1] = FLOAT_TO_BOOL(MAX_POINT_SIZE );
+ params[0] = FLOAT_TO_BOOL(ctx->Const.MinPointSizeAA);
+ params[1] = FLOAT_TO_BOOL(ctx->Const.MaxPointSizeAA);
+ break;
+ case GL_ALIASED_POINT_SIZE_RANGE:
+ params[0] = FLOAT_TO_BOOL(ctx->Const.MinPointSize);
+ params[1] = FLOAT_TO_BOOL(ctx->Const.MaxPointSize);
break;
case GL_POINT_SMOOTH:
*params = ctx->Point.SmoothFlag;
params[0] = ENUM_TO_BOOL(ctx->Polygon.FrontMode);
params[1] = ENUM_TO_BOOL(ctx->Polygon.BackMode);
break;
-#ifdef GL_EXT_polygon_offset
- case GL_POLYGON_OFFSET_BIAS_EXT:
+ case GL_POLYGON_OFFSET_BIAS_EXT: /* GL_EXT_polygon_offset */
*params = FLOAT_TO_BOOL( ctx->Polygon.OffsetUnits );
break;
-#endif
case GL_POLYGON_OFFSET_FACTOR:
*params = FLOAT_TO_BOOL( ctx->Polygon.OffsetFactor );
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 = FLOAT_TO_BOOL(ctx->Pixel.RedBias);
break;
case GL_RED_BITS:
- *params = INT_TO_BOOL( ctx->Visual->RedBits );
+ *params = INT_TO_BOOL( ctx->Visual.redBits );
break;
case GL_RED_SCALE:
*params = FLOAT_TO_BOOL(ctx->Pixel.RedScale);
case GL_RENDER_MODE:
*params = ENUM_TO_BOOL(ctx->RenderMode);
break;
+ case GL_RESCALE_NORMAL:
+ *params = ctx->Transform.RescaleNormals;
+ break;
case GL_RGBA_MODE:
- *params = ctx->Visual->RGBAflag;
+ *params = ctx->Visual.rgbMode;
break;
case GL_SCISSOR_BOX:
params[0] = INT_TO_BOOL(ctx->Scissor.X);
*params = ctx->Texture.SharedPalette;
break;
case GL_STENCIL_BITS:
- *params = INT_TO_BOOL(ctx->Visual->StencilBits);
+ *params = INT_TO_BOOL(ctx->Visual.stencilBits);
break;
case GL_STENCIL_CLEAR_VALUE:
*params = INT_TO_BOOL(ctx->Stencil.Clear);
*params = INT_TO_BOOL(ctx->Stencil.WriteMask);
break;
case GL_STEREO:
- *params = ctx->Visual->StereoFlag;
+ *params = ctx->Visual.stereoMode;
break;
case GL_SUBPIXEL_BITS:
- *params = INT_TO_BOOL(0); /* TODO */
+ *params = INT_TO_BOOL(ctx->Const.SubPixelBits);
break;
case GL_TEXTURE_1D:
- *params = _mesa_IsEnabled(GL_TEXTURE_1D );
+ *params = _mesa_IsEnabled(GL_TEXTURE_1D);
break;
case GL_TEXTURE_2D:
- *params = _mesa_IsEnabled(GL_TEXTURE_2D );
+ *params = _mesa_IsEnabled(GL_TEXTURE_2D);
break;
case GL_TEXTURE_3D:
- *params = _mesa_IsEnabled(GL_TEXTURE_3D );
+ *params = _mesa_IsEnabled(GL_TEXTURE_3D);
break;
case GL_TEXTURE_BINDING_1D:
- *params = INT_TO_BOOL(textureUnit->CurrentD[1]->Name);
+ *params = INT_TO_BOOL(textureUnit->Current1D->Name);
break;
case GL_TEXTURE_BINDING_2D:
- *params = INT_TO_BOOL(textureUnit->CurrentD[2]->Name);
+ *params = INT_TO_BOOL(textureUnit->Current2D->Name);
break;
case GL_TEXTURE_BINDING_3D:
- *params = INT_TO_BOOL(textureUnit->CurrentD[3]->Name);
- break;
+ *params = INT_TO_BOOL(textureUnit->Current3D->Name);
+ break;
case GL_TEXTURE_ENV_COLOR:
{
params[0] = FLOAT_TO_BOOL(textureUnit->EnvColor[0]);
break;
case GL_TEXTURE_MATRIX:
for (i=0;i<16;i++) {
- params[i] =
- FLOAT_TO_BOOL(ctx->TextureMatrix[texTransformUnit].m[i]);
+ params[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);
*params = INT_TO_BOOL(ctx->Array.EdgeFlag.Stride);
break;
+ /* GL_ARB_multitexture */
case GL_MAX_TEXTURE_UNITS_ARB:
*params = ctx->Const.MaxTextureUnits;
break;
*params = INT_TO_BOOL(GL_TEXTURE0_ARB + ctx->Array.ActiveTexture);
break;
+ /* GL_ARB_texture_cube_map */
+ case GL_TEXTURE_CUBE_MAP_ARB:
+ CHECK_EXTENSION_B(ARB_texture_cube_map);
+ *params = _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
+ break;
+ case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
+ CHECK_EXTENSION_B(ARB_texture_cube_map);
+ *params = INT_TO_BOOL(textureUnit->CurrentCubeMap->Name);
+ break;
+ case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
+ CHECK_EXTENSION_B(ARB_texture_cube_map);
+ *params = INT_TO_BOOL(1 << (ctx->Const.MaxCubeTextureLevels - 1));
+ break;
- /* GL_PGI_misc_hints */
- case GL_STRICT_DEPTHFUNC_HINT_PGI:
- *params = ENUM_TO_BOOL(GL_NICEST);
+ /* GL_ARB_texture_compression */
+ case GL_TEXTURE_COMPRESSION_HINT_ARB:
+ CHECK_EXTENSION_B(ARB_texture_compression);
+ *params = INT_TO_BOOL(ctx->Hint.TextureCompression);
break;
- case GL_STRICT_LIGHTING_HINT_PGI:
- *params = ENUM_TO_BOOL(ctx->Hint.StrictLighting);
- break;
- case GL_STRICT_SCISSOR_HINT_PGI:
- case GL_FULL_STIPPLE_HINT_PGI:
- *params = ENUM_TO_BOOL(GL_TRUE);
- break;
- case GL_CONSERVE_MEMORY_HINT_PGI:
- *params = ENUM_TO_BOOL(GL_FALSE);
- break;
- case GL_ALWAYS_FAST_HINT_PGI:
- *params = (GLboolean) (ctx->Hint.AllowDrawWin == GL_TRUE &&
- ctx->Hint.AllowDrawSpn == GL_FALSE &&
- ctx->Hint.AllowDrawMem == GL_FALSE);
- break;
- case GL_ALWAYS_SOFT_HINT_PGI:
- *params = (GLboolean) (ctx->Hint.AllowDrawWin == GL_TRUE &&
- ctx->Hint.AllowDrawSpn == GL_TRUE &&
- ctx->Hint.AllowDrawMem == GL_TRUE);
+ case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
+ CHECK_EXTENSION_B(ARB_texture_compression);
+ *params = INT_TO_BOOL(ctx->Const.NumCompressedTextureFormats);
+ break;
+ case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
+ CHECK_EXTENSION_B(ARB_texture_compression);
+ {
+ GLuint i;
+ for (i = 0; i < ctx->Const.NumCompressedTextureFormats; i++)
+ params[i] = INT_TO_BOOL(ctx->Const.CompressedTextureFormats[i]);
+ }
+ break;
+
+ /* GL_EXT_compiled_vertex_array */
+ case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT:
+ *params = ctx->Array.LockFirst ? GL_TRUE : GL_FALSE;
break;
- case GL_ALLOW_DRAW_OBJ_HINT_PGI:
- *params = (GLboolean) GL_TRUE;
+ case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT:
+ *params = ctx->Array.LockCount ? GL_TRUE : GL_FALSE;
break;
- case GL_ALLOW_DRAW_WIN_HINT_PGI:
- *params = (GLboolean) ctx->Hint.AllowDrawWin;
+
+ /* GL_ARB_transpose_matrix */
+ case GL_TRANSPOSE_COLOR_MATRIX_ARB:
+ {
+ GLfloat tm[16];
+ GLuint i;
+ _math_transposef(tm, ctx->ColorMatrixStack.Top->m);
+ for (i=0;i<16;i++) {
+ params[i] = FLOAT_TO_BOOL(tm[i]);
+ }
+ }
+ break;
+ case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB:
+ {
+ GLfloat tm[16];
+ GLuint i;
+ _math_transposef(tm, ctx->ModelviewMatrixStack.Top->m);
+ for (i=0;i<16;i++) {
+ params[i] = FLOAT_TO_BOOL(tm[i]);
+ }
+ }
+ break;
+ case GL_TRANSPOSE_PROJECTION_MATRIX_ARB:
+ {
+ GLfloat tm[16];
+ GLuint i;
+ _math_transposef(tm, ctx->ProjectionMatrixStack.Top->m);
+ for (i=0;i<16;i++) {
+ params[i] = FLOAT_TO_BOOL(tm[i]);
+ }
+ }
+ break;
+ case GL_TRANSPOSE_TEXTURE_MATRIX_ARB:
+ {
+ GLfloat tm[16];
+ GLuint i;
+ _math_transposef(tm, ctx->TextureMatrixStack[texUnit].Top->m);
+ for (i=0;i<16;i++) {
+ params[i] = FLOAT_TO_BOOL(tm[i]);
+ }
+ }
+ break;
+
+ /* GL_HP_occlusion_test */
+ case GL_OCCLUSION_TEST_HP:
+ CHECK_EXTENSION_B(HP_occlusion_test);
+ *params = ctx->Depth.OcclusionTest;
+ return;
+ case GL_OCCLUSION_TEST_RESULT_HP:
+ CHECK_EXTENSION_B(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;
+ return;
+
+ /* GL_SGIS_pixel_texture */
+ case GL_PIXEL_TEXTURE_SGIS:
+ *params = ctx->Pixel.PixelTextureEnabled;
+ break;
+
+ /* GL_SGIX_pixel_texture */
+ case GL_PIXEL_TEX_GEN_SGIX:
+ *params = ctx->Pixel.PixelTextureEnabled;
+ break;
+ case GL_PIXEL_TEX_GEN_MODE_SGIX:
+ *params = (GLboolean) pixel_texgen_mode(ctx);
+ break;
+
+ /* 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->ColorMatrixStack.Top->m[i]);
+ }
break;
- case GL_ALLOW_DRAW_SPN_HINT_PGI:
- *params = (GLboolean) ctx->Hint.AllowDrawSpn;
+ case GL_COLOR_MATRIX_STACK_DEPTH_SGI:
+ *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);
+ break;
+ case GL_POST_COLOR_MATRIX_RED_SCALE_SGI:
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixScale[0]);
+ break;
+ case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI:
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixScale[1]);
+ break;
+ case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI:
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixScale[2]);
+ break;
+ case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI:
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixScale[3]);
+ break;
+ case GL_POST_COLOR_MATRIX_RED_BIAS_SGI:
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixBias[0]);
+ break;
+ case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI:
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixBias[1]);
+ break;
+ case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI:
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixBias[2]);
+ break;
+ case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI:
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixBias[3]);
+ break;
+
+ /* GL_EXT_convolution (also in 1.2 imaging) */
+ case GL_CONVOLUTION_1D_EXT:
+ CHECK_EXTENSION_B(EXT_convolution);
+ *params = ctx->Pixel.Convolution1DEnabled;
+ break;
+ case GL_CONVOLUTION_2D:
+ CHECK_EXTENSION_B(EXT_convolution);
+ *params = ctx->Pixel.Convolution2DEnabled;
+ break;
+ case GL_SEPARABLE_2D:
+ CHECK_EXTENSION_B(EXT_convolution);
+ *params = ctx->Pixel.Separable2DEnabled;
+ break;
+ case GL_MAX_CONVOLUTION_WIDTH:
+ CHECK_EXTENSION_B(EXT_convolution);
+ *params = INT_TO_BOOL(ctx->Const.MaxConvolutionWidth);
+ break;
+ case GL_MAX_CONVOLUTION_HEIGHT:
+ CHECK_EXTENSION_B(EXT_convolution);
+ *params = INT_TO_BOOL(ctx->Const.MaxConvolutionHeight);
+ break;
+ case GL_POST_CONVOLUTION_RED_SCALE_EXT:
+ CHECK_EXTENSION_B(EXT_convolution);
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionScale[0]);
+ break;
+ case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:
+ CHECK_EXTENSION_B(EXT_convolution);
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionScale[1]);
+ break;
+ case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:
+ CHECK_EXTENSION_B(EXT_convolution);
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionScale[2]);
+ break;
+ case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:
+ CHECK_EXTENSION_B(EXT_convolution);
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionScale[3]);
+ break;
+ case GL_POST_CONVOLUTION_RED_BIAS_EXT:
+ CHECK_EXTENSION_B(EXT_convolution);
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionBias[0]);
+ break;
+ case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:
+ CHECK_EXTENSION_B(EXT_convolution);
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionBias[1]);
+ break;
+ case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:
+ CHECK_EXTENSION_B(EXT_convolution);
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionBias[2]);
+ break;
+ case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:
+ CHECK_EXTENSION_B(EXT_convolution);
+ *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);
+ *params = ctx->Pixel.HistogramEnabled;
break;
- case GL_ALLOW_DRAW_MEM_HINT_PGI:
- *params = (GLboolean) ctx->Hint.AllowDrawMem;
+ case GL_MINMAX:
+ CHECK_EXTENSION_B(EXT_histogram);
+ *params = ctx->Pixel.MinMaxEnabled;
+ break;
+
+ /* GL_SGI_color_table (also in 1.2 imaging */
+ case GL_COLOR_TABLE_SGI:
+ *params = ctx->Pixel.ColorTableEnabled;
+ break;
+ case GL_POST_CONVOLUTION_COLOR_TABLE_SGI:
+ *params = ctx->Pixel.PostConvolutionColorTableEnabled;
+ break;
+ case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
+ *params = ctx->Pixel.PostColorMatrixColorTableEnabled;
+ break;
+
+ /* GL_EXT_secondary_color */
+ case GL_COLOR_SUM_EXT:
+ CHECK_EXTENSION_B(EXT_secondary_color);
+ *params = ctx->Fog.ColorSumEnabled;
+ break;
+ case GL_CURRENT_SECONDARY_COLOR_EXT:
+ CHECK_EXTENSION_B(EXT_secondary_color);
+ FLUSH_CURRENT(ctx, 0);
+ 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]);
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_EXT:
+ CHECK_EXTENSION_B(EXT_secondary_color);
+ *params = ctx->Array.SecondaryColor.Enabled;
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT:
+ CHECK_EXTENSION_B(EXT_secondary_color);
+ *params = ENUM_TO_BOOL(ctx->Array.SecondaryColor.Type);
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT:
+ CHECK_EXTENSION_B(EXT_secondary_color);
+ *params = INT_TO_BOOL(ctx->Array.SecondaryColor.Stride);
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT:
+ CHECK_EXTENSION_B(EXT_secondary_color);
+ *params = INT_TO_BOOL(ctx->Array.SecondaryColor.Stride);
break;
- case GL_CLIP_NEAR_HINT_PGI:
- case GL_CLIP_FAR_HINT_PGI:
- *params = ENUM_TO_BOOL(GL_TRUE);
+
+ /* GL_EXT_fog_coord */
+ case GL_CURRENT_FOG_COORDINATE_EXT:
+ CHECK_EXTENSION_B(EXT_fog_coord);
+ FLUSH_CURRENT(ctx, 0);
+ *params = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_FOG][0]);
break;
- case GL_WIDE_LINE_HINT_PGI:
- *params = ENUM_TO_BOOL(GL_DONT_CARE);
+ case GL_FOG_COORDINATE_ARRAY_EXT:
+ CHECK_EXTENSION_B(EXT_fog_coord);
+ *params = ctx->Array.FogCoord.Enabled;
+ break;
+ case GL_FOG_COORDINATE_ARRAY_TYPE_EXT:
+ CHECK_EXTENSION_B(EXT_fog_coord);
+ *params = ENUM_TO_BOOL(ctx->Array.FogCoord.Type);
break;
- case GL_BACK_NORMALS_HINT_PGI:
- *params = ENUM_TO_BOOL(GL_TRUE);
+ case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT:
+ CHECK_EXTENSION_B(EXT_fog_coord);
+ *params = INT_TO_BOOL(ctx->Array.FogCoord.Stride);
break;
- case GL_NATIVE_GRAPHICS_HANDLE_PGI:
- *params = 0;
+
+ /* 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);
+ *params = FLOAT_TO_BOOL(ctx->Const.MaxTextureMaxAnisotropy);
break;
+
+ /* GL_ARB_multisample */
+ case GL_MULTISAMPLE_ARB:
+ CHECK_EXTENSION_B(ARB_multisample);
+ *params = ctx->Multisample.Enabled;
+ break;
+ case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
+ CHECK_EXTENSION_B(ARB_multisample);
+ *params = ctx->Multisample.SampleAlphaToCoverage;
+ break;
+ case GL_SAMPLE_ALPHA_TO_ONE_ARB:
+ CHECK_EXTENSION_B(ARB_multisample);
+ *params = ctx->Multisample.SampleAlphaToOne;
+ break;
+ case GL_SAMPLE_COVERAGE_ARB:
+ CHECK_EXTENSION_B(ARB_multisample);
+ *params = ctx->Multisample.SampleCoverage;
+ break;
+ case GL_SAMPLE_COVERAGE_VALUE_ARB:
+ CHECK_EXTENSION_B(ARB_multisample);
+ *params = FLOAT_TO_BOOL(ctx->Multisample.SampleCoverageValue);
+ break;
+ case GL_SAMPLE_COVERAGE_INVERT_ARB:
+ CHECK_EXTENSION_B(ARB_multisample);
+ *params = ctx->Multisample.SampleCoverageInvert;
+ break;
+ case GL_SAMPLE_BUFFERS_ARB:
+ CHECK_EXTENSION_B(ARB_multisample);
+ *params = 0; /* XXX fix someday */
+ break;
+ case GL_SAMPLES_ARB:
+ CHECK_EXTENSION_B(ARB_multisample);
+ *params = 0; /* XXX fix someday */
+ break;
+
+ /* GL_IBM_rasterpos_clip */
+ case GL_RASTER_POSITION_UNCLIPPED_IBM:
+ CHECK_EXTENSION_B(IBM_rasterpos_clip);
+ *params = ctx->Transform.RasterPositionUnclipped;
+ break;
+
+ /* GL_MESA_sprite_point */
+ case GL_SPRITE_POINT_MESA:
+ CHECK_EXTENSION_B(MESA_sprite_point);
+ *params = ctx->Point.SpriteMode;
+ break;
+
+ /* GL_SGIS_generate_mipmap */
+ case GL_GENERATE_MIPMAP_HINT_SGIS:
+ CHECK_EXTENSION_B(SGIS_generate_mipmap);
+ *params = ENUM_TO_BOOL(ctx->Hint.GenerateMipmap);
+ break;
+
+ /* GL_NV_vertex_program */
+ case GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV:
+ CHECK_EXTENSION_B(NV_vertex_program);
+ *params = MAX_PROGRAM_STACK_DEPTH;
+ break;
+ case GL_MAX_TRACK_MATRICES_NV:
+ CHECK_EXTENSION_B(NV_vertex_program);
+ *params = MAX_PROGRAM_MATRICES;
+ break;
+ case GL_VERTEX_PROGRAM_NV:
+ CHECK_EXTENSION_B(NV_vertex_program);
+ *params = ctx->VertexProgram.Enabled;
+ break;
+ case GL_VERTEX_PROGRAM_POINT_SIZE_NV:
+ CHECK_EXTENSION_B(NV_vertex_program);
+ *params = ctx->VertexProgram.PointSizeEnabled;
+ break;
+ case GL_VERTEX_PROGRAM_TWO_SIDE_NV:
+ CHECK_EXTENSION_B(NV_vertex_program);
+ *params = ctx->VertexProgram.TwoSideEnabled;
+ break;
+ case GL_CURRENT_MATRIX_STACK_DEPTH_NV:
+ CHECK_EXTENSION_B(NV_vertex_program);
+ *params = 0;
+ break;
+ case GL_CURRENT_MATRIX_NV:
+ CHECK_EXTENSION_B(NV_vertex_program);
+ *params = 0;
+ break;
+ case GL_VERTEX_PROGRAM_BINDING_NV:
+ CHECK_EXTENSION_B(NV_vertex_program);
+ *params = 0;
+ break;
+ case GL_PROGRAM_ERROR_POSITION_NV:
+ CHECK_EXTENSION_B(NV_vertex_program);
+ *params = 0;
+ 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);
+ {
+ GLuint n = (GLint) pname - GL_VERTEX_ATTRIB_ARRAY0_NV;
+ *params = 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);
+ _mesa_problem(ctx, "glGetBoolean NV token not implemented");
+ *params = 0;
+ 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);
+ _mesa_problem(ctx, "glGetBoolean NV token not implemented");
+ *params = 0;
+ break;
+
default:
- printf("invalid enum: %x\n", pname);
- gl_error( ctx, GL_INVALID_ENUM, "glGetBooleanv" );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetBooleanv" );
}
}
-
-
void
_mesa_GetDoublev( GLenum pname, GLdouble *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);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetDoublev");
+ if (!params)
+ return;
- if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glGetDoublev %s\n", gl_lookup_enum_by_nr(pname));
+ /* 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 (MESA_VERBOSE & VERBOSE_API)
+ fprintf(stderr, "glGetDoublev %s\n", _mesa_lookup_enum_by_nr(pname));
+
+ if (ctx->Driver.GetDoublev && (*ctx->Driver.GetDoublev)(ctx, pname, params))
+ return;
switch (pname) {
case GL_ACCUM_RED_BITS:
+ *params = (GLdouble) ctx->Visual.accumRedBits;
+ break;
case GL_ACCUM_GREEN_BITS:
+ *params = (GLdouble) ctx->Visual.accumGreenBits;
+ break;
case GL_ACCUM_BLUE_BITS:
+ *params = (GLdouble) ctx->Visual.accumBlueBits;
+ break;
case GL_ACCUM_ALPHA_BITS:
- *params = (GLdouble) ctx->Visual->AccumBits;
+ *params = (GLdouble) ctx->Visual.accumAlphaBits;
break;
case GL_ACCUM_CLEAR_VALUE:
params[0] = (GLdouble) ctx->Accum.ClearColor[0];
*params = (GLdouble) ctx->Pixel.AlphaBias;
break;
case GL_ALPHA_BITS:
- *params = (GLdouble) ctx->Visual->AlphaBits;
+ *params = (GLdouble) ctx->Visual.alphaBits;
break;
case GL_ALPHA_SCALE:
*params = (GLdouble) ctx->Pixel.AlphaScale;
*params = ENUM_TO_DOUBLE(ctx->Color.AlphaFunc);
break;
case GL_ALPHA_TEST_REF:
- *params = (GLdouble) ctx->Color.AlphaRef / 255.0;
+ *params = (GLdouble) ctx->Color.AlphaRef / CHAN_MAXF;
break;
case GL_ATTRIB_STACK_DEPTH:
*params = (GLdouble ) (ctx->AttribStackDepth);
*params = (GLdouble) ctx->Eval.AutoNormal;
break;
case GL_AUX_BUFFERS:
- *params = (GLdouble) NUM_AUX_BUFFERS;
+ *params = (GLdouble) ctx->Const.NumAuxBuffers;
break;
case GL_BLEND:
*params = (GLdouble) ctx->Color.BlendEnabled;
case GL_BLEND_SRC:
*params = ENUM_TO_DOUBLE(ctx->Color.BlendSrcRGB);
break;
- case GL_BLEND_SRC_RGB_INGR:
+ case GL_BLEND_SRC_RGB_EXT:
*params = ENUM_TO_DOUBLE(ctx->Color.BlendSrcRGB);
break;
- case GL_BLEND_DST_RGB_INGR:
+ case GL_BLEND_DST_RGB_EXT:
*params = ENUM_TO_DOUBLE(ctx->Color.BlendDstRGB);
break;
- case GL_BLEND_SRC_ALPHA_INGR:
+ case GL_BLEND_SRC_ALPHA_EXT:
*params = ENUM_TO_DOUBLE(ctx->Color.BlendSrcA);
break;
- case GL_BLEND_DST_ALPHA_INGR:
+ case GL_BLEND_DST_ALPHA_EXT:
*params = ENUM_TO_DOUBLE(ctx->Color.BlendDstA);
break;
case GL_BLEND_EQUATION_EXT:
*params = (GLdouble) ctx->Pixel.BlueBias;
break;
case GL_BLUE_BITS:
- *params = (GLdouble) ctx->Visual->BlueBits;
+ *params = (GLdouble) ctx->Visual.blueBits;
break;
case GL_BLUE_SCALE:
*params = (GLdouble) ctx->Pixel.BlueScale;
*params = (GLdouble) ctx->Transform.ClipEnabled[pname-GL_CLIP_PLANE0];
break;
case GL_COLOR_CLEAR_VALUE:
- 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];
+ 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]);
break;
case GL_COLOR_MATERIAL:
*params = (GLdouble) ctx->Light.ColorMaterialEnabled;
*params = ENUM_TO_DOUBLE(ctx->Polygon.CullFaceMode);
break;
case GL_CURRENT_COLOR:
- params[0] = UBYTE_COLOR_TO_FLOAT_COLOR(ctx->Current.ByteColor[0]);
- params[1] = UBYTE_COLOR_TO_FLOAT_COLOR(ctx->Current.ByteColor[1]);
- params[2] = UBYTE_COLOR_TO_FLOAT_COLOR(ctx->Current.ByteColor[2]);
- params[3] = UBYTE_COLOR_TO_FLOAT_COLOR(ctx->Current.ByteColor[3]);
+ FLUSH_CURRENT(ctx, 0);
+ 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);
*params = (GLdouble) ctx->Current.Index;
break;
case GL_CURRENT_NORMAL:
- params[0] = (GLdouble) ctx->Current.Normal[0];
- params[1] = (GLdouble) ctx->Current.Normal[1];
- params[2] = (GLdouble) ctx->Current.Normal[2];
+ FLUSH_CURRENT(ctx, 0);
+ 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.RasterMultiTexCoord[texUnit][0];
+ params[1] = (GLdouble) ctx->Current.RasterMultiTexCoord[texUnit][1];
+ params[2] = (GLdouble) ctx->Current.RasterMultiTexCoord[texUnit][2];
+ params[3] = (GLdouble) ctx->Current.RasterMultiTexCoord[texUnit][3];
break;
case GL_CURRENT_RASTER_POSITION_VALID:
*params = (GLdouble) ctx->Current.RasterPosValid;
break;
case GL_CURRENT_TEXTURE_COORDS:
- 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];
+ FLUSH_CURRENT(ctx, 0);
+ 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;
break;
case GL_DEPTH_BITS:
- *params = (GLdouble) ctx->Visual->DepthBits;
+ *params = (GLdouble) ctx->Visual.depthBits;
break;
case GL_DEPTH_CLEAR_VALUE:
*params = (GLdouble) ctx->Depth.Clear;
*params = (GLdouble) ctx->Color.DitherFlag;
break;
case GL_DOUBLEBUFFER:
- *params = (GLdouble) ctx->Visual->DBflag;
+ *params = (GLdouble) ctx->Visual.doubleBufferMode;
break;
case GL_DRAW_BUFFER:
*params = ENUM_TO_DOUBLE(ctx->Color.DrawBuffer);
break;
case GL_EDGE_FLAG:
+ FLUSH_CURRENT(ctx, 0);
*params = (GLdouble) ctx->Current.EdgeFlag;
break;
case GL_FEEDBACK_BUFFER_SIZE:
- /* TODO: is this right? Or, return number of entries in buffer? */
*params = (GLdouble) ctx->Feedback.BufferSize;
break;
case GL_FEEDBACK_BUFFER_TYPE:
*params = (GLdouble) ctx->Pixel.GreenBias;
break;
case GL_GREEN_BITS:
- *params = (GLdouble) ctx->Visual->GreenBits;
+ *params = (GLdouble) ctx->Visual.greenBits;
break;
case GL_GREEN_SCALE:
*params = (GLdouble) ctx->Pixel.GreenScale;
break;
case GL_INDEX_BITS:
- *params = (GLdouble) ctx->Visual->IndexBits;
+ *params = (GLdouble) ctx->Visual.indexBits;
break;
case GL_INDEX_CLEAR_VALUE:
*params = (GLdouble) ctx->Color.ClearIndex;
break;
case GL_INDEX_MODE:
- *params = ctx->Visual->RGBAflag ? 0.0 : 1.0;
+ *params = ctx->Visual.rgbMode ? 0.0 : 1.0;
break;
case GL_INDEX_OFFSET:
*params = (GLdouble) ctx->Pixel.IndexOffset;
*params = (GLdouble) ctx->Line.Width;
break;
case GL_LINE_WIDTH_GRANULARITY:
- *params = (GLdouble) LINE_WIDTH_GRANULARITY;
+ *params = (GLdouble) ctx->Const.LineWidthGranularity;
break;
case GL_LINE_WIDTH_RANGE:
- params[0] = (GLdouble) MIN_LINE_WIDTH;
- params[1] = (GLdouble) MAX_LINE_WIDTH;
+ params[0] = (GLdouble) ctx->Const.MinLineWidthAA;
+ params[1] = (GLdouble) ctx->Const.MaxLineWidthAA;
+ break;
+ case GL_ALIASED_LINE_WIDTH_RANGE:
+ params[0] = (GLdouble) ctx->Const.MinLineWidth;
+ params[1] = (GLdouble) ctx->Const.MaxLineWidth;
break;
case GL_LIST_BASE:
*params = (GLdouble) ctx->List.ListBase;
*params = (GLdouble) MAX_CLIENT_ATTRIB_STACK_DEPTH;
break;
case GL_MAX_CLIP_PLANES:
- *params = (GLdouble) MAX_CLIP_PLANES;
+ *params = (GLdouble) ctx->Const.MaxClipPlanes;
break;
case GL_MAX_ELEMENTS_VERTICES: /* GL_VERSION_1_2 */
- *params = (GLdouble) VB_MAX;
+ *params = (GLdouble) ctx->Const.MaxArrayLockSize;
break;
case GL_MAX_ELEMENTS_INDICES: /* GL_VERSION_1_2 */
- *params = (GLdouble) VB_MAX;
+ *params = (GLdouble) ctx->Const.MaxArrayLockSize;
break;
case GL_MAX_EVAL_ORDER:
*params = (GLdouble) MAX_EVAL_ORDER;
break;
case GL_MAX_LIGHTS:
- *params = (GLdouble) MAX_LIGHTS;
+ *params = (GLdouble) ctx->Const.MaxLights;
break;
case GL_MAX_LIST_NESTING:
*params = (GLdouble) MAX_LIST_NESTING;
*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;
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;
*params = (GLdouble) ctx->Point.Size;
break;
case GL_POINT_SIZE_GRANULARITY:
- *params = (GLdouble) POINT_SIZE_GRANULARITY;
+ *params = (GLdouble) ctx->Const.PointSizeGranularity;
break;
case GL_POINT_SIZE_RANGE:
- params[0] = (GLdouble) MIN_POINT_SIZE;
- params[1] = (GLdouble) MAX_POINT_SIZE;
+ params[0] = (GLdouble) ctx->Const.MinPointSizeAA;
+ params[1] = (GLdouble) ctx->Const.MaxPointSizeAA;
+ break;
+ case GL_ALIASED_POINT_SIZE_RANGE:
+ params[0] = (GLdouble) ctx->Const.MinPointSize;
+ params[1] = (GLdouble) ctx->Const.MaxPointSize;
break;
case GL_POINT_SMOOTH:
*params = (GLdouble) ctx->Point.SmoothFlag;
params[0] = ENUM_TO_DOUBLE(ctx->Polygon.FrontMode);
params[1] = ENUM_TO_DOUBLE(ctx->Polygon.BackMode);
break;
-#ifdef GL_EXT_polygon_offset
- case GL_POLYGON_OFFSET_BIAS_EXT:
+ case GL_POLYGON_OFFSET_BIAS_EXT: /* GL_EXT_polygon_offset */
*params = (GLdouble) ctx->Polygon.OffsetUnits;
break;
-#endif
case GL_POLYGON_OFFSET_FACTOR:
*params = (GLdouble) ctx->Polygon.OffsetFactor;
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->Pixel.RedBias;
break;
case GL_RED_BITS:
- *params = (GLdouble) ctx->Visual->RedBits;
+ *params = (GLdouble) ctx->Visual.redBits;
break;
case GL_RED_SCALE:
*params = (GLdouble) ctx->Pixel.RedScale;
case GL_RENDER_MODE:
*params = ENUM_TO_DOUBLE(ctx->RenderMode);
break;
+ case GL_RESCALE_NORMAL:
+ *params = (GLdouble) ctx->Transform.RescaleNormals;
+ break;
case GL_RGBA_MODE:
- *params = (GLdouble) ctx->Visual->RGBAflag;
+ *params = (GLdouble) ctx->Visual.rgbMode;
break;
case GL_SCISSOR_BOX:
params[0] = (GLdouble) ctx->Scissor.X;
*params = (GLdouble) ctx->Texture.SharedPalette;
break;
case GL_STENCIL_BITS:
- *params = (GLdouble) ctx->Visual->StencilBits;
+ *params = (GLdouble) ctx->Visual.stencilBits;
break;
case GL_STENCIL_CLEAR_VALUE:
*params = (GLdouble) ctx->Stencil.Clear;
*params = (GLdouble) ctx->Stencil.WriteMask;
break;
case GL_STEREO:
- *params = (GLdouble) ctx->Visual->StereoFlag;
+ *params = (GLdouble) ctx->Visual.stereoMode;
break;
case GL_SUBPIXEL_BITS:
- *params = 0.0; /* TODO */
+ *params = (GLdouble) ctx->Const.SubPixelBits;
break;
case GL_TEXTURE_1D:
*params = _mesa_IsEnabled(GL_TEXTURE_1D) ? 1.0 : 0.0;
*params = _mesa_IsEnabled(GL_TEXTURE_3D) ? 1.0 : 0.0;
break;
case GL_TEXTURE_BINDING_1D:
- *params = (GLdouble) textureUnit->CurrentD[1]->Name;
+ *params = (GLdouble) textureUnit->Current1D->Name;
break;
case GL_TEXTURE_BINDING_2D:
- *params = (GLdouble) textureUnit->CurrentD[2]->Name;
+ *params = (GLdouble) textureUnit->Current2D->Name;
break;
case GL_TEXTURE_BINDING_3D:
- *params = (GLdouble) textureUnit->CurrentD[3]->Name;
+ *params = (GLdouble) textureUnit->Current3D->Name;
break;
case GL_TEXTURE_ENV_COLOR:
params[0] = (GLdouble) textureUnit->EnvColor[0];
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;
*params = 0.0;
break;
+ /* GL_ARB_multitexture */
case GL_MAX_TEXTURE_UNITS_ARB:
*params = (GLdouble) ctx->Const.MaxTextureUnits;
break;
*params = (GLdouble) (GL_TEXTURE0_ARB + ctx->Array.ActiveTexture);
break;
+ /* GL_ARB_texture_cube_map */
+ case GL_TEXTURE_CUBE_MAP_ARB:
+ CHECK_EXTENSION_D(ARB_texture_cube_map);
+ *params = (GLdouble) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
+ break;
+ case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
+ CHECK_EXTENSION_D(ARB_texture_cube_map);
+ *params = (GLdouble) textureUnit->CurrentCubeMap->Name;
+ break;
+ case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
+ CHECK_EXTENSION_D(ARB_texture_cube_map);
+ *params = (GLdouble) (1 << (ctx->Const.MaxCubeTextureLevels - 1));
+ break;
- /* GL_PGI_misc_hints */
- case GL_STRICT_DEPTHFUNC_HINT_PGI:
- *params = ENUM_TO_DOUBLE(GL_NICEST);
+ /* GL_ARB_texture_compression */
+ case GL_TEXTURE_COMPRESSION_HINT_ARB:
+ CHECK_EXTENSION_D(ARB_texture_compression);
+ *params = (GLdouble) ctx->Hint.TextureCompression;
break;
- case GL_STRICT_LIGHTING_HINT_PGI:
- *params = ENUM_TO_DOUBLE(ctx->Hint.StrictLighting);
- break;
- case GL_STRICT_SCISSOR_HINT_PGI:
- case GL_FULL_STIPPLE_HINT_PGI:
- *params = ENUM_TO_DOUBLE(GL_TRUE);
- break;
- case GL_CONSERVE_MEMORY_HINT_PGI:
- *params = ENUM_TO_DOUBLE(GL_FALSE);
- break;
- case GL_ALWAYS_FAST_HINT_PGI:
- *params = (GLdouble) (ctx->Hint.AllowDrawWin == GL_TRUE &&
- ctx->Hint.AllowDrawSpn == GL_FALSE &&
- ctx->Hint.AllowDrawMem == GL_FALSE);
- break;
- case GL_ALWAYS_SOFT_HINT_PGI:
- *params = (GLdouble) (ctx->Hint.AllowDrawWin == GL_TRUE &&
- ctx->Hint.AllowDrawSpn == GL_TRUE &&
- ctx->Hint.AllowDrawMem == GL_TRUE);
+ case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
+ CHECK_EXTENSION_D(ARB_texture_compression);
+ *params = (GLdouble) ctx->Const.NumCompressedTextureFormats;
+ break;
+ case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
+ CHECK_EXTENSION_D(ARB_texture_compression);
+ {
+ GLuint i;
+ for (i = 0; i < ctx->Const.NumCompressedTextureFormats; i++)
+ params[i] = (GLdouble) ctx->Const.CompressedTextureFormats[i];
+ }
+ break;
+
+ /* GL_EXT_compiled_vertex_array */
+ case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT:
+ *params = (GLdouble) ctx->Array.LockFirst;
break;
- case GL_ALLOW_DRAW_OBJ_HINT_PGI:
- *params = (GLdouble) GL_TRUE;
+ case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT:
+ *params = (GLdouble) ctx->Array.LockCount;
break;
- case GL_ALLOW_DRAW_WIN_HINT_PGI:
- *params = (GLdouble) ctx->Hint.AllowDrawWin;
+
+ /* GL_ARB_transpose_matrix */
+ case GL_TRANSPOSE_COLOR_MATRIX_ARB:
+ {
+ GLfloat tm[16];
+ GLuint i;
+ _math_transposef(tm, ctx->ColorMatrixStack.Top->m);
+ for (i=0;i<16;i++) {
+ params[i] = (GLdouble) tm[i];
+ }
+ }
+ break;
+ case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB:
+ {
+ GLfloat tm[16];
+ GLuint i;
+ _math_transposef(tm, ctx->ModelviewMatrixStack.Top->m);
+ for (i=0;i<16;i++) {
+ params[i] = (GLdouble) tm[i];
+ }
+ }
+ break;
+ case GL_TRANSPOSE_PROJECTION_MATRIX_ARB:
+ {
+ GLfloat tm[16];
+ GLuint i;
+ _math_transposef(tm, ctx->ProjectionMatrixStack.Top->m);
+ for (i=0;i<16;i++) {
+ params[i] = (GLdouble) tm[i];
+ }
+ }
+ break;
+ case GL_TRANSPOSE_TEXTURE_MATRIX_ARB:
+ {
+ GLfloat tm[16];
+ GLuint i;
+ _math_transposef(tm, ctx->TextureMatrixStack[texUnit].Top->m);
+ for (i=0;i<16;i++) {
+ params[i] = (GLdouble) tm[i];
+ }
+ }
+ break;
+
+ /* GL_HP_occlusion_test */
+ case GL_OCCLUSION_TEST_HP:
+ CHECK_EXTENSION_D(HP_occlusion_test);
+ *params = (GLdouble) ctx->Depth.OcclusionTest;
+ break;
+ case GL_OCCLUSION_TEST_RESULT_HP:
+ CHECK_EXTENSION_D(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;
+ break;
+
+ /* GL_SGIS_pixel_texture */
+ case GL_PIXEL_TEXTURE_SGIS:
+ *params = (GLdouble) ctx->Pixel.PixelTextureEnabled;
+ break;
+
+ /* GL_SGIX_pixel_texture */
+ case GL_PIXEL_TEX_GEN_SGIX:
+ *params = (GLdouble) ctx->Pixel.PixelTextureEnabled;
+ break;
+ case GL_PIXEL_TEX_GEN_MODE_SGIX:
+ *params = (GLdouble) pixel_texgen_mode(ctx);
+ break;
+
+ /* GL_SGI_color_matrix (also in 1.2 imaging) */
+ case GL_COLOR_MATRIX_SGI:
+ for (i=0;i<16;i++) {
+ params[i] = (GLdouble) ctx->ColorMatrixStack.Top->m[i];
+ }
break;
- case GL_ALLOW_DRAW_SPN_HINT_PGI:
- *params = (GLdouble) ctx->Hint.AllowDrawSpn;
+ case GL_COLOR_MATRIX_STACK_DEPTH_SGI:
+ *params = (GLdouble) (ctx->ColorMatrixStack.Depth + 1);
+ break;
+ case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI:
+ *params = (GLdouble) MAX_COLOR_STACK_DEPTH;
+ break;
+ case GL_POST_COLOR_MATRIX_RED_SCALE_SGI:
+ *params = (GLdouble) ctx->Pixel.PostColorMatrixScale[0];
+ break;
+ case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI:
+ *params = (GLdouble) ctx->Pixel.PostColorMatrixScale[1];
+ break;
+ case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI:
+ *params = (GLdouble) ctx->Pixel.PostColorMatrixScale[2];
+ break;
+ case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI:
+ *params = (GLdouble) ctx->Pixel.PostColorMatrixScale[3];
+ break;
+ case GL_POST_COLOR_MATRIX_RED_BIAS_SGI:
+ *params = (GLdouble) ctx->Pixel.PostColorMatrixBias[0];
+ break;
+ case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI:
+ *params = (GLdouble) ctx->Pixel.PostColorMatrixBias[1];
+ break;
+ case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI:
+ *params = (GLdouble) ctx->Pixel.PostColorMatrixBias[2];
+ break;
+ case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI:
+ *params = (GLdouble) ctx->Pixel.PostColorMatrixBias[3];
+ break;
+
+ /* GL_EXT_convolution (also in 1.2 imaging) */
+ case GL_CONVOLUTION_1D_EXT:
+ CHECK_EXTENSION_D(EXT_convolution);
+ *params = (GLdouble) ctx->Pixel.Convolution1DEnabled;
+ break;
+ case GL_CONVOLUTION_2D:
+ CHECK_EXTENSION_D(EXT_convolution);
+ *params = (GLdouble) ctx->Pixel.Convolution2DEnabled;
+ break;
+ case GL_SEPARABLE_2D:
+ CHECK_EXTENSION_D(EXT_convolution);
+ *params = (GLdouble) ctx->Pixel.Separable2DEnabled;
+ break;
+ case GL_MAX_CONVOLUTION_WIDTH:
+ CHECK_EXTENSION_D(EXT_convolution);
+ *params = (GLdouble) ctx->Const.MaxConvolutionWidth;
+ break;
+ case GL_MAX_CONVOLUTION_HEIGHT:
+ CHECK_EXTENSION_D(EXT_convolution);
+ *params = (GLdouble) ctx->Const.MaxConvolutionHeight;
+ break;
+ case GL_POST_CONVOLUTION_RED_SCALE_EXT:
+ CHECK_EXTENSION_D(EXT_convolution);
+ *params = (GLdouble) ctx->Pixel.PostConvolutionScale[0];
+ break;
+ case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:
+ CHECK_EXTENSION_D(EXT_convolution);
+ *params = (GLdouble) ctx->Pixel.PostConvolutionScale[1];
+ break;
+ case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:
+ CHECK_EXTENSION_D(EXT_convolution);
+ *params = (GLdouble) ctx->Pixel.PostConvolutionScale[2];
+ break;
+ case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:
+ CHECK_EXTENSION_D(EXT_convolution);
+ *params = (GLdouble) ctx->Pixel.PostConvolutionScale[3];
+ break;
+ case GL_POST_CONVOLUTION_RED_BIAS_EXT:
+ CHECK_EXTENSION_D(EXT_convolution);
+ *params = (GLdouble) ctx->Pixel.PostConvolutionBias[0];
+ break;
+ case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:
+ CHECK_EXTENSION_D(EXT_convolution);
+ *params = (GLdouble) ctx->Pixel.PostConvolutionBias[1];
+ break;
+ case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:
+ CHECK_EXTENSION_D(EXT_convolution);
+ *params = (GLdouble) ctx->Pixel.PostConvolutionBias[2];
+ break;
+ case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:
+ CHECK_EXTENSION_D(EXT_convolution);
+ *params = (GLdouble) ctx->Pixel.PostConvolutionBias[2];
+ break;
+
+ /* GL_EXT_histogram (also in 1.2 imaging) */
+ case GL_HISTOGRAM:
+ CHECK_EXTENSION_D(EXT_histogram);
+ *params = (GLdouble) ctx->Pixel.HistogramEnabled;
break;
- case GL_ALLOW_DRAW_MEM_HINT_PGI:
- *params = (GLdouble) ctx->Hint.AllowDrawMem;
+ case GL_MINMAX:
+ CHECK_EXTENSION_D(EXT_histogram);
+ *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;
+ break;
+ case GL_POST_CONVOLUTION_COLOR_TABLE_SGI:
+ *params = (GLdouble) ctx->Pixel.PostConvolutionColorTableEnabled;
+ break;
+ case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
+ *params = (GLdouble) ctx->Pixel.PostColorMatrixColorTableEnabled;
+ break;
+
+ /* GL_EXT_secondary_color */
+ case GL_COLOR_SUM_EXT:
+ CHECK_EXTENSION_D(EXT_secondary_color);
+ *params = (GLdouble) ctx->Fog.ColorSumEnabled;
+ break;
+ case GL_CURRENT_SECONDARY_COLOR_EXT:
+ CHECK_EXTENSION_D(EXT_secondary_color);
+ FLUSH_CURRENT(ctx, 0);
+ 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];
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_EXT:
+ CHECK_EXTENSION_D(EXT_secondary_color);
+ *params = (GLdouble) ctx->Array.SecondaryColor.Enabled;
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT:
+ CHECK_EXTENSION_D(EXT_secondary_color);
+ *params = (GLdouble) ctx->Array.SecondaryColor.Type;
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT:
+ CHECK_EXTENSION_D(EXT_secondary_color);
+ *params = (GLdouble) ctx->Array.SecondaryColor.Stride;
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT:
+ CHECK_EXTENSION_D(EXT_secondary_color);
+ *params = (GLdouble) ctx->Array.SecondaryColor.Stride;
break;
- case GL_CLIP_NEAR_HINT_PGI:
- case GL_CLIP_FAR_HINT_PGI:
- *params = ENUM_TO_DOUBLE(GL_TRUE);
+
+ /* GL_EXT_fog_coord */
+ case GL_CURRENT_FOG_COORDINATE_EXT:
+ CHECK_EXTENSION_D(EXT_fog_coord);
+ FLUSH_CURRENT(ctx, 0);
+ *params = (GLdouble) ctx->Current.Attrib[VERT_ATTRIB_FOG][0];
break;
- case GL_WIDE_LINE_HINT_PGI:
- *params = ENUM_TO_DOUBLE(GL_DONT_CARE);
+ case GL_FOG_COORDINATE_ARRAY_EXT:
+ CHECK_EXTENSION_D(EXT_fog_coord);
+ *params = (GLdouble) ctx->Array.FogCoord.Enabled;
+ break;
+ case GL_FOG_COORDINATE_ARRAY_TYPE_EXT:
+ CHECK_EXTENSION_D(EXT_fog_coord);
+ *params = (GLdouble) ctx->Array.FogCoord.Type;
break;
- case GL_BACK_NORMALS_HINT_PGI:
- *params = ENUM_TO_DOUBLE(GL_TRUE);
+ case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT:
+ CHECK_EXTENSION_D(EXT_fog_coord);
+ *params = (GLdouble) ctx->Array.FogCoord.Stride;
break;
- case GL_NATIVE_GRAPHICS_HANDLE_PGI:
- *params = 0;
+
+ /* GL_EXT_texture_lod_bias */
+ case GL_MAX_TEXTURE_LOD_BIAS_EXT:
+ *params = (GLdouble) ctx->Const.MaxTextureLodBias;
+ break;
+
+ /* GL_EXT_texture_filter_anisotropic */
+ case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
+ CHECK_EXTENSION_D(EXT_texture_filter_anisotropic);
+ *params = (GLdouble) ctx->Const.MaxTextureMaxAnisotropy;
break;
+ /* GL_ARB_multisample */
+ case GL_MULTISAMPLE_ARB:
+ CHECK_EXTENSION_D(ARB_multisample);
+ *params = (GLdouble) ctx->Multisample.Enabled;
+ break;
+ case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
+ CHECK_EXTENSION_D(ARB_multisample);
+ *params = (GLdouble) ctx->Multisample.SampleAlphaToCoverage;
+ break;
+ case GL_SAMPLE_ALPHA_TO_ONE_ARB:
+ CHECK_EXTENSION_D(ARB_multisample);
+ *params = (GLdouble) ctx->Multisample.SampleAlphaToOne;
+ break;
+ case GL_SAMPLE_COVERAGE_ARB:
+ CHECK_EXTENSION_D(ARB_multisample);
+ *params = (GLdouble) ctx->Multisample.SampleCoverage;
+ break;
+ case GL_SAMPLE_COVERAGE_VALUE_ARB:
+ CHECK_EXTENSION_D(ARB_multisample);
+ *params = ctx->Multisample.SampleCoverageValue;
+ break;
+ case GL_SAMPLE_COVERAGE_INVERT_ARB:
+ CHECK_EXTENSION_D(ARB_multisample);
+ *params = (GLdouble) ctx->Multisample.SampleCoverageInvert;
+ break;
+ case GL_SAMPLE_BUFFERS_ARB:
+ CHECK_EXTENSION_D(ARB_multisample);
+ *params = 0.0; /* XXX fix someday */
+ break;
+ case GL_SAMPLES_ARB:
+ CHECK_EXTENSION_D(ARB_multisample);
+ *params = 0.0; /* XXX fix someday */
+ break;
+
+ /* GL_IBM_rasterpos_clip */
+ case GL_RASTER_POSITION_UNCLIPPED_IBM:
+ CHECK_EXTENSION_D(IBM_rasterpos_clip);
+ *params = (GLdouble) ctx->Transform.RasterPositionUnclipped;
+ break;
+
+ /* GL_MESA_sprite_point */
+ case GL_SPRITE_POINT_MESA:
+ CHECK_EXTENSION_D(MESA_sprite_point);
+ *params = (GLdouble) ctx->Point.SpriteMode;
+ break;
+
+ /* GL_SGIS_generate_mipmap */
+ case GL_GENERATE_MIPMAP_HINT_SGIS:
+ CHECK_EXTENSION_D(SGIS_generate_mipmap);
+ *params = (GLdouble) ctx->Hint.GenerateMipmap;
+ break;
+ /* GL_NV_vertex_program */
+ /* XXX to do */
default:
- printf("invalid enum: %x\n", pname);
- gl_error( ctx, GL_INVALID_ENUM, "glGetDoublev" );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetDoublev" );
}
}
-
+#define GET_FLOAT_ERROR \
+{ \
+ char s[100]; \
+ sprintf(s, "glGetFloatv(0x%x)", pname); \
+ _mesa_error(ctx, GL_INVALID_ENUM, s); \
+}
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;
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetFloatv");
+ /* 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 (MESA_VERBOSE & VERBOSE_API)
+ fprintf(stderr, "glGetFloatv %s\n", _mesa_lookup_enum_by_nr(pname));
- 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;
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->AccumBits;
+ *params = (GLfloat) ctx->Visual.accumAlphaBits;
break;
case GL_ACCUM_CLEAR_VALUE:
params[0] = ctx->Accum.ClearColor[0];
*params = ctx->Pixel.AlphaBias;
break;
case GL_ALPHA_BITS:
- *params = (GLfloat) ctx->Visual->AlphaBits;
+ *params = (GLfloat) ctx->Visual.alphaBits;
break;
case GL_ALPHA_SCALE:
*params = ctx->Pixel.AlphaScale;
*params = ENUM_TO_FLOAT(ctx->Color.AlphaFunc);
break;
case GL_ALPHA_TEST_REF:
- *params = (GLfloat) ctx->Color.AlphaRef / 255.0;
+ *params = (GLfloat) ctx->Color.AlphaRef / CHAN_MAXF;
break;
case GL_ATTRIB_STACK_DEPTH:
*params = (GLfloat) (ctx->AttribStackDepth);
*params = (GLfloat) ctx->Eval.AutoNormal;
break;
case GL_AUX_BUFFERS:
- *params = (GLfloat) NUM_AUX_BUFFERS;
+ *params = (GLfloat) ctx->Const.NumAuxBuffers;
break;
case GL_BLEND:
*params = (GLfloat) ctx->Color.BlendEnabled;
case GL_BLEND_SRC:
*params = ENUM_TO_FLOAT(ctx->Color.BlendSrcRGB);
break;
- case GL_BLEND_SRC_RGB_INGR:
+ case GL_BLEND_SRC_RGB_EXT:
*params = ENUM_TO_FLOAT(ctx->Color.BlendSrcRGB);
break;
- case GL_BLEND_DST_RGB_INGR:
+ case GL_BLEND_DST_RGB_EXT:
*params = ENUM_TO_FLOAT(ctx->Color.BlendDstRGB);
break;
- case GL_BLEND_SRC_ALPHA_INGR:
+ case GL_BLEND_SRC_ALPHA_EXT:
*params = ENUM_TO_FLOAT(ctx->Color.BlendSrcA);
break;
- case GL_BLEND_DST_ALPHA_INGR:
+ case GL_BLEND_DST_ALPHA_EXT:
*params = ENUM_TO_FLOAT(ctx->Color.BlendDstA);
break;
case GL_BLEND_EQUATION_EXT:
*params = ctx->Pixel.BlueBias;
break;
case GL_BLUE_BITS:
- *params = (GLfloat) ctx->Visual->BlueBits;
+ *params = (GLfloat) ctx->Visual.blueBits;
break;
case GL_BLUE_SCALE:
*params = ctx->Pixel.BlueScale;
*params = (GLfloat) ctx->Transform.ClipEnabled[pname-GL_CLIP_PLANE0];
break;
case GL_COLOR_CLEAR_VALUE:
- params[0] = (GLfloat) ctx->Color.ClearColor[0];
- params[1] = (GLfloat) ctx->Color.ClearColor[1];
- params[2] = (GLfloat) ctx->Color.ClearColor[2];
- params[3] = (GLfloat) ctx->Color.ClearColor[3];
+ 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]);
break;
case GL_COLOR_MATERIAL:
*params = (GLfloat) ctx->Light.ColorMaterialEnabled;
*params = ENUM_TO_FLOAT(ctx->Polygon.CullFaceMode);
break;
case GL_CURRENT_COLOR:
- UBYTE_RGBA_TO_FLOAT_RGBA(params, ctx->Current.ByteColor);
+ FLUSH_CURRENT(ctx, 0);
+ 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);
*params = (GLfloat) ctx->Current.Index;
break;
case GL_CURRENT_NORMAL:
- params[0] = ctx->Current.Normal[0];
- params[1] = ctx->Current.Normal[1];
- params[2] = ctx->Current.Normal[2];
+ FLUSH_CURRENT(ctx, 0);
+ 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[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.RasterMultiTexCoord[texUnit][0];
+ params[1] = ctx->Current.RasterMultiTexCoord[texUnit][1];
+ params[2] = ctx->Current.RasterMultiTexCoord[texUnit][2];
+ params[3] = ctx->Current.RasterMultiTexCoord[texUnit][3];
break;
case GL_CURRENT_RASTER_POSITION_VALID:
*params = (GLfloat) ctx->Current.RasterPosValid;
break;
case GL_CURRENT_TEXTURE_COORDS:
- 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];
+ FLUSH_CURRENT(ctx, 0);
+ 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;
break;
case GL_DEPTH_BITS:
- *params = (GLfloat) ctx->Visual->DepthBits;
+ *params = (GLfloat) ctx->Visual.depthBits;
break;
case GL_DEPTH_CLEAR_VALUE:
*params = (GLfloat) ctx->Depth.Clear;
*params = (GLfloat) ctx->Color.DitherFlag;
break;
case GL_DOUBLEBUFFER:
- *params = (GLfloat) ctx->Visual->DBflag;
+ *params = (GLfloat) ctx->Visual.doubleBufferMode;
break;
case GL_DRAW_BUFFER:
*params = ENUM_TO_FLOAT(ctx->Color.DrawBuffer);
break;
case GL_EDGE_FLAG:
+ FLUSH_CURRENT(ctx, 0);
*params = (GLfloat) ctx->Current.EdgeFlag;
break;
case GL_FEEDBACK_BUFFER_SIZE:
- /* TODO: is this right? Or, return number of entries in buffer? */
*params = (GLfloat) ctx->Feedback.BufferSize;
break;
case GL_FEEDBACK_BUFFER_TYPE:
*params = (GLfloat) ctx->Pixel.GreenBias;
break;
case GL_GREEN_BITS:
- *params = (GLfloat) ctx->Visual->GreenBits;
+ *params = (GLfloat) ctx->Visual.greenBits;
break;
case GL_GREEN_SCALE:
*params = (GLfloat) ctx->Pixel.GreenScale;
break;
case GL_INDEX_BITS:
- *params = (GLfloat) ctx->Visual->IndexBits;
+ *params = (GLfloat) ctx->Visual.indexBits;
break;
case GL_INDEX_CLEAR_VALUE:
*params = (GLfloat) ctx->Color.ClearIndex;
break;
case GL_INDEX_MODE:
- *params = ctx->Visual->RGBAflag ? 0.0F : 1.0F;
+ *params = ctx->Visual.rgbMode ? 0.0F : 1.0F;
break;
case GL_INDEX_OFFSET:
*params = (GLfloat) ctx->Pixel.IndexOffset;
*params = (GLfloat) ctx->Line.Width;
break;
case GL_LINE_WIDTH_GRANULARITY:
- *params = (GLfloat) LINE_WIDTH_GRANULARITY;
+ *params = (GLfloat) ctx->Const.LineWidthGranularity;
break;
case GL_LINE_WIDTH_RANGE:
- params[0] = (GLfloat) MIN_LINE_WIDTH;
- params[1] = (GLfloat) MAX_LINE_WIDTH;
+ params[0] = (GLfloat) ctx->Const.MinLineWidthAA;
+ params[1] = (GLfloat) ctx->Const.MaxLineWidthAA;
+ break;
+ case GL_ALIASED_LINE_WIDTH_RANGE:
+ params[0] = (GLfloat) ctx->Const.MinLineWidth;
+ params[1] = (GLfloat) ctx->Const.MaxLineWidth;
break;
case GL_LIST_BASE:
*params = (GLfloat) ctx->List.ListBase;
*params = (GLfloat) MAX_CLIENT_ATTRIB_STACK_DEPTH;
break;
case GL_MAX_CLIP_PLANES:
- *params = (GLfloat) MAX_CLIP_PLANES;
+ *params = (GLfloat) ctx->Const.MaxClipPlanes;
break;
case GL_MAX_ELEMENTS_VERTICES: /* GL_VERSION_1_2 */
- *params = (GLfloat) VB_MAX;
+ *params = (GLfloat) ctx->Const.MaxArrayLockSize;
break;
case GL_MAX_ELEMENTS_INDICES: /* GL_VERSION_1_2 */
- *params = (GLfloat) VB_MAX;
+ *params = (GLfloat) ctx->Const.MaxArrayLockSize;
break;
case GL_MAX_EVAL_ORDER:
*params = (GLfloat) MAX_EVAL_ORDER;
break;
case GL_MAX_LIGHTS:
- *params = (GLfloat) MAX_LIGHTS;
+ *params = (GLfloat) ctx->Const.MaxLights;
break;
case GL_MAX_LIST_NESTING:
*params = (GLfloat) MAX_LIST_NESTING;
*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;
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;
*params = (GLfloat) ctx->Point.Size;
break;
case GL_POINT_SIZE_GRANULARITY:
- *params = (GLfloat) POINT_SIZE_GRANULARITY;
+ *params = (GLfloat) ctx->Const.PointSizeGranularity;
break;
case GL_POINT_SIZE_RANGE:
- params[0] = (GLfloat) MIN_POINT_SIZE;
- params[1] = (GLfloat) MAX_POINT_SIZE;
+ params[0] = (GLfloat) ctx->Const.MinPointSizeAA;
+ params[1] = (GLfloat) ctx->Const.MaxPointSizeAA;
+ break;
+ case GL_ALIASED_POINT_SIZE_RANGE:
+ params[0] = (GLfloat) ctx->Const.MinPointSize;
+ params[1] = (GLfloat) ctx->Const.MaxPointSize;
break;
case GL_POINT_SMOOTH:
*params = (GLfloat) ctx->Point.SmoothFlag;
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 = ctx->Pixel.RedBias;
break;
case GL_RED_BITS:
- *params = (GLfloat) ctx->Visual->RedBits;
+ *params = (GLfloat) ctx->Visual.redBits;
break;
case GL_RED_SCALE:
*params = ctx->Pixel.RedScale;
case GL_RENDER_MODE:
*params = ENUM_TO_FLOAT(ctx->RenderMode);
break;
+ case GL_RESCALE_NORMAL:
+ *params = (GLfloat) ctx->Transform.RescaleNormals;
+ break;
case GL_RGBA_MODE:
- *params = (GLfloat) ctx->Visual->RGBAflag;
+ *params = (GLfloat) ctx->Visual.rgbMode;
break;
case GL_SCISSOR_BOX:
params[0] = (GLfloat) ctx->Scissor.X;
*params = (GLfloat) ctx->Texture.SharedPalette;
break;
case GL_STENCIL_BITS:
- *params = (GLfloat) ctx->Visual->StencilBits;
+ *params = (GLfloat) ctx->Visual.stencilBits;
break;
case GL_STENCIL_CLEAR_VALUE:
*params = (GLfloat) ctx->Stencil.Clear;
*params = (GLfloat) ctx->Stencil.WriteMask;
break;
case GL_STEREO:
- *params = (GLfloat) ctx->Visual->StereoFlag;
+ *params = (GLfloat) ctx->Visual.stereoMode;
break;
case GL_SUBPIXEL_BITS:
- *params = 0.0F; /* TODO */
+ *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->CurrentD[1]->Name;
+ *params = (GLfloat) textureUnit->Current1D->Name;
break;
case GL_TEXTURE_BINDING_2D:
- *params = (GLfloat) textureUnit->CurrentD[2]->Name;
+ *params = (GLfloat) textureUnit->Current2D->Name;
break;
case GL_TEXTURE_BINDING_3D:
- *params = (GLfloat) textureUnit->CurrentD[2]->Name;
+ *params = (GLfloat) textureUnit->Current2D->Name;
break;
case GL_TEXTURE_ENV_COLOR:
params[0] = textureUnit->EnvColor[0];
*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;
*params = 0.0;
break;
+ /* GL_ARB_multitexture */
case GL_MAX_TEXTURE_UNITS_ARB:
*params = (GLfloat) ctx->Const.MaxTextureUnits;
break;
*params = (GLfloat) (GL_TEXTURE0_ARB + ctx->Array.ActiveTexture);
break;
- /* GL_PGI_misc_hints */
- case GL_STRICT_DEPTHFUNC_HINT_PGI:
- *params = ENUM_TO_FLOAT(GL_NICEST);
+ /* GL_ARB_texture_cube_map */
+ case GL_TEXTURE_CUBE_MAP_ARB:
+ CHECK_EXTENSION_F(ARB_texture_cube_map);
+ *params = (GLfloat) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
break;
- case GL_STRICT_LIGHTING_HINT_PGI:
- *params = ENUM_TO_FLOAT(ctx->Hint.StrictLighting);
- break;
- case GL_STRICT_SCISSOR_HINT_PGI:
- case GL_FULL_STIPPLE_HINT_PGI:
- *params = ENUM_TO_FLOAT(GL_TRUE);
- break;
- case GL_CONSERVE_MEMORY_HINT_PGI:
- *params = ENUM_TO_FLOAT(GL_FALSE);
- break;
- case GL_ALWAYS_FAST_HINT_PGI:
- *params = (GLfloat) (ctx->Hint.AllowDrawWin == GL_TRUE &&
- ctx->Hint.AllowDrawSpn == GL_FALSE &&
- ctx->Hint.AllowDrawMem == GL_FALSE);
- break;
- case GL_ALWAYS_SOFT_HINT_PGI:
- *params = (GLfloat) (ctx->Hint.AllowDrawWin == GL_TRUE &&
- ctx->Hint.AllowDrawSpn == GL_TRUE &&
- ctx->Hint.AllowDrawMem == GL_TRUE);
+ case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
+ CHECK_EXTENSION_F(ARB_texture_cube_map);
+ *params = (GLfloat) textureUnit->CurrentCubeMap->Name;
+ break;
+ case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
+ CHECK_EXTENSION_F(ARB_texture_cube_map);
+ *params = (GLfloat) (1 << (ctx->Const.MaxCubeTextureLevels - 1));
+ break;
+
+ /* GL_ARB_texture_compression */
+ case GL_TEXTURE_COMPRESSION_HINT_ARB:
+ CHECK_EXTENSION_F(ARB_texture_compression);
+ *params = (GLfloat) ctx->Hint.TextureCompression;
+ break;
+ case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
+ CHECK_EXTENSION_F(ARB_texture_compression);
+ *params = (GLfloat) ctx->Const.NumCompressedTextureFormats;
+ break;
+ case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
+ CHECK_EXTENSION_F(ARB_texture_compression);
+ {
+ GLuint i;
+ for (i = 0; i < ctx->Const.NumCompressedTextureFormats; i++)
+ params[i] = (GLfloat) ctx->Const.CompressedTextureFormats[i];
+ }
+ break;
+
+ /* GL_EXT_compiled_vertex_array */
+ case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT:
+ CHECK_EXTENSION_F(EXT_compiled_vertex_array);
+ *params = (GLfloat) ctx->Array.LockFirst;
break;
- case GL_ALLOW_DRAW_OBJ_HINT_PGI:
- *params = (GLfloat) GL_TRUE;
+ case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT:
+ CHECK_EXTENSION_F(EXT_compiled_vertex_array);
+ *params = (GLfloat) ctx->Array.LockCount;
break;
- case GL_ALLOW_DRAW_WIN_HINT_PGI:
- *params = (GLfloat) ctx->Hint.AllowDrawWin;
+
+ /* GL_ARB_transpose_matrix */
+ case GL_TRANSPOSE_COLOR_MATRIX_ARB:
+ _math_transposef(params, ctx->ColorMatrixStack.Top->m);
+ break;
+ case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB:
+ _math_transposef(params, ctx->ModelviewMatrixStack.Top->m);
+ break;
+ case GL_TRANSPOSE_PROJECTION_MATRIX_ARB:
+ _math_transposef(params, ctx->ProjectionMatrixStack.Top->m);
+ break;
+ case GL_TRANSPOSE_TEXTURE_MATRIX_ARB:
+ _math_transposef(params, ctx->TextureMatrixStack[texUnit].Top->m);
+ break;
+
+ /* GL_HP_occlusion_test */
+ case GL_OCCLUSION_TEST_HP:
+ CHECK_EXTENSION_F(HP_occlusion_test);
+ *params = (GLfloat) ctx->Depth.OcclusionTest;
+ break;
+ case GL_OCCLUSION_TEST_RESULT_HP:
+ CHECK_EXTENSION_F(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;
+ break;
+
+ /* GL_SGIS_pixel_texture */
+ case GL_PIXEL_TEXTURE_SGIS:
+ *params = (GLfloat) ctx->Pixel.PixelTextureEnabled;
+ break;
+
+ /* GL_SGIX_pixel_texture */
+ case GL_PIXEL_TEX_GEN_SGIX:
+ *params = (GLfloat) ctx->Pixel.PixelTextureEnabled;
+ break;
+ case GL_PIXEL_TEX_GEN_MODE_SGIX:
+ *params = (GLfloat) pixel_texgen_mode(ctx);
+ break;
+
+ /* GL_SGI_color_matrix (also in 1.2 imaging) */
+ case GL_COLOR_MATRIX_SGI:
+ for (i=0;i<16;i++) {
+ params[i] = ctx->ColorMatrixStack.Top->m[i];
+ }
break;
- case GL_ALLOW_DRAW_SPN_HINT_PGI:
- *params = (GLfloat) ctx->Hint.AllowDrawSpn;
+ case GL_COLOR_MATRIX_STACK_DEPTH_SGI:
+ *params = (GLfloat) (ctx->ColorMatrixStack.Depth + 1);
+ break;
+ case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI:
+ *params = (GLfloat) MAX_COLOR_STACK_DEPTH;
+ break;
+ case GL_POST_COLOR_MATRIX_RED_SCALE_SGI:
+ *params = ctx->Pixel.PostColorMatrixScale[0];
+ break;
+ case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI:
+ *params = ctx->Pixel.PostColorMatrixScale[1];
+ break;
+ case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI:
+ *params = ctx->Pixel.PostColorMatrixScale[2];
+ break;
+ case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI:
+ *params = ctx->Pixel.PostColorMatrixScale[3];
+ break;
+ case GL_POST_COLOR_MATRIX_RED_BIAS_SGI:
+ *params = ctx->Pixel.PostColorMatrixBias[0];
+ break;
+ case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI:
+ *params = ctx->Pixel.PostColorMatrixBias[1];
+ break;
+ case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI:
+ *params = ctx->Pixel.PostColorMatrixBias[2];
+ break;
+ case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI:
+ *params = ctx->Pixel.PostColorMatrixBias[3];
+ break;
+
+ /* GL_EXT_convolution (also in 1.2 imaging) */
+ case GL_CONVOLUTION_1D_EXT:
+ CHECK_EXTENSION_F(EXT_convolution);
+ *params = (GLfloat) ctx->Pixel.Convolution1DEnabled;
+ break;
+ case GL_CONVOLUTION_2D:
+ CHECK_EXTENSION_F(EXT_convolution);
+ *params = (GLfloat) ctx->Pixel.Convolution2DEnabled;
+ break;
+ case GL_SEPARABLE_2D:
+ CHECK_EXTENSION_F(EXT_convolution);
+ *params = (GLfloat) ctx->Pixel.Separable2DEnabled;
+ break;
+ case GL_MAX_CONVOLUTION_WIDTH:
+ CHECK_EXTENSION_F(EXT_convolution);
+ *params = (GLfloat) ctx->Const.MaxConvolutionWidth;
+ break;
+ case GL_MAX_CONVOLUTION_HEIGHT:
+ CHECK_EXTENSION_F(EXT_convolution);
+ *params = (GLfloat) ctx->Const.MaxConvolutionHeight;
+ break;
+ case GL_POST_CONVOLUTION_RED_SCALE_EXT:
+ CHECK_EXTENSION_F(EXT_convolution);
+ *params = ctx->Pixel.PostConvolutionScale[0];
+ break;
+ case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:
+ CHECK_EXTENSION_F(EXT_convolution);
+ *params = ctx->Pixel.PostConvolutionScale[1];
+ break;
+ case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:
+ CHECK_EXTENSION_F(EXT_convolution);
+ *params = ctx->Pixel.PostConvolutionScale[2];
+ break;
+ case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:
+ CHECK_EXTENSION_F(EXT_convolution);
+ *params = ctx->Pixel.PostConvolutionScale[3];
+ break;
+ case GL_POST_CONVOLUTION_RED_BIAS_EXT:
+ CHECK_EXTENSION_F(EXT_convolution);
+ *params = ctx->Pixel.PostConvolutionBias[0];
+ break;
+ case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:
+ CHECK_EXTENSION_F(EXT_convolution);
+ *params = ctx->Pixel.PostConvolutionBias[1];
+ break;
+ case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:
+ CHECK_EXTENSION_F(EXT_convolution);
+ *params = ctx->Pixel.PostConvolutionBias[2];
+ break;
+ case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:
+ CHECK_EXTENSION_F(EXT_convolution);
+ *params = ctx->Pixel.PostConvolutionBias[2];
+ break;
+
+ /* GL_EXT_histogram (also in 1.2 imaging) */
+ case GL_HISTOGRAM:
+ CHECK_EXTENSION_F(EXT_histogram);
+ *params = (GLfloat) ctx->Pixel.HistogramEnabled;
break;
- case GL_ALLOW_DRAW_MEM_HINT_PGI:
- *params = (GLfloat) ctx->Hint.AllowDrawMem;
+ case GL_MINMAX:
+ CHECK_EXTENSION_F(EXT_histogram);
+ *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;
+ break;
+ case GL_POST_CONVOLUTION_COLOR_TABLE_SGI:
+ *params = (GLfloat) ctx->Pixel.PostConvolutionColorTableEnabled;
+ break;
+ case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
+ *params = (GLfloat) ctx->Pixel.PostColorMatrixColorTableEnabled;
+ break;
+
+ /* GL_EXT_secondary_color */
+ case GL_COLOR_SUM_EXT:
+ CHECK_EXTENSION_F(EXT_secondary_color);
+ *params = (GLfloat) ctx->Fog.ColorSumEnabled;
+ break;
+ case GL_CURRENT_SECONDARY_COLOR_EXT:
+ CHECK_EXTENSION_F(EXT_secondary_color);
+ FLUSH_CURRENT(ctx, 0);
+ 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];
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_EXT:
+ CHECK_EXTENSION_F(EXT_secondary_color);
+ *params = (GLfloat) ctx->Array.SecondaryColor.Enabled;
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT:
+ CHECK_EXTENSION_F(EXT_secondary_color);
+ *params = (GLfloat) ctx->Array.SecondaryColor.Type;
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT:
+ CHECK_EXTENSION_F(EXT_secondary_color);
+ *params = (GLfloat) ctx->Array.SecondaryColor.Stride;
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT:
+ CHECK_EXTENSION_F(EXT_secondary_color);
+ *params = (GLfloat) ctx->Array.SecondaryColor.Stride;
break;
- case GL_CLIP_NEAR_HINT_PGI:
- case GL_CLIP_FAR_HINT_PGI:
- *params = ENUM_TO_FLOAT(GL_TRUE);
+
+ /* GL_EXT_fog_coord */
+ case GL_CURRENT_FOG_COORDINATE_EXT:
+ CHECK_EXTENSION_F(EXT_fog_coord);
+ FLUSH_CURRENT(ctx, 0);
+ *params = (GLfloat) ctx->Current.Attrib[VERT_ATTRIB_FOG][0];
break;
- case GL_WIDE_LINE_HINT_PGI:
- *params = ENUM_TO_FLOAT(GL_DONT_CARE);
+ case GL_FOG_COORDINATE_ARRAY_EXT:
+ CHECK_EXTENSION_F(EXT_fog_coord);
+ *params = (GLfloat) ctx->Array.FogCoord.Enabled;
+ break;
+ case GL_FOG_COORDINATE_ARRAY_TYPE_EXT:
+ CHECK_EXTENSION_F(EXT_fog_coord);
+ *params = (GLfloat) ctx->Array.FogCoord.Type;
break;
- case GL_BACK_NORMALS_HINT_PGI:
- *params = ENUM_TO_FLOAT(GL_TRUE);
+ case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT:
+ CHECK_EXTENSION_F(EXT_fog_coord);
+ *params = (GLfloat) ctx->Array.FogCoord.Stride;
break;
- case GL_NATIVE_GRAPHICS_HANDLE_PGI:
- *params = 0;
+
+ /* GL_EXT_texture_lod_bias */
+ case GL_MAX_TEXTURE_LOD_BIAS_EXT:
+ *params = ctx->Const.MaxTextureLodBias;
+ break;
+
+ /* GL_EXT_texture_filter_anisotropic */
+ case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
+ CHECK_EXTENSION_F(EXT_texture_filter_anisotropic);
+ *params = ctx->Const.MaxTextureMaxAnisotropy;
break;
+ /* GL_ARB_multisample */
+ case GL_MULTISAMPLE_ARB:
+ CHECK_EXTENSION_F(ARB_multisample);
+ *params = (GLfloat) ctx->Multisample.Enabled;
+ break;
+ case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
+ CHECK_EXTENSION_F(ARB_multisample);
+ *params = (GLfloat) ctx->Multisample.SampleAlphaToCoverage;
+ break;
+ case GL_SAMPLE_ALPHA_TO_ONE_ARB:
+ CHECK_EXTENSION_F(ARB_multisample);
+ *params = (GLfloat) ctx->Multisample.SampleAlphaToOne;
+ break;
+ case GL_SAMPLE_COVERAGE_ARB:
+ CHECK_EXTENSION_F(ARB_multisample);
+ *params = (GLfloat) ctx->Multisample.SampleCoverage;
+ break;
+ case GL_SAMPLE_COVERAGE_VALUE_ARB:
+ CHECK_EXTENSION_F(ARB_multisample);
+ *params = ctx->Multisample.SampleCoverageValue;
+ break;
+ case GL_SAMPLE_COVERAGE_INVERT_ARB:
+ CHECK_EXTENSION_F(ARB_multisample);
+ *params = (GLfloat) ctx->Multisample.SampleCoverageInvert;
+ break;
+ case GL_SAMPLE_BUFFERS_ARB:
+ CHECK_EXTENSION_F(ARB_multisample);
+ *params = 0.0; /* XXX fix someday */
+ break;
+ case GL_SAMPLES_ARB:
+ CHECK_EXTENSION_F(ARB_multisample);
+ *params = 0.0; /* XXX fix someday */
+ break;
+
+ /* GL_IBM_rasterpos_clip */
+ case GL_RASTER_POSITION_UNCLIPPED_IBM:
+ CHECK_EXTENSION_F(IBM_rasterpos_clip);
+ *params = (GLfloat) ctx->Transform.RasterPositionUnclipped;
+ break;
+
+ /* GL_MESA_sprite_point */
+ case GL_SPRITE_POINT_MESA:
+ CHECK_EXTENSION_F(MESA_sprite_point);
+ *params = (GLfloat) ctx->Point.SpriteMode;
+ break;
+
+ /* GL_SGIS_generate_mipmap */
+ case GL_GENERATE_MIPMAP_HINT_SGIS:
+ CHECK_EXTENSION_F(SGIS_generate_mipmap);
+ *params = (GLfloat) ctx->Hint.GenerateMipmap;
+ break;
+
+ /* GL_NV_vertex_program */
+ /* XXX to do */
+
default:
- printf("invalid enum: %x\n", pname);
- gl_error( ctx, GL_INVALID_ENUM, "glGetFloatv" );
+ GET_FLOAT_ERROR;
}
}
-
-
void
_mesa_GetIntegerv( GLenum pname, GLint *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);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetIntegerv");
+ if (!params)
+ return;
- if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glGetIntegerv %s\n", gl_lookup_enum_by_nr(pname));
+ /* 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 (MESA_VERBOSE & VERBOSE_API)
+ fprintf(stderr, "glGetIntegerv %s\n", _mesa_lookup_enum_by_nr(pname));
+
+ if (ctx->Driver.GetIntegerv
+ && (*ctx->Driver.GetIntegerv)(ctx, pname, params))
+ return;
switch (pname) {
case GL_ACCUM_RED_BITS:
+ *params = (GLint) ctx->Visual.accumRedBits;
+ break;
case GL_ACCUM_GREEN_BITS:
+ *params = (GLint) ctx->Visual.accumGreenBits;
+ break;
case GL_ACCUM_BLUE_BITS:
+ *params = (GLint) ctx->Visual.accumBlueBits;
+ break;
case GL_ACCUM_ALPHA_BITS:
- *params = (GLint) ctx->Visual->AccumBits;
+ *params = (GLint) ctx->Visual.accumAlphaBits;
break;
case GL_ACCUM_CLEAR_VALUE:
params[0] = FLOAT_TO_INT( ctx->Accum.ClearColor[0] );
*params = (GLint) ctx->Pixel.AlphaBias;
break;
case GL_ALPHA_BITS:
- *params = ctx->Visual->AlphaBits;
+ *params = ctx->Visual.alphaBits;
break;
case GL_ALPHA_SCALE:
*params = (GLint) ctx->Pixel.AlphaScale;
*params = (GLint) ctx->Color.AlphaEnabled;
break;
case GL_ALPHA_TEST_REF:
- *params = FLOAT_TO_INT( (GLfloat) ctx->Color.AlphaRef / 255.0 );
+ *params = FLOAT_TO_INT( (GLfloat) ctx->Color.AlphaRef / CHAN_MAXF );
break;
case GL_ALPHA_TEST_FUNC:
*params = (GLint) ctx->Color.AlphaFunc;
*params = (GLint) ctx->Eval.AutoNormal;
break;
case GL_AUX_BUFFERS:
- *params = (GLint) NUM_AUX_BUFFERS;
+ *params = (GLint) ctx->Const.NumAuxBuffers;
break;
case GL_BLEND:
*params = (GLint) ctx->Color.BlendEnabled;
case GL_BLEND_SRC:
*params = (GLint) ctx->Color.BlendSrcRGB;
break;
- case GL_BLEND_SRC_RGB_INGR:
+ case GL_BLEND_SRC_RGB_EXT:
*params = (GLint) ctx->Color.BlendSrcRGB;
break;
- case GL_BLEND_DST_RGB_INGR:
+ case GL_BLEND_DST_RGB_EXT:
*params = (GLint) ctx->Color.BlendDstRGB;
break;
- case GL_BLEND_SRC_ALPHA_INGR:
+ case GL_BLEND_SRC_ALPHA_EXT:
*params = (GLint) ctx->Color.BlendSrcA;
break;
- case GL_BLEND_DST_ALPHA_INGR:
+ case GL_BLEND_DST_ALPHA_EXT:
*params = (GLint) ctx->Color.BlendDstA;
break;
case GL_BLEND_EQUATION_EXT:
*params = (GLint) ctx->Pixel.BlueBias;
break;
case GL_BLUE_BITS:
- *params = (GLint) ctx->Visual->BlueBits;
+ *params = (GLint) ctx->Visual.blueBits;
break;
case GL_BLUE_SCALE:
*params = (GLint) ctx->Pixel.BlueScale;
*params = (GLint) ctx->Transform.ClipEnabled[i];
break;
case GL_COLOR_CLEAR_VALUE:
- 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] );
+ 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;
*params = (GLint) ctx->Polygon.CullFaceMode;
break;
case GL_CURRENT_COLOR:
- params[0] = FLOAT_TO_INT( UBYTE_COLOR_TO_FLOAT_COLOR( ctx->Current.ByteColor[0] ) );
- params[1] = FLOAT_TO_INT( UBYTE_COLOR_TO_FLOAT_COLOR( ctx->Current.ByteColor[1] ) );
- params[2] = FLOAT_TO_INT( UBYTE_COLOR_TO_FLOAT_COLOR( ctx->Current.ByteColor[2] ) );
- params[3] = FLOAT_TO_INT( UBYTE_COLOR_TO_FLOAT_COLOR( ctx->Current.ByteColor[3] ) );
+ FLUSH_CURRENT(ctx, 0);
+ 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);
*params = (GLint) ctx->Current.Index;
break;
case GL_CURRENT_NORMAL:
- 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] );
+ FLUSH_CURRENT(ctx, 0);
+ 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.RasterMultiTexCoord[texUnit][0];
+ params[1] = (GLint) ctx->Current.RasterMultiTexCoord[texUnit][1];
+ params[2] = (GLint) ctx->Current.RasterMultiTexCoord[texUnit][2];
+ params[3] = (GLint) ctx->Current.RasterMultiTexCoord[texUnit][3];
break;
case GL_CURRENT_RASTER_POSITION_VALID:
*params = (GLint) ctx->Current.RasterPosValid;
break;
case GL_CURRENT_TEXTURE_COORDS:
- 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];
+ FLUSH_CURRENT(ctx, 0);
+ 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;
break;
case GL_DEPTH_BITS:
- *params = ctx->Visual->DepthBits;
+ *params = ctx->Visual.depthBits;
break;
case GL_DEPTH_CLEAR_VALUE:
*params = (GLint) ctx->Depth.Clear;
*params = (GLint) ctx->Color.DitherFlag;
break;
case GL_DOUBLEBUFFER:
- *params = (GLint) ctx->Visual->DBflag;
+ *params = (GLint) ctx->Visual.doubleBufferMode;
break;
case GL_DRAW_BUFFER:
*params = (GLint) ctx->Color.DrawBuffer;
break;
case GL_EDGE_FLAG:
+ FLUSH_CURRENT(ctx, 0);
*params = (GLint) ctx->Current.EdgeFlag;
break;
case GL_FEEDBACK_BUFFER_SIZE:
- /* TODO: is this right? Or, return number of entries in buffer? */
*params = ctx->Feedback.BufferSize;
break;
case GL_FEEDBACK_BUFFER_TYPE:
*params = (GLint) ctx->Pixel.GreenBias;
break;
case GL_GREEN_BITS:
- *params = (GLint) ctx->Visual->GreenBits;
+ *params = (GLint) ctx->Visual.greenBits;
break;
case GL_GREEN_SCALE:
*params = (GLint) ctx->Pixel.GreenScale;
break;
case GL_INDEX_BITS:
- *params = (GLint) ctx->Visual->IndexBits;
+ *params = (GLint) ctx->Visual.indexBits;
break;
case GL_INDEX_CLEAR_VALUE:
*params = (GLint) ctx->Color.ClearIndex;
break;
case GL_INDEX_MODE:
- *params = ctx->Visual->RGBAflag ? 0 : 1;
+ *params = ctx->Visual.rgbMode ? 0 : 1;
break;
case GL_INDEX_OFFSET:
*params = ctx->Pixel.IndexOffset;
*params = (GLint) ctx->Line.Width;
break;
case GL_LINE_WIDTH_GRANULARITY:
- *params = (GLint) LINE_WIDTH_GRANULARITY;
+ *params = (GLint) ctx->Const.LineWidthGranularity;
break;
case GL_LINE_WIDTH_RANGE:
- params[0] = (GLint) MIN_LINE_WIDTH;
- params[1] = (GLint) MAX_LINE_WIDTH;
+ params[0] = (GLint) ctx->Const.MinLineWidthAA;
+ params[1] = (GLint) ctx->Const.MaxLineWidthAA;
+ break;
+ case GL_ALIASED_LINE_WIDTH_RANGE:
+ params[0] = (GLint) ctx->Const.MinLineWidth;
+ params[1] = (GLint) ctx->Const.MaxLineWidth;
break;
case GL_LIST_BASE:
*params = (GLint) ctx->List.ListBase;
*params = (GLint) MAX_CLIENT_ATTRIB_STACK_DEPTH;
break;
case GL_MAX_CLIP_PLANES:
- *params = (GLint) MAX_CLIP_PLANES;
+ *params = (GLint) ctx->Const.MaxClipPlanes;
break;
case GL_MAX_ELEMENTS_VERTICES: /* GL_VERSION_1_2 */
- *params = VB_MAX;
+ *params = (GLint) ctx->Const.MaxArrayLockSize;
break;
case GL_MAX_ELEMENTS_INDICES: /* GL_VERSION_1_2 */
- *params = VB_MAX;
+ *params = (GLint) ctx->Const.MaxArrayLockSize;
break;
case GL_MAX_EVAL_ORDER:
*params = (GLint) MAX_EVAL_ORDER;
break;
case GL_MAX_LIGHTS:
- *params = (GLint) MAX_LIGHTS;
+ *params = (GLint) ctx->Const.MaxLights;
break;
case GL_MAX_LIST_NESTING:
*params = (GLint) MAX_LIST_NESTING;
*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;
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;
*params = (GLint) ctx->Point.Size;
break;
case GL_POINT_SIZE_GRANULARITY:
- *params = (GLint) POINT_SIZE_GRANULARITY;
+ *params = (GLint) ctx->Const.PointSizeGranularity;
break;
case GL_POINT_SIZE_RANGE:
- params[0] = (GLint) MIN_POINT_SIZE;
- params[1] = (GLint) MAX_POINT_SIZE;
+ params[0] = (GLint) ctx->Const.MinPointSizeAA;
+ params[1] = (GLint) ctx->Const.MaxPointSizeAA;
+ break;
+ case GL_ALIASED_POINT_SIZE_RANGE:
+ params[0] = (GLint) ctx->Const.MinPointSize;
+ params[1] = (GLint) ctx->Const.MaxPointSize;
break;
case GL_POINT_SMOOTH:
*params = (GLint) ctx->Point.SmoothFlag;
params[0] = (GLint) ctx->Polygon.FrontMode;
params[1] = (GLint) ctx->Polygon.BackMode;
break;
-#ifdef GL_EXT_polygon_offset
- case GL_POLYGON_OFFSET_BIAS_EXT:
+ case GL_POLYGON_OFFSET_BIAS_EXT: /* GL_EXT_polygon_offset */
*params = (GLint) ctx->Polygon.OffsetUnits;
break;
-#endif
case GL_POLYGON_OFFSET_FACTOR:
*params = (GLint) ctx->Polygon.OffsetFactor;
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->Pixel.RedBias;
break;
case GL_RED_BITS:
- *params = (GLint) ctx->Visual->RedBits;
+ *params = (GLint) ctx->Visual.redBits;
break;
case GL_RED_SCALE:
*params = (GLint) ctx->Pixel.RedScale;
case GL_RENDER_MODE:
*params = (GLint) ctx->RenderMode;
break;
+ case GL_RESCALE_NORMAL:
+ *params = (GLint) ctx->Transform.RescaleNormals;
+ break;
case GL_RGBA_MODE:
- *params = (GLint) ctx->Visual->RGBAflag;
+ *params = (GLint) ctx->Visual.rgbMode;
break;
case GL_SCISSOR_BOX:
params[0] = (GLint) ctx->Scissor.X;
*params = (GLint) ctx->Texture.SharedPalette;
break;
case GL_STENCIL_BITS:
- *params = ctx->Visual->StencilBits;
+ *params = ctx->Visual.stencilBits;
break;
case GL_STENCIL_CLEAR_VALUE:
*params = (GLint) ctx->Stencil.Clear;
*params = (GLint) ctx->Stencil.WriteMask;
break;
case GL_STEREO:
- *params = (GLint) ctx->Visual->StereoFlag;
+ *params = (GLint) ctx->Visual.stereoMode;
break;
case GL_SUBPIXEL_BITS:
- *params = 0; /* TODO */
+ *params = ctx->Const.SubPixelBits;
break;
case GL_TEXTURE_1D:
*params = _mesa_IsEnabled(GL_TEXTURE_1D) ? 1 : 0;
*params = _mesa_IsEnabled(GL_TEXTURE_3D) ? 1 : 0;
break;
case GL_TEXTURE_BINDING_1D:
- *params = textureUnit->CurrentD[1]->Name;
+ *params = textureUnit->Current1D->Name;
break;
case GL_TEXTURE_BINDING_2D:
- *params = textureUnit->CurrentD[2]->Name;
+ *params = textureUnit->Current2D->Name;
break;
case GL_TEXTURE_BINDING_3D:
- *params = textureUnit->CurrentD[3]->Name;
+ *params = textureUnit->Current3D->Name;
break;
case GL_TEXTURE_ENV_COLOR:
params[0] = FLOAT_TO_INT( textureUnit->EnvColor[0] );
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;
*params = 0;
break;
+ /* GL_ARB_multitexture */
case GL_MAX_TEXTURE_UNITS_ARB:
*params = ctx->Const.MaxTextureUnits;
break;
*params = GL_TEXTURE0_ARB + ctx->Array.ActiveTexture;
break;
+ /* GL_ARB_texture_cube_map */
+ case GL_TEXTURE_CUBE_MAP_ARB:
+ CHECK_EXTENSION_I(ARB_texture_cube_map);
+ *params = (GLint) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
+ break;
+ case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
+ CHECK_EXTENSION_I(ARB_texture_cube_map);
+ *params = textureUnit->CurrentCubeMap->Name;
+ break;
+ case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
+ CHECK_EXTENSION_I(ARB_texture_cube_map);
+ *params = (1 << (ctx->Const.MaxCubeTextureLevels - 1));
+ break;
- /* GL_PGI_misc_hints */
- case GL_STRICT_DEPTHFUNC_HINT_PGI:
- *params = (GL_NICEST);
+ /* GL_ARB_texture_compression */
+ case GL_TEXTURE_COMPRESSION_HINT_ARB:
+ CHECK_EXTENSION_I(ARB_texture_compression);
+ *params = (GLint) ctx->Hint.TextureCompression;
break;
- case GL_STRICT_LIGHTING_HINT_PGI:
- *params = (ctx->Hint.StrictLighting);
- break;
- case GL_STRICT_SCISSOR_HINT_PGI:
- case GL_FULL_STIPPLE_HINT_PGI:
- *params = (GL_TRUE);
- break;
- case GL_CONSERVE_MEMORY_HINT_PGI:
- *params = (GL_FALSE);
- break;
- case GL_ALWAYS_FAST_HINT_PGI:
- *params = (ctx->Hint.AllowDrawWin == GL_TRUE &&
- ctx->Hint.AllowDrawSpn == GL_FALSE &&
- ctx->Hint.AllowDrawMem == GL_FALSE);
- break;
- case GL_ALWAYS_SOFT_HINT_PGI:
- *params = (ctx->Hint.AllowDrawWin == GL_TRUE &&
- ctx->Hint.AllowDrawSpn == GL_TRUE &&
- ctx->Hint.AllowDrawMem == GL_TRUE);
- break;
- case GL_ALLOW_DRAW_OBJ_HINT_PGI:
- *params = GL_TRUE;
+ case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
+ CHECK_EXTENSION_I(ARB_texture_compression);
+ *params = (GLint) ctx->Const.NumCompressedTextureFormats;
+ break;
+ case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
+ CHECK_EXTENSION_I(ARB_texture_compression);
+ {
+ GLuint i;
+ for (i = 0; i < ctx->Const.NumCompressedTextureFormats; i++)
+ params[i] = (GLint) ctx->Const.CompressedTextureFormats[i];
+ }
+ break;
+
+ /* GL_EXT_compiled_vertex_array */
+ case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT:
+ CHECK_EXTENSION_I(EXT_compiled_vertex_array);
+ *params = ctx->Array.LockFirst;
break;
- case GL_ALLOW_DRAW_WIN_HINT_PGI:
- *params = ctx->Hint.AllowDrawWin;
+ case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT:
+ CHECK_EXTENSION_I(EXT_compiled_vertex_array);
+ *params = ctx->Array.LockCount;
break;
- case GL_ALLOW_DRAW_SPN_HINT_PGI:
- *params = ctx->Hint.AllowDrawSpn;
+
+ /* GL_ARB_transpose_matrix */
+ case GL_TRANSPOSE_COLOR_MATRIX_ARB:
+ {
+ GLfloat tm[16];
+ GLuint i;
+ _math_transposef(tm, ctx->ColorMatrixStack.Top->m);
+ for (i=0;i<16;i++) {
+ params[i] = (GLint) tm[i];
+ }
+ }
+ break;
+ case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB:
+ {
+ GLfloat tm[16];
+ GLuint i;
+ _math_transposef(tm, ctx->ModelviewMatrixStack.Top->m);
+ for (i=0;i<16;i++) {
+ params[i] = (GLint) tm[i];
+ }
+ }
+ break;
+ case GL_TRANSPOSE_PROJECTION_MATRIX_ARB:
+ {
+ GLfloat tm[16];
+ GLuint i;
+ _math_transposef(tm, ctx->ProjectionMatrixStack.Top->m);
+ for (i=0;i<16;i++) {
+ params[i] = (GLint) tm[i];
+ }
+ }
+ break;
+ case GL_TRANSPOSE_TEXTURE_MATRIX_ARB:
+ {
+ GLfloat tm[16];
+ GLuint i;
+ _math_transposef(tm, ctx->TextureMatrixStack[texUnit].Top->m);
+ for (i=0;i<16;i++) {
+ params[i] = (GLint) tm[i];
+ }
+ }
+ break;
+
+ /* GL_HP_occlusion_test */
+ case GL_OCCLUSION_TEST_HP:
+ CHECK_EXTENSION_I(HP_occlusion_test);
+ *params = (GLint) ctx->Depth.OcclusionTest;
+ break;
+ case GL_OCCLUSION_TEST_RESULT_HP:
+ CHECK_EXTENSION_I(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;
+ break;
+
+ /* GL_SGIS_pixel_texture */
+ case GL_PIXEL_TEXTURE_SGIS:
+ CHECK_EXTENSION_I(SGIS_pixel_texture);
+ *params = (GLint) ctx->Pixel.PixelTextureEnabled;
+ break;
+
+ /* GL_SGIX_pixel_texture */
+ case GL_PIXEL_TEX_GEN_SGIX:
+ CHECK_EXTENSION_I(SGIX_pixel_texture);
+ *params = (GLint) ctx->Pixel.PixelTextureEnabled;
+ break;
+ case GL_PIXEL_TEX_GEN_MODE_SGIX:
+ CHECK_EXTENSION_I(SGIX_pixel_texture);
+ *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);
+ for (i=0;i<16;i++) {
+ params[i] = (GLint) ctx->ColorMatrixStack.Top->m[i];
+ }
break;
- case GL_ALLOW_DRAW_MEM_HINT_PGI:
- *params = ctx->Hint.AllowDrawMem;
+ case GL_COLOR_MATRIX_STACK_DEPTH_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix);
+ *params = ctx->ColorMatrixStack.Depth + 1;
+ break;
+ case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix);
+ *params = MAX_COLOR_STACK_DEPTH;
+ break;
+ case GL_POST_COLOR_MATRIX_RED_SCALE_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix);
+ *params = (GLint) ctx->Pixel.PostColorMatrixScale[0];
+ break;
+ case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix);
+ *params = (GLint) ctx->Pixel.PostColorMatrixScale[1];
+ break;
+ case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix);
+ *params = (GLint) ctx->Pixel.PostColorMatrixScale[2];
+ break;
+ case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix);
+ *params = (GLint) ctx->Pixel.PostColorMatrixScale[3];
+ break;
+ case GL_POST_COLOR_MATRIX_RED_BIAS_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix);
+ *params = (GLint) ctx->Pixel.PostColorMatrixBias[0];
+ break;
+ case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix);
+ *params = (GLint) ctx->Pixel.PostColorMatrixBias[1];
+ break;
+ case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix);
+ *params = (GLint) ctx->Pixel.PostColorMatrixBias[2];
+ break;
+ case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI:
+ CHECK_EXTENSION_I(SGI_color_matrix);
+ *params = (GLint) ctx->Pixel.PostColorMatrixBias[3];
+ break;
+
+ /* GL_EXT_convolution (also in 1.2 imaging) */
+ case GL_CONVOLUTION_1D_EXT:
+ CHECK_EXTENSION_I(EXT_convolution);
+ *params = (GLint) ctx->Pixel.Convolution1DEnabled;
+ break;
+ case GL_CONVOLUTION_2D:
+ CHECK_EXTENSION_I(EXT_convolution);
+ *params = (GLint) ctx->Pixel.Convolution2DEnabled;
+ break;
+ case GL_SEPARABLE_2D:
+ CHECK_EXTENSION_I(EXT_convolution);
+ *params = (GLint) ctx->Pixel.Separable2DEnabled;
+ break;
+ case GL_MAX_CONVOLUTION_WIDTH:
+ CHECK_EXTENSION_I(EXT_convolution);
+ *params = ctx->Const.MaxConvolutionWidth;
+ break;
+ case GL_MAX_CONVOLUTION_HEIGHT:
+ CHECK_EXTENSION_I(EXT_convolution);
+ *params = ctx->Const.MaxConvolutionHeight;
+ break;
+ case GL_POST_CONVOLUTION_RED_SCALE_EXT:
+ CHECK_EXTENSION_I(EXT_convolution);
+ *params = (GLint) ctx->Pixel.PostConvolutionScale[0];
+ break;
+ case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:
+ CHECK_EXTENSION_I(EXT_convolution);
+ *params = (GLint) ctx->Pixel.PostConvolutionScale[1];
+ break;
+ case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:
+ CHECK_EXTENSION_I(EXT_convolution);
+ *params = (GLint) ctx->Pixel.PostConvolutionScale[2];
+ break;
+ case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:
+ CHECK_EXTENSION_I(EXT_convolution);
+ *params = (GLint) ctx->Pixel.PostConvolutionScale[3];
+ break;
+ case GL_POST_CONVOLUTION_RED_BIAS_EXT:
+ CHECK_EXTENSION_I(EXT_convolution);
+ *params = (GLint) ctx->Pixel.PostConvolutionBias[0];
+ break;
+ case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:
+ CHECK_EXTENSION_I(EXT_convolution);
+ *params = (GLint) ctx->Pixel.PostConvolutionBias[1];
+ break;
+ case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:
+ CHECK_EXTENSION_I(EXT_convolution);
+ *params = (GLint) ctx->Pixel.PostConvolutionBias[2];
+ break;
+ case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:
+ CHECK_EXTENSION_I(EXT_convolution);
+ *params = (GLint) ctx->Pixel.PostConvolutionBias[2];
+ break;
+
+ /* GL_EXT_histogram (also in 1.2 imaging) */
+ case GL_HISTOGRAM:
+ CHECK_EXTENSION_I(EXT_histogram);
+ *params = (GLint) ctx->Pixel.HistogramEnabled;
break;
- case GL_CLIP_NEAR_HINT_PGI:
- case GL_CLIP_FAR_HINT_PGI:
- *params = GL_TRUE;
+ case GL_MINMAX:
+ CHECK_EXTENSION_I(EXT_histogram);
+ *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);
+ *params = (GLint) ctx->Pixel.ColorTableEnabled;
+ break;
+ case GL_POST_CONVOLUTION_COLOR_TABLE_SGI:
+ CHECK_EXTENSION_I(SGI_color_table);
+ *params = (GLint) ctx->Pixel.PostConvolutionColorTableEnabled;
+ break;
+ case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
+ CHECK_EXTENSION_I(SGI_color_table);
+ *params = (GLint) ctx->Pixel.PostColorMatrixColorTableEnabled;
+ break;
+
+
+ /* GL_EXT_secondary_color */
+ case GL_COLOR_SUM_EXT:
+ CHECK_EXTENSION_I(EXT_secondary_color);
+ *params = (GLint) ctx->Fog.ColorSumEnabled;
+ break;
+ case GL_CURRENT_SECONDARY_COLOR_EXT:
+ CHECK_EXTENSION_I(EXT_secondary_color);
+ FLUSH_CURRENT(ctx, 0);
+ 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]) );
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_EXT:
+ CHECK_EXTENSION_I(EXT_secondary_color);
+ *params = (GLint) ctx->Array.SecondaryColor.Enabled;
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT:
+ CHECK_EXTENSION_I(EXT_secondary_color);
+ *params = (GLint) ctx->Array.SecondaryColor.Type;
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT:
+ CHECK_EXTENSION_I(EXT_secondary_color);
+ *params = (GLint) ctx->Array.SecondaryColor.Stride;
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT:
+ CHECK_EXTENSION_I(EXT_secondary_color);
+ *params = (GLint) ctx->Array.SecondaryColor.Stride;
break;
- case GL_WIDE_LINE_HINT_PGI:
- *params = GL_DONT_CARE;
+
+ /* GL_EXT_fog_coord */
+ case GL_CURRENT_FOG_COORDINATE_EXT:
+ CHECK_EXTENSION_I(EXT_fog_coord);
+ FLUSH_CURRENT(ctx, 0);
+ *params = (GLint) ctx->Current.Attrib[VERT_ATTRIB_FOG][0];
break;
- case GL_BACK_NORMALS_HINT_PGI:
- *params = (GL_TRUE);
+ case GL_FOG_COORDINATE_ARRAY_EXT:
+ CHECK_EXTENSION_I(EXT_fog_coord);
+ *params = (GLint) ctx->Array.FogCoord.Enabled;
+ break;
+ case GL_FOG_COORDINATE_ARRAY_TYPE_EXT:
+ CHECK_EXTENSION_I(EXT_fog_coord);
+ *params = (GLint) ctx->Array.FogCoord.Type;
break;
- case GL_NATIVE_GRAPHICS_HANDLE_PGI:
- *params = 0;
+ case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT:
+ CHECK_EXTENSION_I(EXT_fog_coord);
+ *params = (GLint) ctx->Array.FogCoord.Stride;
break;
- /* GL_EXT_compiled_vertex_array
- */
- case GL_ARRAY_ELEMENT_LOCK_FIRST_SGI:
- *params = ctx->Array.LockFirst;
- break;
+ /* GL_EXT_texture_lod_bias */
+ case GL_MAX_TEXTURE_LOD_BIAS_EXT:
+ *params = (GLint) ctx->Const.MaxTextureLodBias;
+ break;
- case GL_ARRAY_ELEMENT_LOCK_COUNT_SGI:
- *params = ctx->Array.LockCount;
+ /* GL_EXT_texture_filter_anisotropic */
+ case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
+ CHECK_EXTENSION_I(EXT_texture_filter_anisotropic);
+ *params = (GLint) ctx->Const.MaxTextureMaxAnisotropy;
break;
-
+
+ /* GL_ARB_multisample */
+ case GL_MULTISAMPLE_ARB:
+ CHECK_EXTENSION_I(ARB_multisample);
+ *params = (GLint) ctx->Multisample.Enabled;
+ break;
+ case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
+ CHECK_EXTENSION_I(ARB_multisample);
+ *params = (GLint) ctx->Multisample.SampleAlphaToCoverage;
+ break;
+ case GL_SAMPLE_ALPHA_TO_ONE_ARB:
+ CHECK_EXTENSION_I(ARB_multisample);
+ *params = (GLint) ctx->Multisample.SampleAlphaToOne;
+ break;
+ case GL_SAMPLE_COVERAGE_ARB:
+ CHECK_EXTENSION_I(ARB_multisample);
+ *params = (GLint) ctx->Multisample.SampleCoverage;
+ break;
+ case GL_SAMPLE_COVERAGE_VALUE_ARB:
+ CHECK_EXTENSION_I(ARB_multisample);
+ *params = (GLint) ctx->Multisample.SampleCoverageValue;
+ break;
+ case GL_SAMPLE_COVERAGE_INVERT_ARB:
+ CHECK_EXTENSION_I(ARB_multisample);
+ *params = (GLint) ctx->Multisample.SampleCoverageInvert;
+ break;
+ case GL_SAMPLE_BUFFERS_ARB:
+ CHECK_EXTENSION_I(ARB_multisample);
+ *params = 0; /* XXX fix someday */
+ break;
+ case GL_SAMPLES_ARB:
+ CHECK_EXTENSION_I(ARB_multisample);
+ *params = 0; /* XXX fix someday */
+ break;
+
+ /* GL_IBM_rasterpos_clip */
+ case GL_RASTER_POSITION_UNCLIPPED_IBM:
+ CHECK_EXTENSION_I(IBM_rasterpos_clip);
+ *params = (GLint) ctx->Transform.RasterPositionUnclipped;
+ break;
+
+ /* GL_MESA_sprite_point */
+ case GL_SPRITE_POINT_MESA:
+ CHECK_EXTENSION_I(MESA_sprite_point);
+ *params = (GLint) ctx->Point.SpriteMode;
+ break;
+
+ /* GL_SGIS_generate_mipmap */
+ case GL_GENERATE_MIPMAP_HINT_SGIS:
+ CHECK_EXTENSION_I(SGIS_generate_mipmap);
+ *params = (GLint) ctx->Hint.GenerateMipmap;
+ break;
+
+ /* GL_NV_vertex_program */
+ /* XXX to do */
+
default:
- printf("invalid enum: %x\n", pname);
- gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
}
}
{
GET_CURRENT_CONTEXT(ctx);
GLuint texUnit = ctx->Texture.CurrentUnit;
- /*GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit;*/
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (!params)
+ return;
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ fprintf(stderr, "glGetPointerv %s\n", _mesa_lookup_enum_by_nr(pname));
- if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glGetPointerv %s\n", gl_lookup_enum_by_nr(pname));
+ if (ctx->Driver.GetPointerv
+ && (*ctx->Driver.GetPointerv)(ctx, pname, params))
+ return;
switch (pname) {
case GL_VERTEX_ARRAY_POINTER:
case GL_COLOR_ARRAY_POINTER:
*params = ctx->Array.Color.Ptr;
break;
+ case GL_SECONDARY_COLOR_ARRAY_POINTER_EXT:
+ *params = ctx->Array.SecondaryColor.Ptr;
+ break;
+ case GL_FOG_COORDINATE_ARRAY_POINTER_EXT:
+ *params = ctx->Array.FogCoord.Ptr;
+ break;
case GL_INDEX_ARRAY_POINTER:
*params = ctx->Array.Index.Ptr;
break;
*params = ctx->Select.Buffer;
break;
default:
- gl_error( ctx, GL_INVALID_ENUM, "glGetPointerv" );
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetPointerv" );
return;
}
}
_mesa_GetString( GLenum name )
{
GET_CURRENT_CONTEXT(ctx);
- static char result[1000];
- static char *vendor = "Brian Paul";
- static char *version = "1.2 Mesa 3.3 beta";
-
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glGetString", 0);
-
- /* First see if device driver can satisfy this call */
- switch (name) {
- case GL_VENDOR:
- case GL_RENDERER:
- case GL_VERSION:
- if (ctx->Driver.GetString) {
- const GLubyte *str = (*ctx->Driver.GetString)(ctx, name);
- if (str && str[0])
- return str;
- }
- break;
- /* Extensions always handled by extensions.c */
- case GL_EXTENSIONS:
- return (GLubyte *) gl_extensions_get_string( ctx );
- default:
- gl_error( ctx, GL_INVALID_ENUM, "glGetString" );
- return (GLubyte *) 0;
- }
+ static const char *vendor = "Brian Paul";
+ static const char *renderer = "Mesa";
+ static const char *version_1_2 = "1.2 Mesa 4.1 beta";
+ static const char *version_1_3 = "1.3 Mesa 4.1 beta";
- /* If we get here, device driver didn't return a string */
- switch (name) {
- case GL_VENDOR:
- return (GLubyte *) vendor;
- case GL_RENDERER:
- strcpy(result, "Mesa");
- if (ctx->Driver.RendererString) {
- strcat(result, " ");
- strcat(result, (*ctx->Driver.RendererString)());
- }
- return (GLubyte *) result;
- case GL_VERSION:
- return (GLubyte *) version;
- default:
- /* caught above */
- return NULL;
+ ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
+
+ /* this is a required driver function */
+ assert(ctx->Driver.GetString);
+ {
+ const GLubyte *str = (*ctx->Driver.GetString)(ctx, name);
+ if (str)
+ return str;
+
+ switch (name) {
+ case GL_VENDOR:
+ return (const GLubyte *) vendor;
+ case GL_RENDERER:
+ return (const GLubyte *) renderer;
+ case GL_VERSION:
+ if (ctx->Extensions.ARB_multitexture &&
+ ctx->Extensions.ARB_multisample &&
+ ctx->Extensions.ARB_texture_border_clamp &&
+ ctx->Extensions.ARB_texture_compression &&
+ ctx->Extensions.EXT_texture_env_add &&
+ ctx->Extensions.ARB_texture_env_combine &&
+ ctx->Extensions.ARB_texture_env_dot3)
+ return (const GLubyte *) version_1_3;
+ else
+ return (const GLubyte *) version_1_2;
+ case GL_EXTENSIONS:
+ return (const GLubyte *) _mesa_extensions_get_string(ctx);
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glGetString" );
+ return (const GLubyte *) 0;
+ }
}
}
_mesa_GetError( void )
{
GET_CURRENT_CONTEXT(ctx);
-
GLenum e = ctx->ErrorValue;
-
- ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL( ctx, "glGetError", (GLenum) 0);
+ ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "glGetError <-- %s\n", gl_lookup_enum_by_nr(e));
+ fprintf(stderr, "glGetError <-- %s\n", _mesa_lookup_enum_by_nr(e));
ctx->ErrorValue = (GLenum) GL_NO_ERROR;
return e;
}
-