3 * State query functions.
7 * Mesa 3-D graphics library
10 * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
19 * The above copyright notice and this permission notice shall be included
20 * in all copies or substantial portions of the Software.
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
26 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
27 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 * Regarding GL_NV_light_max_exponent:
33 * Portions of this software may use or implement intellectual
34 * property owned and licensed by NVIDIA Corporation. NVIDIA disclaims
35 * any and all warranties with respect to such intellectual property,
36 * including any use thereof or modifications thereto.
44 #include "extensions.h"
48 #include "texcompress.h"
50 #include "math/m_matrix.h"
53 #define FLOAT_TO_BOOL(X) ( (X)==0.0F ? GL_FALSE : GL_TRUE )
54 #define INT_TO_BOOL(I) ( (I)==0 ? GL_FALSE : GL_TRUE )
55 #define ENUM_TO_BOOL(E) ( (E)==0 ? GL_FALSE : GL_TRUE )
58 /* Needed for an Amiga compiler */
59 #define ENUM_TO_FLOAT(X) ((GLfloat)(GLint)(X))
60 #define ENUM_TO_DOUBLE(X) ((GLdouble)(GLint)(X))
62 /* all other compilers */
63 #define ENUM_TO_FLOAT(X) ((GLfloat)(X))
64 #define ENUM_TO_DOUBLE(X) ((GLdouble)(X))
68 /* Check if named extension is enabled, if not generate error and return */
70 #define CHECK1(E1, str, PNAME) \
71 if (!ctx->Extensions.E1) { \
72 _mesa_error(ctx, GL_INVALID_VALUE, \
73 "glGet" str "v(0x%x)", (int) PNAME); \
77 #define CHECK2(E1, E2, str, PNAME) \
78 if (!ctx->Extensions.E1 && !ctx->Extensions.E2) { \
79 _mesa_error(ctx, GL_INVALID_VALUE, \
80 "glGet" str "v(0x%x)", (int) PNAME); \
84 #define CHECK_EXTENSION_B(EXTNAME, PNAME) \
85 CHECK1(EXTNAME, "Boolean", PNAME )
87 #define CHECK_EXTENSION_I(EXTNAME, PNAME) \
88 CHECK1(EXTNAME, "Integer", PNAME )
90 #define CHECK_EXTENSION_F(EXTNAME, PNAME) \
91 CHECK1(EXTNAME, "Float", PNAME )
93 #define CHECK_EXTENSION_D(EXTNAME, PNAME) \
94 CHECK1(EXTNAME, "Double", PNAME )
96 #define CHECK_EXTENSION2_B(EXT1, EXT2, PNAME) \
97 CHECK2(EXT1, EXT2, "Boolean", PNAME)
99 #define CHECK_EXTENSION2_I(EXT1, EXT2, PNAME) \
100 CHECK2(EXT1, EXT2, "Integer", PNAME)
102 #define CHECK_EXTENSION2_F(EXT1, EXT2, PNAME) \
103 CHECK2(EXT1, EXT2, "Float", PNAME)
105 #define CHECK_EXTENSION2_D(EXT1, EXT2, PNAME) \
106 CHECK2(EXT1, EXT2, "Double", PNAME)
111 pixel_texgen_mode(const GLcontext
*ctx
)
113 if (ctx
->Pixel
.FragmentRgbSource
== GL_CURRENT_RASTER_POSITION
) {
114 if (ctx
->Pixel
.FragmentAlphaSource
== GL_CURRENT_RASTER_POSITION
) {
122 if (ctx
->Pixel
.FragmentAlphaSource
== GL_CURRENT_RASTER_POSITION
) {
133 * Get the value(s) of a selected parameter.
135 * \param pname parameter to be returned.
136 * \param params will hold the value(s) of the speficifed parameter.
138 * \sa glGetBooleanv().
140 * Tries to get the specified parameter via dd_function_table::GetBooleanv,
141 * otherwise gets the specified parameter from the current context, converting
142 * it value into GLboolean.
145 _mesa_GetBooleanv( GLenum pname
, GLboolean
*params
)
147 GET_CURRENT_CONTEXT(ctx
);
149 const GLuint clientUnit
= ctx
->Array
.ActiveTexture
;
150 const GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
151 const struct gl_texture_unit
*textureUnit
= &ctx
->Texture
.Unit
[texUnit
];
152 ASSERT_OUTSIDE_BEGIN_END(ctx
);
157 if (MESA_VERBOSE
& VERBOSE_API
)
158 _mesa_debug(ctx
, "glGetBooleanv %s\n", _mesa_lookup_enum_by_nr(pname
));
160 if (!ctx
->_CurrentProgram
) {
161 /* We need this in order to get correct results for
162 * GL_OCCLUSION_TEST_RESULT_HP. There might be other important cases.
164 FLUSH_VERTICES(ctx
, 0);
167 if (ctx
->Driver
.GetBooleanv
168 && (*ctx
->Driver
.GetBooleanv
)(ctx
, pname
, params
))
172 case GL_ACCUM_RED_BITS
:
173 *params
= INT_TO_BOOL(ctx
->Visual
.accumRedBits
);
175 case GL_ACCUM_GREEN_BITS
:
176 *params
= INT_TO_BOOL(ctx
->Visual
.accumGreenBits
);
178 case GL_ACCUM_BLUE_BITS
:
179 *params
= INT_TO_BOOL(ctx
->Visual
.accumBlueBits
);
181 case GL_ACCUM_ALPHA_BITS
:
182 *params
= INT_TO_BOOL(ctx
->Visual
.accumAlphaBits
);
184 case GL_ACCUM_CLEAR_VALUE
:
185 params
[0] = FLOAT_TO_BOOL(ctx
->Accum
.ClearColor
[0]);
186 params
[1] = FLOAT_TO_BOOL(ctx
->Accum
.ClearColor
[1]);
187 params
[2] = FLOAT_TO_BOOL(ctx
->Accum
.ClearColor
[2]);
188 params
[3] = FLOAT_TO_BOOL(ctx
->Accum
.ClearColor
[3]);
191 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.AlphaBias
);
194 *params
= INT_TO_BOOL(ctx
->Visual
.alphaBits
);
197 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.AlphaScale
);
200 *params
= ctx
->Color
.AlphaEnabled
;
202 case GL_ALPHA_TEST_FUNC
:
203 *params
= ENUM_TO_BOOL(ctx
->Color
.AlphaFunc
);
205 case GL_ALPHA_TEST_REF
:
206 *params
= ctx
->Color
.AlphaRef
? GL_TRUE
: GL_FALSE
;
208 case GL_ATTRIB_STACK_DEPTH
:
209 *params
= INT_TO_BOOL(ctx
->AttribStackDepth
);
212 *params
= ctx
->Eval
.AutoNormal
;
215 *params
= (ctx
->Visual
.numAuxBuffers
) ? GL_TRUE
: GL_FALSE
;
218 *params
= ctx
->Color
.BlendEnabled
;
221 *params
= ENUM_TO_BOOL(ctx
->Color
.BlendDstRGB
);
224 *params
= ENUM_TO_BOOL(ctx
->Color
.BlendSrcRGB
);
226 case GL_BLEND_SRC_RGB_EXT
:
227 *params
= ENUM_TO_BOOL(ctx
->Color
.BlendSrcRGB
);
229 case GL_BLEND_DST_RGB_EXT
:
230 *params
= ENUM_TO_BOOL(ctx
->Color
.BlendDstRGB
);
232 case GL_BLEND_SRC_ALPHA_EXT
:
233 *params
= ENUM_TO_BOOL(ctx
->Color
.BlendSrcA
);
235 case GL_BLEND_DST_ALPHA_EXT
:
236 *params
= ENUM_TO_BOOL(ctx
->Color
.BlendDstA
);
238 case GL_BLEND_EQUATION
:
239 *params
= ENUM_TO_BOOL( ctx
->Color
.BlendEquationRGB
);
241 case GL_BLEND_EQUATION_ALPHA_EXT
:
242 *params
= ENUM_TO_BOOL( ctx
->Color
.BlendEquationA
);
244 case GL_BLEND_COLOR_EXT
:
245 params
[0] = FLOAT_TO_BOOL( ctx
->Color
.BlendColor
[0] );
246 params
[1] = FLOAT_TO_BOOL( ctx
->Color
.BlendColor
[1] );
247 params
[2] = FLOAT_TO_BOOL( ctx
->Color
.BlendColor
[2] );
248 params
[3] = FLOAT_TO_BOOL( ctx
->Color
.BlendColor
[3] );
251 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.BlueBias
);
254 *params
= INT_TO_BOOL( ctx
->Visual
.blueBits
);
257 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.BlueScale
);
259 case GL_CLIENT_ATTRIB_STACK_DEPTH
:
260 *params
= INT_TO_BOOL(ctx
->ClientAttribStackDepth
);
268 if (ctx
->Transform
.ClipPlanesEnabled
& (1 << (pname
- GL_CLIP_PLANE0
)))
273 case GL_COLOR_CLEAR_VALUE
:
274 params
[0] = ctx
->Color
.ClearColor
[0] ? GL_TRUE
: GL_FALSE
;
275 params
[1] = ctx
->Color
.ClearColor
[1] ? GL_TRUE
: GL_FALSE
;
276 params
[2] = ctx
->Color
.ClearColor
[2] ? GL_TRUE
: GL_FALSE
;
277 params
[3] = ctx
->Color
.ClearColor
[3] ? GL_TRUE
: GL_FALSE
;
279 case GL_COLOR_MATERIAL
:
280 *params
= ctx
->Light
.ColorMaterialEnabled
;
282 case GL_COLOR_MATERIAL_FACE
:
283 *params
= ENUM_TO_BOOL(ctx
->Light
.ColorMaterialFace
);
285 case GL_COLOR_MATERIAL_PARAMETER
:
286 *params
= ENUM_TO_BOOL(ctx
->Light
.ColorMaterialMode
);
288 case GL_COLOR_WRITEMASK
:
289 params
[0] = ctx
->Color
.ColorMask
[RCOMP
] ? GL_TRUE
: GL_FALSE
;
290 params
[1] = ctx
->Color
.ColorMask
[GCOMP
] ? GL_TRUE
: GL_FALSE
;
291 params
[2] = ctx
->Color
.ColorMask
[BCOMP
] ? GL_TRUE
: GL_FALSE
;
292 params
[3] = ctx
->Color
.ColorMask
[ACOMP
] ? GL_TRUE
: GL_FALSE
;
295 *params
= ctx
->Polygon
.CullFlag
;
297 case GL_CULL_FACE_MODE
:
298 *params
= ENUM_TO_BOOL(ctx
->Polygon
.CullFaceMode
);
300 case GL_CURRENT_COLOR
:
301 FLUSH_CURRENT(ctx
, 0);
302 params
[0] = FLOAT_TO_BOOL(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][0]);
303 params
[1] = FLOAT_TO_BOOL(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][1]);
304 params
[2] = FLOAT_TO_BOOL(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][2]);
305 params
[3] = FLOAT_TO_BOOL(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][3]);
307 case GL_CURRENT_INDEX
:
308 FLUSH_CURRENT(ctx
, 0);
309 *params
= FLOAT_TO_BOOL(ctx
->Current
.Index
);
311 case GL_CURRENT_NORMAL
:
312 FLUSH_CURRENT(ctx
, 0);
313 params
[0] = FLOAT_TO_BOOL(ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][0]);
314 params
[1] = FLOAT_TO_BOOL(ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][1]);
315 params
[2] = FLOAT_TO_BOOL(ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][2]);
317 case GL_CURRENT_RASTER_COLOR
:
318 params
[0] = FLOAT_TO_BOOL(ctx
->Current
.RasterColor
[0]);
319 params
[1] = FLOAT_TO_BOOL(ctx
->Current
.RasterColor
[1]);
320 params
[2] = FLOAT_TO_BOOL(ctx
->Current
.RasterColor
[2]);
321 params
[3] = FLOAT_TO_BOOL(ctx
->Current
.RasterColor
[3]);
323 case GL_CURRENT_RASTER_DISTANCE
:
324 *params
= FLOAT_TO_BOOL(ctx
->Current
.RasterDistance
);
326 case GL_CURRENT_RASTER_INDEX
:
327 *params
= FLOAT_TO_BOOL(ctx
->Current
.RasterIndex
);
329 case GL_CURRENT_RASTER_POSITION
:
330 params
[0] = FLOAT_TO_BOOL(ctx
->Current
.RasterPos
[0]);
331 params
[1] = FLOAT_TO_BOOL(ctx
->Current
.RasterPos
[1]);
332 params
[2] = FLOAT_TO_BOOL(ctx
->Current
.RasterPos
[2]);
333 params
[3] = FLOAT_TO_BOOL(ctx
->Current
.RasterPos
[3]);
335 case GL_CURRENT_RASTER_TEXTURE_COORDS
:
336 params
[0] = FLOAT_TO_BOOL(ctx
->Current
.RasterTexCoords
[texUnit
][0]);
337 params
[1] = FLOAT_TO_BOOL(ctx
->Current
.RasterTexCoords
[texUnit
][1]);
338 params
[2] = FLOAT_TO_BOOL(ctx
->Current
.RasterTexCoords
[texUnit
][2]);
339 params
[3] = FLOAT_TO_BOOL(ctx
->Current
.RasterTexCoords
[texUnit
][3]);
341 case GL_CURRENT_RASTER_POSITION_VALID
:
342 *params
= ctx
->Current
.RasterPosValid
;
344 case GL_CURRENT_TEXTURE_COORDS
:
345 FLUSH_CURRENT(ctx
, 0);
346 params
[0] = FLOAT_TO_BOOL(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][0]);
347 params
[1] = FLOAT_TO_BOOL(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][1]);
348 params
[2] = FLOAT_TO_BOOL(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][2]);
349 params
[3] = FLOAT_TO_BOOL(ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][3]);
352 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.DepthBias
);
355 *params
= INT_TO_BOOL(ctx
->Visual
.depthBits
);
357 case GL_DEPTH_CLEAR_VALUE
:
358 *params
= FLOAT_TO_BOOL(ctx
->Depth
.Clear
);
361 *params
= ENUM_TO_BOOL(ctx
->Depth
.Func
);
364 params
[0] = FLOAT_TO_BOOL(ctx
->Viewport
.Near
);
365 params
[1] = FLOAT_TO_BOOL(ctx
->Viewport
.Far
);
368 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.DepthScale
);
371 *params
= ctx
->Depth
.Test
;
373 case GL_DEPTH_WRITEMASK
:
374 *params
= ctx
->Depth
.Mask
;
377 *params
= ctx
->Color
.DitherFlag
;
379 case GL_DOUBLEBUFFER
:
380 *params
= ctx
->Visual
.doubleBufferMode
;
383 *params
= ENUM_TO_BOOL(ctx
->Color
.DrawBuffer
[0]);
386 FLUSH_CURRENT(ctx
, 0);
387 *params
= ctx
->Current
.EdgeFlag
;
389 case GL_FEEDBACK_BUFFER_SIZE
:
390 *params
= INT_TO_BOOL(ctx
->Feedback
.BufferSize
);
392 case GL_FEEDBACK_BUFFER_TYPE
:
393 *params
= INT_TO_BOOL(ctx
->Feedback
.Type
);
396 *params
= ctx
->Fog
.Enabled
;
399 params
[0] = FLOAT_TO_BOOL(ctx
->Fog
.Color
[0]);
400 params
[1] = FLOAT_TO_BOOL(ctx
->Fog
.Color
[1]);
401 params
[2] = FLOAT_TO_BOOL(ctx
->Fog
.Color
[2]);
402 params
[3] = FLOAT_TO_BOOL(ctx
->Fog
.Color
[3]);
405 *params
= FLOAT_TO_BOOL(ctx
->Fog
.Density
);
408 *params
= FLOAT_TO_BOOL(ctx
->Fog
.End
);
411 *params
= ENUM_TO_BOOL(ctx
->Hint
.Fog
);
414 *params
= FLOAT_TO_BOOL(ctx
->Fog
.Index
);
417 *params
= ENUM_TO_BOOL(ctx
->Fog
.Mode
);
420 *params
= FLOAT_TO_BOOL(ctx
->Fog
.End
);
423 *params
= ENUM_TO_BOOL(ctx
->Polygon
.FrontFace
);
426 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.GreenBias
);
429 *params
= INT_TO_BOOL( ctx
->Visual
.greenBits
);
432 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.GreenScale
);
435 *params
= INT_TO_BOOL( ctx
->Visual
.indexBits
);
437 case GL_INDEX_CLEAR_VALUE
:
438 *params
= INT_TO_BOOL(ctx
->Color
.ClearIndex
);
441 *params
= ctx
->Visual
.rgbMode
? GL_FALSE
: GL_TRUE
;
443 case GL_INDEX_OFFSET
:
444 *params
= INT_TO_BOOL(ctx
->Pixel
.IndexOffset
);
447 *params
= INT_TO_BOOL(ctx
->Pixel
.IndexShift
);
449 case GL_INDEX_WRITEMASK
:
450 *params
= INT_TO_BOOL(ctx
->Color
.IndexMask
);
460 *params
= ctx
->Light
.Light
[pname
-GL_LIGHT0
].Enabled
;
463 *params
= ctx
->Light
.Enabled
;
465 case GL_LIGHT_MODEL_AMBIENT
:
466 params
[0] = FLOAT_TO_BOOL(ctx
->Light
.Model
.Ambient
[0]);
467 params
[1] = FLOAT_TO_BOOL(ctx
->Light
.Model
.Ambient
[1]);
468 params
[2] = FLOAT_TO_BOOL(ctx
->Light
.Model
.Ambient
[2]);
469 params
[3] = FLOAT_TO_BOOL(ctx
->Light
.Model
.Ambient
[3]);
471 case GL_LIGHT_MODEL_COLOR_CONTROL
:
472 params
[0] = ENUM_TO_BOOL(ctx
->Light
.Model
.ColorControl
);
474 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
475 *params
= ctx
->Light
.Model
.LocalViewer
;
477 case GL_LIGHT_MODEL_TWO_SIDE
:
478 *params
= ctx
->Light
.Model
.TwoSide
;
481 *params
= ctx
->Line
.SmoothFlag
;
483 case GL_LINE_SMOOTH_HINT
:
484 *params
= ENUM_TO_BOOL(ctx
->Hint
.LineSmooth
);
486 case GL_LINE_STIPPLE
:
487 *params
= ctx
->Line
.StippleFlag
;
489 case GL_LINE_STIPPLE_PATTERN
:
490 *params
= INT_TO_BOOL(ctx
->Line
.StipplePattern
);
492 case GL_LINE_STIPPLE_REPEAT
:
493 *params
= INT_TO_BOOL(ctx
->Line
.StippleFactor
);
496 *params
= FLOAT_TO_BOOL(ctx
->Line
.Width
);
498 case GL_LINE_WIDTH_GRANULARITY
:
499 *params
= FLOAT_TO_BOOL(ctx
->Const
.LineWidthGranularity
);
501 case GL_LINE_WIDTH_RANGE
:
502 params
[0] = FLOAT_TO_BOOL(ctx
->Const
.MinLineWidthAA
);
503 params
[1] = FLOAT_TO_BOOL(ctx
->Const
.MaxLineWidthAA
);
505 case GL_ALIASED_LINE_WIDTH_RANGE
:
506 params
[0] = FLOAT_TO_BOOL(ctx
->Const
.MinLineWidth
);
507 params
[1] = FLOAT_TO_BOOL(ctx
->Const
.MaxLineWidth
);
510 *params
= INT_TO_BOOL(ctx
->List
.ListBase
);
513 *params
= INT_TO_BOOL( ctx
->ListState
.CurrentListNum
);
516 if (!ctx
->CompileFlag
)
518 else if (ctx
->ExecuteFlag
)
519 *params
= ENUM_TO_BOOL(GL_COMPILE_AND_EXECUTE
);
521 *params
= ENUM_TO_BOOL(GL_COMPILE
);
523 case GL_INDEX_LOGIC_OP
:
524 *params
= ctx
->Color
.IndexLogicOpEnabled
;
526 case GL_COLOR_LOGIC_OP
:
527 *params
= ctx
->Color
.ColorLogicOpEnabled
;
529 case GL_LOGIC_OP_MODE
:
530 *params
= ENUM_TO_BOOL(ctx
->Color
.LogicOp
);
532 case GL_MAP1_COLOR_4
:
533 *params
= ctx
->Eval
.Map1Color4
;
535 case GL_MAP1_GRID_DOMAIN
:
536 params
[0] = FLOAT_TO_BOOL(ctx
->Eval
.MapGrid1u1
);
537 params
[1] = FLOAT_TO_BOOL(ctx
->Eval
.MapGrid1u2
);
539 case GL_MAP1_GRID_SEGMENTS
:
540 *params
= INT_TO_BOOL(ctx
->Eval
.MapGrid1un
);
543 *params
= ctx
->Eval
.Map1Index
;
546 *params
= ctx
->Eval
.Map1Normal
;
548 case GL_MAP1_TEXTURE_COORD_1
:
549 *params
= ctx
->Eval
.Map1TextureCoord1
;
551 case GL_MAP1_TEXTURE_COORD_2
:
552 *params
= ctx
->Eval
.Map1TextureCoord2
;
554 case GL_MAP1_TEXTURE_COORD_3
:
555 *params
= ctx
->Eval
.Map1TextureCoord3
;
557 case GL_MAP1_TEXTURE_COORD_4
:
558 *params
= ctx
->Eval
.Map1TextureCoord4
;
560 case GL_MAP1_VERTEX_3
:
561 *params
= ctx
->Eval
.Map1Vertex3
;
563 case GL_MAP1_VERTEX_4
:
564 *params
= ctx
->Eval
.Map1Vertex4
;
566 case GL_MAP2_COLOR_4
:
567 *params
= ctx
->Eval
.Map2Color4
;
569 case GL_MAP2_GRID_DOMAIN
:
570 params
[0] = FLOAT_TO_BOOL(ctx
->Eval
.MapGrid2u1
);
571 params
[1] = FLOAT_TO_BOOL(ctx
->Eval
.MapGrid2u2
);
572 params
[2] = FLOAT_TO_BOOL(ctx
->Eval
.MapGrid2v1
);
573 params
[3] = FLOAT_TO_BOOL(ctx
->Eval
.MapGrid2v2
);
575 case GL_MAP2_GRID_SEGMENTS
:
576 params
[0] = INT_TO_BOOL(ctx
->Eval
.MapGrid2un
);
577 params
[1] = INT_TO_BOOL(ctx
->Eval
.MapGrid2vn
);
580 *params
= ctx
->Eval
.Map2Index
;
583 *params
= ctx
->Eval
.Map2Normal
;
585 case GL_MAP2_TEXTURE_COORD_1
:
586 *params
= ctx
->Eval
.Map2TextureCoord1
;
588 case GL_MAP2_TEXTURE_COORD_2
:
589 *params
= ctx
->Eval
.Map2TextureCoord2
;
591 case GL_MAP2_TEXTURE_COORD_3
:
592 *params
= ctx
->Eval
.Map2TextureCoord3
;
594 case GL_MAP2_TEXTURE_COORD_4
:
595 *params
= ctx
->Eval
.Map2TextureCoord4
;
597 case GL_MAP2_VERTEX_3
:
598 *params
= ctx
->Eval
.Map2Vertex3
;
600 case GL_MAP2_VERTEX_4
:
601 *params
= ctx
->Eval
.Map2Vertex4
;
604 *params
= ctx
->Pixel
.MapColorFlag
;
607 *params
= ctx
->Pixel
.MapStencilFlag
;
610 *params
= ENUM_TO_BOOL( ctx
->Transform
.MatrixMode
);
612 case GL_MAX_ATTRIB_STACK_DEPTH
:
613 *params
= INT_TO_BOOL(MAX_ATTRIB_STACK_DEPTH
);
615 case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
:
616 *params
= INT_TO_BOOL( MAX_CLIENT_ATTRIB_STACK_DEPTH
);
618 case GL_MAX_CLIP_PLANES
:
619 *params
= INT_TO_BOOL(ctx
->Const
.MaxClipPlanes
);
621 case GL_MAX_ELEMENTS_VERTICES
: /* GL_VERSION_1_2 */
622 *params
= INT_TO_BOOL(ctx
->Const
.MaxArrayLockSize
);
624 case GL_MAX_ELEMENTS_INDICES
: /* GL_VERSION_1_2 */
625 *params
= INT_TO_BOOL(ctx
->Const
.MaxArrayLockSize
);
627 case GL_MAX_EVAL_ORDER
:
628 *params
= INT_TO_BOOL(MAX_EVAL_ORDER
);
631 *params
= INT_TO_BOOL(ctx
->Const
.MaxLights
);
633 case GL_MAX_LIST_NESTING
:
634 *params
= INT_TO_BOOL(MAX_LIST_NESTING
);
636 case GL_MAX_MODELVIEW_STACK_DEPTH
:
637 *params
= INT_TO_BOOL(MAX_MODELVIEW_STACK_DEPTH
);
639 case GL_MAX_NAME_STACK_DEPTH
:
640 *params
= INT_TO_BOOL(MAX_NAME_STACK_DEPTH
);
642 case GL_MAX_PIXEL_MAP_TABLE
:
643 *params
= INT_TO_BOOL(MAX_PIXEL_MAP_TABLE
);
645 case GL_MAX_PROJECTION_STACK_DEPTH
:
646 *params
= INT_TO_BOOL(MAX_PROJECTION_STACK_DEPTH
);
648 case GL_MAX_TEXTURE_SIZE
:
649 *params
= INT_TO_BOOL(1 << (ctx
->Const
.MaxTextureLevels
- 1));
651 case GL_MAX_3D_TEXTURE_SIZE
:
652 *params
= INT_TO_BOOL(1 << (ctx
->Const
.Max3DTextureLevels
- 1));
654 case GL_MAX_TEXTURE_STACK_DEPTH
:
655 *params
= INT_TO_BOOL(MAX_TEXTURE_STACK_DEPTH
);
657 case GL_MAX_VIEWPORT_DIMS
:
658 params
[0] = INT_TO_BOOL(MAX_WIDTH
);
659 params
[1] = INT_TO_BOOL(MAX_HEIGHT
);
661 case GL_MODELVIEW_MATRIX
:
663 params
[i
] = FLOAT_TO_BOOL(ctx
->ModelviewMatrixStack
.Top
->m
[i
]);
666 case GL_MODELVIEW_STACK_DEPTH
:
667 *params
= INT_TO_BOOL(ctx
->ModelviewMatrixStack
.Depth
+ 1);
669 case GL_NAME_STACK_DEPTH
:
670 *params
= INT_TO_BOOL(ctx
->Select
.NameStackDepth
);
673 *params
= ctx
->Transform
.Normalize
;
675 case GL_PACK_ALIGNMENT
:
676 *params
= INT_TO_BOOL(ctx
->Pack
.Alignment
);
678 case GL_PACK_LSB_FIRST
:
679 *params
= ctx
->Pack
.LsbFirst
;
681 case GL_PACK_ROW_LENGTH
:
682 *params
= INT_TO_BOOL(ctx
->Pack
.RowLength
);
684 case GL_PACK_SKIP_PIXELS
:
685 *params
= INT_TO_BOOL(ctx
->Pack
.SkipPixels
);
687 case GL_PACK_SKIP_ROWS
:
688 *params
= INT_TO_BOOL(ctx
->Pack
.SkipRows
);
690 case GL_PACK_SWAP_BYTES
:
691 *params
= ctx
->Pack
.SwapBytes
;
693 case GL_PACK_SKIP_IMAGES_EXT
:
694 *params
= ctx
->Pack
.SkipImages
;
696 case GL_PACK_IMAGE_HEIGHT_EXT
:
697 *params
= ctx
->Pack
.ImageHeight
;
699 case GL_PACK_INVERT_MESA
:
700 *params
= ctx
->Pack
.Invert
;
702 case GL_PERSPECTIVE_CORRECTION_HINT
:
703 *params
= ENUM_TO_BOOL(ctx
->Hint
.PerspectiveCorrection
);
705 case GL_PIXEL_MAP_A_TO_A_SIZE
:
706 *params
= INT_TO_BOOL(ctx
->Pixel
.MapAtoAsize
);
708 case GL_PIXEL_MAP_B_TO_B_SIZE
:
709 *params
= INT_TO_BOOL(ctx
->Pixel
.MapBtoBsize
);
711 case GL_PIXEL_MAP_G_TO_G_SIZE
:
712 *params
= INT_TO_BOOL(ctx
->Pixel
.MapGtoGsize
);
714 case GL_PIXEL_MAP_I_TO_A_SIZE
:
715 *params
= INT_TO_BOOL(ctx
->Pixel
.MapItoAsize
);
717 case GL_PIXEL_MAP_I_TO_B_SIZE
:
718 *params
= INT_TO_BOOL(ctx
->Pixel
.MapItoBsize
);
720 case GL_PIXEL_MAP_I_TO_G_SIZE
:
721 *params
= INT_TO_BOOL(ctx
->Pixel
.MapItoGsize
);
723 case GL_PIXEL_MAP_I_TO_I_SIZE
:
724 *params
= INT_TO_BOOL(ctx
->Pixel
.MapItoIsize
);
726 case GL_PIXEL_MAP_I_TO_R_SIZE
:
727 *params
= INT_TO_BOOL(ctx
->Pixel
.MapItoRsize
);
729 case GL_PIXEL_MAP_R_TO_R_SIZE
:
730 *params
= INT_TO_BOOL(ctx
->Pixel
.MapRtoRsize
);
732 case GL_PIXEL_MAP_S_TO_S_SIZE
:
733 *params
= INT_TO_BOOL(ctx
->Pixel
.MapStoSsize
);
736 *params
= FLOAT_TO_BOOL(ctx
->Point
.Size
);
738 case GL_POINT_SIZE_GRANULARITY
:
739 *params
= FLOAT_TO_BOOL(ctx
->Const
.PointSizeGranularity
);
741 case GL_POINT_SIZE_RANGE
:
742 params
[0] = FLOAT_TO_BOOL(ctx
->Const
.MinPointSizeAA
);
743 params
[1] = FLOAT_TO_BOOL(ctx
->Const
.MaxPointSizeAA
);
745 case GL_ALIASED_POINT_SIZE_RANGE
:
746 params
[0] = FLOAT_TO_BOOL(ctx
->Const
.MinPointSize
);
747 params
[1] = FLOAT_TO_BOOL(ctx
->Const
.MaxPointSize
);
749 case GL_POINT_SMOOTH
:
750 *params
= ctx
->Point
.SmoothFlag
;
752 case GL_POINT_SMOOTH_HINT
:
753 *params
= ENUM_TO_BOOL(ctx
->Hint
.PointSmooth
);
755 case GL_POINT_SIZE_MIN_EXT
:
756 *params
= FLOAT_TO_BOOL(ctx
->Point
.MinSize
);
758 case GL_POINT_SIZE_MAX_EXT
:
759 *params
= FLOAT_TO_BOOL(ctx
->Point
.MaxSize
);
761 case GL_POINT_FADE_THRESHOLD_SIZE_EXT
:
762 *params
= FLOAT_TO_BOOL(ctx
->Point
.Threshold
);
764 case GL_DISTANCE_ATTENUATION_EXT
:
765 params
[0] = FLOAT_TO_BOOL(ctx
->Point
.Params
[0]);
766 params
[1] = FLOAT_TO_BOOL(ctx
->Point
.Params
[1]);
767 params
[2] = FLOAT_TO_BOOL(ctx
->Point
.Params
[2]);
769 case GL_POLYGON_MODE
:
770 params
[0] = ENUM_TO_BOOL(ctx
->Polygon
.FrontMode
);
771 params
[1] = ENUM_TO_BOOL(ctx
->Polygon
.BackMode
);
773 case GL_POLYGON_OFFSET_BIAS_EXT
: /* GL_EXT_polygon_offset */
774 *params
= FLOAT_TO_BOOL( ctx
->Polygon
.OffsetUnits
);
776 case GL_POLYGON_OFFSET_FACTOR
:
777 *params
= FLOAT_TO_BOOL( ctx
->Polygon
.OffsetFactor
);
779 case GL_POLYGON_OFFSET_UNITS
:
780 *params
= FLOAT_TO_BOOL( ctx
->Polygon
.OffsetUnits
);
782 case GL_POLYGON_SMOOTH
:
783 *params
= ctx
->Polygon
.SmoothFlag
;
785 case GL_POLYGON_SMOOTH_HINT
:
786 *params
= ENUM_TO_BOOL(ctx
->Hint
.PolygonSmooth
);
788 case GL_POLYGON_STIPPLE
:
789 *params
= ctx
->Polygon
.StippleFlag
;
791 case GL_PROJECTION_MATRIX
:
793 params
[i
] = FLOAT_TO_BOOL(ctx
->ProjectionMatrixStack
.Top
->m
[i
]);
796 case GL_PROJECTION_STACK_DEPTH
:
797 *params
= INT_TO_BOOL(ctx
->ProjectionMatrixStack
.Depth
+ 1);
800 *params
= ENUM_TO_BOOL(ctx
->Pixel
.ReadBuffer
);
803 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.RedBias
);
806 *params
= INT_TO_BOOL( ctx
->Visual
.redBits
);
809 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.RedScale
);
812 *params
= ENUM_TO_BOOL(ctx
->RenderMode
);
814 case GL_RESCALE_NORMAL
:
815 *params
= ctx
->Transform
.RescaleNormals
;
818 *params
= ctx
->Visual
.rgbMode
;
821 params
[0] = INT_TO_BOOL(ctx
->Scissor
.X
);
822 params
[1] = INT_TO_BOOL(ctx
->Scissor
.Y
);
823 params
[2] = INT_TO_BOOL(ctx
->Scissor
.Width
);
824 params
[3] = INT_TO_BOOL(ctx
->Scissor
.Height
);
826 case GL_SCISSOR_TEST
:
827 *params
= ctx
->Scissor
.Enabled
;
829 case GL_SELECTION_BUFFER_SIZE
:
830 *params
= INT_TO_BOOL(ctx
->Select
.BufferSize
);
833 *params
= ENUM_TO_BOOL(ctx
->Light
.ShadeModel
);
835 case GL_SHARED_TEXTURE_PALETTE_EXT
:
836 *params
= ctx
->Texture
.SharedPalette
;
838 case GL_STENCIL_BITS
:
839 *params
= INT_TO_BOOL(ctx
->Visual
.stencilBits
);
841 case GL_STENCIL_CLEAR_VALUE
:
842 *params
= INT_TO_BOOL(ctx
->Stencil
.Clear
);
844 case GL_STENCIL_FAIL
:
845 *params
= ENUM_TO_BOOL(ctx
->Stencil
.FailFunc
[ctx
->Stencil
.ActiveFace
]);
847 case GL_STENCIL_FUNC
:
848 *params
= ENUM_TO_BOOL(ctx
->Stencil
.Function
[ctx
->Stencil
.ActiveFace
]);
850 case GL_STENCIL_PASS_DEPTH_FAIL
:
851 *params
= ENUM_TO_BOOL(ctx
->Stencil
.ZFailFunc
[ctx
->Stencil
.ActiveFace
]);
853 case GL_STENCIL_PASS_DEPTH_PASS
:
854 *params
= ENUM_TO_BOOL(ctx
->Stencil
.ZPassFunc
[ctx
->Stencil
.ActiveFace
]);
857 *params
= INT_TO_BOOL(ctx
->Stencil
.Ref
[ctx
->Stencil
.ActiveFace
]);
859 case GL_STENCIL_TEST
:
860 *params
= ctx
->Stencil
.Enabled
;
862 case GL_STENCIL_VALUE_MASK
:
863 *params
= INT_TO_BOOL(ctx
->Stencil
.ValueMask
[ctx
->Stencil
.ActiveFace
]);
865 case GL_STENCIL_WRITEMASK
:
866 *params
= INT_TO_BOOL(ctx
->Stencil
.WriteMask
[ctx
->Stencil
.ActiveFace
]);
869 *params
= ctx
->Visual
.stereoMode
;
871 case GL_SUBPIXEL_BITS
:
872 *params
= INT_TO_BOOL(ctx
->Const
.SubPixelBits
);
875 *params
= _mesa_IsEnabled(GL_TEXTURE_1D
);
878 *params
= _mesa_IsEnabled(GL_TEXTURE_2D
);
881 *params
= _mesa_IsEnabled(GL_TEXTURE_3D
);
883 case GL_TEXTURE_BINDING_1D
:
884 *params
= INT_TO_BOOL(textureUnit
->Current1D
->Name
);
886 case GL_TEXTURE_BINDING_2D
:
887 *params
= INT_TO_BOOL(textureUnit
->Current2D
->Name
);
889 case GL_TEXTURE_BINDING_3D
:
890 *params
= INT_TO_BOOL(textureUnit
->Current3D
->Name
);
892 case GL_TEXTURE_ENV_COLOR
:
894 params
[0] = FLOAT_TO_BOOL(textureUnit
->EnvColor
[0]);
895 params
[1] = FLOAT_TO_BOOL(textureUnit
->EnvColor
[1]);
896 params
[2] = FLOAT_TO_BOOL(textureUnit
->EnvColor
[2]);
897 params
[3] = FLOAT_TO_BOOL(textureUnit
->EnvColor
[3]);
900 case GL_TEXTURE_ENV_MODE
:
901 *params
= ENUM_TO_BOOL(textureUnit
->EnvMode
);
903 case GL_TEXTURE_GEN_S
:
904 *params
= (textureUnit
->TexGenEnabled
& S_BIT
) ? GL_TRUE
: GL_FALSE
;
906 case GL_TEXTURE_GEN_T
:
907 *params
= (textureUnit
->TexGenEnabled
& T_BIT
) ? GL_TRUE
: GL_FALSE
;
909 case GL_TEXTURE_GEN_R
:
910 *params
= (textureUnit
->TexGenEnabled
& R_BIT
) ? GL_TRUE
: GL_FALSE
;
912 case GL_TEXTURE_GEN_Q
:
913 *params
= (textureUnit
->TexGenEnabled
& Q_BIT
) ? GL_TRUE
: GL_FALSE
;
915 case GL_TEXTURE_MATRIX
:
918 FLOAT_TO_BOOL(ctx
->TextureMatrixStack
[texUnit
].Top
->m
[i
]);
921 case GL_TEXTURE_STACK_DEPTH
:
922 *params
= INT_TO_BOOL(ctx
->TextureMatrixStack
[texUnit
].Depth
+ 1);
924 case GL_UNPACK_ALIGNMENT
:
925 *params
= INT_TO_BOOL(ctx
->Unpack
.Alignment
);
927 case GL_UNPACK_LSB_FIRST
:
928 *params
= ctx
->Unpack
.LsbFirst
;
930 case GL_UNPACK_ROW_LENGTH
:
931 *params
= INT_TO_BOOL(ctx
->Unpack
.RowLength
);
933 case GL_UNPACK_SKIP_PIXELS
:
934 *params
= INT_TO_BOOL(ctx
->Unpack
.SkipPixels
);
936 case GL_UNPACK_SKIP_ROWS
:
937 *params
= INT_TO_BOOL(ctx
->Unpack
.SkipRows
);
939 case GL_UNPACK_SWAP_BYTES
:
940 *params
= ctx
->Unpack
.SwapBytes
;
942 case GL_UNPACK_SKIP_IMAGES_EXT
:
943 *params
= ctx
->Unpack
.SkipImages
;
945 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
946 *params
= ctx
->Unpack
.ImageHeight
;
948 case GL_UNPACK_CLIENT_STORAGE_APPLE
:
949 *params
= ctx
->Unpack
.ClientStorage
;
952 params
[0] = INT_TO_BOOL(ctx
->Viewport
.X
);
953 params
[1] = INT_TO_BOOL(ctx
->Viewport
.Y
);
954 params
[2] = INT_TO_BOOL(ctx
->Viewport
.Width
);
955 params
[3] = INT_TO_BOOL(ctx
->Viewport
.Height
);
958 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.ZoomX
);
961 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.ZoomY
);
963 case GL_VERTEX_ARRAY
:
964 *params
= ctx
->Array
.Vertex
.Enabled
;
966 case GL_VERTEX_ARRAY_SIZE
:
967 *params
= INT_TO_BOOL(ctx
->Array
.Vertex
.Size
);
969 case GL_VERTEX_ARRAY_TYPE
:
970 *params
= ENUM_TO_BOOL(ctx
->Array
.Vertex
.Type
);
972 case GL_VERTEX_ARRAY_STRIDE
:
973 *params
= INT_TO_BOOL(ctx
->Array
.Vertex
.Stride
);
975 case GL_VERTEX_ARRAY_COUNT_EXT
:
976 *params
= INT_TO_BOOL(0);
978 case GL_NORMAL_ARRAY
:
979 *params
= ctx
->Array
.Normal
.Enabled
;
981 case GL_NORMAL_ARRAY_TYPE
:
982 *params
= ENUM_TO_BOOL(ctx
->Array
.Normal
.Type
);
984 case GL_NORMAL_ARRAY_STRIDE
:
985 *params
= INT_TO_BOOL(ctx
->Array
.Normal
.Stride
);
987 case GL_NORMAL_ARRAY_COUNT_EXT
:
988 *params
= INT_TO_BOOL(0);
991 *params
= ctx
->Array
.Color
.Enabled
;
993 case GL_COLOR_ARRAY_SIZE
:
994 *params
= INT_TO_BOOL(ctx
->Array
.Color
.Size
);
996 case GL_COLOR_ARRAY_TYPE
:
997 *params
= ENUM_TO_BOOL(ctx
->Array
.Color
.Type
);
999 case GL_COLOR_ARRAY_STRIDE
:
1000 *params
= INT_TO_BOOL(ctx
->Array
.Color
.Stride
);
1002 case GL_COLOR_ARRAY_COUNT_EXT
:
1003 *params
= INT_TO_BOOL(0);
1005 case GL_INDEX_ARRAY
:
1006 *params
= ctx
->Array
.Index
.Enabled
;
1008 case GL_INDEX_ARRAY_TYPE
:
1009 *params
= ENUM_TO_BOOL(ctx
->Array
.Index
.Type
);
1011 case GL_INDEX_ARRAY_STRIDE
:
1012 *params
= INT_TO_BOOL(ctx
->Array
.Index
.Stride
);
1014 case GL_INDEX_ARRAY_COUNT_EXT
:
1015 *params
= INT_TO_BOOL(0);
1017 case GL_TEXTURE_COORD_ARRAY
:
1018 *params
= ctx
->Array
.TexCoord
[clientUnit
].Enabled
;
1020 case GL_TEXTURE_COORD_ARRAY_SIZE
:
1021 *params
= INT_TO_BOOL(ctx
->Array
.TexCoord
[clientUnit
].Size
);
1023 case GL_TEXTURE_COORD_ARRAY_TYPE
:
1024 *params
= ENUM_TO_BOOL(ctx
->Array
.TexCoord
[clientUnit
].Type
);
1026 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
1027 *params
= INT_TO_BOOL(ctx
->Array
.TexCoord
[clientUnit
].Stride
);
1029 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
1030 *params
= INT_TO_BOOL(0);
1032 case GL_EDGE_FLAG_ARRAY
:
1033 *params
= ctx
->Array
.EdgeFlag
.Enabled
;
1035 case GL_EDGE_FLAG_ARRAY_STRIDE
:
1036 *params
= INT_TO_BOOL(ctx
->Array
.EdgeFlag
.Stride
);
1038 case GL_EDGE_FLAG_ARRAY_COUNT_EXT
:
1039 *params
= INT_TO_BOOL(0);
1042 /* GL_ARB_multitexture */
1043 case GL_MAX_TEXTURE_UNITS_ARB
:
1044 CHECK_EXTENSION_B(ARB_multitexture
, pname
);
1045 *params
= INT_TO_BOOL(MIN2(ctx
->Const
.MaxTextureImageUnits
,
1046 ctx
->Const
.MaxTextureCoordUnits
));
1048 case GL_ACTIVE_TEXTURE_ARB
:
1049 CHECK_EXTENSION_B(ARB_multitexture
, pname
);
1050 *params
= INT_TO_BOOL(GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
);
1052 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
1053 CHECK_EXTENSION_B(ARB_multitexture
, pname
);
1054 *params
= INT_TO_BOOL(GL_TEXTURE0_ARB
+ clientUnit
);
1057 /* GL_ARB_texture_cube_map */
1058 case GL_TEXTURE_CUBE_MAP_ARB
:
1059 CHECK_EXTENSION_B(ARB_texture_cube_map
, pname
);
1060 *params
= _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
);
1062 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
1063 CHECK_EXTENSION_B(ARB_texture_cube_map
, pname
);
1064 *params
= INT_TO_BOOL(textureUnit
->CurrentCubeMap
->Name
);
1066 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
1067 CHECK_EXTENSION_B(ARB_texture_cube_map
, pname
);
1068 *params
= INT_TO_BOOL(1 << (ctx
->Const
.MaxCubeTextureLevels
- 1));
1071 /* GL_ARB_texture_compression */
1072 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
1073 CHECK_EXTENSION_B(ARB_texture_compression
, pname
);
1074 *params
= INT_TO_BOOL(ctx
->Hint
.TextureCompression
);
1076 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
1077 CHECK_EXTENSION_B(ARB_texture_compression
, pname
);
1078 *params
= INT_TO_BOOL(_mesa_get_compressed_formats(ctx
, NULL
));
1080 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
1081 CHECK_EXTENSION_B(ARB_texture_compression
, pname
);
1085 n
= _mesa_get_compressed_formats(ctx
, formats
);
1086 for (i
= 0; i
< n
; i
++)
1087 params
[i
] = INT_TO_BOOL(formats
[i
]);
1091 /* GL_EXT_compiled_vertex_array */
1092 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
1093 *params
= ctx
->Array
.LockFirst
? GL_TRUE
: GL_FALSE
;
1095 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
1096 *params
= ctx
->Array
.LockCount
? GL_TRUE
: GL_FALSE
;
1099 /* GL_ARB_transpose_matrix */
1100 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
1104 _math_transposef(tm
, ctx
->ColorMatrixStack
.Top
->m
);
1105 for (i
=0;i
<16;i
++) {
1106 params
[i
] = FLOAT_TO_BOOL(tm
[i
]);
1110 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
1114 _math_transposef(tm
, ctx
->ModelviewMatrixStack
.Top
->m
);
1115 for (i
=0;i
<16;i
++) {
1116 params
[i
] = FLOAT_TO_BOOL(tm
[i
]);
1120 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
1124 _math_transposef(tm
, ctx
->ProjectionMatrixStack
.Top
->m
);
1125 for (i
=0;i
<16;i
++) {
1126 params
[i
] = FLOAT_TO_BOOL(tm
[i
]);
1130 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
1134 _math_transposef(tm
, ctx
->TextureMatrixStack
[texUnit
].Top
->m
);
1135 for (i
=0;i
<16;i
++) {
1136 params
[i
] = FLOAT_TO_BOOL(tm
[i
]);
1141 /* GL_HP_occlusion_test */
1142 case GL_OCCLUSION_TEST_HP
:
1143 CHECK_EXTENSION_B(HP_occlusion_test
, pname
);
1144 *params
= ctx
->Depth
.OcclusionTest
;
1146 case GL_OCCLUSION_TEST_RESULT_HP
:
1147 CHECK_EXTENSION_B(HP_occlusion_test
, pname
);
1148 if (ctx
->Depth
.OcclusionTest
)
1149 *params
= ctx
->OcclusionResult
;
1151 *params
= ctx
->OcclusionResultSaved
;
1152 /* reset flag now */
1153 ctx
->OcclusionResult
= GL_FALSE
;
1154 ctx
->OcclusionResultSaved
= GL_FALSE
;
1157 /* GL_SGIS_pixel_texture */
1158 case GL_PIXEL_TEXTURE_SGIS
:
1159 *params
= ctx
->Pixel
.PixelTextureEnabled
;
1162 /* GL_SGIX_pixel_texture */
1163 case GL_PIXEL_TEX_GEN_SGIX
:
1164 *params
= ctx
->Pixel
.PixelTextureEnabled
;
1166 case GL_PIXEL_TEX_GEN_MODE_SGIX
:
1167 *params
= (GLboolean
) pixel_texgen_mode(ctx
);
1170 /* GL_SGI_color_matrix (also in 1.2 imaging) */
1171 case GL_COLOR_MATRIX_SGI
:
1172 for (i
=0;i
<16;i
++) {
1173 params
[i
] = FLOAT_TO_BOOL(ctx
->ColorMatrixStack
.Top
->m
[i
]);
1176 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
1177 *params
= INT_TO_BOOL(ctx
->ColorMatrixStack
.Depth
+ 1);
1179 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
1180 *params
= FLOAT_TO_BOOL(MAX_COLOR_STACK_DEPTH
);
1182 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
1183 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixScale
[0]);
1185 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
1186 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixScale
[1]);
1188 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
1189 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixScale
[2]);
1191 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
1192 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixScale
[3]);
1194 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
1195 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixBias
[0]);
1197 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
1198 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixBias
[1]);
1200 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
1201 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixBias
[2]);
1203 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
1204 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixBias
[3]);
1207 /* GL_EXT_convolution (also in 1.2 imaging) */
1208 case GL_CONVOLUTION_1D_EXT
:
1209 CHECK_EXTENSION_B(EXT_convolution
, pname
);
1210 *params
= ctx
->Pixel
.Convolution1DEnabled
;
1212 case GL_CONVOLUTION_2D
:
1213 CHECK_EXTENSION_B(EXT_convolution
, pname
);
1214 *params
= ctx
->Pixel
.Convolution2DEnabled
;
1216 case GL_SEPARABLE_2D
:
1217 CHECK_EXTENSION_B(EXT_convolution
, pname
);
1218 *params
= ctx
->Pixel
.Separable2DEnabled
;
1220 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
1221 CHECK_EXTENSION_B(EXT_convolution
, pname
);
1222 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionScale
[0]);
1224 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
1225 CHECK_EXTENSION_B(EXT_convolution
, pname
);
1226 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionScale
[1]);
1228 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
1229 CHECK_EXTENSION_B(EXT_convolution
, pname
);
1230 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionScale
[2]);
1232 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
1233 CHECK_EXTENSION_B(EXT_convolution
, pname
);
1234 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionScale
[3]);
1236 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
1237 CHECK_EXTENSION_B(EXT_convolution
, pname
);
1238 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionBias
[0]);
1240 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
1241 CHECK_EXTENSION_B(EXT_convolution
, pname
);
1242 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionBias
[1]);
1244 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
1245 CHECK_EXTENSION_B(EXT_convolution
, pname
);
1246 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionBias
[2]);
1248 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
1249 CHECK_EXTENSION_B(EXT_convolution
, pname
);
1250 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionBias
[2]);
1253 /* GL_EXT_histogram (also in 1.2 imaging) */
1255 CHECK_EXTENSION_B(EXT_histogram
, pname
);
1256 *params
= ctx
->Pixel
.HistogramEnabled
;
1259 CHECK_EXTENSION_B(EXT_histogram
, pname
);
1260 *params
= ctx
->Pixel
.MinMaxEnabled
;
1263 /* GL_SGI_color_table (also in 1.2 imaging */
1264 case GL_COLOR_TABLE_SGI
:
1265 *params
= ctx
->Pixel
.ColorTableEnabled
;
1267 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
1268 *params
= ctx
->Pixel
.PostConvolutionColorTableEnabled
;
1270 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
1271 *params
= ctx
->Pixel
.PostColorMatrixColorTableEnabled
;
1274 /* GL_SGI_texture_color_table */
1275 case GL_TEXTURE_COLOR_TABLE_SGI
:
1276 CHECK_EXTENSION_B(SGI_texture_color_table
, pname
);
1277 *params
= textureUnit
->ColorTableEnabled
;
1280 /* GL_EXT_secondary_color */
1281 case GL_COLOR_SUM_EXT
:
1282 CHECK_EXTENSION_B(EXT_secondary_color
, pname
);
1283 *params
= ctx
->Fog
.ColorSumEnabled
;
1285 case GL_CURRENT_SECONDARY_COLOR_EXT
:
1286 CHECK_EXTENSION_B(EXT_secondary_color
, pname
);
1287 FLUSH_CURRENT(ctx
, 0);
1288 params
[0] = INT_TO_BOOL(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][0]);
1289 params
[1] = INT_TO_BOOL(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][1]);
1290 params
[2] = INT_TO_BOOL(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][2]);
1291 params
[3] = INT_TO_BOOL(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][3]);
1293 case GL_SECONDARY_COLOR_ARRAY_EXT
:
1294 CHECK_EXTENSION_B(EXT_secondary_color
, pname
);
1295 *params
= ctx
->Array
.SecondaryColor
.Enabled
;
1297 case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT
:
1298 CHECK_EXTENSION_B(EXT_secondary_color
, pname
);
1299 *params
= ENUM_TO_BOOL(ctx
->Array
.SecondaryColor
.Type
);
1301 case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT
:
1302 CHECK_EXTENSION_B(EXT_secondary_color
, pname
);
1303 *params
= INT_TO_BOOL(ctx
->Array
.SecondaryColor
.Stride
);
1305 case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT
:
1306 CHECK_EXTENSION_B(EXT_secondary_color
, pname
);
1307 *params
= INT_TO_BOOL(ctx
->Array
.SecondaryColor
.Size
);
1310 /* GL_EXT_fog_coord */
1311 case GL_CURRENT_FOG_COORDINATE_EXT
:
1312 CHECK_EXTENSION_B(EXT_fog_coord
, pname
);
1313 FLUSH_CURRENT(ctx
, 0);
1314 *params
= FLOAT_TO_BOOL(ctx
->Current
.Attrib
[VERT_ATTRIB_FOG
][0]);
1316 case GL_FOG_COORDINATE_ARRAY_EXT
:
1317 CHECK_EXTENSION_B(EXT_fog_coord
, pname
);
1318 *params
= ctx
->Array
.FogCoord
.Enabled
;
1320 case GL_FOG_COORDINATE_ARRAY_TYPE_EXT
:
1321 CHECK_EXTENSION_B(EXT_fog_coord
, pname
);
1322 *params
= ENUM_TO_BOOL(ctx
->Array
.FogCoord
.Type
);
1324 case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
:
1325 CHECK_EXTENSION_B(EXT_fog_coord
, pname
);
1326 *params
= INT_TO_BOOL(ctx
->Array
.FogCoord
.Stride
);
1328 case GL_FOG_COORDINATE_SOURCE_EXT
:
1329 CHECK_EXTENSION_B(EXT_fog_coord
, pname
);
1330 *params
= ENUM_TO_BOOL(ctx
->Fog
.FogCoordinateSource
);
1333 /* GL_EXT_texture_lod_bias */
1334 case GL_MAX_TEXTURE_LOD_BIAS_EXT
:
1335 *params
= FLOAT_TO_BOOL(ctx
->Const
.MaxTextureLodBias
);
1338 /* GL_EXT_texture_filter_anisotropic */
1339 case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
:
1340 CHECK_EXTENSION_B(EXT_texture_filter_anisotropic
, pname
);
1341 *params
= FLOAT_TO_BOOL(ctx
->Const
.MaxTextureMaxAnisotropy
);
1344 /* GL_ARB_multisample */
1345 case GL_MULTISAMPLE_ARB
:
1346 CHECK_EXTENSION_B(ARB_multisample
, pname
);
1347 *params
= ctx
->Multisample
.Enabled
;
1349 case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB
:
1350 CHECK_EXTENSION_B(ARB_multisample
, pname
);
1351 *params
= ctx
->Multisample
.SampleAlphaToCoverage
;
1353 case GL_SAMPLE_ALPHA_TO_ONE_ARB
:
1354 CHECK_EXTENSION_B(ARB_multisample
, pname
);
1355 *params
= ctx
->Multisample
.SampleAlphaToOne
;
1357 case GL_SAMPLE_COVERAGE_ARB
:
1358 CHECK_EXTENSION_B(ARB_multisample
, pname
);
1359 *params
= ctx
->Multisample
.SampleCoverage
;
1361 case GL_SAMPLE_COVERAGE_VALUE_ARB
:
1362 CHECK_EXTENSION_B(ARB_multisample
, pname
);
1363 *params
= FLOAT_TO_BOOL(ctx
->Multisample
.SampleCoverageValue
);
1365 case GL_SAMPLE_COVERAGE_INVERT_ARB
:
1366 CHECK_EXTENSION_B(ARB_multisample
, pname
);
1367 *params
= ctx
->Multisample
.SampleCoverageInvert
;
1369 case GL_SAMPLE_BUFFERS_ARB
:
1370 CHECK_EXTENSION_B(ARB_multisample
, pname
);
1371 *params
= 0; /* XXX fix someday */
1373 case GL_SAMPLES_ARB
:
1374 CHECK_EXTENSION_B(ARB_multisample
, pname
);
1375 *params
= 0; /* XXX fix someday */
1378 /* GL_IBM_rasterpos_clip */
1379 case GL_RASTER_POSITION_UNCLIPPED_IBM
:
1380 CHECK_EXTENSION_B(IBM_rasterpos_clip
, pname
);
1381 *params
= ctx
->Transform
.RasterPositionUnclipped
;
1384 /* GL_NV_point_sprite */
1385 case GL_POINT_SPRITE_NV
:
1386 CHECK_EXTENSION2_B(NV_point_sprite
, ARB_point_sprite
, pname
);
1387 *params
= ctx
->Point
.PointSprite
;
1389 case GL_POINT_SPRITE_R_MODE_NV
:
1390 CHECK_EXTENSION_B(NV_point_sprite
, pname
);
1391 *params
= ENUM_TO_BOOL(ctx
->Point
.SpriteRMode
);
1393 case GL_POINT_SPRITE_COORD_ORIGIN
:
1394 CHECK_EXTENSION_B(ARB_point_sprite
, pname
);
1395 *params
= ENUM_TO_BOOL(ctx
->Point
.SpriteOrigin
);
1398 /* GL_SGIS_generate_mipmap */
1399 case GL_GENERATE_MIPMAP_HINT_SGIS
:
1400 CHECK_EXTENSION_B(SGIS_generate_mipmap
, pname
);
1401 *params
= ENUM_TO_BOOL(ctx
->Hint
.GenerateMipmap
);
1404 #if FEATURE_NV_vertex_program
1405 case GL_VERTEX_PROGRAM_NV
:
1406 CHECK_EXTENSION_B(NV_vertex_program
, pname
);
1407 *params
= ctx
->VertexProgram
.Enabled
;
1409 case GL_VERTEX_PROGRAM_POINT_SIZE_NV
:
1410 CHECK_EXTENSION_B(NV_vertex_program
, pname
);
1411 *params
= ctx
->VertexProgram
.PointSizeEnabled
;
1413 case GL_VERTEX_PROGRAM_TWO_SIDE_NV
:
1414 CHECK_EXTENSION_B(NV_vertex_program
, pname
);
1415 *params
= ctx
->VertexProgram
.TwoSideEnabled
;
1417 case GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV
:
1418 CHECK_EXTENSION_B(NV_vertex_program
, pname
);
1419 *params
= (ctx
->Const
.MaxProgramMatrixStackDepth
> 0) ? GL_TRUE
: GL_FALSE
;
1421 case GL_MAX_TRACK_MATRICES_NV
:
1422 CHECK_EXTENSION_B(NV_vertex_program
, pname
);
1423 *params
= (ctx
->Const
.MaxProgramMatrices
> 0) ? GL_TRUE
: GL_FALSE
;
1425 case GL_CURRENT_MATRIX_STACK_DEPTH_NV
:
1426 CHECK_EXTENSION_B(NV_vertex_program
, pname
);
1429 case GL_CURRENT_MATRIX_NV
:
1430 CHECK_EXTENSION_B(NV_vertex_program
, pname
);
1431 for (i
= 0; i
< 16; i
++)
1432 params
[i
] = FLOAT_TO_BOOL(ctx
->CurrentStack
->Top
->m
[i
]);
1434 case GL_VERTEX_PROGRAM_BINDING_NV
:
1435 CHECK_EXTENSION_B(NV_vertex_program
, pname
);
1436 if (ctx
->VertexProgram
.Current
&&
1437 ctx
->VertexProgram
.Current
->Base
.Id
!= 0)
1442 case GL_PROGRAM_ERROR_POSITION_NV
:
1443 CHECK_EXTENSION_B(NV_vertex_program
, pname
);
1444 *params
= (ctx
->Program
.ErrorPos
!= 0) ? GL_TRUE
: GL_FALSE
;
1446 case GL_VERTEX_ATTRIB_ARRAY0_NV
:
1447 case GL_VERTEX_ATTRIB_ARRAY1_NV
:
1448 case GL_VERTEX_ATTRIB_ARRAY2_NV
:
1449 case GL_VERTEX_ATTRIB_ARRAY3_NV
:
1450 case GL_VERTEX_ATTRIB_ARRAY4_NV
:
1451 case GL_VERTEX_ATTRIB_ARRAY5_NV
:
1452 case GL_VERTEX_ATTRIB_ARRAY6_NV
:
1453 case GL_VERTEX_ATTRIB_ARRAY7_NV
:
1454 case GL_VERTEX_ATTRIB_ARRAY8_NV
:
1455 case GL_VERTEX_ATTRIB_ARRAY9_NV
:
1456 case GL_VERTEX_ATTRIB_ARRAY10_NV
:
1457 case GL_VERTEX_ATTRIB_ARRAY11_NV
:
1458 case GL_VERTEX_ATTRIB_ARRAY12_NV
:
1459 case GL_VERTEX_ATTRIB_ARRAY13_NV
:
1460 case GL_VERTEX_ATTRIB_ARRAY14_NV
:
1461 case GL_VERTEX_ATTRIB_ARRAY15_NV
:
1462 CHECK_EXTENSION_B(NV_vertex_program
, pname
);
1464 GLuint n
= (GLuint
) pname
- GL_VERTEX_ATTRIB_ARRAY0_NV
;
1465 *params
= ctx
->Array
.VertexAttrib
[n
].Enabled
;
1468 case GL_MAP1_VERTEX_ATTRIB0_4_NV
:
1469 case GL_MAP1_VERTEX_ATTRIB1_4_NV
:
1470 case GL_MAP1_VERTEX_ATTRIB2_4_NV
:
1471 case GL_MAP1_VERTEX_ATTRIB3_4_NV
:
1472 case GL_MAP1_VERTEX_ATTRIB4_4_NV
:
1473 case GL_MAP1_VERTEX_ATTRIB5_4_NV
:
1474 case GL_MAP1_VERTEX_ATTRIB6_4_NV
:
1475 case GL_MAP1_VERTEX_ATTRIB7_4_NV
:
1476 case GL_MAP1_VERTEX_ATTRIB8_4_NV
:
1477 case GL_MAP1_VERTEX_ATTRIB9_4_NV
:
1478 case GL_MAP1_VERTEX_ATTRIB10_4_NV
:
1479 case GL_MAP1_VERTEX_ATTRIB11_4_NV
:
1480 case GL_MAP1_VERTEX_ATTRIB12_4_NV
:
1481 case GL_MAP1_VERTEX_ATTRIB13_4_NV
:
1482 case GL_MAP1_VERTEX_ATTRIB14_4_NV
:
1483 case GL_MAP1_VERTEX_ATTRIB15_4_NV
:
1484 CHECK_EXTENSION_B(NV_vertex_program
, pname
);
1486 GLuint n
= (GLuint
) pname
- GL_MAP1_VERTEX_ATTRIB0_4_NV
;
1487 *params
= ctx
->Eval
.Map1Attrib
[n
];
1490 case GL_MAP2_VERTEX_ATTRIB0_4_NV
:
1491 case GL_MAP2_VERTEX_ATTRIB1_4_NV
:
1492 case GL_MAP2_VERTEX_ATTRIB2_4_NV
:
1493 case GL_MAP2_VERTEX_ATTRIB3_4_NV
:
1494 case GL_MAP2_VERTEX_ATTRIB4_4_NV
:
1495 case GL_MAP2_VERTEX_ATTRIB5_4_NV
:
1496 case GL_MAP2_VERTEX_ATTRIB6_4_NV
:
1497 case GL_MAP2_VERTEX_ATTRIB7_4_NV
:
1498 case GL_MAP2_VERTEX_ATTRIB8_4_NV
:
1499 case GL_MAP2_VERTEX_ATTRIB9_4_NV
:
1500 case GL_MAP2_VERTEX_ATTRIB10_4_NV
:
1501 case GL_MAP2_VERTEX_ATTRIB11_4_NV
:
1502 case GL_MAP2_VERTEX_ATTRIB12_4_NV
:
1503 case GL_MAP2_VERTEX_ATTRIB13_4_NV
:
1504 case GL_MAP2_VERTEX_ATTRIB14_4_NV
:
1505 case GL_MAP2_VERTEX_ATTRIB15_4_NV
:
1506 CHECK_EXTENSION_B(NV_vertex_program
, pname
);
1508 GLuint n
= (GLuint
) pname
- GL_MAP2_VERTEX_ATTRIB0_4_NV
;
1509 *params
= ctx
->Eval
.Map2Attrib
[n
];
1512 #endif /* FEATURE_NV_vertex_program */
1514 #if FEATURE_NV_fragment_program
1515 case GL_FRAGMENT_PROGRAM_NV
:
1516 CHECK_EXTENSION_B(NV_fragment_program
, pname
);
1517 *params
= ctx
->FragmentProgram
.Enabled
;
1519 case GL_MAX_TEXTURE_COORDS_NV
:
1520 CHECK_EXTENSION_B(NV_fragment_program
, pname
);
1521 *params
= INT_TO_BOOL(ctx
->Const
.MaxTextureCoordUnits
);
1523 case GL_MAX_TEXTURE_IMAGE_UNITS_NV
:
1524 CHECK_EXTENSION_B(NV_fragment_program
, pname
);
1525 *params
= INT_TO_BOOL(ctx
->Const
.MaxTextureImageUnits
);
1527 case GL_FRAGMENT_PROGRAM_BINDING_NV
:
1528 CHECK_EXTENSION_B(NV_fragment_program
, pname
);
1529 if (ctx
->VertexProgram
.Current
&&
1530 ctx
->VertexProgram
.Current
->Base
.Id
!= 0)
1535 case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV
:
1536 CHECK_EXTENSION_B(NV_fragment_program
, pname
);
1537 *params
= MAX_NV_FRAGMENT_PROGRAM_PARAMS
? GL_TRUE
: GL_FALSE
;
1539 #endif /* FEATURE_NV_fragment_program */
1541 /* GL_NV_texture_rectangle */
1542 case GL_TEXTURE_RECTANGLE_NV
:
1543 CHECK_EXTENSION_B(NV_texture_rectangle
, pname
);
1544 *params
= _mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV
);
1546 case GL_TEXTURE_BINDING_RECTANGLE_NV
:
1547 CHECK_EXTENSION_B(NV_texture_rectangle
, pname
);
1548 *params
= INT_TO_BOOL(textureUnit
->CurrentRect
->Name
);
1550 case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV
:
1551 CHECK_EXTENSION_B(NV_texture_rectangle
, pname
);
1552 *params
= INT_TO_BOOL(ctx
->Const
.MaxTextureRectSize
);
1555 /* GL_EXT_stencil_two_side */
1556 case GL_STENCIL_TEST_TWO_SIDE_EXT
:
1557 CHECK_EXTENSION_B(EXT_stencil_two_side
, pname
);
1558 *params
= ctx
->Stencil
.TestTwoSide
;
1560 case GL_ACTIVE_STENCIL_FACE_EXT
:
1561 CHECK_EXTENSION_B(EXT_stencil_two_side
, pname
);
1562 *params
= ENUM_TO_BOOL(ctx
->Stencil
.ActiveFace
? GL_BACK
: GL_FRONT
);
1565 /* GL_NV_light_max_exponent */
1566 case GL_MAX_SHININESS_NV
:
1567 *params
= FLOAT_TO_BOOL(ctx
->Const
.MaxShininess
);
1569 case GL_MAX_SPOT_EXPONENT_NV
:
1570 *params
= FLOAT_TO_BOOL(ctx
->Const
.MaxSpotExponent
);
1573 #if FEATURE_ARB_vertex_buffer_object
1574 case GL_ARRAY_BUFFER_BINDING_ARB
:
1575 CHECK_EXTENSION_B(ARB_vertex_buffer_object
, pname
);
1576 *params
= INT_TO_BOOL(ctx
->Array
.ArrayBufferObj
->Name
);
1578 case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB
:
1579 CHECK_EXTENSION_B(ARB_vertex_buffer_object
, pname
);
1580 *params
= INT_TO_BOOL(ctx
->Array
.Vertex
.BufferObj
->Name
);
1582 case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB
:
1583 CHECK_EXTENSION_B(ARB_vertex_buffer_object
, pname
);
1584 *params
= INT_TO_BOOL(ctx
->Array
.Normal
.BufferObj
->Name
);
1586 case GL_COLOR_ARRAY_BUFFER_BINDING_ARB
:
1587 CHECK_EXTENSION_B(ARB_vertex_buffer_object
, pname
);
1588 *params
= INT_TO_BOOL(ctx
->Array
.Color
.BufferObj
->Name
);
1590 case GL_INDEX_ARRAY_BUFFER_BINDING_ARB
:
1591 CHECK_EXTENSION_B(ARB_vertex_buffer_object
, pname
);
1592 *params
= INT_TO_BOOL(ctx
->Array
.Index
.BufferObj
->Name
);
1594 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB
:
1595 CHECK_EXTENSION_B(ARB_vertex_buffer_object
, pname
);
1596 *params
= INT_TO_BOOL(ctx
->Array
.TexCoord
[clientUnit
].BufferObj
->Name
);
1598 case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB
:
1599 CHECK_EXTENSION_B(ARB_vertex_buffer_object
, pname
);
1600 *params
= INT_TO_BOOL(ctx
->Array
.EdgeFlag
.BufferObj
->Name
);
1602 case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB
:
1603 CHECK_EXTENSION_B(ARB_vertex_buffer_object
, pname
);
1604 *params
= INT_TO_BOOL(ctx
->Array
.SecondaryColor
.BufferObj
->Name
);
1606 case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB
:
1607 CHECK_EXTENSION_B(ARB_vertex_buffer_object
, pname
);
1608 *params
= INT_TO_BOOL(ctx
->Array
.FogCoord
.BufferObj
->Name
);
1610 /*case GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB: - not supported */
1611 case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB
:
1612 CHECK_EXTENSION_B(ARB_vertex_buffer_object
, pname
);
1613 *params
= INT_TO_BOOL(ctx
->Array
.ElementArrayBufferObj
->Name
);
1616 #if FEATURE_EXT_pixel_buffer_object
1617 case GL_PIXEL_PACK_BUFFER_BINDING_EXT
:
1618 CHECK_EXTENSION_B(EXT_pixel_buffer_object
, pname
);
1619 *params
= INT_TO_BOOL(ctx
->Pack
.BufferObj
->Name
);
1621 case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT
:
1622 CHECK_EXTENSION_B(EXT_pixel_buffer_object
, pname
);
1623 *params
= INT_TO_BOOL(ctx
->Unpack
.BufferObj
->Name
);
1627 #if FEATURE_ARB_vertex_program
1628 /* GL_NV_vertex_program and GL_ARB_fragment_program define others */
1629 case GL_MAX_VERTEX_ATTRIBS_ARB
:
1630 CHECK_EXTENSION_B(ARB_vertex_program
, pname
);
1631 *params
= (ctx
->Const
.MaxVertexProgramAttribs
> 0) ? GL_TRUE
: GL_FALSE
;
1635 #if FEATURE_ARB_fragment_program
1636 case GL_FRAGMENT_PROGRAM_ARB
:
1637 CHECK_EXTENSION_B(ARB_fragment_program
, pname
);
1638 *params
= ctx
->FragmentProgram
.Enabled
;
1640 case GL_TRANSPOSE_CURRENT_MATRIX_ARB
:
1641 CHECK_EXTENSION_B(ARB_fragment_program
, pname
);
1642 params
[0] = FLOAT_TO_BOOL(ctx
->CurrentStack
->Top
->m
[0]);
1643 params
[1] = FLOAT_TO_BOOL(ctx
->CurrentStack
->Top
->m
[4]);
1644 params
[2] = FLOAT_TO_BOOL(ctx
->CurrentStack
->Top
->m
[8]);
1645 params
[3] = FLOAT_TO_BOOL(ctx
->CurrentStack
->Top
->m
[12]);
1646 params
[4] = FLOAT_TO_BOOL(ctx
->CurrentStack
->Top
->m
[1]);
1647 params
[5] = FLOAT_TO_BOOL(ctx
->CurrentStack
->Top
->m
[5]);
1648 params
[6] = FLOAT_TO_BOOL(ctx
->CurrentStack
->Top
->m
[9]);
1649 params
[7] = FLOAT_TO_BOOL(ctx
->CurrentStack
->Top
->m
[13]);
1650 params
[8] = FLOAT_TO_BOOL(ctx
->CurrentStack
->Top
->m
[2]);
1651 params
[9] = FLOAT_TO_BOOL(ctx
->CurrentStack
->Top
->m
[6]);
1652 params
[10] = FLOAT_TO_BOOL(ctx
->CurrentStack
->Top
->m
[10]);
1653 params
[11] = FLOAT_TO_BOOL(ctx
->CurrentStack
->Top
->m
[14]);
1654 params
[12] = FLOAT_TO_BOOL(ctx
->CurrentStack
->Top
->m
[3]);
1655 params
[13] = FLOAT_TO_BOOL(ctx
->CurrentStack
->Top
->m
[7]);
1656 params
[14] = FLOAT_TO_BOOL(ctx
->CurrentStack
->Top
->m
[11]);
1657 params
[15] = FLOAT_TO_BOOL(ctx
->CurrentStack
->Top
->m
[15]);
1659 /* Remaining ARB_fragment_program queries alias with
1660 * the GL_NV_fragment_program queries.
1664 /* GL_EXT_depth_bounds_test */
1665 case GL_DEPTH_BOUNDS_TEST_EXT
:
1666 CHECK_EXTENSION_B(EXT_depth_bounds_test
, pname
);
1667 params
[0] = ctx
->Depth
.BoundsTest
;
1669 case GL_DEPTH_BOUNDS_EXT
:
1670 CHECK_EXTENSION_B(EXT_depth_bounds_test
, pname
);
1671 params
[0] = FLOAT_TO_BOOL(ctx
->Depth
.BoundsMin
);
1672 params
[1] = FLOAT_TO_BOOL(ctx
->Depth
.BoundsMax
);
1675 #if FEATURE_MESA_program_debug
1676 case GL_FRAGMENT_PROGRAM_CALLBACK_MESA
:
1677 CHECK_EXTENSION_B(MESA_program_debug
, pname
);
1678 *params
= ctx
->FragmentProgram
.CallbackEnabled
;
1680 case GL_VERTEX_PROGRAM_CALLBACK_MESA
:
1681 CHECK_EXTENSION_B(MESA_program_debug
, pname
);
1682 *params
= ctx
->VertexProgram
.CallbackEnabled
;
1684 case GL_FRAGMENT_PROGRAM_POSITION_MESA
:
1685 CHECK_EXTENSION_B(MESA_program_debug
, pname
);
1686 *params
= INT_TO_BOOL(ctx
->FragmentProgram
.CurrentPosition
);
1688 case GL_VERTEX_PROGRAM_POSITION_MESA
:
1689 CHECK_EXTENSION_B(MESA_program_debug
, pname
);
1690 *params
= INT_TO_BOOL(ctx
->VertexProgram
.CurrentPosition
);
1694 case GL_MAX_DRAW_BUFFERS_ARB
:
1695 CHECK_EXTENSION_B(ARB_draw_buffers
, pname
);
1696 *params
= INT_TO_BOOL(ctx
->Const
.MaxDrawBuffers
);
1698 case GL_DRAW_BUFFER0_ARB
:
1699 case GL_DRAW_BUFFER1_ARB
:
1700 case GL_DRAW_BUFFER2_ARB
:
1701 case GL_DRAW_BUFFER3_ARB
:
1702 case GL_DRAW_BUFFER4_ARB
:
1703 case GL_DRAW_BUFFER5_ARB
:
1704 case GL_DRAW_BUFFER6_ARB
:
1705 case GL_DRAW_BUFFER7_ARB
:
1706 case GL_DRAW_BUFFER8_ARB
:
1707 case GL_DRAW_BUFFER9_ARB
:
1708 case GL_DRAW_BUFFER10_ARB
:
1709 case GL_DRAW_BUFFER11_ARB
:
1710 case GL_DRAW_BUFFER12_ARB
:
1711 case GL_DRAW_BUFFER13_ARB
:
1712 case GL_DRAW_BUFFER14_ARB
:
1713 case GL_DRAW_BUFFER15_ARB
:
1714 CHECK_EXTENSION_B(ARB_draw_buffers
, pname
);
1716 GLuint i
= pname
- GL_DRAW_BUFFER0_ARB
;
1717 if (i
>= ctx
->Const
.MaxDrawBuffers
) {
1718 _mesa_error(ctx
, GL_INVALID_ENUM
,
1719 "glGetBooleanv(GL_DRAW_BUFFERx_ARB)");
1722 *params
= INT_TO_BOOL(ctx
->Color
.DrawBuffer
[i
]);
1727 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv(pname=0x%x)", pname
);
1733 * Get the value(s) of a selected parameter.
1735 * \param pname parameter to be returned.
1736 * \param params will hold the value(s) of the speficifed parameter.
1738 * \sa glGetDoublev().
1740 * Tries to get the specified parameter via dd_function_table::GetDoublev,
1741 * otherwise gets the specified parameter from the current context, converting
1742 * it value into GLdouble.
1745 _mesa_GetDoublev( GLenum pname
, GLdouble
*params
)
1747 GET_CURRENT_CONTEXT(ctx
);
1749 const GLuint clientUnit
= ctx
->Array
.ActiveTexture
;
1750 const GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
1751 const struct gl_texture_unit
*textureUnit
= &ctx
->Texture
.Unit
[texUnit
];
1752 ASSERT_OUTSIDE_BEGIN_END(ctx
);
1757 if (MESA_VERBOSE
& VERBOSE_API
)
1758 _mesa_debug(ctx
, "glGetDoublev %s\n", _mesa_lookup_enum_by_nr(pname
));
1760 if (!ctx
->_CurrentProgram
) {
1761 /* We need this in order to get correct results for
1762 * GL_OCCLUSION_TEST_RESULT_HP. There might be other important cases.
1764 FLUSH_VERTICES(ctx
, 0);
1767 if (ctx
->Driver
.GetDoublev
&& (*ctx
->Driver
.GetDoublev
)(ctx
, pname
, params
))
1771 case GL_ACCUM_RED_BITS
:
1772 *params
= (GLdouble
) ctx
->Visual
.accumRedBits
;
1774 case GL_ACCUM_GREEN_BITS
:
1775 *params
= (GLdouble
) ctx
->Visual
.accumGreenBits
;
1777 case GL_ACCUM_BLUE_BITS
:
1778 *params
= (GLdouble
) ctx
->Visual
.accumBlueBits
;
1780 case GL_ACCUM_ALPHA_BITS
:
1781 *params
= (GLdouble
) ctx
->Visual
.accumAlphaBits
;
1783 case GL_ACCUM_CLEAR_VALUE
:
1784 params
[0] = (GLdouble
) ctx
->Accum
.ClearColor
[0];
1785 params
[1] = (GLdouble
) ctx
->Accum
.ClearColor
[1];
1786 params
[2] = (GLdouble
) ctx
->Accum
.ClearColor
[2];
1787 params
[3] = (GLdouble
) ctx
->Accum
.ClearColor
[3];
1790 *params
= (GLdouble
) ctx
->Pixel
.AlphaBias
;
1793 *params
= (GLdouble
) ctx
->Visual
.alphaBits
;
1795 case GL_ALPHA_SCALE
:
1796 *params
= (GLdouble
) ctx
->Pixel
.AlphaScale
;
1799 *params
= (GLdouble
) ctx
->Color
.AlphaEnabled
;
1801 case GL_ALPHA_TEST_FUNC
:
1802 *params
= ENUM_TO_DOUBLE(ctx
->Color
.AlphaFunc
);
1804 case GL_ALPHA_TEST_REF
:
1805 *params
= (GLdouble
) ctx
->Color
.AlphaRef
;
1807 case GL_ATTRIB_STACK_DEPTH
:
1808 *params
= (GLdouble
) (ctx
->AttribStackDepth
);
1810 case GL_AUTO_NORMAL
:
1811 *params
= (GLdouble
) ctx
->Eval
.AutoNormal
;
1813 case GL_AUX_BUFFERS
:
1814 *params
= (GLdouble
) ctx
->Visual
.numAuxBuffers
;
1817 *params
= (GLdouble
) ctx
->Color
.BlendEnabled
;
1820 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendDstRGB
);
1823 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendSrcRGB
);
1825 case GL_BLEND_SRC_RGB_EXT
:
1826 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendSrcRGB
);
1828 case GL_BLEND_DST_RGB_EXT
:
1829 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendDstRGB
);
1831 case GL_BLEND_SRC_ALPHA_EXT
:
1832 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendSrcA
);
1834 case GL_BLEND_DST_ALPHA_EXT
:
1835 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendDstA
);
1837 case GL_BLEND_EQUATION
:
1838 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendEquationRGB
);
1840 case GL_BLEND_EQUATION_ALPHA_EXT
:
1841 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendEquationA
);
1843 case GL_BLEND_COLOR_EXT
:
1844 params
[0] = (GLdouble
) ctx
->Color
.BlendColor
[0];
1845 params
[1] = (GLdouble
) ctx
->Color
.BlendColor
[1];
1846 params
[2] = (GLdouble
) ctx
->Color
.BlendColor
[2];
1847 params
[3] = (GLdouble
) ctx
->Color
.BlendColor
[3];
1850 *params
= (GLdouble
) ctx
->Pixel
.BlueBias
;
1853 *params
= (GLdouble
) ctx
->Visual
.blueBits
;
1856 *params
= (GLdouble
) ctx
->Pixel
.BlueScale
;
1858 case GL_CLIENT_ATTRIB_STACK_DEPTH
:
1859 *params
= (GLdouble
) (ctx
->ClientAttribStackDepth
);
1861 case GL_CLIP_PLANE0
:
1862 case GL_CLIP_PLANE1
:
1863 case GL_CLIP_PLANE2
:
1864 case GL_CLIP_PLANE3
:
1865 case GL_CLIP_PLANE4
:
1866 case GL_CLIP_PLANE5
:
1867 if (ctx
->Transform
.ClipPlanesEnabled
& (1 << (pname
- GL_CLIP_PLANE0
)))
1872 case GL_COLOR_CLEAR_VALUE
:
1873 params
[0] = (GLdouble
) ctx
->Color
.ClearColor
[0];
1874 params
[1] = (GLdouble
) ctx
->Color
.ClearColor
[1];
1875 params
[2] = (GLdouble
) ctx
->Color
.ClearColor
[2];
1876 params
[3] = (GLdouble
) ctx
->Color
.ClearColor
[3];
1878 case GL_COLOR_MATERIAL
:
1879 *params
= (GLdouble
) ctx
->Light
.ColorMaterialEnabled
;
1881 case GL_COLOR_MATERIAL_FACE
:
1882 *params
= ENUM_TO_DOUBLE(ctx
->Light
.ColorMaterialFace
);
1884 case GL_COLOR_MATERIAL_PARAMETER
:
1885 *params
= ENUM_TO_DOUBLE(ctx
->Light
.ColorMaterialMode
);
1887 case GL_COLOR_WRITEMASK
:
1888 params
[0] = ctx
->Color
.ColorMask
[RCOMP
] ? 1.0 : 0.0;
1889 params
[1] = ctx
->Color
.ColorMask
[GCOMP
] ? 1.0 : 0.0;
1890 params
[2] = ctx
->Color
.ColorMask
[BCOMP
] ? 1.0 : 0.0;
1891 params
[3] = ctx
->Color
.ColorMask
[ACOMP
] ? 1.0 : 0.0;
1894 *params
= (GLdouble
) ctx
->Polygon
.CullFlag
;
1896 case GL_CULL_FACE_MODE
:
1897 *params
= ENUM_TO_DOUBLE(ctx
->Polygon
.CullFaceMode
);
1899 case GL_CURRENT_COLOR
:
1900 FLUSH_CURRENT(ctx
, 0);
1901 params
[0] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][0];
1902 params
[1] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][1];
1903 params
[2] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][2];
1904 params
[3] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][3];
1906 case GL_CURRENT_INDEX
:
1907 FLUSH_CURRENT(ctx
, 0);
1908 *params
= (GLdouble
) ctx
->Current
.Index
;
1910 case GL_CURRENT_NORMAL
:
1911 FLUSH_CURRENT(ctx
, 0);
1912 params
[0] = (GLdouble
) ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][0];
1913 params
[1] = (GLdouble
) ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][1];
1914 params
[2] = (GLdouble
) ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][2];
1916 case GL_CURRENT_RASTER_COLOR
:
1917 params
[0] = (GLdouble
) ctx
->Current
.RasterColor
[0];
1918 params
[1] = (GLdouble
) ctx
->Current
.RasterColor
[1];
1919 params
[2] = (GLdouble
) ctx
->Current
.RasterColor
[2];
1920 params
[3] = (GLdouble
) ctx
->Current
.RasterColor
[3];
1922 case GL_CURRENT_RASTER_DISTANCE
:
1923 params
[0] = (GLdouble
) ctx
->Current
.RasterDistance
;
1925 case GL_CURRENT_RASTER_INDEX
:
1926 *params
= (GLdouble
) ctx
->Current
.RasterIndex
;
1928 case GL_CURRENT_RASTER_POSITION
:
1929 params
[0] = (GLdouble
) ctx
->Current
.RasterPos
[0];
1930 params
[1] = (GLdouble
) ctx
->Current
.RasterPos
[1];
1931 params
[2] = (GLdouble
) ctx
->Current
.RasterPos
[2];
1932 params
[3] = (GLdouble
) ctx
->Current
.RasterPos
[3];
1934 case GL_CURRENT_RASTER_TEXTURE_COORDS
:
1935 params
[0] = (GLdouble
) ctx
->Current
.RasterTexCoords
[texUnit
][0];
1936 params
[1] = (GLdouble
) ctx
->Current
.RasterTexCoords
[texUnit
][1];
1937 params
[2] = (GLdouble
) ctx
->Current
.RasterTexCoords
[texUnit
][2];
1938 params
[3] = (GLdouble
) ctx
->Current
.RasterTexCoords
[texUnit
][3];
1940 case GL_CURRENT_RASTER_POSITION_VALID
:
1941 *params
= (GLdouble
) ctx
->Current
.RasterPosValid
;
1943 case GL_CURRENT_TEXTURE_COORDS
:
1944 FLUSH_CURRENT(ctx
, 0);
1945 params
[0] = (GLdouble
) ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][0];
1946 params
[1] = (GLdouble
) ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][1];
1947 params
[2] = (GLdouble
) ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][2];
1948 params
[3] = (GLdouble
) ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][3];
1951 *params
= (GLdouble
) ctx
->Pixel
.DepthBias
;
1954 *params
= (GLdouble
) ctx
->Visual
.depthBits
;
1956 case GL_DEPTH_CLEAR_VALUE
:
1957 *params
= (GLdouble
) ctx
->Depth
.Clear
;
1960 *params
= ENUM_TO_DOUBLE(ctx
->Depth
.Func
);
1962 case GL_DEPTH_RANGE
:
1963 params
[0] = (GLdouble
) ctx
->Viewport
.Near
;
1964 params
[1] = (GLdouble
) ctx
->Viewport
.Far
;
1966 case GL_DEPTH_SCALE
:
1967 *params
= (GLdouble
) ctx
->Pixel
.DepthScale
;
1970 *params
= (GLdouble
) ctx
->Depth
.Test
;
1972 case GL_DEPTH_WRITEMASK
:
1973 *params
= (GLdouble
) ctx
->Depth
.Mask
;
1976 *params
= (GLdouble
) ctx
->Color
.DitherFlag
;
1978 case GL_DOUBLEBUFFER
:
1979 *params
= (GLdouble
) ctx
->Visual
.doubleBufferMode
;
1981 case GL_DRAW_BUFFER
:
1982 *params
= ENUM_TO_DOUBLE(ctx
->Color
.DrawBuffer
[0]);
1985 FLUSH_CURRENT(ctx
, 0);
1986 *params
= (GLdouble
) ctx
->Current
.EdgeFlag
;
1988 case GL_FEEDBACK_BUFFER_SIZE
:
1989 *params
= (GLdouble
) ctx
->Feedback
.BufferSize
;
1991 case GL_FEEDBACK_BUFFER_TYPE
:
1992 *params
= ENUM_TO_DOUBLE(ctx
->Feedback
.Type
);
1995 *params
= (GLdouble
) ctx
->Fog
.Enabled
;
1998 params
[0] = (GLdouble
) ctx
->Fog
.Color
[0];
1999 params
[1] = (GLdouble
) ctx
->Fog
.Color
[1];
2000 params
[2] = (GLdouble
) ctx
->Fog
.Color
[2];
2001 params
[3] = (GLdouble
) ctx
->Fog
.Color
[3];
2003 case GL_FOG_DENSITY
:
2004 *params
= (GLdouble
) ctx
->Fog
.Density
;
2007 *params
= (GLdouble
) ctx
->Fog
.End
;
2010 *params
= ENUM_TO_DOUBLE(ctx
->Hint
.Fog
);
2013 *params
= (GLdouble
) ctx
->Fog
.Index
;
2016 *params
= ENUM_TO_DOUBLE(ctx
->Fog
.Mode
);
2019 *params
= (GLdouble
) ctx
->Fog
.Start
;
2022 *params
= ENUM_TO_DOUBLE(ctx
->Polygon
.FrontFace
);
2025 *params
= (GLdouble
) ctx
->Pixel
.GreenBias
;
2028 *params
= (GLdouble
) ctx
->Visual
.greenBits
;
2030 case GL_GREEN_SCALE
:
2031 *params
= (GLdouble
) ctx
->Pixel
.GreenScale
;
2034 *params
= (GLdouble
) ctx
->Visual
.indexBits
;
2036 case GL_INDEX_CLEAR_VALUE
:
2037 *params
= (GLdouble
) ctx
->Color
.ClearIndex
;
2040 *params
= ctx
->Visual
.rgbMode
? 0.0 : 1.0;
2042 case GL_INDEX_OFFSET
:
2043 *params
= (GLdouble
) ctx
->Pixel
.IndexOffset
;
2045 case GL_INDEX_SHIFT
:
2046 *params
= (GLdouble
) ctx
->Pixel
.IndexShift
;
2048 case GL_INDEX_WRITEMASK
:
2049 *params
= (GLdouble
) ctx
->Color
.IndexMask
;
2059 *params
= (GLdouble
) ctx
->Light
.Light
[pname
-GL_LIGHT0
].Enabled
;
2062 *params
= (GLdouble
) ctx
->Light
.Enabled
;
2064 case GL_LIGHT_MODEL_AMBIENT
:
2065 params
[0] = (GLdouble
) ctx
->Light
.Model
.Ambient
[0];
2066 params
[1] = (GLdouble
) ctx
->Light
.Model
.Ambient
[1];
2067 params
[2] = (GLdouble
) ctx
->Light
.Model
.Ambient
[2];
2068 params
[3] = (GLdouble
) ctx
->Light
.Model
.Ambient
[3];
2070 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2071 params
[0] = (GLdouble
) ctx
->Light
.Model
.ColorControl
;
2073 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2074 *params
= (GLdouble
) ctx
->Light
.Model
.LocalViewer
;
2076 case GL_LIGHT_MODEL_TWO_SIDE
:
2077 *params
= (GLdouble
) ctx
->Light
.Model
.TwoSide
;
2079 case GL_LINE_SMOOTH
:
2080 *params
= (GLdouble
) ctx
->Line
.SmoothFlag
;
2082 case GL_LINE_SMOOTH_HINT
:
2083 *params
= ENUM_TO_DOUBLE(ctx
->Hint
.LineSmooth
);
2085 case GL_LINE_STIPPLE
:
2086 *params
= (GLdouble
) ctx
->Line
.StippleFlag
;
2088 case GL_LINE_STIPPLE_PATTERN
:
2089 *params
= (GLdouble
) ctx
->Line
.StipplePattern
;
2091 case GL_LINE_STIPPLE_REPEAT
:
2092 *params
= (GLdouble
) ctx
->Line
.StippleFactor
;
2095 *params
= (GLdouble
) ctx
->Line
.Width
;
2097 case GL_LINE_WIDTH_GRANULARITY
:
2098 *params
= (GLdouble
) ctx
->Const
.LineWidthGranularity
;
2100 case GL_LINE_WIDTH_RANGE
:
2101 params
[0] = (GLdouble
) ctx
->Const
.MinLineWidthAA
;
2102 params
[1] = (GLdouble
) ctx
->Const
.MaxLineWidthAA
;
2104 case GL_ALIASED_LINE_WIDTH_RANGE
:
2105 params
[0] = (GLdouble
) ctx
->Const
.MinLineWidth
;
2106 params
[1] = (GLdouble
) ctx
->Const
.MaxLineWidth
;
2109 *params
= (GLdouble
) ctx
->List
.ListBase
;
2112 *params
= (GLdouble
) ctx
->ListState
.CurrentListNum
;
2115 if (!ctx
->CompileFlag
)
2117 else if (ctx
->ExecuteFlag
)
2118 *params
= ENUM_TO_DOUBLE(GL_COMPILE_AND_EXECUTE
);
2120 *params
= ENUM_TO_DOUBLE(GL_COMPILE
);
2122 case GL_INDEX_LOGIC_OP
:
2123 *params
= (GLdouble
) ctx
->Color
.IndexLogicOpEnabled
;
2125 case GL_COLOR_LOGIC_OP
:
2126 *params
= (GLdouble
) ctx
->Color
.ColorLogicOpEnabled
;
2128 case GL_LOGIC_OP_MODE
:
2129 *params
= ENUM_TO_DOUBLE(ctx
->Color
.LogicOp
);
2131 case GL_MAP1_COLOR_4
:
2132 *params
= (GLdouble
) ctx
->Eval
.Map1Color4
;
2134 case GL_MAP1_GRID_DOMAIN
:
2135 params
[0] = (GLdouble
) ctx
->Eval
.MapGrid1u1
;
2136 params
[1] = (GLdouble
) ctx
->Eval
.MapGrid1u2
;
2138 case GL_MAP1_GRID_SEGMENTS
:
2139 *params
= (GLdouble
) ctx
->Eval
.MapGrid1un
;
2142 *params
= (GLdouble
) ctx
->Eval
.Map1Index
;
2144 case GL_MAP1_NORMAL
:
2145 *params
= (GLdouble
) ctx
->Eval
.Map1Normal
;
2147 case GL_MAP1_TEXTURE_COORD_1
:
2148 *params
= (GLdouble
) ctx
->Eval
.Map1TextureCoord1
;
2150 case GL_MAP1_TEXTURE_COORD_2
:
2151 *params
= (GLdouble
) ctx
->Eval
.Map1TextureCoord2
;
2153 case GL_MAP1_TEXTURE_COORD_3
:
2154 *params
= (GLdouble
) ctx
->Eval
.Map1TextureCoord3
;
2156 case GL_MAP1_TEXTURE_COORD_4
:
2157 *params
= (GLdouble
) ctx
->Eval
.Map1TextureCoord4
;
2159 case GL_MAP1_VERTEX_3
:
2160 *params
= (GLdouble
) ctx
->Eval
.Map1Vertex3
;
2162 case GL_MAP1_VERTEX_4
:
2163 *params
= (GLdouble
) ctx
->Eval
.Map1Vertex4
;
2165 case GL_MAP2_COLOR_4
:
2166 *params
= (GLdouble
) ctx
->Eval
.Map2Color4
;
2168 case GL_MAP2_GRID_DOMAIN
:
2169 params
[0] = (GLdouble
) ctx
->Eval
.MapGrid2u1
;
2170 params
[1] = (GLdouble
) ctx
->Eval
.MapGrid2u2
;
2171 params
[2] = (GLdouble
) ctx
->Eval
.MapGrid2v1
;
2172 params
[3] = (GLdouble
) ctx
->Eval
.MapGrid2v2
;
2174 case GL_MAP2_GRID_SEGMENTS
:
2175 params
[0] = (GLdouble
) ctx
->Eval
.MapGrid2un
;
2176 params
[1] = (GLdouble
) ctx
->Eval
.MapGrid2vn
;
2179 *params
= (GLdouble
) ctx
->Eval
.Map2Index
;
2181 case GL_MAP2_NORMAL
:
2182 *params
= (GLdouble
) ctx
->Eval
.Map2Normal
;
2184 case GL_MAP2_TEXTURE_COORD_1
:
2185 *params
= (GLdouble
) ctx
->Eval
.Map2TextureCoord1
;
2187 case GL_MAP2_TEXTURE_COORD_2
:
2188 *params
= (GLdouble
) ctx
->Eval
.Map2TextureCoord2
;
2190 case GL_MAP2_TEXTURE_COORD_3
:
2191 *params
= (GLdouble
) ctx
->Eval
.Map2TextureCoord3
;
2193 case GL_MAP2_TEXTURE_COORD_4
:
2194 *params
= (GLdouble
) ctx
->Eval
.Map2TextureCoord4
;
2196 case GL_MAP2_VERTEX_3
:
2197 *params
= (GLdouble
) ctx
->Eval
.Map2Vertex3
;
2199 case GL_MAP2_VERTEX_4
:
2200 *params
= (GLdouble
) ctx
->Eval
.Map2Vertex4
;
2203 *params
= (GLdouble
) ctx
->Pixel
.MapColorFlag
;
2205 case GL_MAP_STENCIL
:
2206 *params
= (GLdouble
) ctx
->Pixel
.MapStencilFlag
;
2208 case GL_MATRIX_MODE
:
2209 *params
= ENUM_TO_DOUBLE(ctx
->Transform
.MatrixMode
);
2211 case GL_MAX_ATTRIB_STACK_DEPTH
:
2212 *params
= (GLdouble
) MAX_ATTRIB_STACK_DEPTH
;
2214 case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
:
2215 *params
= (GLdouble
) MAX_CLIENT_ATTRIB_STACK_DEPTH
;
2217 case GL_MAX_CLIP_PLANES
:
2218 *params
= (GLdouble
) ctx
->Const
.MaxClipPlanes
;
2220 case GL_MAX_ELEMENTS_VERTICES
: /* GL_VERSION_1_2 */
2221 *params
= (GLdouble
) ctx
->Const
.MaxArrayLockSize
;
2223 case GL_MAX_ELEMENTS_INDICES
: /* GL_VERSION_1_2 */
2224 *params
= (GLdouble
) ctx
->Const
.MaxArrayLockSize
;
2226 case GL_MAX_EVAL_ORDER
:
2227 *params
= (GLdouble
) MAX_EVAL_ORDER
;
2230 *params
= (GLdouble
) ctx
->Const
.MaxLights
;
2232 case GL_MAX_LIST_NESTING
:
2233 *params
= (GLdouble
) MAX_LIST_NESTING
;
2235 case GL_MAX_MODELVIEW_STACK_DEPTH
:
2236 *params
= (GLdouble
) MAX_MODELVIEW_STACK_DEPTH
;
2238 case GL_MAX_NAME_STACK_DEPTH
:
2239 *params
= (GLdouble
) MAX_NAME_STACK_DEPTH
;
2241 case GL_MAX_PIXEL_MAP_TABLE
:
2242 *params
= (GLdouble
) MAX_PIXEL_MAP_TABLE
;
2244 case GL_MAX_PROJECTION_STACK_DEPTH
:
2245 *params
= (GLdouble
) MAX_PROJECTION_STACK_DEPTH
;
2247 case GL_MAX_TEXTURE_SIZE
:
2248 *params
= (GLdouble
) (1 << (ctx
->Const
.MaxTextureLevels
- 1));
2250 case GL_MAX_3D_TEXTURE_SIZE
:
2251 *params
= (GLdouble
) (1 << (ctx
->Const
.Max3DTextureLevels
- 1));
2253 case GL_MAX_TEXTURE_STACK_DEPTH
:
2254 *params
= (GLdouble
) MAX_TEXTURE_STACK_DEPTH
;
2256 case GL_MAX_VIEWPORT_DIMS
:
2257 params
[0] = (GLdouble
) MAX_WIDTH
;
2258 params
[1] = (GLdouble
) MAX_HEIGHT
;
2260 case GL_MODELVIEW_MATRIX
:
2261 for (i
=0;i
<16;i
++) {
2262 params
[i
] = (GLdouble
) ctx
->ModelviewMatrixStack
.Top
->m
[i
];
2265 case GL_MODELVIEW_STACK_DEPTH
:
2266 *params
= (GLdouble
) (ctx
->ModelviewMatrixStack
.Depth
+ 1);
2268 case GL_NAME_STACK_DEPTH
:
2269 *params
= (GLdouble
) ctx
->Select
.NameStackDepth
;
2272 *params
= (GLdouble
) ctx
->Transform
.Normalize
;
2274 case GL_PACK_ALIGNMENT
:
2275 *params
= (GLdouble
) ctx
->Pack
.Alignment
;
2277 case GL_PACK_LSB_FIRST
:
2278 *params
= (GLdouble
) ctx
->Pack
.LsbFirst
;
2280 case GL_PACK_ROW_LENGTH
:
2281 *params
= (GLdouble
) ctx
->Pack
.RowLength
;
2283 case GL_PACK_SKIP_PIXELS
:
2284 *params
= (GLdouble
) ctx
->Pack
.SkipPixels
;
2286 case GL_PACK_SKIP_ROWS
:
2287 *params
= (GLdouble
) ctx
->Pack
.SkipRows
;
2289 case GL_PACK_SWAP_BYTES
:
2290 *params
= (GLdouble
) ctx
->Pack
.SwapBytes
;
2292 case GL_PACK_SKIP_IMAGES_EXT
:
2293 *params
= (GLdouble
) ctx
->Pack
.SkipImages
;
2295 case GL_PACK_IMAGE_HEIGHT_EXT
:
2296 *params
= (GLdouble
) ctx
->Pack
.ImageHeight
;
2298 case GL_PACK_INVERT_MESA
:
2299 *params
= (GLdouble
) ctx
->Pack
.Invert
;
2301 case GL_PERSPECTIVE_CORRECTION_HINT
:
2302 *params
= ENUM_TO_DOUBLE(ctx
->Hint
.PerspectiveCorrection
);
2304 case GL_PIXEL_MAP_A_TO_A_SIZE
:
2305 *params
= (GLdouble
) ctx
->Pixel
.MapAtoAsize
;
2307 case GL_PIXEL_MAP_B_TO_B_SIZE
:
2308 *params
= (GLdouble
) ctx
->Pixel
.MapBtoBsize
;
2310 case GL_PIXEL_MAP_G_TO_G_SIZE
:
2311 *params
= (GLdouble
) ctx
->Pixel
.MapGtoGsize
;
2313 case GL_PIXEL_MAP_I_TO_A_SIZE
:
2314 *params
= (GLdouble
) ctx
->Pixel
.MapItoAsize
;
2316 case GL_PIXEL_MAP_I_TO_B_SIZE
:
2317 *params
= (GLdouble
) ctx
->Pixel
.MapItoBsize
;
2319 case GL_PIXEL_MAP_I_TO_G_SIZE
:
2320 *params
= (GLdouble
) ctx
->Pixel
.MapItoGsize
;
2322 case GL_PIXEL_MAP_I_TO_I_SIZE
:
2323 *params
= (GLdouble
) ctx
->Pixel
.MapItoIsize
;
2325 case GL_PIXEL_MAP_I_TO_R_SIZE
:
2326 *params
= (GLdouble
) ctx
->Pixel
.MapItoRsize
;
2328 case GL_PIXEL_MAP_R_TO_R_SIZE
:
2329 *params
= (GLdouble
) ctx
->Pixel
.MapRtoRsize
;
2331 case GL_PIXEL_MAP_S_TO_S_SIZE
:
2332 *params
= (GLdouble
) ctx
->Pixel
.MapStoSsize
;
2335 *params
= (GLdouble
) ctx
->Point
.Size
;
2337 case GL_POINT_SIZE_GRANULARITY
:
2338 *params
= (GLdouble
) ctx
->Const
.PointSizeGranularity
;
2340 case GL_POINT_SIZE_RANGE
:
2341 params
[0] = (GLdouble
) ctx
->Const
.MinPointSizeAA
;
2342 params
[1] = (GLdouble
) ctx
->Const
.MaxPointSizeAA
;
2344 case GL_ALIASED_POINT_SIZE_RANGE
:
2345 params
[0] = (GLdouble
) ctx
->Const
.MinPointSize
;
2346 params
[1] = (GLdouble
) ctx
->Const
.MaxPointSize
;
2348 case GL_POINT_SMOOTH
:
2349 *params
= (GLdouble
) ctx
->Point
.SmoothFlag
;
2351 case GL_POINT_SMOOTH_HINT
:
2352 *params
= ENUM_TO_DOUBLE(ctx
->Hint
.PointSmooth
);
2354 case GL_POINT_SIZE_MIN_EXT
:
2355 *params
= (GLdouble
) (ctx
->Point
.MinSize
);
2357 case GL_POINT_SIZE_MAX_EXT
:
2358 *params
= (GLdouble
) (ctx
->Point
.MaxSize
);
2360 case GL_POINT_FADE_THRESHOLD_SIZE_EXT
:
2361 *params
= (GLdouble
) (ctx
->Point
.Threshold
);
2363 case GL_DISTANCE_ATTENUATION_EXT
:
2364 params
[0] = (GLdouble
) (ctx
->Point
.Params
[0]);
2365 params
[1] = (GLdouble
) (ctx
->Point
.Params
[1]);
2366 params
[2] = (GLdouble
) (ctx
->Point
.Params
[2]);
2368 case GL_POLYGON_MODE
:
2369 params
[0] = ENUM_TO_DOUBLE(ctx
->Polygon
.FrontMode
);
2370 params
[1] = ENUM_TO_DOUBLE(ctx
->Polygon
.BackMode
);
2372 case GL_POLYGON_OFFSET_BIAS_EXT
: /* GL_EXT_polygon_offset */
2373 *params
= (GLdouble
) ctx
->Polygon
.OffsetUnits
;
2375 case GL_POLYGON_OFFSET_FACTOR
:
2376 *params
= (GLdouble
) ctx
->Polygon
.OffsetFactor
;
2378 case GL_POLYGON_OFFSET_UNITS
:
2379 *params
= (GLdouble
) ctx
->Polygon
.OffsetUnits
;
2381 case GL_POLYGON_SMOOTH
:
2382 *params
= (GLdouble
) ctx
->Polygon
.SmoothFlag
;
2384 case GL_POLYGON_SMOOTH_HINT
:
2385 *params
= ENUM_TO_DOUBLE(ctx
->Hint
.PolygonSmooth
);
2387 case GL_POLYGON_STIPPLE
:
2388 *params
= (GLdouble
) ctx
->Polygon
.StippleFlag
;
2390 case GL_PROJECTION_MATRIX
:
2391 for (i
=0;i
<16;i
++) {
2392 params
[i
] = (GLdouble
) ctx
->ProjectionMatrixStack
.Top
->m
[i
];
2395 case GL_PROJECTION_STACK_DEPTH
:
2396 *params
= (GLdouble
) (ctx
->ProjectionMatrixStack
.Depth
+ 1);
2398 case GL_READ_BUFFER
:
2399 *params
= ENUM_TO_DOUBLE(ctx
->Pixel
.ReadBuffer
);
2402 *params
= (GLdouble
) ctx
->Pixel
.RedBias
;
2405 *params
= (GLdouble
) ctx
->Visual
.redBits
;
2408 *params
= (GLdouble
) ctx
->Pixel
.RedScale
;
2410 case GL_RENDER_MODE
:
2411 *params
= ENUM_TO_DOUBLE(ctx
->RenderMode
);
2413 case GL_RESCALE_NORMAL
:
2414 *params
= (GLdouble
) ctx
->Transform
.RescaleNormals
;
2417 *params
= (GLdouble
) ctx
->Visual
.rgbMode
;
2419 case GL_SCISSOR_BOX
:
2420 params
[0] = (GLdouble
) ctx
->Scissor
.X
;
2421 params
[1] = (GLdouble
) ctx
->Scissor
.Y
;
2422 params
[2] = (GLdouble
) ctx
->Scissor
.Width
;
2423 params
[3] = (GLdouble
) ctx
->Scissor
.Height
;
2425 case GL_SCISSOR_TEST
:
2426 *params
= (GLdouble
) ctx
->Scissor
.Enabled
;
2428 case GL_SELECTION_BUFFER_SIZE
:
2429 *params
= (GLdouble
) ctx
->Select
.BufferSize
;
2431 case GL_SHADE_MODEL
:
2432 *params
= ENUM_TO_DOUBLE(ctx
->Light
.ShadeModel
);
2434 case GL_SHARED_TEXTURE_PALETTE_EXT
:
2435 *params
= (GLdouble
) ctx
->Texture
.SharedPalette
;
2437 case GL_STENCIL_BITS
:
2438 *params
= (GLdouble
) ctx
->Visual
.stencilBits
;
2440 case GL_STENCIL_CLEAR_VALUE
:
2441 *params
= (GLdouble
) ctx
->Stencil
.Clear
;
2443 case GL_STENCIL_FAIL
:
2444 *params
= ENUM_TO_DOUBLE(ctx
->Stencil
.FailFunc
[ctx
->Stencil
.ActiveFace
]);
2446 case GL_STENCIL_FUNC
:
2447 *params
= ENUM_TO_DOUBLE(ctx
->Stencil
.Function
[ctx
->Stencil
.ActiveFace
]);
2449 case GL_STENCIL_PASS_DEPTH_FAIL
:
2450 *params
= ENUM_TO_DOUBLE(ctx
->Stencil
.ZFailFunc
[ctx
->Stencil
.ActiveFace
]);
2452 case GL_STENCIL_PASS_DEPTH_PASS
:
2453 *params
= ENUM_TO_DOUBLE(ctx
->Stencil
.ZPassFunc
[ctx
->Stencil
.ActiveFace
]);
2455 case GL_STENCIL_REF
:
2456 *params
= (GLdouble
) ctx
->Stencil
.Ref
[ctx
->Stencil
.ActiveFace
];
2458 case GL_STENCIL_TEST
:
2459 *params
= (GLdouble
) ctx
->Stencil
.Enabled
;
2461 case GL_STENCIL_VALUE_MASK
:
2462 *params
= (GLdouble
) ctx
->Stencil
.ValueMask
[ctx
->Stencil
.ActiveFace
];
2464 case GL_STENCIL_WRITEMASK
:
2465 *params
= (GLdouble
) ctx
->Stencil
.WriteMask
[ctx
->Stencil
.ActiveFace
];
2468 *params
= (GLdouble
) ctx
->Visual
.stereoMode
;
2470 case GL_SUBPIXEL_BITS
:
2471 *params
= (GLdouble
) ctx
->Const
.SubPixelBits
;
2474 *params
= _mesa_IsEnabled(GL_TEXTURE_1D
) ? 1.0 : 0.0;
2477 *params
= _mesa_IsEnabled(GL_TEXTURE_2D
) ? 1.0 : 0.0;
2480 *params
= _mesa_IsEnabled(GL_TEXTURE_3D
) ? 1.0 : 0.0;
2482 case GL_TEXTURE_BINDING_1D
:
2483 *params
= (GLdouble
) textureUnit
->Current1D
->Name
;
2485 case GL_TEXTURE_BINDING_2D
:
2486 *params
= (GLdouble
) textureUnit
->Current2D
->Name
;
2488 case GL_TEXTURE_BINDING_3D
:
2489 *params
= (GLdouble
) textureUnit
->Current3D
->Name
;
2491 case GL_TEXTURE_ENV_COLOR
:
2492 params
[0] = (GLdouble
) textureUnit
->EnvColor
[0];
2493 params
[1] = (GLdouble
) textureUnit
->EnvColor
[1];
2494 params
[2] = (GLdouble
) textureUnit
->EnvColor
[2];
2495 params
[3] = (GLdouble
) textureUnit
->EnvColor
[3];
2497 case GL_TEXTURE_ENV_MODE
:
2498 *params
= ENUM_TO_DOUBLE(textureUnit
->EnvMode
);
2500 case GL_TEXTURE_GEN_S
:
2501 *params
= (textureUnit
->TexGenEnabled
& S_BIT
) ? 1.0 : 0.0;
2503 case GL_TEXTURE_GEN_T
:
2504 *params
= (textureUnit
->TexGenEnabled
& T_BIT
) ? 1.0 : 0.0;
2506 case GL_TEXTURE_GEN_R
:
2507 *params
= (textureUnit
->TexGenEnabled
& R_BIT
) ? 1.0 : 0.0;
2509 case GL_TEXTURE_GEN_Q
:
2510 *params
= (textureUnit
->TexGenEnabled
& Q_BIT
) ? 1.0 : 0.0;
2512 case GL_TEXTURE_MATRIX
:
2513 for (i
=0;i
<16;i
++) {
2514 params
[i
] = (GLdouble
) ctx
->TextureMatrixStack
[texUnit
].Top
->m
[i
];
2517 case GL_TEXTURE_STACK_DEPTH
:
2518 *params
= (GLdouble
) (ctx
->TextureMatrixStack
[texUnit
].Depth
+ 1);
2520 case GL_UNPACK_ALIGNMENT
:
2521 *params
= (GLdouble
) ctx
->Unpack
.Alignment
;
2523 case GL_UNPACK_LSB_FIRST
:
2524 *params
= (GLdouble
) ctx
->Unpack
.LsbFirst
;
2526 case GL_UNPACK_ROW_LENGTH
:
2527 *params
= (GLdouble
) ctx
->Unpack
.RowLength
;
2529 case GL_UNPACK_SKIP_PIXELS
:
2530 *params
= (GLdouble
) ctx
->Unpack
.SkipPixels
;
2532 case GL_UNPACK_SKIP_ROWS
:
2533 *params
= (GLdouble
) ctx
->Unpack
.SkipRows
;
2535 case GL_UNPACK_SWAP_BYTES
:
2536 *params
= (GLdouble
) ctx
->Unpack
.SwapBytes
;
2538 case GL_UNPACK_SKIP_IMAGES_EXT
:
2539 *params
= (GLdouble
) ctx
->Unpack
.SkipImages
;
2541 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
2542 *params
= (GLdouble
) ctx
->Unpack
.ImageHeight
;
2544 case GL_UNPACK_CLIENT_STORAGE_APPLE
:
2545 *params
= (GLdouble
) ctx
->Unpack
.ClientStorage
;
2548 params
[0] = (GLdouble
) ctx
->Viewport
.X
;
2549 params
[1] = (GLdouble
) ctx
->Viewport
.Y
;
2550 params
[2] = (GLdouble
) ctx
->Viewport
.Width
;
2551 params
[3] = (GLdouble
) ctx
->Viewport
.Height
;
2554 *params
= (GLdouble
) ctx
->Pixel
.ZoomX
;
2557 *params
= (GLdouble
) ctx
->Pixel
.ZoomY
;
2559 case GL_VERTEX_ARRAY
:
2560 *params
= (GLdouble
) ctx
->Array
.Vertex
.Enabled
;
2562 case GL_VERTEX_ARRAY_SIZE
:
2563 *params
= (GLdouble
) ctx
->Array
.Vertex
.Size
;
2565 case GL_VERTEX_ARRAY_TYPE
:
2566 *params
= ENUM_TO_DOUBLE(ctx
->Array
.Vertex
.Type
);
2568 case GL_VERTEX_ARRAY_STRIDE
:
2569 *params
= (GLdouble
) ctx
->Array
.Vertex
.Stride
;
2571 case GL_VERTEX_ARRAY_COUNT_EXT
:
2574 case GL_NORMAL_ARRAY
:
2575 *params
= (GLdouble
) ctx
->Array
.Normal
.Enabled
;
2577 case GL_NORMAL_ARRAY_TYPE
:
2578 *params
= ENUM_TO_DOUBLE(ctx
->Array
.Normal
.Type
);
2580 case GL_NORMAL_ARRAY_STRIDE
:
2581 *params
= (GLdouble
) ctx
->Array
.Normal
.Stride
;
2583 case GL_NORMAL_ARRAY_COUNT_EXT
:
2586 case GL_COLOR_ARRAY
:
2587 *params
= (GLdouble
) ctx
->Array
.Color
.Enabled
;
2589 case GL_COLOR_ARRAY_SIZE
:
2590 *params
= (GLdouble
) ctx
->Array
.Color
.Size
;
2592 case GL_COLOR_ARRAY_TYPE
:
2593 *params
= ENUM_TO_DOUBLE(ctx
->Array
.Color
.Type
);
2595 case GL_COLOR_ARRAY_STRIDE
:
2596 *params
= (GLdouble
) ctx
->Array
.Color
.Stride
;
2598 case GL_COLOR_ARRAY_COUNT_EXT
:
2601 case GL_INDEX_ARRAY
:
2602 *params
= (GLdouble
) ctx
->Array
.Index
.Enabled
;
2604 case GL_INDEX_ARRAY_TYPE
:
2605 *params
= ENUM_TO_DOUBLE(ctx
->Array
.Index
.Type
);
2607 case GL_INDEX_ARRAY_STRIDE
:
2608 *params
= (GLdouble
) ctx
->Array
.Index
.Stride
;
2610 case GL_INDEX_ARRAY_COUNT_EXT
:
2613 case GL_TEXTURE_COORD_ARRAY
:
2614 *params
= (GLdouble
) ctx
->Array
.TexCoord
[clientUnit
].Enabled
;
2616 case GL_TEXTURE_COORD_ARRAY_SIZE
:
2617 *params
= (GLdouble
) ctx
->Array
.TexCoord
[clientUnit
].Size
;
2619 case GL_TEXTURE_COORD_ARRAY_TYPE
:
2620 *params
= ENUM_TO_DOUBLE(ctx
->Array
.TexCoord
[clientUnit
].Type
);
2622 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
2623 *params
= (GLdouble
) ctx
->Array
.TexCoord
[clientUnit
].Stride
;
2625 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
2628 case GL_EDGE_FLAG_ARRAY
:
2629 *params
= (GLdouble
) ctx
->Array
.EdgeFlag
.Enabled
;
2631 case GL_EDGE_FLAG_ARRAY_STRIDE
:
2632 *params
= (GLdouble
) ctx
->Array
.EdgeFlag
.Stride
;
2634 case GL_EDGE_FLAG_ARRAY_COUNT_EXT
:
2638 /* GL_ARB_multitexture */
2639 case GL_MAX_TEXTURE_UNITS_ARB
:
2640 CHECK_EXTENSION_D(ARB_multitexture
, pname
);
2641 *params
= (GLdouble
) MIN2(ctx
->Const
.MaxTextureImageUnits
,
2642 ctx
->Const
.MaxTextureCoordUnits
);
2644 case GL_ACTIVE_TEXTURE_ARB
:
2645 CHECK_EXTENSION_D(ARB_multitexture
, pname
);
2646 *params
= (GLdouble
) (GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
);
2648 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
2649 CHECK_EXTENSION_D(ARB_multitexture
, pname
);
2650 *params
= (GLdouble
) (GL_TEXTURE0_ARB
+ clientUnit
);
2653 /* GL_ARB_texture_cube_map */
2654 case GL_TEXTURE_CUBE_MAP_ARB
:
2655 CHECK_EXTENSION_D(ARB_texture_cube_map
, pname
);
2656 *params
= (GLdouble
) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
);
2658 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
2659 CHECK_EXTENSION_D(ARB_texture_cube_map
, pname
);
2660 *params
= (GLdouble
) textureUnit
->CurrentCubeMap
->Name
;
2662 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
2663 CHECK_EXTENSION_D(ARB_texture_cube_map
, pname
);
2664 *params
= (GLdouble
) (1 << (ctx
->Const
.MaxCubeTextureLevels
- 1));
2667 /* GL_ARB_texture_compression */
2668 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
2669 CHECK_EXTENSION_D(ARB_texture_compression
, pname
);
2670 *params
= (GLdouble
) ctx
->Hint
.TextureCompression
;
2672 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
2673 CHECK_EXTENSION_D(ARB_texture_compression
, pname
);
2674 *params
= (GLdouble
) _mesa_get_compressed_formats(ctx
, NULL
);
2676 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
2677 CHECK_EXTENSION_D(ARB_texture_compression
, pname
);
2681 n
= _mesa_get_compressed_formats(ctx
, formats
);
2682 for (i
= 0; i
< n
; i
++)
2683 params
[i
] = (GLdouble
) formats
[i
];
2687 /* GL_EXT_compiled_vertex_array */
2688 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
2689 *params
= (GLdouble
) ctx
->Array
.LockFirst
;
2691 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
2692 *params
= (GLdouble
) ctx
->Array
.LockCount
;
2695 /* GL_ARB_transpose_matrix */
2696 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
2700 _math_transposef(tm
, ctx
->ColorMatrixStack
.Top
->m
);
2701 for (i
=0;i
<16;i
++) {
2702 params
[i
] = (GLdouble
) tm
[i
];
2706 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
2710 _math_transposef(tm
, ctx
->ModelviewMatrixStack
.Top
->m
);
2711 for (i
=0;i
<16;i
++) {
2712 params
[i
] = (GLdouble
) tm
[i
];
2716 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
2720 _math_transposef(tm
, ctx
->ProjectionMatrixStack
.Top
->m
);
2721 for (i
=0;i
<16;i
++) {
2722 params
[i
] = (GLdouble
) tm
[i
];
2726 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
2730 _math_transposef(tm
, ctx
->TextureMatrixStack
[texUnit
].Top
->m
);
2731 for (i
=0;i
<16;i
++) {
2732 params
[i
] = (GLdouble
) tm
[i
];
2737 /* GL_HP_occlusion_test */
2738 case GL_OCCLUSION_TEST_HP
:
2739 CHECK_EXTENSION_D(HP_occlusion_test
, pname
);
2740 *params
= (GLdouble
) ctx
->Depth
.OcclusionTest
;
2742 case GL_OCCLUSION_TEST_RESULT_HP
:
2743 CHECK_EXTENSION_D(HP_occlusion_test
, pname
);
2744 if (ctx
->Depth
.OcclusionTest
)
2745 *params
= (GLdouble
) ctx
->OcclusionResult
;
2747 *params
= (GLdouble
) ctx
->OcclusionResultSaved
;
2748 /* reset flag now */
2749 ctx
->OcclusionResult
= GL_FALSE
;
2750 ctx
->OcclusionResultSaved
= GL_FALSE
;
2753 /* GL_SGIS_pixel_texture */
2754 case GL_PIXEL_TEXTURE_SGIS
:
2755 *params
= (GLdouble
) ctx
->Pixel
.PixelTextureEnabled
;
2758 /* GL_SGIX_pixel_texture */
2759 case GL_PIXEL_TEX_GEN_SGIX
:
2760 *params
= (GLdouble
) ctx
->Pixel
.PixelTextureEnabled
;
2762 case GL_PIXEL_TEX_GEN_MODE_SGIX
:
2763 *params
= (GLdouble
) pixel_texgen_mode(ctx
);
2766 /* GL_SGI_color_matrix (also in 1.2 imaging) */
2767 case GL_COLOR_MATRIX_SGI
:
2768 for (i
=0;i
<16;i
++) {
2769 params
[i
] = (GLdouble
) ctx
->ColorMatrixStack
.Top
->m
[i
];
2772 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
2773 *params
= (GLdouble
) (ctx
->ColorMatrixStack
.Depth
+ 1);
2775 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
2776 *params
= (GLdouble
) MAX_COLOR_STACK_DEPTH
;
2778 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
2779 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixScale
[0];
2781 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
2782 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixScale
[1];
2784 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
2785 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixScale
[2];
2787 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
2788 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixScale
[3];
2790 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
2791 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixBias
[0];
2793 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
2794 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixBias
[1];
2796 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
2797 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixBias
[2];
2799 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
2800 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixBias
[3];
2803 /* GL_EXT_convolution (also in 1.2 imaging) */
2804 case GL_CONVOLUTION_1D_EXT
:
2805 CHECK_EXTENSION_D(EXT_convolution
, pname
);
2806 *params
= (GLdouble
) ctx
->Pixel
.Convolution1DEnabled
;
2808 case GL_CONVOLUTION_2D
:
2809 CHECK_EXTENSION_D(EXT_convolution
, pname
);
2810 *params
= (GLdouble
) ctx
->Pixel
.Convolution2DEnabled
;
2812 case GL_SEPARABLE_2D
:
2813 CHECK_EXTENSION_D(EXT_convolution
, pname
);
2814 *params
= (GLdouble
) ctx
->Pixel
.Separable2DEnabled
;
2816 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
2817 CHECK_EXTENSION_D(EXT_convolution
, pname
);
2818 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionScale
[0];
2820 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
2821 CHECK_EXTENSION_D(EXT_convolution
, pname
);
2822 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionScale
[1];
2824 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
2825 CHECK_EXTENSION_D(EXT_convolution
, pname
);
2826 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionScale
[2];
2828 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
2829 CHECK_EXTENSION_D(EXT_convolution
, pname
);
2830 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionScale
[3];
2832 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
2833 CHECK_EXTENSION_D(EXT_convolution
, pname
);
2834 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionBias
[0];
2836 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
2837 CHECK_EXTENSION_D(EXT_convolution
, pname
);
2838 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionBias
[1];
2840 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
2841 CHECK_EXTENSION_D(EXT_convolution
, pname
);
2842 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionBias
[2];
2844 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
2845 CHECK_EXTENSION_D(EXT_convolution
, pname
);
2846 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionBias
[2];
2849 /* GL_EXT_histogram (also in 1.2 imaging) */
2851 CHECK_EXTENSION_D(EXT_histogram
, pname
);
2852 *params
= (GLdouble
) ctx
->Pixel
.HistogramEnabled
;
2855 CHECK_EXTENSION_D(EXT_histogram
, pname
);
2856 *params
= (GLdouble
) ctx
->Pixel
.MinMaxEnabled
;
2859 /* GL_SGI_color_table (also in 1.2 imaging */
2860 case GL_COLOR_TABLE_SGI
:
2861 *params
= (GLdouble
) ctx
->Pixel
.ColorTableEnabled
;
2863 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
2864 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionColorTableEnabled
;
2866 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
2867 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixColorTableEnabled
;
2870 /* GL_SGI_texture_color_table */
2871 case GL_TEXTURE_COLOR_TABLE_SGI
:
2872 CHECK_EXTENSION_D(SGI_texture_color_table
, pname
);
2873 *params
= (GLdouble
) textureUnit
->ColorTableEnabled
;
2876 /* GL_EXT_secondary_color */
2877 case GL_COLOR_SUM_EXT
:
2878 CHECK_EXTENSION_D(EXT_secondary_color
, pname
);
2879 *params
= (GLdouble
) ctx
->Fog
.ColorSumEnabled
;
2881 case GL_CURRENT_SECONDARY_COLOR_EXT
:
2882 CHECK_EXTENSION_D(EXT_secondary_color
, pname
);
2883 FLUSH_CURRENT(ctx
, 0);
2884 params
[0] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][0];
2885 params
[1] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][1];
2886 params
[2] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][2];
2887 params
[3] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][3];
2889 case GL_SECONDARY_COLOR_ARRAY_EXT
:
2890 CHECK_EXTENSION_D(EXT_secondary_color
, pname
);
2891 *params
= (GLdouble
) ctx
->Array
.SecondaryColor
.Enabled
;
2893 case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT
:
2894 CHECK_EXTENSION_D(EXT_secondary_color
, pname
);
2895 *params
= (GLdouble
) ctx
->Array
.SecondaryColor
.Type
;
2897 case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT
:
2898 CHECK_EXTENSION_D(EXT_secondary_color
, pname
);
2899 *params
= (GLdouble
) ctx
->Array
.SecondaryColor
.Stride
;
2901 case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT
:
2902 CHECK_EXTENSION_D(EXT_secondary_color
, pname
);
2903 *params
= (GLdouble
) ctx
->Array
.SecondaryColor
.Size
;
2906 /* GL_EXT_fog_coord */
2907 case GL_CURRENT_FOG_COORDINATE_EXT
:
2908 CHECK_EXTENSION_D(EXT_fog_coord
, pname
);
2909 FLUSH_CURRENT(ctx
, 0);
2910 *params
= (GLdouble
) ctx
->Current
.Attrib
[VERT_ATTRIB_FOG
][0];
2912 case GL_FOG_COORDINATE_ARRAY_EXT
:
2913 CHECK_EXTENSION_D(EXT_fog_coord
, pname
);
2914 *params
= (GLdouble
) ctx
->Array
.FogCoord
.Enabled
;
2916 case GL_FOG_COORDINATE_ARRAY_TYPE_EXT
:
2917 CHECK_EXTENSION_D(EXT_fog_coord
, pname
);
2918 *params
= (GLdouble
) ctx
->Array
.FogCoord
.Type
;
2920 case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
:
2921 CHECK_EXTENSION_D(EXT_fog_coord
, pname
);
2922 *params
= (GLdouble
) ctx
->Array
.FogCoord
.Stride
;
2924 case GL_FOG_COORDINATE_SOURCE_EXT
:
2925 CHECK_EXTENSION_D(EXT_fog_coord
, pname
);
2926 *params
= (GLdouble
) ctx
->Fog
.FogCoordinateSource
;
2929 /* GL_EXT_texture_lod_bias */
2930 case GL_MAX_TEXTURE_LOD_BIAS_EXT
:
2931 *params
= (GLdouble
) ctx
->Const
.MaxTextureLodBias
;
2934 /* GL_EXT_texture_filter_anisotropic */
2935 case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
:
2936 CHECK_EXTENSION_D(EXT_texture_filter_anisotropic
, pname
);
2937 *params
= (GLdouble
) ctx
->Const
.MaxTextureMaxAnisotropy
;
2940 /* GL_ARB_multisample */
2941 case GL_MULTISAMPLE_ARB
:
2942 CHECK_EXTENSION_D(ARB_multisample
, pname
);
2943 *params
= (GLdouble
) ctx
->Multisample
.Enabled
;
2945 case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB
:
2946 CHECK_EXTENSION_D(ARB_multisample
, pname
);
2947 *params
= (GLdouble
) ctx
->Multisample
.SampleAlphaToCoverage
;
2949 case GL_SAMPLE_ALPHA_TO_ONE_ARB
:
2950 CHECK_EXTENSION_D(ARB_multisample
, pname
);
2951 *params
= (GLdouble
) ctx
->Multisample
.SampleAlphaToOne
;
2953 case GL_SAMPLE_COVERAGE_ARB
:
2954 CHECK_EXTENSION_D(ARB_multisample
, pname
);
2955 *params
= (GLdouble
) ctx
->Multisample
.SampleCoverage
;
2957 case GL_SAMPLE_COVERAGE_VALUE_ARB
:
2958 CHECK_EXTENSION_D(ARB_multisample
, pname
);
2959 *params
= ctx
->Multisample
.SampleCoverageValue
;
2961 case GL_SAMPLE_COVERAGE_INVERT_ARB
:
2962 CHECK_EXTENSION_D(ARB_multisample
, pname
);
2963 *params
= (GLdouble
) ctx
->Multisample
.SampleCoverageInvert
;
2965 case GL_SAMPLE_BUFFERS_ARB
:
2966 CHECK_EXTENSION_D(ARB_multisample
, pname
);
2967 *params
= 0.0; /* XXX fix someday */
2969 case GL_SAMPLES_ARB
:
2970 CHECK_EXTENSION_D(ARB_multisample
, pname
);
2971 *params
= 0.0; /* XXX fix someday */
2974 /* GL_IBM_rasterpos_clip */
2975 case GL_RASTER_POSITION_UNCLIPPED_IBM
:
2976 CHECK_EXTENSION_D(IBM_rasterpos_clip
, pname
);
2977 *params
= (GLdouble
) ctx
->Transform
.RasterPositionUnclipped
;
2980 /* GL_NV_point_sprite */
2981 case GL_POINT_SPRITE_NV
:
2982 CHECK_EXTENSION2_D(NV_point_sprite
, ARB_point_sprite
, pname
);
2983 *params
= (GLdouble
) ctx
->Point
.PointSprite
;
2985 case GL_POINT_SPRITE_R_MODE_NV
:
2986 CHECK_EXTENSION_D(NV_point_sprite
, pname
);
2987 *params
= (GLdouble
) ctx
->Point
.SpriteRMode
;
2989 case GL_POINT_SPRITE_COORD_ORIGIN
:
2990 CHECK_EXTENSION_D(ARB_point_sprite
, pname
);
2991 *params
= (GLdouble
) ctx
->Point
.SpriteOrigin
;
2994 /* GL_SGIS_generate_mipmap */
2995 case GL_GENERATE_MIPMAP_HINT_SGIS
:
2996 CHECK_EXTENSION_D(SGIS_generate_mipmap
, pname
);
2997 *params
= (GLdouble
) ctx
->Hint
.GenerateMipmap
;
3000 #if FEATURE_NV_vertex_program
3001 case GL_VERTEX_PROGRAM_NV
:
3002 CHECK_EXTENSION_D(NV_vertex_program
, pname
);
3003 *params
= (GLdouble
) ctx
->VertexProgram
.Enabled
;
3005 case GL_VERTEX_PROGRAM_POINT_SIZE_NV
:
3006 CHECK_EXTENSION_D(NV_vertex_program
, pname
);
3007 *params
= (GLdouble
) ctx
->VertexProgram
.PointSizeEnabled
;
3009 case GL_VERTEX_PROGRAM_TWO_SIDE_NV
:
3010 CHECK_EXTENSION_D(NV_vertex_program
, pname
);
3011 *params
= (GLdouble
) ctx
->VertexProgram
.TwoSideEnabled
;
3013 case GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV
:
3014 CHECK_EXTENSION_D(NV_vertex_program
, pname
);
3015 *params
= (GLdouble
) ctx
->Const
.MaxProgramMatrixStackDepth
;
3017 case GL_MAX_TRACK_MATRICES_NV
:
3018 CHECK_EXTENSION_D(NV_vertex_program
, pname
);
3019 *params
= (GLdouble
) ctx
->Const
.MaxProgramMatrices
;
3021 case GL_CURRENT_MATRIX_STACK_DEPTH_NV
:
3022 CHECK_EXTENSION_D(NV_vertex_program
, pname
);
3023 *params
= (GLdouble
) ctx
->CurrentStack
->Depth
+ 1;
3025 case GL_CURRENT_MATRIX_NV
:
3026 CHECK_EXTENSION_D(NV_vertex_program
, pname
);
3027 for (i
= 0; i
< 16; i
++)
3028 params
[i
] = (GLdouble
) ctx
->CurrentStack
->Top
->m
[i
];
3030 case GL_VERTEX_PROGRAM_BINDING_NV
:
3031 CHECK_EXTENSION_D(NV_vertex_program
, pname
);
3032 if (ctx
->VertexProgram
.Current
)
3033 *params
= (GLdouble
) ctx
->VertexProgram
.Current
->Base
.Id
;
3037 case GL_PROGRAM_ERROR_POSITION_NV
:
3038 CHECK_EXTENSION_D(NV_vertex_program
, pname
);
3039 *params
= (GLdouble
) ctx
->Program
.ErrorPos
;
3041 case GL_VERTEX_ATTRIB_ARRAY0_NV
:
3042 case GL_VERTEX_ATTRIB_ARRAY1_NV
:
3043 case GL_VERTEX_ATTRIB_ARRAY2_NV
:
3044 case GL_VERTEX_ATTRIB_ARRAY3_NV
:
3045 case GL_VERTEX_ATTRIB_ARRAY4_NV
:
3046 case GL_VERTEX_ATTRIB_ARRAY5_NV
:
3047 case GL_VERTEX_ATTRIB_ARRAY6_NV
:
3048 case GL_VERTEX_ATTRIB_ARRAY7_NV
:
3049 case GL_VERTEX_ATTRIB_ARRAY8_NV
:
3050 case GL_VERTEX_ATTRIB_ARRAY9_NV
:
3051 case GL_VERTEX_ATTRIB_ARRAY10_NV
:
3052 case GL_VERTEX_ATTRIB_ARRAY11_NV
:
3053 case GL_VERTEX_ATTRIB_ARRAY12_NV
:
3054 case GL_VERTEX_ATTRIB_ARRAY13_NV
:
3055 case GL_VERTEX_ATTRIB_ARRAY14_NV
:
3056 case GL_VERTEX_ATTRIB_ARRAY15_NV
:
3057 CHECK_EXTENSION_D(NV_vertex_program
, pname
);
3059 GLuint n
= (GLuint
) pname
- GL_VERTEX_ATTRIB_ARRAY0_NV
;
3060 *params
= (GLdouble
) ctx
->Array
.VertexAttrib
[n
].Enabled
;
3063 case GL_MAP1_VERTEX_ATTRIB0_4_NV
:
3064 case GL_MAP1_VERTEX_ATTRIB1_4_NV
:
3065 case GL_MAP1_VERTEX_ATTRIB2_4_NV
:
3066 case GL_MAP1_VERTEX_ATTRIB3_4_NV
:
3067 case GL_MAP1_VERTEX_ATTRIB4_4_NV
:
3068 case GL_MAP1_VERTEX_ATTRIB5_4_NV
:
3069 case GL_MAP1_VERTEX_ATTRIB6_4_NV
:
3070 case GL_MAP1_VERTEX_ATTRIB7_4_NV
:
3071 case GL_MAP1_VERTEX_ATTRIB8_4_NV
:
3072 case GL_MAP1_VERTEX_ATTRIB9_4_NV
:
3073 case GL_MAP1_VERTEX_ATTRIB10_4_NV
:
3074 case GL_MAP1_VERTEX_ATTRIB11_4_NV
:
3075 case GL_MAP1_VERTEX_ATTRIB12_4_NV
:
3076 case GL_MAP1_VERTEX_ATTRIB13_4_NV
:
3077 case GL_MAP1_VERTEX_ATTRIB14_4_NV
:
3078 case GL_MAP1_VERTEX_ATTRIB15_4_NV
:
3079 CHECK_EXTENSION_B(NV_vertex_program
, pname
);
3081 GLuint n
= (GLuint
) pname
- GL_MAP1_VERTEX_ATTRIB0_4_NV
;
3082 *params
= (GLdouble
) ctx
->Eval
.Map1Attrib
[n
];
3085 case GL_MAP2_VERTEX_ATTRIB0_4_NV
:
3086 case GL_MAP2_VERTEX_ATTRIB1_4_NV
:
3087 case GL_MAP2_VERTEX_ATTRIB2_4_NV
:
3088 case GL_MAP2_VERTEX_ATTRIB3_4_NV
:
3089 case GL_MAP2_VERTEX_ATTRIB4_4_NV
:
3090 case GL_MAP2_VERTEX_ATTRIB5_4_NV
:
3091 case GL_MAP2_VERTEX_ATTRIB6_4_NV
:
3092 case GL_MAP2_VERTEX_ATTRIB7_4_NV
:
3093 case GL_MAP2_VERTEX_ATTRIB8_4_NV
:
3094 case GL_MAP2_VERTEX_ATTRIB9_4_NV
:
3095 case GL_MAP2_VERTEX_ATTRIB10_4_NV
:
3096 case GL_MAP2_VERTEX_ATTRIB11_4_NV
:
3097 case GL_MAP2_VERTEX_ATTRIB12_4_NV
:
3098 case GL_MAP2_VERTEX_ATTRIB13_4_NV
:
3099 case GL_MAP2_VERTEX_ATTRIB14_4_NV
:
3100 case GL_MAP2_VERTEX_ATTRIB15_4_NV
:
3101 CHECK_EXTENSION_B(NV_vertex_program
, pname
);
3103 GLuint n
= (GLuint
) pname
- GL_MAP2_VERTEX_ATTRIB0_4_NV
;
3104 *params
= (GLdouble
) ctx
->Eval
.Map2Attrib
[n
];
3107 #endif /* FEATURE_NV_vertex_program */
3109 #if FEATURE_NV_fragment_program
3110 case GL_FRAGMENT_PROGRAM_NV
:
3111 CHECK_EXTENSION_D(NV_fragment_program
, pname
);
3112 *params
= (GLdouble
) ctx
->FragmentProgram
.Enabled
;
3114 case GL_MAX_TEXTURE_COORDS_NV
:
3115 CHECK_EXTENSION_B(NV_fragment_program
, pname
);
3116 *params
= (GLdouble
) ctx
->Const
.MaxTextureCoordUnits
;
3118 case GL_MAX_TEXTURE_IMAGE_UNITS_NV
:
3119 CHECK_EXTENSION_B(NV_fragment_program
, pname
);
3120 *params
= (GLdouble
) ctx
->Const
.MaxTextureImageUnits
;
3122 case GL_FRAGMENT_PROGRAM_BINDING_NV
:
3123 CHECK_EXTENSION_D(NV_fragment_program
, pname
);
3124 if (ctx
->FragmentProgram
.Current
)
3125 *params
= (GLdouble
) ctx
->FragmentProgram
.Current
->Base
.Id
;
3129 case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV
:
3130 CHECK_EXTENSION_D(NV_fragment_program
, pname
);
3131 *params
= (GLdouble
) MAX_NV_FRAGMENT_PROGRAM_PARAMS
;
3133 #endif /* FEATURE_NV_fragment_program */
3135 /* GL_NV_texture_rectangle */
3136 case GL_TEXTURE_RECTANGLE_NV
:
3137 CHECK_EXTENSION_D(NV_texture_rectangle
, pname
);
3138 *params
= (GLdouble
) _mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV
);
3140 case GL_TEXTURE_BINDING_RECTANGLE_NV
:
3141 CHECK_EXTENSION_D(NV_texture_rectangle
, pname
);
3142 *params
= (GLdouble
) textureUnit
->CurrentRect
->Name
;
3144 case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV
:
3145 CHECK_EXTENSION_D(NV_texture_rectangle
, pname
);
3146 *params
= (GLdouble
) ctx
->Const
.MaxTextureRectSize
;
3149 /* GL_EXT_stencil_two_side */
3150 case GL_STENCIL_TEST_TWO_SIDE_EXT
:
3151 CHECK_EXTENSION_D(EXT_stencil_two_side
, pname
);
3152 *params
= (GLdouble
) ctx
->Stencil
.TestTwoSide
;
3154 case GL_ACTIVE_STENCIL_FACE_EXT
:
3155 CHECK_EXTENSION_D(EXT_stencil_two_side
, pname
);
3156 *params
= (GLdouble
) (ctx
->Stencil
.ActiveFace
? GL_BACK
: GL_FRONT
);
3159 /* GL_NV_light_max_exponent */
3160 case GL_MAX_SHININESS_NV
:
3161 *params
= (GLdouble
) ctx
->Const
.MaxShininess
;
3163 case GL_MAX_SPOT_EXPONENT_NV
:
3164 *params
= (GLdouble
) ctx
->Const
.MaxSpotExponent
;
3167 #if FEATURE_ARB_vertex_buffer_object
3168 case GL_ARRAY_BUFFER_BINDING_ARB
:
3169 CHECK_EXTENSION_D(ARB_vertex_buffer_object
, pname
);
3170 *params
= (GLdouble
) ctx
->Array
.ArrayBufferObj
->Name
;
3172 case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB
:
3173 CHECK_EXTENSION_D(ARB_vertex_buffer_object
, pname
);
3174 *params
= (GLdouble
) ctx
->Array
.Vertex
.BufferObj
->Name
;
3176 case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB
:
3177 CHECK_EXTENSION_D(ARB_vertex_buffer_object
, pname
);
3178 *params
= (GLdouble
) ctx
->Array
.Normal
.BufferObj
->Name
;
3180 case GL_COLOR_ARRAY_BUFFER_BINDING_ARB
:
3181 CHECK_EXTENSION_D(ARB_vertex_buffer_object
, pname
);
3182 *params
= (GLdouble
) ctx
->Array
.Color
.BufferObj
->Name
;
3184 case GL_INDEX_ARRAY_BUFFER_BINDING_ARB
:
3185 CHECK_EXTENSION_D(ARB_vertex_buffer_object
, pname
);
3186 *params
= (GLdouble
) ctx
->Array
.Index
.BufferObj
->Name
;
3188 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB
:
3189 CHECK_EXTENSION_D(ARB_vertex_buffer_object
, pname
);
3190 *params
= (GLdouble
) ctx
->Array
.TexCoord
[clientUnit
].BufferObj
->Name
;
3192 case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB
:
3193 CHECK_EXTENSION_D(ARB_vertex_buffer_object
, pname
);
3194 *params
= (GLdouble
) ctx
->Array
.EdgeFlag
.BufferObj
->Name
;
3196 case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB
:
3197 CHECK_EXTENSION_D(ARB_vertex_buffer_object
, pname
);
3198 *params
= (GLdouble
) ctx
->Array
.SecondaryColor
.BufferObj
->Name
;
3200 case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB
:
3201 CHECK_EXTENSION_D(ARB_vertex_buffer_object
, pname
);
3202 *params
= (GLdouble
) ctx
->Array
.FogCoord
.BufferObj
->Name
;
3204 /*case GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB: - not supported */
3205 case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB
:
3206 CHECK_EXTENSION_D(ARB_vertex_buffer_object
, pname
);
3207 *params
= (GLdouble
) ctx
->Array
.ElementArrayBufferObj
->Name
;
3210 #if FEATURE_EXT_pixel_buffer_object
3211 case GL_PIXEL_PACK_BUFFER_BINDING_EXT
:
3212 CHECK_EXTENSION_D(EXT_pixel_buffer_object
, pname
);
3213 *params
= (GLdouble
) ctx
->Pack
.BufferObj
->Name
;
3215 case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT
:
3216 CHECK_EXTENSION_D(EXT_pixel_buffer_object
, pname
);
3217 *params
= (GLdouble
) ctx
->Unpack
.BufferObj
->Name
;
3221 #if FEATURE_ARB_vertex_program
3222 /* GL_NV_vertex_program and GL_ARB_fragment_program define others */
3223 case GL_MAX_VERTEX_ATTRIBS_ARB
:
3224 CHECK_EXTENSION_D(ARB_vertex_program
, pname
);
3225 *params
= (GLdouble
) ctx
->Const
.MaxVertexProgramAttribs
;
3229 #if FEATURE_ARB_fragment_program
3230 case GL_FRAGMENT_PROGRAM_ARB
:
3231 CHECK_EXTENSION_D(ARB_fragment_program
, pname
);
3232 *params
= (GLdouble
) ctx
->FragmentProgram
.Enabled
;
3234 case GL_TRANSPOSE_CURRENT_MATRIX_ARB
:
3235 CHECK_EXTENSION_D(ARB_fragment_program
, pname
);
3236 params
[0] = ctx
->CurrentStack
->Top
->m
[0];
3237 params
[1] = ctx
->CurrentStack
->Top
->m
[4];
3238 params
[2] = ctx
->CurrentStack
->Top
->m
[8];
3239 params
[3] = ctx
->CurrentStack
->Top
->m
[12];
3240 params
[4] = ctx
->CurrentStack
->Top
->m
[1];
3241 params
[5] = ctx
->CurrentStack
->Top
->m
[5];
3242 params
[6] = ctx
->CurrentStack
->Top
->m
[9];
3243 params
[7] = ctx
->CurrentStack
->Top
->m
[13];
3244 params
[8] = ctx
->CurrentStack
->Top
->m
[2];
3245 params
[9] = ctx
->CurrentStack
->Top
->m
[6];
3246 params
[10] = ctx
->CurrentStack
->Top
->m
[10];
3247 params
[11] = ctx
->CurrentStack
->Top
->m
[14];
3248 params
[12] = ctx
->CurrentStack
->Top
->m
[3];
3249 params
[13] = ctx
->CurrentStack
->Top
->m
[7];
3250 params
[14] = ctx
->CurrentStack
->Top
->m
[11];
3251 params
[15] = ctx
->CurrentStack
->Top
->m
[15];
3253 /* Remaining ARB_fragment_program queries alias with
3254 * the GL_NV_fragment_program queries.
3258 /* GL_EXT_depth_bounds_test */
3259 case GL_DEPTH_BOUNDS_TEST_EXT
:
3260 CHECK_EXTENSION_D(EXT_depth_bounds_test
, pname
);
3261 params
[0] = (GLdouble
) ctx
->Depth
.BoundsTest
;
3263 case GL_DEPTH_BOUNDS_EXT
:
3264 CHECK_EXTENSION_D(EXT_depth_bounds_test
, pname
);
3265 params
[0] = ctx
->Depth
.BoundsMin
;
3266 params
[1] = ctx
->Depth
.BoundsMax
;
3269 #if FEATURE_MESA_program_debug
3270 case GL_FRAGMENT_PROGRAM_CALLBACK_MESA
:
3271 CHECK_EXTENSION_D(MESA_program_debug
, pname
);
3272 *params
= (GLdouble
) ctx
->FragmentProgram
.CallbackEnabled
;
3274 case GL_VERTEX_PROGRAM_CALLBACK_MESA
:
3275 CHECK_EXTENSION_D(MESA_program_debug
, pname
);
3276 *params
= (GLdouble
) ctx
->VertexProgram
.CallbackEnabled
;
3278 case GL_FRAGMENT_PROGRAM_POSITION_MESA
:
3279 CHECK_EXTENSION_D(MESA_program_debug
, pname
);
3280 *params
= (GLdouble
) ctx
->FragmentProgram
.CurrentPosition
;
3282 case GL_VERTEX_PROGRAM_POSITION_MESA
:
3283 CHECK_EXTENSION_D(MESA_program_debug
, pname
);
3284 *params
= (GLdouble
) ctx
->VertexProgram
.CurrentPosition
;
3288 case GL_MAX_DRAW_BUFFERS_ARB
:
3289 CHECK_EXTENSION_D(ARB_draw_buffers
, pname
);
3290 *params
= (GLdouble
) ctx
->Const
.MaxDrawBuffers
;
3292 case GL_DRAW_BUFFER0_ARB
:
3293 case GL_DRAW_BUFFER1_ARB
:
3294 case GL_DRAW_BUFFER2_ARB
:
3295 case GL_DRAW_BUFFER3_ARB
:
3296 case GL_DRAW_BUFFER4_ARB
:
3297 case GL_DRAW_BUFFER5_ARB
:
3298 case GL_DRAW_BUFFER6_ARB
:
3299 case GL_DRAW_BUFFER7_ARB
:
3300 case GL_DRAW_BUFFER8_ARB
:
3301 case GL_DRAW_BUFFER9_ARB
:
3302 case GL_DRAW_BUFFER10_ARB
:
3303 case GL_DRAW_BUFFER11_ARB
:
3304 case GL_DRAW_BUFFER12_ARB
:
3305 case GL_DRAW_BUFFER13_ARB
:
3306 case GL_DRAW_BUFFER14_ARB
:
3307 case GL_DRAW_BUFFER15_ARB
:
3308 CHECK_EXTENSION_D(ARB_draw_buffers
, pname
);
3310 GLuint i
= pname
- GL_DRAW_BUFFER0_ARB
;
3311 if (i
>= ctx
->Const
.MaxDrawBuffers
) {
3312 _mesa_error(ctx
, GL_INVALID_ENUM
,
3313 "glGetDoublev(GL_DRAW_BUFFERx_ARB)");
3316 *params
= (GLdouble
) ctx
->Color
.DrawBuffer
[i
];
3321 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev(pname=0x%x)", pname
);
3327 * Get the value(s) of a selected parameter.
3329 * \param pname parameter to be returned.
3330 * \param params will hold the value(s) of the speficifed parameter.
3332 * \sa glGetFloatv().
3334 * Tries to get the specified parameter via dd_function_table::GetFloatv,
3335 * otherwise gets the specified parameter from the current context, converting
3336 * it value into GLfloat.
3339 _mesa_GetFloatv( GLenum pname
, GLfloat
*params
)
3341 GET_CURRENT_CONTEXT(ctx
);
3343 const GLuint clientUnit
= ctx
->Array
.ActiveTexture
;
3344 const GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
3345 const struct gl_texture_unit
*textureUnit
= &ctx
->Texture
.Unit
[texUnit
];
3346 ASSERT_OUTSIDE_BEGIN_END(ctx
);
3351 if (MESA_VERBOSE
& VERBOSE_API
)
3352 _mesa_debug(ctx
, "glGetFloatv %s\n", _mesa_lookup_enum_by_nr(pname
));
3354 if (!ctx
->_CurrentProgram
) {
3355 /* We need this in order to get correct results for
3356 * GL_OCCLUSION_TEST_RESULT_HP. There might be other important cases.
3358 FLUSH_VERTICES(ctx
, 0);
3361 if (ctx
->Driver
.GetFloatv
&& (*ctx
->Driver
.GetFloatv
)(ctx
, pname
, params
))
3365 case GL_ACCUM_RED_BITS
:
3366 *params
= (GLfloat
) ctx
->Visual
.accumRedBits
;
3368 case GL_ACCUM_GREEN_BITS
:
3369 *params
= (GLfloat
) ctx
->Visual
.accumGreenBits
;
3371 case GL_ACCUM_BLUE_BITS
:
3372 *params
= (GLfloat
) ctx
->Visual
.accumBlueBits
;
3374 case GL_ACCUM_ALPHA_BITS
:
3375 *params
= (GLfloat
) ctx
->Visual
.accumAlphaBits
;
3377 case GL_ACCUM_CLEAR_VALUE
:
3378 params
[0] = ctx
->Accum
.ClearColor
[0];
3379 params
[1] = ctx
->Accum
.ClearColor
[1];
3380 params
[2] = ctx
->Accum
.ClearColor
[2];
3381 params
[3] = ctx
->Accum
.ClearColor
[3];
3384 *params
= ctx
->Pixel
.AlphaBias
;
3387 *params
= (GLfloat
) ctx
->Visual
.alphaBits
;
3389 case GL_ALPHA_SCALE
:
3390 *params
= ctx
->Pixel
.AlphaScale
;
3393 *params
= (GLfloat
) ctx
->Color
.AlphaEnabled
;
3395 case GL_ALPHA_TEST_FUNC
:
3396 *params
= ENUM_TO_FLOAT(ctx
->Color
.AlphaFunc
);
3398 case GL_ALPHA_TEST_REF
:
3399 *params
= (GLfloat
) ctx
->Color
.AlphaRef
;
3401 case GL_ATTRIB_STACK_DEPTH
:
3402 *params
= (GLfloat
) (ctx
->AttribStackDepth
);
3404 case GL_AUTO_NORMAL
:
3405 *params
= (GLfloat
) ctx
->Eval
.AutoNormal
;
3407 case GL_AUX_BUFFERS
:
3408 *params
= (GLfloat
) ctx
->Visual
.numAuxBuffers
;
3411 *params
= (GLfloat
) ctx
->Color
.BlendEnabled
;
3414 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendDstRGB
);
3417 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendSrcRGB
);
3419 case GL_BLEND_SRC_RGB_EXT
:
3420 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendSrcRGB
);
3422 case GL_BLEND_DST_RGB_EXT
:
3423 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendDstRGB
);
3425 case GL_BLEND_SRC_ALPHA_EXT
:
3426 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendSrcA
);
3428 case GL_BLEND_DST_ALPHA_EXT
:
3429 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendDstA
);
3431 case GL_BLEND_EQUATION
:
3432 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendEquationRGB
);
3434 case GL_BLEND_EQUATION_ALPHA_EXT
:
3435 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendEquationA
);
3437 case GL_BLEND_COLOR_EXT
:
3438 params
[0] = ctx
->Color
.BlendColor
[0];
3439 params
[1] = ctx
->Color
.BlendColor
[1];
3440 params
[2] = ctx
->Color
.BlendColor
[2];
3441 params
[3] = ctx
->Color
.BlendColor
[3];
3444 *params
= ctx
->Pixel
.BlueBias
;
3447 *params
= (GLfloat
) ctx
->Visual
.blueBits
;
3450 *params
= ctx
->Pixel
.BlueScale
;
3452 case GL_CLIENT_ATTRIB_STACK_DEPTH
:
3453 *params
= (GLfloat
) (ctx
->ClientAttribStackDepth
);
3455 case GL_CLIP_PLANE0
:
3456 case GL_CLIP_PLANE1
:
3457 case GL_CLIP_PLANE2
:
3458 case GL_CLIP_PLANE3
:
3459 case GL_CLIP_PLANE4
:
3460 case GL_CLIP_PLANE5
:
3461 if (ctx
->Transform
.ClipPlanesEnabled
& (1 << (pname
- GL_CLIP_PLANE0
)))
3466 case GL_COLOR_CLEAR_VALUE
:
3467 params
[0] = ctx
->Color
.ClearColor
[0];
3468 params
[1] = ctx
->Color
.ClearColor
[1];
3469 params
[2] = ctx
->Color
.ClearColor
[2];
3470 params
[3] = ctx
->Color
.ClearColor
[3];
3472 case GL_COLOR_MATERIAL
:
3473 *params
= (GLfloat
) ctx
->Light
.ColorMaterialEnabled
;
3475 case GL_COLOR_MATERIAL_FACE
:
3476 *params
= ENUM_TO_FLOAT(ctx
->Light
.ColorMaterialFace
);
3478 case GL_COLOR_MATERIAL_PARAMETER
:
3479 *params
= ENUM_TO_FLOAT(ctx
->Light
.ColorMaterialMode
);
3481 case GL_COLOR_WRITEMASK
:
3482 params
[0] = ctx
->Color
.ColorMask
[RCOMP
] ? 1.0F
: 0.0F
;
3483 params
[1] = ctx
->Color
.ColorMask
[GCOMP
] ? 1.0F
: 0.0F
;
3484 params
[2] = ctx
->Color
.ColorMask
[BCOMP
] ? 1.0F
: 0.0F
;
3485 params
[3] = ctx
->Color
.ColorMask
[ACOMP
] ? 1.0F
: 0.0F
;
3488 *params
= (GLfloat
) ctx
->Polygon
.CullFlag
;
3490 case GL_CULL_FACE_MODE
:
3491 *params
= ENUM_TO_FLOAT(ctx
->Polygon
.CullFaceMode
);
3493 case GL_CURRENT_COLOR
:
3494 FLUSH_CURRENT(ctx
, 0);
3495 params
[0] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][0];
3496 params
[1] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][1];
3497 params
[2] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][2];
3498 params
[3] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][3];
3500 case GL_CURRENT_INDEX
:
3501 FLUSH_CURRENT(ctx
, 0);
3502 *params
= (GLfloat
) ctx
->Current
.Index
;
3504 case GL_CURRENT_NORMAL
:
3505 FLUSH_CURRENT(ctx
, 0);
3506 params
[0] = ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][0];
3507 params
[1] = ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][1];
3508 params
[2] = ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][2];
3510 case GL_CURRENT_RASTER_COLOR
:
3511 params
[0] = ctx
->Current
.RasterColor
[0];
3512 params
[1] = ctx
->Current
.RasterColor
[1];
3513 params
[2] = ctx
->Current
.RasterColor
[2];
3514 params
[3] = ctx
->Current
.RasterColor
[3];
3516 case GL_CURRENT_RASTER_DISTANCE
:
3517 params
[0] = ctx
->Current
.RasterDistance
;
3519 case GL_CURRENT_RASTER_INDEX
:
3520 *params
= ctx
->Current
.RasterIndex
;
3522 case GL_CURRENT_RASTER_POSITION
:
3523 params
[0] = ctx
->Current
.RasterPos
[0];
3524 params
[1] = ctx
->Current
.RasterPos
[1];
3525 params
[2] = ctx
->Current
.RasterPos
[2];
3526 params
[3] = ctx
->Current
.RasterPos
[3];
3528 case GL_CURRENT_RASTER_TEXTURE_COORDS
:
3529 params
[0] = ctx
->Current
.RasterTexCoords
[texUnit
][0];
3530 params
[1] = ctx
->Current
.RasterTexCoords
[texUnit
][1];
3531 params
[2] = ctx
->Current
.RasterTexCoords
[texUnit
][2];
3532 params
[3] = ctx
->Current
.RasterTexCoords
[texUnit
][3];
3534 case GL_CURRENT_RASTER_POSITION_VALID
:
3535 *params
= (GLfloat
) ctx
->Current
.RasterPosValid
;
3537 case GL_CURRENT_TEXTURE_COORDS
:
3538 FLUSH_CURRENT(ctx
, 0);
3539 params
[0] = (GLfloat
) ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][0];
3540 params
[1] = (GLfloat
) ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][1];
3541 params
[2] = (GLfloat
) ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][2];
3542 params
[3] = (GLfloat
) ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][3];
3545 *params
= (GLfloat
) ctx
->Pixel
.DepthBias
;
3548 *params
= (GLfloat
) ctx
->Visual
.depthBits
;
3550 case GL_DEPTH_CLEAR_VALUE
:
3551 *params
= (GLfloat
) ctx
->Depth
.Clear
;
3554 *params
= ENUM_TO_FLOAT(ctx
->Depth
.Func
);
3556 case GL_DEPTH_RANGE
:
3557 params
[0] = (GLfloat
) ctx
->Viewport
.Near
;
3558 params
[1] = (GLfloat
) ctx
->Viewport
.Far
;
3560 case GL_DEPTH_SCALE
:
3561 *params
= (GLfloat
) ctx
->Pixel
.DepthScale
;
3564 *params
= (GLfloat
) ctx
->Depth
.Test
;
3566 case GL_DEPTH_WRITEMASK
:
3567 *params
= (GLfloat
) ctx
->Depth
.Mask
;
3570 *params
= (GLfloat
) ctx
->Color
.DitherFlag
;
3572 case GL_DOUBLEBUFFER
:
3573 *params
= (GLfloat
) ctx
->Visual
.doubleBufferMode
;
3575 case GL_DRAW_BUFFER
:
3576 *params
= ENUM_TO_FLOAT(ctx
->Color
.DrawBuffer
[0]);
3579 FLUSH_CURRENT(ctx
, 0);
3580 *params
= (GLfloat
) ctx
->Current
.EdgeFlag
;
3582 case GL_FEEDBACK_BUFFER_SIZE
:
3583 *params
= (GLfloat
) ctx
->Feedback
.BufferSize
;
3585 case GL_FEEDBACK_BUFFER_TYPE
:
3586 *params
= ENUM_TO_FLOAT(ctx
->Feedback
.Type
);
3589 *params
= (GLfloat
) ctx
->Fog
.Enabled
;
3592 params
[0] = ctx
->Fog
.Color
[0];
3593 params
[1] = ctx
->Fog
.Color
[1];
3594 params
[2] = ctx
->Fog
.Color
[2];
3595 params
[3] = ctx
->Fog
.Color
[3];
3597 case GL_FOG_DENSITY
:
3598 *params
= ctx
->Fog
.Density
;
3601 *params
= ctx
->Fog
.End
;
3604 *params
= ENUM_TO_FLOAT(ctx
->Hint
.Fog
);
3607 *params
= ctx
->Fog
.Index
;
3610 *params
= ENUM_TO_FLOAT(ctx
->Fog
.Mode
);
3613 *params
= ctx
->Fog
.Start
;
3616 *params
= ENUM_TO_FLOAT(ctx
->Polygon
.FrontFace
);
3619 *params
= (GLfloat
) ctx
->Pixel
.GreenBias
;
3622 *params
= (GLfloat
) ctx
->Visual
.greenBits
;
3624 case GL_GREEN_SCALE
:
3625 *params
= (GLfloat
) ctx
->Pixel
.GreenScale
;
3628 *params
= (GLfloat
) ctx
->Visual
.indexBits
;
3630 case GL_INDEX_CLEAR_VALUE
:
3631 *params
= (GLfloat
) ctx
->Color
.ClearIndex
;
3634 *params
= ctx
->Visual
.rgbMode
? 0.0F
: 1.0F
;
3636 case GL_INDEX_OFFSET
:
3637 *params
= (GLfloat
) ctx
->Pixel
.IndexOffset
;
3639 case GL_INDEX_SHIFT
:
3640 *params
= (GLfloat
) ctx
->Pixel
.IndexShift
;
3642 case GL_INDEX_WRITEMASK
:
3643 *params
= (GLfloat
) ctx
->Color
.IndexMask
;
3653 *params
= (GLfloat
) ctx
->Light
.Light
[pname
-GL_LIGHT0
].Enabled
;
3656 *params
= (GLfloat
) ctx
->Light
.Enabled
;
3658 case GL_LIGHT_MODEL_AMBIENT
:
3659 params
[0] = ctx
->Light
.Model
.Ambient
[0];
3660 params
[1] = ctx
->Light
.Model
.Ambient
[1];
3661 params
[2] = ctx
->Light
.Model
.Ambient
[2];
3662 params
[3] = ctx
->Light
.Model
.Ambient
[3];
3664 case GL_LIGHT_MODEL_COLOR_CONTROL
:
3665 params
[0] = ENUM_TO_FLOAT(ctx
->Light
.Model
.ColorControl
);
3667 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
3668 *params
= (GLfloat
) ctx
->Light
.Model
.LocalViewer
;
3670 case GL_LIGHT_MODEL_TWO_SIDE
:
3671 *params
= (GLfloat
) ctx
->Light
.Model
.TwoSide
;
3673 case GL_LINE_SMOOTH
:
3674 *params
= (GLfloat
) ctx
->Line
.SmoothFlag
;
3676 case GL_LINE_SMOOTH_HINT
:
3677 *params
= ENUM_TO_FLOAT(ctx
->Hint
.LineSmooth
);
3679 case GL_LINE_STIPPLE
:
3680 *params
= (GLfloat
) ctx
->Line
.StippleFlag
;
3682 case GL_LINE_STIPPLE_PATTERN
:
3683 *params
= (GLfloat
) ctx
->Line
.StipplePattern
;
3685 case GL_LINE_STIPPLE_REPEAT
:
3686 *params
= (GLfloat
) ctx
->Line
.StippleFactor
;
3689 *params
= (GLfloat
) ctx
->Line
.Width
;
3691 case GL_LINE_WIDTH_GRANULARITY
:
3692 *params
= (GLfloat
) ctx
->Const
.LineWidthGranularity
;
3694 case GL_LINE_WIDTH_RANGE
:
3695 params
[0] = (GLfloat
) ctx
->Const
.MinLineWidthAA
;
3696 params
[1] = (GLfloat
) ctx
->Const
.MaxLineWidthAA
;
3698 case GL_ALIASED_LINE_WIDTH_RANGE
:
3699 params
[0] = (GLfloat
) ctx
->Const
.MinLineWidth
;
3700 params
[1] = (GLfloat
) ctx
->Const
.MaxLineWidth
;
3703 *params
= (GLfloat
) ctx
->List
.ListBase
;
3706 *params
= (GLfloat
) ctx
->ListState
.CurrentListNum
;
3709 if (!ctx
->CompileFlag
)
3711 else if (ctx
->ExecuteFlag
)
3712 *params
= ENUM_TO_FLOAT(GL_COMPILE_AND_EXECUTE
);
3714 *params
= ENUM_TO_FLOAT(GL_COMPILE
);
3716 case GL_INDEX_LOGIC_OP
:
3717 *params
= (GLfloat
) ctx
->Color
.IndexLogicOpEnabled
;
3719 case GL_COLOR_LOGIC_OP
:
3720 *params
= (GLfloat
) ctx
->Color
.ColorLogicOpEnabled
;
3722 case GL_LOGIC_OP_MODE
:
3723 *params
= ENUM_TO_FLOAT(ctx
->Color
.LogicOp
);
3725 case GL_MAP1_COLOR_4
:
3726 *params
= (GLfloat
) ctx
->Eval
.Map1Color4
;
3728 case GL_MAP1_GRID_DOMAIN
:
3729 params
[0] = ctx
->Eval
.MapGrid1u1
;
3730 params
[1] = ctx
->Eval
.MapGrid1u2
;
3732 case GL_MAP1_GRID_SEGMENTS
:
3733 *params
= (GLfloat
) ctx
->Eval
.MapGrid1un
;
3736 *params
= (GLfloat
) ctx
->Eval
.Map1Index
;
3738 case GL_MAP1_NORMAL
:
3739 *params
= (GLfloat
) ctx
->Eval
.Map1Normal
;
3741 case GL_MAP1_TEXTURE_COORD_1
:
3742 *params
= (GLfloat
) ctx
->Eval
.Map1TextureCoord1
;
3744 case GL_MAP1_TEXTURE_COORD_2
:
3745 *params
= (GLfloat
) ctx
->Eval
.Map1TextureCoord2
;
3747 case GL_MAP1_TEXTURE_COORD_3
:
3748 *params
= (GLfloat
) ctx
->Eval
.Map1TextureCoord3
;
3750 case GL_MAP1_TEXTURE_COORD_4
:
3751 *params
= (GLfloat
) ctx
->Eval
.Map1TextureCoord4
;
3753 case GL_MAP1_VERTEX_3
:
3754 *params
= (GLfloat
) ctx
->Eval
.Map1Vertex3
;
3756 case GL_MAP1_VERTEX_4
:
3757 *params
= (GLfloat
) ctx
->Eval
.Map1Vertex4
;
3759 case GL_MAP2_COLOR_4
:
3760 *params
= (GLfloat
) ctx
->Eval
.Map2Color4
;
3762 case GL_MAP2_GRID_DOMAIN
:
3763 params
[0] = ctx
->Eval
.MapGrid2u1
;
3764 params
[1] = ctx
->Eval
.MapGrid2u2
;
3765 params
[2] = ctx
->Eval
.MapGrid2v1
;
3766 params
[3] = ctx
->Eval
.MapGrid2v2
;
3768 case GL_MAP2_GRID_SEGMENTS
:
3769 params
[0] = (GLfloat
) ctx
->Eval
.MapGrid2un
;
3770 params
[1] = (GLfloat
) ctx
->Eval
.MapGrid2vn
;
3773 *params
= (GLfloat
) ctx
->Eval
.Map2Index
;
3775 case GL_MAP2_NORMAL
:
3776 *params
= (GLfloat
) ctx
->Eval
.Map2Normal
;
3778 case GL_MAP2_TEXTURE_COORD_1
:
3779 *params
= ctx
->Eval
.Map2TextureCoord1
;
3781 case GL_MAP2_TEXTURE_COORD_2
:
3782 *params
= ctx
->Eval
.Map2TextureCoord2
;
3784 case GL_MAP2_TEXTURE_COORD_3
:
3785 *params
= ctx
->Eval
.Map2TextureCoord3
;
3787 case GL_MAP2_TEXTURE_COORD_4
:
3788 *params
= ctx
->Eval
.Map2TextureCoord4
;
3790 case GL_MAP2_VERTEX_3
:
3791 *params
= (GLfloat
) ctx
->Eval
.Map2Vertex3
;
3793 case GL_MAP2_VERTEX_4
:
3794 *params
= (GLfloat
) ctx
->Eval
.Map2Vertex4
;
3797 *params
= (GLfloat
) ctx
->Pixel
.MapColorFlag
;
3799 case GL_MAP_STENCIL
:
3800 *params
= (GLfloat
) ctx
->Pixel
.MapStencilFlag
;
3802 case GL_MATRIX_MODE
:
3803 *params
= ENUM_TO_FLOAT(ctx
->Transform
.MatrixMode
);
3805 case GL_MAX_ATTRIB_STACK_DEPTH
:
3806 *params
= (GLfloat
) MAX_ATTRIB_STACK_DEPTH
;
3808 case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
:
3809 *params
= (GLfloat
) MAX_CLIENT_ATTRIB_STACK_DEPTH
;
3811 case GL_MAX_CLIP_PLANES
:
3812 *params
= (GLfloat
) ctx
->Const
.MaxClipPlanes
;
3814 case GL_MAX_ELEMENTS_VERTICES
: /* GL_VERSION_1_2 */
3815 *params
= (GLfloat
) ctx
->Const
.MaxArrayLockSize
;
3817 case GL_MAX_ELEMENTS_INDICES
: /* GL_VERSION_1_2 */
3818 *params
= (GLfloat
) ctx
->Const
.MaxArrayLockSize
;
3820 case GL_MAX_EVAL_ORDER
:
3821 *params
= (GLfloat
) MAX_EVAL_ORDER
;
3824 *params
= (GLfloat
) ctx
->Const
.MaxLights
;
3826 case GL_MAX_LIST_NESTING
:
3827 *params
= (GLfloat
) MAX_LIST_NESTING
;
3829 case GL_MAX_MODELVIEW_STACK_DEPTH
:
3830 *params
= (GLfloat
) MAX_MODELVIEW_STACK_DEPTH
;
3832 case GL_MAX_NAME_STACK_DEPTH
:
3833 *params
= (GLfloat
) MAX_NAME_STACK_DEPTH
;
3835 case GL_MAX_PIXEL_MAP_TABLE
:
3836 *params
= (GLfloat
) MAX_PIXEL_MAP_TABLE
;
3838 case GL_MAX_PROJECTION_STACK_DEPTH
:
3839 *params
= (GLfloat
) MAX_PROJECTION_STACK_DEPTH
;
3841 case GL_MAX_TEXTURE_SIZE
:
3842 *params
= (GLfloat
) (1 << (ctx
->Const
.MaxTextureLevels
- 1));
3844 case GL_MAX_3D_TEXTURE_SIZE
:
3845 *params
= (GLfloat
) (1 << (ctx
->Const
.Max3DTextureLevels
- 1));
3847 case GL_MAX_TEXTURE_STACK_DEPTH
:
3848 *params
= (GLfloat
) MAX_TEXTURE_STACK_DEPTH
;
3850 case GL_MAX_VIEWPORT_DIMS
:
3851 params
[0] = (GLfloat
) MAX_WIDTH
;
3852 params
[1] = (GLfloat
) MAX_HEIGHT
;
3854 case GL_MODELVIEW_MATRIX
:
3855 for (i
=0;i
<16;i
++) {
3856 params
[i
] = ctx
->ModelviewMatrixStack
.Top
->m
[i
];
3859 case GL_MODELVIEW_STACK_DEPTH
:
3860 *params
= (GLfloat
) (ctx
->ModelviewMatrixStack
.Depth
+ 1);
3862 case GL_NAME_STACK_DEPTH
:
3863 *params
= (GLfloat
) ctx
->Select
.NameStackDepth
;
3866 *params
= (GLfloat
) ctx
->Transform
.Normalize
;
3868 case GL_PACK_ALIGNMENT
:
3869 *params
= (GLfloat
) ctx
->Pack
.Alignment
;
3871 case GL_PACK_LSB_FIRST
:
3872 *params
= (GLfloat
) ctx
->Pack
.LsbFirst
;
3874 case GL_PACK_ROW_LENGTH
:
3875 *params
= (GLfloat
) ctx
->Pack
.RowLength
;
3877 case GL_PACK_SKIP_PIXELS
:
3878 *params
= (GLfloat
) ctx
->Pack
.SkipPixels
;
3880 case GL_PACK_SKIP_ROWS
:
3881 *params
= (GLfloat
) ctx
->Pack
.SkipRows
;
3883 case GL_PACK_SWAP_BYTES
:
3884 *params
= (GLfloat
) ctx
->Pack
.SwapBytes
;
3886 case GL_PACK_SKIP_IMAGES_EXT
:
3887 *params
= (GLfloat
) ctx
->Pack
.SkipImages
;
3889 case GL_PACK_IMAGE_HEIGHT_EXT
:
3890 *params
= (GLfloat
) ctx
->Pack
.ImageHeight
;
3892 case GL_PACK_INVERT_MESA
:
3893 *params
= (GLfloat
) ctx
->Pack
.Invert
;
3895 case GL_PERSPECTIVE_CORRECTION_HINT
:
3896 *params
= ENUM_TO_FLOAT(ctx
->Hint
.PerspectiveCorrection
);
3898 case GL_PIXEL_MAP_A_TO_A_SIZE
:
3899 *params
= (GLfloat
) ctx
->Pixel
.MapAtoAsize
;
3901 case GL_PIXEL_MAP_B_TO_B_SIZE
:
3902 *params
= (GLfloat
) ctx
->Pixel
.MapBtoBsize
;
3904 case GL_PIXEL_MAP_G_TO_G_SIZE
:
3905 *params
= (GLfloat
) ctx
->Pixel
.MapGtoGsize
;
3907 case GL_PIXEL_MAP_I_TO_A_SIZE
:
3908 *params
= (GLfloat
) ctx
->Pixel
.MapItoAsize
;
3910 case GL_PIXEL_MAP_I_TO_B_SIZE
:
3911 *params
= (GLfloat
) ctx
->Pixel
.MapItoBsize
;
3913 case GL_PIXEL_MAP_I_TO_G_SIZE
:
3914 *params
= (GLfloat
) ctx
->Pixel
.MapItoGsize
;
3916 case GL_PIXEL_MAP_I_TO_I_SIZE
:
3917 *params
= (GLfloat
) ctx
->Pixel
.MapItoIsize
;
3919 case GL_PIXEL_MAP_I_TO_R_SIZE
:
3920 *params
= (GLfloat
) ctx
->Pixel
.MapItoRsize
;
3922 case GL_PIXEL_MAP_R_TO_R_SIZE
:
3923 *params
= (GLfloat
) ctx
->Pixel
.MapRtoRsize
;
3925 case GL_PIXEL_MAP_S_TO_S_SIZE
:
3926 *params
= (GLfloat
) ctx
->Pixel
.MapStoSsize
;
3929 *params
= (GLfloat
) ctx
->Point
.Size
;
3931 case GL_POINT_SIZE_GRANULARITY
:
3932 *params
= (GLfloat
) ctx
->Const
.PointSizeGranularity
;
3934 case GL_POINT_SIZE_RANGE
:
3935 params
[0] = (GLfloat
) ctx
->Const
.MinPointSizeAA
;
3936 params
[1] = (GLfloat
) ctx
->Const
.MaxPointSizeAA
;
3938 case GL_ALIASED_POINT_SIZE_RANGE
:
3939 params
[0] = (GLfloat
) ctx
->Const
.MinPointSize
;
3940 params
[1] = (GLfloat
) ctx
->Const
.MaxPointSize
;
3942 case GL_POINT_SMOOTH
:
3943 *params
= (GLfloat
) ctx
->Point
.SmoothFlag
;
3945 case GL_POINT_SMOOTH_HINT
:
3946 *params
= ENUM_TO_FLOAT(ctx
->Hint
.PointSmooth
);
3948 case GL_POINT_SIZE_MIN_EXT
:
3949 *params
= (GLfloat
) (ctx
->Point
.MinSize
);
3951 case GL_POINT_SIZE_MAX_EXT
:
3952 *params
= (GLfloat
) (ctx
->Point
.MaxSize
);
3954 case GL_POINT_FADE_THRESHOLD_SIZE_EXT
:
3955 *params
= (GLfloat
) (ctx
->Point
.Threshold
);
3957 case GL_DISTANCE_ATTENUATION_EXT
:
3958 params
[0] = (GLfloat
) (ctx
->Point
.Params
[0]);
3959 params
[1] = (GLfloat
) (ctx
->Point
.Params
[1]);
3960 params
[2] = (GLfloat
) (ctx
->Point
.Params
[2]);
3962 case GL_POLYGON_MODE
:
3963 params
[0] = ENUM_TO_FLOAT(ctx
->Polygon
.FrontMode
);
3964 params
[1] = ENUM_TO_FLOAT(ctx
->Polygon
.BackMode
);
3966 #ifdef GL_EXT_polygon_offset
3967 case GL_POLYGON_OFFSET_BIAS_EXT
:
3968 *params
= ctx
->Polygon
.OffsetUnits
;
3971 case GL_POLYGON_OFFSET_FACTOR
:
3972 *params
= ctx
->Polygon
.OffsetFactor
;
3974 case GL_POLYGON_OFFSET_UNITS
:
3975 *params
= ctx
->Polygon
.OffsetUnits
;
3977 case GL_POLYGON_SMOOTH
:
3978 *params
= (GLfloat
) ctx
->Polygon
.SmoothFlag
;
3980 case GL_POLYGON_SMOOTH_HINT
:
3981 *params
= ENUM_TO_FLOAT(ctx
->Hint
.PolygonSmooth
);
3983 case GL_POLYGON_STIPPLE
:
3984 *params
= (GLfloat
) ctx
->Polygon
.StippleFlag
;
3986 case GL_PROJECTION_MATRIX
:
3987 for (i
=0;i
<16;i
++) {
3988 params
[i
] = ctx
->ProjectionMatrixStack
.Top
->m
[i
];
3991 case GL_PROJECTION_STACK_DEPTH
:
3992 *params
= (GLfloat
) (ctx
->ProjectionMatrixStack
.Depth
+ 1);
3994 case GL_READ_BUFFER
:
3995 *params
= ENUM_TO_FLOAT(ctx
->Pixel
.ReadBuffer
);
3998 *params
= ctx
->Pixel
.RedBias
;
4001 *params
= (GLfloat
) ctx
->Visual
.redBits
;
4004 *params
= ctx
->Pixel
.RedScale
;
4006 case GL_RENDER_MODE
:
4007 *params
= ENUM_TO_FLOAT(ctx
->RenderMode
);
4009 case GL_RESCALE_NORMAL
:
4010 *params
= (GLfloat
) ctx
->Transform
.RescaleNormals
;
4013 *params
= (GLfloat
) ctx
->Visual
.rgbMode
;
4015 case GL_SCISSOR_BOX
:
4016 params
[0] = (GLfloat
) ctx
->Scissor
.X
;
4017 params
[1] = (GLfloat
) ctx
->Scissor
.Y
;
4018 params
[2] = (GLfloat
) ctx
->Scissor
.Width
;
4019 params
[3] = (GLfloat
) ctx
->Scissor
.Height
;
4021 case GL_SCISSOR_TEST
:
4022 *params
= (GLfloat
) ctx
->Scissor
.Enabled
;
4024 case GL_SELECTION_BUFFER_SIZE
:
4025 *params
= (GLfloat
) ctx
->Select
.BufferSize
;
4027 case GL_SHADE_MODEL
:
4028 *params
= ENUM_TO_FLOAT(ctx
->Light
.ShadeModel
);
4030 case GL_SHARED_TEXTURE_PALETTE_EXT
:
4031 *params
= (GLfloat
) ctx
->Texture
.SharedPalette
;
4033 case GL_STENCIL_BITS
:
4034 *params
= (GLfloat
) ctx
->Visual
.stencilBits
;
4036 case GL_STENCIL_CLEAR_VALUE
:
4037 *params
= (GLfloat
) ctx
->Stencil
.Clear
;
4039 case GL_STENCIL_FAIL
:
4040 *params
= ENUM_TO_FLOAT(ctx
->Stencil
.FailFunc
[ctx
->Stencil
.ActiveFace
]);
4042 case GL_STENCIL_FUNC
:
4043 *params
= ENUM_TO_FLOAT(ctx
->Stencil
.Function
[ctx
->Stencil
.ActiveFace
]);
4045 case GL_STENCIL_PASS_DEPTH_FAIL
:
4046 *params
= ENUM_TO_FLOAT(ctx
->Stencil
.ZFailFunc
[ctx
->Stencil
.ActiveFace
]);
4048 case GL_STENCIL_PASS_DEPTH_PASS
:
4049 *params
= ENUM_TO_FLOAT(ctx
->Stencil
.ZPassFunc
[ctx
->Stencil
.ActiveFace
]);
4051 case GL_STENCIL_REF
:
4052 *params
= (GLfloat
) ctx
->Stencil
.Ref
[ctx
->Stencil
.ActiveFace
];
4054 case GL_STENCIL_TEST
:
4055 *params
= (GLfloat
) ctx
->Stencil
.Enabled
;
4057 case GL_STENCIL_VALUE_MASK
:
4058 *params
= (GLfloat
) ctx
->Stencil
.ValueMask
[ctx
->Stencil
.ActiveFace
];
4060 case GL_STENCIL_WRITEMASK
:
4061 *params
= (GLfloat
) ctx
->Stencil
.WriteMask
[ctx
->Stencil
.ActiveFace
];
4064 *params
= (GLfloat
) ctx
->Visual
.stereoMode
;
4066 case GL_SUBPIXEL_BITS
:
4067 *params
= (GLfloat
) ctx
->Const
.SubPixelBits
;
4070 *params
= _mesa_IsEnabled(GL_TEXTURE_1D
) ? 1.0F
: 0.0F
;
4073 *params
= _mesa_IsEnabled(GL_TEXTURE_2D
) ? 1.0F
: 0.0F
;
4076 *params
= _mesa_IsEnabled(GL_TEXTURE_3D
) ? 1.0F
: 0.0F
;
4078 case GL_TEXTURE_BINDING_1D
:
4079 *params
= (GLfloat
) textureUnit
->Current1D
->Name
;
4081 case GL_TEXTURE_BINDING_2D
:
4082 *params
= (GLfloat
) textureUnit
->Current2D
->Name
;
4084 case GL_TEXTURE_BINDING_3D
:
4085 *params
= (GLfloat
) textureUnit
->Current2D
->Name
;
4087 case GL_TEXTURE_ENV_COLOR
:
4088 params
[0] = textureUnit
->EnvColor
[0];
4089 params
[1] = textureUnit
->EnvColor
[1];
4090 params
[2] = textureUnit
->EnvColor
[2];
4091 params
[3] = textureUnit
->EnvColor
[3];
4093 case GL_TEXTURE_ENV_MODE
:
4094 *params
= ENUM_TO_FLOAT(textureUnit
->EnvMode
);
4096 case GL_TEXTURE_GEN_S
:
4097 *params
= (textureUnit
->TexGenEnabled
& S_BIT
) ? 1.0F
: 0.0F
;
4099 case GL_TEXTURE_GEN_T
:
4100 *params
= (textureUnit
->TexGenEnabled
& T_BIT
) ? 1.0F
: 0.0F
;
4102 case GL_TEXTURE_GEN_R
:
4103 *params
= (textureUnit
->TexGenEnabled
& R_BIT
) ? 1.0F
: 0.0F
;
4105 case GL_TEXTURE_GEN_Q
:
4106 *params
= (textureUnit
->TexGenEnabled
& Q_BIT
) ? 1.0F
: 0.0F
;
4108 case GL_TEXTURE_MATRIX
:
4109 for (i
=0;i
<16;i
++) {
4110 params
[i
] = ctx
->TextureMatrixStack
[texUnit
].Top
->m
[i
];
4113 case GL_TEXTURE_STACK_DEPTH
:
4114 *params
= (GLfloat
) (ctx
->TextureMatrixStack
[texUnit
].Depth
+ 1);
4116 case GL_UNPACK_ALIGNMENT
:
4117 *params
= (GLfloat
) ctx
->Unpack
.Alignment
;
4119 case GL_UNPACK_LSB_FIRST
:
4120 *params
= (GLfloat
) ctx
->Unpack
.LsbFirst
;
4122 case GL_UNPACK_ROW_LENGTH
:
4123 *params
= (GLfloat
) ctx
->Unpack
.RowLength
;
4125 case GL_UNPACK_SKIP_PIXELS
:
4126 *params
= (GLfloat
) ctx
->Unpack
.SkipPixels
;
4128 case GL_UNPACK_SKIP_ROWS
:
4129 *params
= (GLfloat
) ctx
->Unpack
.SkipRows
;
4131 case GL_UNPACK_SWAP_BYTES
:
4132 *params
= (GLfloat
) ctx
->Unpack
.SwapBytes
;
4134 case GL_UNPACK_SKIP_IMAGES_EXT
:
4135 *params
= (GLfloat
) ctx
->Unpack
.SkipImages
;
4137 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
4138 *params
= (GLfloat
) ctx
->Unpack
.ImageHeight
;
4140 case GL_UNPACK_CLIENT_STORAGE_APPLE
:
4141 *params
= (GLfloat
) ctx
->Unpack
.ClientStorage
;
4144 params
[0] = (GLfloat
) ctx
->Viewport
.X
;
4145 params
[1] = (GLfloat
) ctx
->Viewport
.Y
;
4146 params
[2] = (GLfloat
) ctx
->Viewport
.Width
;
4147 params
[3] = (GLfloat
) ctx
->Viewport
.Height
;
4150 *params
= (GLfloat
) ctx
->Pixel
.ZoomX
;
4153 *params
= (GLfloat
) ctx
->Pixel
.ZoomY
;
4155 case GL_VERTEX_ARRAY
:
4156 *params
= (GLfloat
) ctx
->Array
.Vertex
.Enabled
;
4158 case GL_VERTEX_ARRAY_SIZE
:
4159 *params
= (GLfloat
) ctx
->Array
.Vertex
.Size
;
4161 case GL_VERTEX_ARRAY_TYPE
:
4162 *params
= ENUM_TO_FLOAT(ctx
->Array
.Vertex
.Type
);
4164 case GL_VERTEX_ARRAY_STRIDE
:
4165 *params
= (GLfloat
) ctx
->Array
.Vertex
.Stride
;
4167 case GL_VERTEX_ARRAY_COUNT_EXT
:
4170 case GL_NORMAL_ARRAY
:
4171 *params
= (GLfloat
) ctx
->Array
.Normal
.Enabled
;
4173 case GL_NORMAL_ARRAY_TYPE
:
4174 *params
= ENUM_TO_FLOAT(ctx
->Array
.Normal
.Type
);
4176 case GL_NORMAL_ARRAY_STRIDE
:
4177 *params
= (GLfloat
) ctx
->Array
.Normal
.Stride
;
4179 case GL_NORMAL_ARRAY_COUNT_EXT
:
4182 case GL_COLOR_ARRAY
:
4183 *params
= (GLfloat
) ctx
->Array
.Color
.Enabled
;
4185 case GL_COLOR_ARRAY_SIZE
:
4186 *params
= (GLfloat
) ctx
->Array
.Color
.Size
;
4188 case GL_COLOR_ARRAY_TYPE
:
4189 *params
= ENUM_TO_FLOAT(ctx
->Array
.Color
.Type
);
4191 case GL_COLOR_ARRAY_STRIDE
:
4192 *params
= (GLfloat
) ctx
->Array
.Color
.Stride
;
4194 case GL_COLOR_ARRAY_COUNT_EXT
:
4197 case GL_INDEX_ARRAY
:
4198 *params
= (GLfloat
) ctx
->Array
.Index
.Enabled
;
4200 case GL_INDEX_ARRAY_TYPE
:
4201 *params
= ENUM_TO_FLOAT(ctx
->Array
.Index
.Type
);
4203 case GL_INDEX_ARRAY_STRIDE
:
4204 *params
= (GLfloat
) ctx
->Array
.Index
.Stride
;
4206 case GL_INDEX_ARRAY_COUNT_EXT
:
4209 case GL_TEXTURE_COORD_ARRAY
:
4210 *params
= (GLfloat
) ctx
->Array
.TexCoord
[clientUnit
].Enabled
;
4212 case GL_TEXTURE_COORD_ARRAY_SIZE
:
4213 *params
= (GLfloat
) ctx
->Array
.TexCoord
[clientUnit
].Size
;
4215 case GL_TEXTURE_COORD_ARRAY_TYPE
:
4216 *params
= ENUM_TO_FLOAT(ctx
->Array
.TexCoord
[clientUnit
].Type
);
4218 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
4219 *params
= (GLfloat
) ctx
->Array
.TexCoord
[clientUnit
].Stride
;
4221 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
4224 case GL_EDGE_FLAG_ARRAY
:
4225 *params
= (GLfloat
) ctx
->Array
.EdgeFlag
.Enabled
;
4227 case GL_EDGE_FLAG_ARRAY_STRIDE
:
4228 *params
= (GLfloat
) ctx
->Array
.EdgeFlag
.Stride
;
4230 case GL_EDGE_FLAG_ARRAY_COUNT_EXT
:
4234 /* GL_ARB_multitexture */
4235 case GL_MAX_TEXTURE_UNITS_ARB
:
4236 CHECK_EXTENSION_F(ARB_multitexture
, pname
);
4237 *params
= (GLfloat
) MIN2(ctx
->Const
.MaxTextureImageUnits
,
4238 ctx
->Const
.MaxTextureCoordUnits
);
4240 case GL_ACTIVE_TEXTURE_ARB
:
4241 CHECK_EXTENSION_F(ARB_multitexture
, pname
);
4242 *params
= (GLfloat
) (GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
);
4244 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
4245 CHECK_EXTENSION_F(ARB_multitexture
, pname
);
4246 *params
= (GLfloat
) (GL_TEXTURE0_ARB
+ clientUnit
);
4249 /* GL_ARB_texture_cube_map */
4250 case GL_TEXTURE_CUBE_MAP_ARB
:
4251 CHECK_EXTENSION_F(ARB_texture_cube_map
, pname
);
4252 *params
= (GLfloat
) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
);
4254 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
4255 CHECK_EXTENSION_F(ARB_texture_cube_map
, pname
);
4256 *params
= (GLfloat
) textureUnit
->CurrentCubeMap
->Name
;
4258 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
4259 CHECK_EXTENSION_F(ARB_texture_cube_map
, pname
);
4260 *params
= (GLfloat
) (1 << (ctx
->Const
.MaxCubeTextureLevels
- 1));
4263 /* GL_ARB_texture_compression */
4264 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
4265 CHECK_EXTENSION_F(ARB_texture_compression
, pname
);
4266 *params
= (GLfloat
) ctx
->Hint
.TextureCompression
;
4268 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
4269 CHECK_EXTENSION_F(ARB_texture_compression
, pname
);
4270 *params
= (GLfloat
) _mesa_get_compressed_formats(ctx
, NULL
);
4272 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
4273 CHECK_EXTENSION_F(ARB_texture_compression
, pname
);
4277 n
= _mesa_get_compressed_formats(ctx
, formats
);
4278 for (i
= 0; i
< n
; i
++)
4279 params
[i
] = (GLfloat
) formats
[i
];
4283 /* GL_EXT_compiled_vertex_array */
4284 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
4285 CHECK_EXTENSION_F(EXT_compiled_vertex_array
, pname
);
4286 *params
= (GLfloat
) ctx
->Array
.LockFirst
;
4288 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
4289 CHECK_EXTENSION_F(EXT_compiled_vertex_array
, pname
);
4290 *params
= (GLfloat
) ctx
->Array
.LockCount
;
4293 /* GL_ARB_transpose_matrix */
4294 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
4295 _math_transposef(params
, ctx
->ColorMatrixStack
.Top
->m
);
4297 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
4298 _math_transposef(params
, ctx
->ModelviewMatrixStack
.Top
->m
);
4300 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
4301 _math_transposef(params
, ctx
->ProjectionMatrixStack
.Top
->m
);
4303 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
4304 _math_transposef(params
, ctx
->TextureMatrixStack
[texUnit
].Top
->m
);
4307 /* GL_HP_occlusion_test */
4308 case GL_OCCLUSION_TEST_HP
:
4309 CHECK_EXTENSION_F(HP_occlusion_test
, pname
);
4310 *params
= (GLfloat
) ctx
->Depth
.OcclusionTest
;
4312 case GL_OCCLUSION_TEST_RESULT_HP
:
4313 CHECK_EXTENSION_F(HP_occlusion_test
, pname
);
4314 if (ctx
->Depth
.OcclusionTest
)
4315 *params
= (GLfloat
) ctx
->OcclusionResult
;
4317 *params
= (GLfloat
) ctx
->OcclusionResultSaved
;
4318 /* reset flag now */
4319 ctx
->OcclusionResult
= GL_FALSE
;
4320 ctx
->OcclusionResultSaved
= GL_FALSE
;
4323 /* GL_SGIS_pixel_texture */
4324 case GL_PIXEL_TEXTURE_SGIS
:
4325 *params
= (GLfloat
) ctx
->Pixel
.PixelTextureEnabled
;
4328 /* GL_SGIX_pixel_texture */
4329 case GL_PIXEL_TEX_GEN_SGIX
:
4330 *params
= (GLfloat
) ctx
->Pixel
.PixelTextureEnabled
;
4332 case GL_PIXEL_TEX_GEN_MODE_SGIX
:
4333 *params
= (GLfloat
) pixel_texgen_mode(ctx
);
4336 /* GL_SGI_color_matrix (also in 1.2 imaging) */
4337 case GL_COLOR_MATRIX_SGI
:
4338 for (i
=0;i
<16;i
++) {
4339 params
[i
] = ctx
->ColorMatrixStack
.Top
->m
[i
];
4342 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
4343 *params
= (GLfloat
) (ctx
->ColorMatrixStack
.Depth
+ 1);
4345 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
4346 *params
= (GLfloat
) MAX_COLOR_STACK_DEPTH
;
4348 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
4349 *params
= ctx
->Pixel
.PostColorMatrixScale
[0];
4351 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
4352 *params
= ctx
->Pixel
.PostColorMatrixScale
[1];
4354 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
4355 *params
= ctx
->Pixel
.PostColorMatrixScale
[2];
4357 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
4358 *params
= ctx
->Pixel
.PostColorMatrixScale
[3];
4360 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
4361 *params
= ctx
->Pixel
.PostColorMatrixBias
[0];
4363 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
4364 *params
= ctx
->Pixel
.PostColorMatrixBias
[1];
4366 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
4367 *params
= ctx
->Pixel
.PostColorMatrixBias
[2];
4369 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
4370 *params
= ctx
->Pixel
.PostColorMatrixBias
[3];
4373 /* GL_EXT_convolution (also in 1.2 imaging) */
4374 case GL_CONVOLUTION_1D_EXT
:
4375 CHECK_EXTENSION_F(EXT_convolution
, pname
);
4376 *params
= (GLfloat
) ctx
->Pixel
.Convolution1DEnabled
;
4378 case GL_CONVOLUTION_2D
:
4379 CHECK_EXTENSION_F(EXT_convolution
, pname
);
4380 *params
= (GLfloat
) ctx
->Pixel
.Convolution2DEnabled
;
4382 case GL_SEPARABLE_2D
:
4383 CHECK_EXTENSION_F(EXT_convolution
, pname
);
4384 *params
= (GLfloat
) ctx
->Pixel
.Separable2DEnabled
;
4386 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
4387 CHECK_EXTENSION_F(EXT_convolution
, pname
);
4388 *params
= ctx
->Pixel
.PostConvolutionScale
[0];
4390 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
4391 CHECK_EXTENSION_F(EXT_convolution
, pname
);
4392 *params
= ctx
->Pixel
.PostConvolutionScale
[1];
4394 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
4395 CHECK_EXTENSION_F(EXT_convolution
, pname
);
4396 *params
= ctx
->Pixel
.PostConvolutionScale
[2];
4398 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
4399 CHECK_EXTENSION_F(EXT_convolution
, pname
);
4400 *params
= ctx
->Pixel
.PostConvolutionScale
[3];
4402 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
4403 CHECK_EXTENSION_F(EXT_convolution
, pname
);
4404 *params
= ctx
->Pixel
.PostConvolutionBias
[0];
4406 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
4407 CHECK_EXTENSION_F(EXT_convolution
, pname
);
4408 *params
= ctx
->Pixel
.PostConvolutionBias
[1];
4410 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
4411 CHECK_EXTENSION_F(EXT_convolution
, pname
);
4412 *params
= ctx
->Pixel
.PostConvolutionBias
[2];
4414 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
4415 CHECK_EXTENSION_F(EXT_convolution
, pname
);
4416 *params
= ctx
->Pixel
.PostConvolutionBias
[2];
4419 /* GL_EXT_histogram (also in 1.2 imaging) */
4421 CHECK_EXTENSION_F(EXT_histogram
, pname
);
4422 *params
= (GLfloat
) ctx
->Pixel
.HistogramEnabled
;
4425 CHECK_EXTENSION_F(EXT_histogram
, pname
);
4426 *params
= (GLfloat
) ctx
->Pixel
.MinMaxEnabled
;
4429 /* GL_SGI_color_table (also in 1.2 imaging */
4430 case GL_COLOR_TABLE_SGI
:
4431 *params
= (GLfloat
) ctx
->Pixel
.ColorTableEnabled
;
4433 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
4434 *params
= (GLfloat
) ctx
->Pixel
.PostConvolutionColorTableEnabled
;
4436 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
4437 *params
= (GLfloat
) ctx
->Pixel
.PostColorMatrixColorTableEnabled
;
4440 /* GL_SGI_texture_color_table */
4441 case GL_TEXTURE_COLOR_TABLE_SGI
:
4442 CHECK_EXTENSION_F(SGI_texture_color_table
, pname
);
4443 *params
= (GLfloat
) textureUnit
->ColorTableEnabled
;
4446 /* GL_EXT_secondary_color */
4447 case GL_COLOR_SUM_EXT
:
4448 CHECK_EXTENSION_F(EXT_secondary_color
, pname
);
4449 *params
= (GLfloat
) ctx
->Fog
.ColorSumEnabled
;
4451 case GL_CURRENT_SECONDARY_COLOR_EXT
:
4452 CHECK_EXTENSION_F(EXT_secondary_color
, pname
);
4453 FLUSH_CURRENT(ctx
, 0);
4454 params
[0] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][0];
4455 params
[1] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][1];
4456 params
[2] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][2];
4457 params
[3] = ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][3];
4459 case GL_SECONDARY_COLOR_ARRAY_EXT
:
4460 CHECK_EXTENSION_F(EXT_secondary_color
, pname
);
4461 *params
= (GLfloat
) ctx
->Array
.SecondaryColor
.Enabled
;
4463 case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT
:
4464 CHECK_EXTENSION_F(EXT_secondary_color
, pname
);
4465 *params
= (GLfloat
) ctx
->Array
.SecondaryColor
.Type
;
4467 case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT
:
4468 CHECK_EXTENSION_F(EXT_secondary_color
, pname
);
4469 *params
= (GLfloat
) ctx
->Array
.SecondaryColor
.Stride
;
4471 case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT
:
4472 CHECK_EXTENSION_F(EXT_secondary_color
, pname
);
4473 *params
= (GLfloat
) ctx
->Array
.SecondaryColor
.Size
;
4476 /* GL_EXT_fog_coord */
4477 case GL_CURRENT_FOG_COORDINATE_EXT
:
4478 CHECK_EXTENSION_F(EXT_fog_coord
, pname
);
4479 FLUSH_CURRENT(ctx
, 0);
4480 *params
= (GLfloat
) ctx
->Current
.Attrib
[VERT_ATTRIB_FOG
][0];
4482 case GL_FOG_COORDINATE_ARRAY_EXT
:
4483 CHECK_EXTENSION_F(EXT_fog_coord
, pname
);
4484 *params
= (GLfloat
) ctx
->Array
.FogCoord
.Enabled
;
4486 case GL_FOG_COORDINATE_ARRAY_TYPE_EXT
:
4487 CHECK_EXTENSION_F(EXT_fog_coord
, pname
);
4488 *params
= (GLfloat
) ctx
->Array
.FogCoord
.Type
;
4490 case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
:
4491 CHECK_EXTENSION_F(EXT_fog_coord
, pname
);
4492 *params
= (GLfloat
) ctx
->Array
.FogCoord
.Stride
;
4494 case GL_FOG_COORDINATE_SOURCE_EXT
:
4495 CHECK_EXTENSION_F(EXT_fog_coord
, pname
);
4496 *params
= (GLfloat
) ctx
->Fog
.FogCoordinateSource
;
4499 /* GL_EXT_texture_lod_bias */
4500 case GL_MAX_TEXTURE_LOD_BIAS_EXT
:
4501 *params
= ctx
->Const
.MaxTextureLodBias
;
4504 /* GL_EXT_texture_filter_anisotropic */
4505 case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
:
4506 CHECK_EXTENSION_F(EXT_texture_filter_anisotropic
, pname
);
4507 *params
= ctx
->Const
.MaxTextureMaxAnisotropy
;
4510 /* GL_ARB_multisample */
4511 case GL_MULTISAMPLE_ARB
:
4512 CHECK_EXTENSION_F(ARB_multisample
, pname
);
4513 *params
= (GLfloat
) ctx
->Multisample
.Enabled
;
4515 case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB
:
4516 CHECK_EXTENSION_F(ARB_multisample
, pname
);
4517 *params
= (GLfloat
) ctx
->Multisample
.SampleAlphaToCoverage
;
4519 case GL_SAMPLE_ALPHA_TO_ONE_ARB
:
4520 CHECK_EXTENSION_F(ARB_multisample
, pname
);
4521 *params
= (GLfloat
) ctx
->Multisample
.SampleAlphaToOne
;
4523 case GL_SAMPLE_COVERAGE_ARB
:
4524 CHECK_EXTENSION_F(ARB_multisample
, pname
);
4525 *params
= (GLfloat
) ctx
->Multisample
.SampleCoverage
;
4527 case GL_SAMPLE_COVERAGE_VALUE_ARB
:
4528 CHECK_EXTENSION_F(ARB_multisample
, pname
);
4529 *params
= ctx
->Multisample
.SampleCoverageValue
;
4531 case GL_SAMPLE_COVERAGE_INVERT_ARB
:
4532 CHECK_EXTENSION_F(ARB_multisample
, pname
);
4533 *params
= (GLfloat
) ctx
->Multisample
.SampleCoverageInvert
;
4535 case GL_SAMPLE_BUFFERS_ARB
:
4536 CHECK_EXTENSION_F(ARB_multisample
, pname
);
4537 *params
= 0.0; /* XXX fix someday */
4539 case GL_SAMPLES_ARB
:
4540 CHECK_EXTENSION_F(ARB_multisample
, pname
);
4541 *params
= 0.0; /* XXX fix someday */
4544 /* GL_IBM_rasterpos_clip */
4545 case GL_RASTER_POSITION_UNCLIPPED_IBM
:
4546 CHECK_EXTENSION_F(IBM_rasterpos_clip
, pname
);
4547 *params
= (GLfloat
) ctx
->Transform
.RasterPositionUnclipped
;
4550 /* GL_NV_point_sprite */
4551 case GL_POINT_SPRITE_NV
:
4552 CHECK_EXTENSION2_F(NV_point_sprite
, ARB_point_sprite
, pname
);
4553 *params
= (GLfloat
) ctx
->Point
.PointSprite
;
4555 case GL_POINT_SPRITE_R_MODE_NV
:
4556 CHECK_EXTENSION_F(NV_point_sprite
, pname
);
4557 *params
= (GLfloat
) ctx
->Point
.SpriteRMode
;
4559 case GL_POINT_SPRITE_COORD_ORIGIN
:
4560 CHECK_EXTENSION_F(ARB_point_sprite
, pname
);
4561 *params
= (GLfloat
) ctx
->Point
.SpriteOrigin
;
4564 /* GL_SGIS_generate_mipmap */
4565 case GL_GENERATE_MIPMAP_HINT_SGIS
:
4566 CHECK_EXTENSION_F(SGIS_generate_mipmap
, pname
);
4567 *params
= (GLfloat
) ctx
->Hint
.GenerateMipmap
;
4570 #if FEATURE_NV_vertex_program
4571 case GL_VERTEX_PROGRAM_NV
:
4572 CHECK_EXTENSION_F(NV_vertex_program
, pname
);
4573 *params
= (GLfloat
) ctx
->VertexProgram
.Enabled
;
4575 case GL_VERTEX_PROGRAM_POINT_SIZE_NV
:
4576 CHECK_EXTENSION_F(NV_vertex_program
, pname
);
4577 *params
= (GLfloat
) ctx
->VertexProgram
.PointSizeEnabled
;
4579 case GL_VERTEX_PROGRAM_TWO_SIDE_NV
:
4580 CHECK_EXTENSION_F(NV_vertex_program
, pname
);
4581 *params
= (GLfloat
) ctx
->VertexProgram
.TwoSideEnabled
;
4583 case GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV
:
4584 CHECK_EXTENSION_F(NV_vertex_program
, pname
);
4585 *params
= (GLfloat
) ctx
->Const
.MaxProgramMatrixStackDepth
;
4587 case GL_MAX_TRACK_MATRICES_NV
:
4588 CHECK_EXTENSION_F(NV_vertex_program
, pname
);
4589 *params
= (GLfloat
) ctx
->Const
.MaxProgramMatrices
;
4591 case GL_CURRENT_MATRIX_STACK_DEPTH_NV
:
4592 CHECK_EXTENSION_F(NV_vertex_program
, pname
);
4593 *params
= (GLfloat
) ctx
->CurrentStack
->Depth
+ 1;
4595 case GL_CURRENT_MATRIX_NV
:
4596 CHECK_EXTENSION_F(NV_vertex_program
, pname
);
4597 for (i
= 0; i
< 16; i
++)
4598 params
[i
] = ctx
->CurrentStack
->Top
->m
[i
];
4600 case GL_VERTEX_PROGRAM_BINDING_NV
:
4601 CHECK_EXTENSION_F(NV_vertex_program
, pname
);
4602 if (ctx
->VertexProgram
.Current
)
4603 *params
= (GLfloat
) ctx
->VertexProgram
.Current
->Base
.Id
;
4607 case GL_PROGRAM_ERROR_POSITION_NV
:
4608 CHECK_EXTENSION_F(NV_vertex_program
, pname
);
4609 *params
= (GLfloat
) ctx
->Program
.ErrorPos
;
4611 case GL_VERTEX_ATTRIB_ARRAY0_NV
:
4612 case GL_VERTEX_ATTRIB_ARRAY1_NV
:
4613 case GL_VERTEX_ATTRIB_ARRAY2_NV
:
4614 case GL_VERTEX_ATTRIB_ARRAY3_NV
:
4615 case GL_VERTEX_ATTRIB_ARRAY4_NV
:
4616 case GL_VERTEX_ATTRIB_ARRAY5_NV
:
4617 case GL_VERTEX_ATTRIB_ARRAY6_NV
:
4618 case GL_VERTEX_ATTRIB_ARRAY7_NV
:
4619 case GL_VERTEX_ATTRIB_ARRAY8_NV
:
4620 case GL_VERTEX_ATTRIB_ARRAY9_NV
:
4621 case GL_VERTEX_ATTRIB_ARRAY10_NV
:
4622 case GL_VERTEX_ATTRIB_ARRAY11_NV
:
4623 case GL_VERTEX_ATTRIB_ARRAY12_NV
:
4624 case GL_VERTEX_ATTRIB_ARRAY13_NV
:
4625 case GL_VERTEX_ATTRIB_ARRAY14_NV
:
4626 case GL_VERTEX_ATTRIB_ARRAY15_NV
:
4627 CHECK_EXTENSION_F(NV_vertex_program
, pname
);
4629 GLuint n
= (GLuint
) pname
- GL_VERTEX_ATTRIB_ARRAY0_NV
;
4630 *params
= (GLfloat
) ctx
->Array
.VertexAttrib
[n
].Enabled
;
4633 case GL_MAP1_VERTEX_ATTRIB0_4_NV
:
4634 case GL_MAP1_VERTEX_ATTRIB1_4_NV
:
4635 case GL_MAP1_VERTEX_ATTRIB2_4_NV
:
4636 case GL_MAP1_VERTEX_ATTRIB3_4_NV
:
4637 case GL_MAP1_VERTEX_ATTRIB4_4_NV
:
4638 case GL_MAP1_VERTEX_ATTRIB5_4_NV
:
4639 case GL_MAP1_VERTEX_ATTRIB6_4_NV
:
4640 case GL_MAP1_VERTEX_ATTRIB7_4_NV
:
4641 case GL_MAP1_VERTEX_ATTRIB8_4_NV
:
4642 case GL_MAP1_VERTEX_ATTRIB9_4_NV
:
4643 case GL_MAP1_VERTEX_ATTRIB10_4_NV
:
4644 case GL_MAP1_VERTEX_ATTRIB11_4_NV
:
4645 case GL_MAP1_VERTEX_ATTRIB12_4_NV
:
4646 case GL_MAP1_VERTEX_ATTRIB13_4_NV
:
4647 case GL_MAP1_VERTEX_ATTRIB14_4_NV
:
4648 case GL_MAP1_VERTEX_ATTRIB15_4_NV
:
4649 CHECK_EXTENSION_F(NV_vertex_program
, pname
);
4651 GLuint n
= (GLuint
) pname
- GL_MAP1_VERTEX_ATTRIB0_4_NV
;
4652 *params
= (GLfloat
) ctx
->Eval
.Map1Attrib
[n
];
4655 case GL_MAP2_VERTEX_ATTRIB0_4_NV
:
4656 case GL_MAP2_VERTEX_ATTRIB1_4_NV
:
4657 case GL_MAP2_VERTEX_ATTRIB2_4_NV
:
4658 case GL_MAP2_VERTEX_ATTRIB3_4_NV
:
4659 case GL_MAP2_VERTEX_ATTRIB4_4_NV
:
4660 case GL_MAP2_VERTEX_ATTRIB5_4_NV
:
4661 case GL_MAP2_VERTEX_ATTRIB6_4_NV
:
4662 case GL_MAP2_VERTEX_ATTRIB7_4_NV
:
4663 case GL_MAP2_VERTEX_ATTRIB8_4_NV
:
4664 case GL_MAP2_VERTEX_ATTRIB9_4_NV
:
4665 case GL_MAP2_VERTEX_ATTRIB10_4_NV
:
4666 case GL_MAP2_VERTEX_ATTRIB11_4_NV
:
4667 case GL_MAP2_VERTEX_ATTRIB12_4_NV
:
4668 case GL_MAP2_VERTEX_ATTRIB13_4_NV
:
4669 case GL_MAP2_VERTEX_ATTRIB14_4_NV
:
4670 case GL_MAP2_VERTEX_ATTRIB15_4_NV
:
4671 CHECK_EXTENSION_F(NV_vertex_program
, pname
);
4673 GLuint n
= (GLuint
) pname
- GL_MAP2_VERTEX_ATTRIB0_4_NV
;
4674 *params
= (GLfloat
) ctx
->Eval
.Map2Attrib
[n
];
4677 #endif /* FEATURE_NV_vertex_program */
4679 #if FEATURE_NV_fragment_program
4680 case GL_FRAGMENT_PROGRAM_NV
:
4681 CHECK_EXTENSION_F(NV_fragment_program
, pname
);
4682 *params
= (GLfloat
) ctx
->FragmentProgram
.Enabled
;
4684 case GL_MAX_TEXTURE_COORDS_NV
:
4685 CHECK_EXTENSION_F(NV_fragment_program
, pname
);
4686 *params
= (GLfloat
) ctx
->Const
.MaxTextureCoordUnits
;
4688 case GL_MAX_TEXTURE_IMAGE_UNITS_NV
:
4689 CHECK_EXTENSION_F(NV_fragment_program
, pname
);
4690 *params
= (GLfloat
) ctx
->Const
.MaxTextureImageUnits
;
4692 case GL_FRAGMENT_PROGRAM_BINDING_NV
:
4693 CHECK_EXTENSION_F(NV_fragment_program
, pname
);
4694 if (ctx
->FragmentProgram
.Current
)
4695 *params
= (GLfloat
) ctx
->FragmentProgram
.Current
->Base
.Id
;
4699 case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV
:
4700 CHECK_EXTENSION_F(NV_fragment_program
, pname
);
4701 *params
= (GLfloat
) MAX_NV_FRAGMENT_PROGRAM_PARAMS
;
4703 #endif /* FEATURE_NV_fragment_program */
4705 /* GL_NV_texture_rectangle */
4706 case GL_TEXTURE_RECTANGLE_NV
:
4707 CHECK_EXTENSION_F(NV_texture_rectangle
, pname
);
4708 *params
= (GLfloat
) _mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV
);
4710 case GL_TEXTURE_BINDING_RECTANGLE_NV
:
4711 CHECK_EXTENSION_F(NV_texture_rectangle
, pname
);
4712 *params
= (GLfloat
) textureUnit
->CurrentRect
->Name
;
4714 case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV
:
4715 CHECK_EXTENSION_F(NV_texture_rectangle
, pname
);
4716 *params
= (GLfloat
) ctx
->Const
.MaxTextureRectSize
;
4719 /* GL_EXT_stencil_two_side */
4720 case GL_STENCIL_TEST_TWO_SIDE_EXT
:
4721 CHECK_EXTENSION_F(EXT_stencil_two_side
, pname
);
4722 *params
= (GLfloat
) ctx
->Stencil
.TestTwoSide
;
4724 case GL_ACTIVE_STENCIL_FACE_EXT
:
4725 CHECK_EXTENSION_F(EXT_stencil_two_side
, pname
);
4726 *params
= (GLfloat
) (ctx
->Stencil
.ActiveFace
? GL_BACK
: GL_FRONT
);
4729 /* GL_NV_light_max_exponent */
4730 case GL_MAX_SHININESS_NV
:
4731 *params
= ctx
->Const
.MaxShininess
;
4733 case GL_MAX_SPOT_EXPONENT_NV
:
4734 *params
= ctx
->Const
.MaxSpotExponent
;
4737 #if FEATURE_ARB_vertex_buffer_object
4738 case GL_ARRAY_BUFFER_BINDING_ARB
:
4739 CHECK_EXTENSION_F(ARB_vertex_buffer_object
, pname
);
4740 *params
= (GLfloat
) ctx
->Array
.ArrayBufferObj
->Name
;
4742 case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB
:
4743 CHECK_EXTENSION_F(ARB_vertex_buffer_object
, pname
);
4744 *params
= (GLfloat
) ctx
->Array
.Vertex
.BufferObj
->Name
;
4746 case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB
:
4747 CHECK_EXTENSION_F(ARB_vertex_buffer_object
, pname
);
4748 *params
= (GLfloat
) ctx
->Array
.Normal
.BufferObj
->Name
;
4750 case GL_COLOR_ARRAY_BUFFER_BINDING_ARB
:
4751 CHECK_EXTENSION_F(ARB_vertex_buffer_object
, pname
);
4752 *params
= (GLfloat
) ctx
->Array
.Color
.BufferObj
->Name
;
4754 case GL_INDEX_ARRAY_BUFFER_BINDING_ARB
:
4755 CHECK_EXTENSION_F(ARB_vertex_buffer_object
, pname
);
4756 *params
= (GLfloat
) ctx
->Array
.Index
.BufferObj
->Name
;
4758 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB
:
4759 CHECK_EXTENSION_F(ARB_vertex_buffer_object
, pname
);
4760 *params
= (GLfloat
) ctx
->Array
.TexCoord
[clientUnit
].BufferObj
->Name
;
4762 case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB
:
4763 CHECK_EXTENSION_F(ARB_vertex_buffer_object
, pname
);
4764 *params
= (GLfloat
) ctx
->Array
.EdgeFlag
.BufferObj
->Name
;
4766 case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB
:
4767 CHECK_EXTENSION_F(ARB_vertex_buffer_object
, pname
);
4768 *params
= (GLfloat
) ctx
->Array
.SecondaryColor
.BufferObj
->Name
;
4770 case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB
:
4771 CHECK_EXTENSION_F(ARB_vertex_buffer_object
, pname
);
4772 *params
= (GLfloat
) ctx
->Array
.FogCoord
.BufferObj
->Name
;
4774 /*case GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB: - not supported */
4775 case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB
:
4776 CHECK_EXTENSION_F(ARB_vertex_buffer_object
, pname
);
4777 *params
= (GLfloat
) ctx
->Array
.ElementArrayBufferObj
->Name
;
4780 #if FEATURE_EXT_pixel_buffer_object
4781 case GL_PIXEL_PACK_BUFFER_BINDING_EXT
:
4782 CHECK_EXTENSION_F(EXT_pixel_buffer_object
, pname
);
4783 *params
= (GLfloat
) ctx
->Pack
.BufferObj
->Name
;
4785 case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT
:
4786 CHECK_EXTENSION_F(EXT_pixel_buffer_object
, pname
);
4787 *params
= (GLfloat
) ctx
->Unpack
.BufferObj
->Name
;
4791 #if FEATURE_ARB_vertex_program
4792 /* GL_NV_vertex_program and GL_ARB_fragment_program define others */
4793 case GL_MAX_VERTEX_ATTRIBS_ARB
:
4794 CHECK_EXTENSION_F(ARB_vertex_program
, pname
);
4795 *params
= (GLfloat
) ctx
->Const
.MaxVertexProgramAttribs
;
4799 #if FEATURE_ARB_fragment_program
4800 case GL_FRAGMENT_PROGRAM_ARB
:
4801 CHECK_EXTENSION_F(ARB_fragment_program
, pname
);
4802 *params
= (GLfloat
) ctx
->FragmentProgram
.Enabled
;
4804 case GL_TRANSPOSE_CURRENT_MATRIX_ARB
:
4805 CHECK_EXTENSION_F(ARB_fragment_program
, pname
);
4806 params
[0] = ctx
->CurrentStack
->Top
->m
[0];
4807 params
[1] = ctx
->CurrentStack
->Top
->m
[4];
4808 params
[2] = ctx
->CurrentStack
->Top
->m
[8];
4809 params
[3] = ctx
->CurrentStack
->Top
->m
[12];
4810 params
[4] = ctx
->CurrentStack
->Top
->m
[1];
4811 params
[5] = ctx
->CurrentStack
->Top
->m
[5];
4812 params
[6] = ctx
->CurrentStack
->Top
->m
[9];
4813 params
[7] = ctx
->CurrentStack
->Top
->m
[13];
4814 params
[8] = ctx
->CurrentStack
->Top
->m
[2];
4815 params
[9] = ctx
->CurrentStack
->Top
->m
[6];
4816 params
[10] = ctx
->CurrentStack
->Top
->m
[10];
4817 params
[11] = ctx
->CurrentStack
->Top
->m
[14];
4818 params
[12] = ctx
->CurrentStack
->Top
->m
[3];
4819 params
[13] = ctx
->CurrentStack
->Top
->m
[7];
4820 params
[14] = ctx
->CurrentStack
->Top
->m
[11];
4821 params
[15] = ctx
->CurrentStack
->Top
->m
[15];
4823 /* Remaining ARB_fragment_program queries alias with
4824 * the GL_NV_fragment_program queries.
4828 /* GL_EXT_depth_bounds_test */
4829 case GL_DEPTH_BOUNDS_TEST_EXT
:
4830 CHECK_EXTENSION_F(EXT_depth_bounds_test
, pname
);
4831 params
[0] = (GLfloat
) ctx
->Depth
.BoundsTest
;
4833 case GL_DEPTH_BOUNDS_EXT
:
4834 CHECK_EXTENSION_F(EXT_depth_bounds_test
, pname
);
4835 params
[0] = ctx
->Depth
.BoundsMin
;
4836 params
[1] = ctx
->Depth
.BoundsMax
;
4839 #if FEATURE_MESA_program_debug
4840 case GL_FRAGMENT_PROGRAM_CALLBACK_MESA
:
4841 CHECK_EXTENSION_F(MESA_program_debug
, pname
);
4842 *params
= (GLfloat
) ctx
->FragmentProgram
.CallbackEnabled
;
4844 case GL_VERTEX_PROGRAM_CALLBACK_MESA
:
4845 CHECK_EXTENSION_F(MESA_program_debug
, pname
);
4846 *params
= (GLfloat
) ctx
->VertexProgram
.CallbackEnabled
;
4848 case GL_FRAGMENT_PROGRAM_POSITION_MESA
:
4849 CHECK_EXTENSION_F(MESA_program_debug
, pname
);
4850 *params
= (GLfloat
) ctx
->FragmentProgram
.CurrentPosition
;
4852 case GL_VERTEX_PROGRAM_POSITION_MESA
:
4853 CHECK_EXTENSION_F(MESA_program_debug
, pname
);
4854 *params
= (GLfloat
) ctx
->VertexProgram
.CurrentPosition
;
4858 case GL_MAX_DRAW_BUFFERS_ARB
:
4859 CHECK_EXTENSION_F(ARB_draw_buffers
, pname
);
4860 *params
= (GLfloat
) ctx
->Const
.MaxDrawBuffers
;
4862 case GL_DRAW_BUFFER0_ARB
:
4863 case GL_DRAW_BUFFER1_ARB
:
4864 case GL_DRAW_BUFFER2_ARB
:
4865 case GL_DRAW_BUFFER3_ARB
:
4866 case GL_DRAW_BUFFER4_ARB
:
4867 case GL_DRAW_BUFFER5_ARB
:
4868 case GL_DRAW_BUFFER6_ARB
:
4869 case GL_DRAW_BUFFER7_ARB
:
4870 case GL_DRAW_BUFFER8_ARB
:
4871 case GL_DRAW_BUFFER9_ARB
:
4872 case GL_DRAW_BUFFER10_ARB
:
4873 case GL_DRAW_BUFFER11_ARB
:
4874 case GL_DRAW_BUFFER12_ARB
:
4875 case GL_DRAW_BUFFER13_ARB
:
4876 case GL_DRAW_BUFFER14_ARB
:
4877 case GL_DRAW_BUFFER15_ARB
:
4878 CHECK_EXTENSION_F(ARB_draw_buffers
, pname
);
4880 GLuint i
= pname
- GL_DRAW_BUFFER0_ARB
;
4881 if (i
>= ctx
->Const
.MaxDrawBuffers
) {
4882 _mesa_error(ctx
, GL_INVALID_ENUM
,
4883 "glGetFloatv(GL_DRAW_BUFFERx_ARB)");
4886 *params
= (GLfloat
) ctx
->Color
.DrawBuffer
[i
];
4891 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv(0x%x)", pname
);
4897 * Get the value(s) of a selected parameter.
4899 * \param pname parameter to be returned.
4900 * \param params will hold the value(s) of the speficifed parameter.
4902 * \sa glGetIntegerv().
4904 * Tries to get the specified parameter via dd_function_table::GetIntegerv,
4905 * otherwise gets the specified parameter from the current context, converting
4906 * it value into GLinteger.
4909 _mesa_GetIntegerv( GLenum pname
, GLint
*params
)
4911 GET_CURRENT_CONTEXT(ctx
);
4913 const GLuint clientUnit
= ctx
->Array
.ActiveTexture
;
4914 const GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
4915 const struct gl_texture_unit
*textureUnit
= &ctx
->Texture
.Unit
[texUnit
];
4916 ASSERT_OUTSIDE_BEGIN_END(ctx
);
4921 if (MESA_VERBOSE
& VERBOSE_API
)
4922 _mesa_debug(ctx
, "glGetIntegerv %s\n", _mesa_lookup_enum_by_nr(pname
));
4924 if (!ctx
->_CurrentProgram
) {
4925 /* We need this in order to get correct results for
4926 * GL_OCCLUSION_TEST_RESULT_HP. There might be other important cases.
4928 FLUSH_VERTICES(ctx
, 0);
4931 if (ctx
->Driver
.GetIntegerv
4932 && (*ctx
->Driver
.GetIntegerv
)(ctx
, pname
, params
))
4936 case GL_ACCUM_RED_BITS
:
4937 *params
= (GLint
) ctx
->Visual
.accumRedBits
;
4939 case GL_ACCUM_GREEN_BITS
:
4940 *params
= (GLint
) ctx
->Visual
.accumGreenBits
;
4942 case GL_ACCUM_BLUE_BITS
:
4943 *params
= (GLint
) ctx
->Visual
.accumBlueBits
;
4945 case GL_ACCUM_ALPHA_BITS
:
4946 *params
= (GLint
) ctx
->Visual
.accumAlphaBits
;
4948 case GL_ACCUM_CLEAR_VALUE
:
4949 params
[0] = FLOAT_TO_INT( ctx
->Accum
.ClearColor
[0] );
4950 params
[1] = FLOAT_TO_INT( ctx
->Accum
.ClearColor
[1] );
4951 params
[2] = FLOAT_TO_INT( ctx
->Accum
.ClearColor
[2] );
4952 params
[3] = FLOAT_TO_INT( ctx
->Accum
.ClearColor
[3] );
4955 *params
= (GLint
) ctx
->Pixel
.AlphaBias
;
4958 *params
= ctx
->Visual
.alphaBits
;
4960 case GL_ALPHA_SCALE
:
4961 *params
= (GLint
) ctx
->Pixel
.AlphaScale
;
4964 *params
= (GLint
) ctx
->Color
.AlphaEnabled
;
4966 case GL_ALPHA_TEST_REF
:
4967 *params
= FLOAT_TO_INT(ctx
->Color
.AlphaRef
);
4969 case GL_ALPHA_TEST_FUNC
:
4970 *params
= (GLint
) ctx
->Color
.AlphaFunc
;
4972 case GL_ATTRIB_STACK_DEPTH
:
4973 *params
= (GLint
) (ctx
->AttribStackDepth
);
4975 case GL_AUTO_NORMAL
:
4976 *params
= (GLint
) ctx
->Eval
.AutoNormal
;
4978 case GL_AUX_BUFFERS
:
4979 *params
= (GLint
) ctx
->Visual
.numAuxBuffers
;
4982 *params
= (GLint
) ctx
->Color
.BlendEnabled
;
4985 *params
= (GLint
) ctx
->Color
.BlendDstRGB
;
4988 *params
= (GLint
) ctx
->Color
.BlendSrcRGB
;
4990 case GL_BLEND_SRC_RGB_EXT
:
4991 *params
= (GLint
) ctx
->Color
.BlendSrcRGB
;
4993 case GL_BLEND_DST_RGB_EXT
:
4994 *params
= (GLint
) ctx
->Color
.BlendDstRGB
;
4996 case GL_BLEND_SRC_ALPHA_EXT
:
4997 *params
= (GLint
) ctx
->Color
.BlendSrcA
;
4999 case GL_BLEND_DST_ALPHA_EXT
:
5000 *params
= (GLint
) ctx
->Color
.BlendDstA
;
5002 case GL_BLEND_EQUATION
:
5003 *params
= (GLint
) ctx
->Color
.BlendEquationRGB
;
5005 case GL_BLEND_EQUATION_ALPHA_EXT
:
5006 *params
= (GLint
) ctx
->Color
.BlendEquationA
;
5008 case GL_BLEND_COLOR_EXT
:
5009 params
[0] = FLOAT_TO_INT( ctx
->Color
.BlendColor
[0] );
5010 params
[1] = FLOAT_TO_INT( ctx
->Color
.BlendColor
[1] );
5011 params
[2] = FLOAT_TO_INT( ctx
->Color
.BlendColor
[2] );
5012 params
[3] = FLOAT_TO_INT( ctx
->Color
.BlendColor
[3] );
5015 *params
= (GLint
) ctx
->Pixel
.BlueBias
;
5018 *params
= (GLint
) ctx
->Visual
.blueBits
;
5021 *params
= (GLint
) ctx
->Pixel
.BlueScale
;
5023 case GL_CLIENT_ATTRIB_STACK_DEPTH
:
5024 *params
= (GLint
) (ctx
->ClientAttribStackDepth
);
5026 case GL_CLIP_PLANE0
:
5027 case GL_CLIP_PLANE1
:
5028 case GL_CLIP_PLANE2
:
5029 case GL_CLIP_PLANE3
:
5030 case GL_CLIP_PLANE4
:
5031 case GL_CLIP_PLANE5
:
5032 if (ctx
->Transform
.ClipPlanesEnabled
& (1 << (pname
- GL_CLIP_PLANE0
)))
5037 case GL_COLOR_CLEAR_VALUE
:
5038 params
[0] = FLOAT_TO_INT( (ctx
->Color
.ClearColor
[0]) );
5039 params
[1] = FLOAT_TO_INT( (ctx
->Color
.ClearColor
[1]) );
5040 params
[2] = FLOAT_TO_INT( (ctx
->Color
.ClearColor
[2]) );
5041 params
[3] = FLOAT_TO_INT( (ctx
->Color
.ClearColor
[3]) );
5043 case GL_COLOR_MATERIAL
:
5044 *params
= (GLint
) ctx
->Light
.ColorMaterialEnabled
;
5046 case GL_COLOR_MATERIAL_FACE
:
5047 *params
= (GLint
) ctx
->Light
.ColorMaterialFace
;
5049 case GL_COLOR_MATERIAL_PARAMETER
:
5050 *params
= (GLint
) ctx
->Light
.ColorMaterialMode
;
5052 case GL_COLOR_WRITEMASK
:
5053 params
[0] = ctx
->Color
.ColorMask
[RCOMP
] ? 1 : 0;
5054 params
[1] = ctx
->Color
.ColorMask
[GCOMP
] ? 1 : 0;
5055 params
[2] = ctx
->Color
.ColorMask
[BCOMP
] ? 1 : 0;
5056 params
[3] = ctx
->Color
.ColorMask
[ACOMP
] ? 1 : 0;
5059 *params
= (GLint
) ctx
->Polygon
.CullFlag
;
5061 case GL_CULL_FACE_MODE
:
5062 *params
= (GLint
) ctx
->Polygon
.CullFaceMode
;
5064 case GL_CURRENT_COLOR
:
5065 FLUSH_CURRENT(ctx
, 0);
5066 params
[0] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][0]);
5067 params
[1] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][1]);
5068 params
[2] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][2]);
5069 params
[3] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
][3]);
5071 case GL_CURRENT_INDEX
:
5072 FLUSH_CURRENT(ctx
, 0);
5073 *params
= (GLint
) ctx
->Current
.Index
;
5075 case GL_CURRENT_NORMAL
:
5076 FLUSH_CURRENT(ctx
, 0);
5077 params
[0] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][0]);
5078 params
[1] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][1]);
5079 params
[2] = FLOAT_TO_INT(ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
][2]);
5081 case GL_CURRENT_RASTER_COLOR
:
5082 params
[0] = FLOAT_TO_INT( ctx
->Current
.RasterColor
[0] );
5083 params
[1] = FLOAT_TO_INT( ctx
->Current
.RasterColor
[1] );
5084 params
[2] = FLOAT_TO_INT( ctx
->Current
.RasterColor
[2] );
5085 params
[3] = FLOAT_TO_INT( ctx
->Current
.RasterColor
[3] );
5087 case GL_CURRENT_RASTER_DISTANCE
:
5088 params
[0] = (GLint
) ctx
->Current
.RasterDistance
;
5090 case GL_CURRENT_RASTER_INDEX
:
5091 *params
= (GLint
) ctx
->Current
.RasterIndex
;
5093 case GL_CURRENT_RASTER_POSITION
:
5094 params
[0] = (GLint
) ctx
->Current
.RasterPos
[0];
5095 params
[1] = (GLint
) ctx
->Current
.RasterPos
[1];
5096 params
[2] = (GLint
) ctx
->Current
.RasterPos
[2];
5097 params
[3] = (GLint
) ctx
->Current
.RasterPos
[3];
5099 case GL_CURRENT_RASTER_TEXTURE_COORDS
:
5100 params
[0] = (GLint
) ctx
->Current
.RasterTexCoords
[texUnit
][0];
5101 params
[1] = (GLint
) ctx
->Current
.RasterTexCoords
[texUnit
][1];
5102 params
[2] = (GLint
) ctx
->Current
.RasterTexCoords
[texUnit
][2];
5103 params
[3] = (GLint
) ctx
->Current
.RasterTexCoords
[texUnit
][3];
5105 case GL_CURRENT_RASTER_POSITION_VALID
:
5106 *params
= (GLint
) ctx
->Current
.RasterPosValid
;
5108 case GL_CURRENT_TEXTURE_COORDS
:
5109 FLUSH_CURRENT(ctx
, 0);
5110 params
[0] = (GLint
) ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][0];
5111 params
[1] = (GLint
) ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][1];
5112 params
[2] = (GLint
) ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][2];
5113 params
[3] = (GLint
) ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ texUnit
][3];
5116 *params
= (GLint
) ctx
->Pixel
.DepthBias
;
5119 *params
= ctx
->Visual
.depthBits
;
5121 case GL_DEPTH_CLEAR_VALUE
:
5122 *params
= (GLint
) ctx
->Depth
.Clear
;
5125 *params
= (GLint
) ctx
->Depth
.Func
;
5127 case GL_DEPTH_RANGE
:
5128 params
[0] = (GLint
) ctx
->Viewport
.Near
;
5129 params
[1] = (GLint
) ctx
->Viewport
.Far
;
5131 case GL_DEPTH_SCALE
:
5132 *params
= (GLint
) ctx
->Pixel
.DepthScale
;
5135 *params
= (GLint
) ctx
->Depth
.Test
;
5137 case GL_DEPTH_WRITEMASK
:
5138 *params
= (GLint
) ctx
->Depth
.Mask
;
5141 *params
= (GLint
) ctx
->Color
.DitherFlag
;
5143 case GL_DOUBLEBUFFER
:
5144 *params
= (GLint
) ctx
->Visual
.doubleBufferMode
;
5146 case GL_DRAW_BUFFER
:
5147 *params
= (GLint
) ctx
->Color
.DrawBuffer
[0];
5150 FLUSH_CURRENT(ctx
, 0);
5151 *params
= (GLint
) ctx
->Current
.EdgeFlag
;
5153 case GL_FEEDBACK_BUFFER_SIZE
:
5154 *params
= ctx
->Feedback
.BufferSize
;
5156 case GL_FEEDBACK_BUFFER_TYPE
:
5157 *params
= ctx
->Feedback
.Type
;
5160 *params
= (GLint
) ctx
->Fog
.Enabled
;
5163 params
[0] = FLOAT_TO_INT( ctx
->Fog
.Color
[0] );
5164 params
[1] = FLOAT_TO_INT( ctx
->Fog
.Color
[1] );
5165 params
[2] = FLOAT_TO_INT( ctx
->Fog
.Color
[2] );
5166 params
[3] = FLOAT_TO_INT( ctx
->Fog
.Color
[3] );
5168 case GL_FOG_DENSITY
:
5169 *params
= (GLint
) ctx
->Fog
.Density
;
5172 *params
= (GLint
) ctx
->Fog
.End
;
5175 *params
= (GLint
) ctx
->Hint
.Fog
;
5178 *params
= (GLint
) ctx
->Fog
.Index
;
5181 *params
= (GLint
) ctx
->Fog
.Mode
;
5184 *params
= (GLint
) ctx
->Fog
.Start
;
5187 *params
= (GLint
) ctx
->Polygon
.FrontFace
;
5190 *params
= (GLint
) ctx
->Pixel
.GreenBias
;
5193 *params
= (GLint
) ctx
->Visual
.greenBits
;
5195 case GL_GREEN_SCALE
:
5196 *params
= (GLint
) ctx
->Pixel
.GreenScale
;
5199 *params
= (GLint
) ctx
->Visual
.indexBits
;
5201 case GL_INDEX_CLEAR_VALUE
:
5202 *params
= (GLint
) ctx
->Color
.ClearIndex
;
5205 *params
= ctx
->Visual
.rgbMode
? 0 : 1;
5207 case GL_INDEX_OFFSET
:
5208 *params
= ctx
->Pixel
.IndexOffset
;
5210 case GL_INDEX_SHIFT
:
5211 *params
= ctx
->Pixel
.IndexShift
;
5213 case GL_INDEX_WRITEMASK
:
5214 *params
= (GLint
) ctx
->Color
.IndexMask
;
5224 *params
= (GLint
) ctx
->Light
.Light
[pname
-GL_LIGHT0
].Enabled
;
5227 *params
= (GLint
) ctx
->Light
.Enabled
;
5229 case GL_LIGHT_MODEL_AMBIENT
:
5230 params
[0] = FLOAT_TO_INT( ctx
->Light
.Model
.Ambient
[0] );
5231 params
[1] = FLOAT_TO_INT( ctx
->Light
.Model
.Ambient
[1] );
5232 params
[2] = FLOAT_TO_INT( ctx
->Light
.Model
.Ambient
[2] );
5233 params
[3] = FLOAT_TO_INT( ctx
->Light
.Model
.Ambient
[3] );
5235 case GL_LIGHT_MODEL_COLOR_CONTROL
:
5236 params
[0] = (GLint
) ctx
->Light
.Model
.ColorControl
;
5238 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
5239 *params
= (GLint
) ctx
->Light
.Model
.LocalViewer
;
5241 case GL_LIGHT_MODEL_TWO_SIDE
:
5242 *params
= (GLint
) ctx
->Light
.Model
.TwoSide
;
5244 case GL_LINE_SMOOTH
:
5245 *params
= (GLint
) ctx
->Line
.SmoothFlag
;
5247 case GL_LINE_SMOOTH_HINT
:
5248 *params
= (GLint
) ctx
->Hint
.LineSmooth
;
5250 case GL_LINE_STIPPLE
:
5251 *params
= (GLint
) ctx
->Line
.StippleFlag
;
5253 case GL_LINE_STIPPLE_PATTERN
:
5254 *params
= (GLint
) ctx
->Line
.StipplePattern
;
5256 case GL_LINE_STIPPLE_REPEAT
:
5257 *params
= (GLint
) ctx
->Line
.StippleFactor
;
5260 *params
= (GLint
) ctx
->Line
.Width
;
5262 case GL_LINE_WIDTH_GRANULARITY
:
5263 *params
= (GLint
) ctx
->Const
.LineWidthGranularity
;
5265 case GL_LINE_WIDTH_RANGE
:
5266 params
[0] = (GLint
) ctx
->Const
.MinLineWidthAA
;
5267 params
[1] = (GLint
) ctx
->Const
.MaxLineWidthAA
;
5269 case GL_ALIASED_LINE_WIDTH_RANGE
:
5270 params
[0] = (GLint
) ctx
->Const
.MinLineWidth
;
5271 params
[1] = (GLint
) ctx
->Const
.MaxLineWidth
;
5274 *params
= (GLint
) ctx
->List
.ListBase
;
5277 *params
= (GLint
) ctx
->ListState
.CurrentListNum
;
5280 if (!ctx
->CompileFlag
)
5282 else if (ctx
->ExecuteFlag
)
5283 *params
= (GLint
) GL_COMPILE_AND_EXECUTE
;
5285 *params
= (GLint
) GL_COMPILE
;
5287 case GL_INDEX_LOGIC_OP
:
5288 *params
= (GLint
) ctx
->Color
.IndexLogicOpEnabled
;
5290 case GL_COLOR_LOGIC_OP
:
5291 *params
= (GLint
) ctx
->Color
.ColorLogicOpEnabled
;
5293 case GL_LOGIC_OP_MODE
:
5294 *params
= (GLint
) ctx
->Color
.LogicOp
;
5296 case GL_MAP1_COLOR_4
:
5297 *params
= (GLint
) ctx
->Eval
.Map1Color4
;
5299 case GL_MAP1_GRID_DOMAIN
:
5300 params
[0] = (GLint
) ctx
->Eval
.MapGrid1u1
;
5301 params
[1] = (GLint
) ctx
->Eval
.MapGrid1u2
;
5303 case GL_MAP1_GRID_SEGMENTS
:
5304 *params
= (GLint
) ctx
->Eval
.MapGrid1un
;
5307 *params
= (GLint
) ctx
->Eval
.Map1Index
;
5309 case GL_MAP1_NORMAL
:
5310 *params
= (GLint
) ctx
->Eval
.Map1Normal
;
5312 case GL_MAP1_TEXTURE_COORD_1
:
5313 *params
= (GLint
) ctx
->Eval
.Map1TextureCoord1
;
5315 case GL_MAP1_TEXTURE_COORD_2
:
5316 *params
= (GLint
) ctx
->Eval
.Map1TextureCoord2
;
5318 case GL_MAP1_TEXTURE_COORD_3
:
5319 *params
= (GLint
) ctx
->Eval
.Map1TextureCoord3
;
5321 case GL_MAP1_TEXTURE_COORD_4
:
5322 *params
= (GLint
) ctx
->Eval
.Map1TextureCoord4
;
5324 case GL_MAP1_VERTEX_3
:
5325 *params
= (GLint
) ctx
->Eval
.Map1Vertex3
;
5327 case GL_MAP1_VERTEX_4
:
5328 *params
= (GLint
) ctx
->Eval
.Map1Vertex4
;
5330 case GL_MAP2_COLOR_4
:
5331 *params
= (GLint
) ctx
->Eval
.Map2Color4
;
5333 case GL_MAP2_GRID_DOMAIN
:
5334 params
[0] = (GLint
) ctx
->Eval
.MapGrid2u1
;
5335 params
[1] = (GLint
) ctx
->Eval
.MapGrid2u2
;
5336 params
[2] = (GLint
) ctx
->Eval
.MapGrid2v1
;
5337 params
[3] = (GLint
) ctx
->Eval
.MapGrid2v2
;
5339 case GL_MAP2_GRID_SEGMENTS
:
5340 params
[0] = (GLint
) ctx
->Eval
.MapGrid2un
;
5341 params
[1] = (GLint
) ctx
->Eval
.MapGrid2vn
;
5344 *params
= (GLint
) ctx
->Eval
.Map2Index
;
5346 case GL_MAP2_NORMAL
:
5347 *params
= (GLint
) ctx
->Eval
.Map2Normal
;
5349 case GL_MAP2_TEXTURE_COORD_1
:
5350 *params
= (GLint
) ctx
->Eval
.Map2TextureCoord1
;
5352 case GL_MAP2_TEXTURE_COORD_2
:
5353 *params
= (GLint
) ctx
->Eval
.Map2TextureCoord2
;
5355 case GL_MAP2_TEXTURE_COORD_3
:
5356 *params
= (GLint
) ctx
->Eval
.Map2TextureCoord3
;
5358 case GL_MAP2_TEXTURE_COORD_4
:
5359 *params
= (GLint
) ctx
->Eval
.Map2TextureCoord4
;
5361 case GL_MAP2_VERTEX_3
:
5362 *params
= (GLint
) ctx
->Eval
.Map2Vertex3
;
5364 case GL_MAP2_VERTEX_4
:
5365 *params
= (GLint
) ctx
->Eval
.Map2Vertex4
;
5368 *params
= (GLint
) ctx
->Pixel
.MapColorFlag
;
5370 case GL_MAP_STENCIL
:
5371 *params
= (GLint
) ctx
->Pixel
.MapStencilFlag
;
5373 case GL_MATRIX_MODE
:
5374 *params
= (GLint
) ctx
->Transform
.MatrixMode
;
5376 case GL_MAX_ATTRIB_STACK_DEPTH
:
5377 *params
= (GLint
) MAX_ATTRIB_STACK_DEPTH
;
5379 case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
:
5380 *params
= (GLint
) MAX_CLIENT_ATTRIB_STACK_DEPTH
;
5382 case GL_MAX_CLIP_PLANES
:
5383 *params
= (GLint
) ctx
->Const
.MaxClipPlanes
;
5385 case GL_MAX_ELEMENTS_VERTICES
: /* GL_VERSION_1_2 */
5386 *params
= (GLint
) ctx
->Const
.MaxArrayLockSize
;
5388 case GL_MAX_ELEMENTS_INDICES
: /* GL_VERSION_1_2 */
5389 *params
= (GLint
) ctx
->Const
.MaxArrayLockSize
;
5391 case GL_MAX_EVAL_ORDER
:
5392 *params
= (GLint
) MAX_EVAL_ORDER
;
5395 *params
= (GLint
) ctx
->Const
.MaxLights
;
5397 case GL_MAX_LIST_NESTING
:
5398 *params
= (GLint
) MAX_LIST_NESTING
;
5400 case GL_MAX_MODELVIEW_STACK_DEPTH
:
5401 *params
= (GLint
) MAX_MODELVIEW_STACK_DEPTH
;
5403 case GL_MAX_NAME_STACK_DEPTH
:
5404 *params
= (GLint
) MAX_NAME_STACK_DEPTH
;
5406 case GL_MAX_PIXEL_MAP_TABLE
:
5407 *params
= (GLint
) MAX_PIXEL_MAP_TABLE
;
5409 case GL_MAX_PROJECTION_STACK_DEPTH
:
5410 *params
= (GLint
) MAX_PROJECTION_STACK_DEPTH
;
5412 case GL_MAX_TEXTURE_SIZE
:
5413 *params
= (1 << (ctx
->Const
.MaxTextureLevels
- 1));
5415 case GL_MAX_3D_TEXTURE_SIZE
:
5416 *params
= (1 << (ctx
->Const
.Max3DTextureLevels
- 1));
5418 case GL_MAX_TEXTURE_STACK_DEPTH
:
5419 *params
= (GLint
) MAX_TEXTURE_STACK_DEPTH
;
5421 case GL_MAX_VIEWPORT_DIMS
:
5422 params
[0] = (GLint
) MAX_WIDTH
;
5423 params
[1] = (GLint
) MAX_HEIGHT
;
5425 case GL_MODELVIEW_MATRIX
:
5426 for (i
=0;i
<16;i
++) {
5427 params
[i
] = (GLint
) ctx
->ModelviewMatrixStack
.Top
->m
[i
];
5430 case GL_MODELVIEW_STACK_DEPTH
:
5431 *params
= (GLint
) (ctx
->ModelviewMatrixStack
.Depth
+ 1);
5433 case GL_NAME_STACK_DEPTH
:
5434 *params
= (GLint
) ctx
->Select
.NameStackDepth
;
5437 *params
= (GLint
) ctx
->Transform
.Normalize
;
5439 case GL_PACK_ALIGNMENT
:
5440 *params
= ctx
->Pack
.Alignment
;
5442 case GL_PACK_LSB_FIRST
:
5443 *params
= (GLint
) ctx
->Pack
.LsbFirst
;
5445 case GL_PACK_ROW_LENGTH
:
5446 *params
= ctx
->Pack
.RowLength
;
5448 case GL_PACK_SKIP_PIXELS
:
5449 *params
= ctx
->Pack
.SkipPixels
;
5451 case GL_PACK_SKIP_ROWS
:
5452 *params
= ctx
->Pack
.SkipRows
;
5454 case GL_PACK_SWAP_BYTES
:
5455 *params
= (GLint
) ctx
->Pack
.SwapBytes
;
5457 case GL_PACK_SKIP_IMAGES_EXT
:
5458 *params
= ctx
->Pack
.SkipImages
;
5460 case GL_PACK_IMAGE_HEIGHT_EXT
:
5461 *params
= ctx
->Pack
.ImageHeight
;
5463 case GL_PACK_INVERT_MESA
:
5464 *params
= ctx
->Pack
.Invert
;
5466 case GL_PERSPECTIVE_CORRECTION_HINT
:
5467 *params
= (GLint
) ctx
->Hint
.PerspectiveCorrection
;
5469 case GL_PIXEL_MAP_A_TO_A_SIZE
:
5470 *params
= ctx
->Pixel
.MapAtoAsize
;
5472 case GL_PIXEL_MAP_B_TO_B_SIZE
:
5473 *params
= ctx
->Pixel
.MapBtoBsize
;
5475 case GL_PIXEL_MAP_G_TO_G_SIZE
:
5476 *params
= ctx
->Pixel
.MapGtoGsize
;
5478 case GL_PIXEL_MAP_I_TO_A_SIZE
:
5479 *params
= ctx
->Pixel
.MapItoAsize
;
5481 case GL_PIXEL_MAP_I_TO_B_SIZE
:
5482 *params
= ctx
->Pixel
.MapItoBsize
;
5484 case GL_PIXEL_MAP_I_TO_G_SIZE
:
5485 *params
= ctx
->Pixel
.MapItoGsize
;
5487 case GL_PIXEL_MAP_I_TO_I_SIZE
:
5488 *params
= ctx
->Pixel
.MapItoIsize
;
5490 case GL_PIXEL_MAP_I_TO_R_SIZE
:
5491 *params
= ctx
->Pixel
.MapItoRsize
;
5493 case GL_PIXEL_MAP_R_TO_R_SIZE
:
5494 *params
= ctx
->Pixel
.MapRtoRsize
;
5496 case GL_PIXEL_MAP_S_TO_S_SIZE
:
5497 *params
= ctx
->Pixel
.MapStoSsize
;
5500 *params
= (GLint
) ctx
->Point
.Size
;
5502 case GL_POINT_SIZE_GRANULARITY
:
5503 *params
= (GLint
) ctx
->Const
.PointSizeGranularity
;
5505 case GL_POINT_SIZE_RANGE
:
5506 params
[0] = (GLint
) ctx
->Const
.MinPointSizeAA
;
5507 params
[1] = (GLint
) ctx
->Const
.MaxPointSizeAA
;
5509 case GL_ALIASED_POINT_SIZE_RANGE
:
5510 params
[0] = (GLint
) ctx
->Const
.MinPointSize
;
5511 params
[1] = (GLint
) ctx
->Const
.MaxPointSize
;
5513 case GL_POINT_SMOOTH
:
5514 *params
= (GLint
) ctx
->Point
.SmoothFlag
;
5516 case GL_POINT_SMOOTH_HINT
:
5517 *params
= (GLint
) ctx
->Hint
.PointSmooth
;
5519 case GL_POINT_SIZE_MIN_EXT
:
5520 *params
= (GLint
) (ctx
->Point
.MinSize
);
5522 case GL_POINT_SIZE_MAX_EXT
:
5523 *params
= (GLint
) (ctx
->Point
.MaxSize
);
5525 case GL_POINT_FADE_THRESHOLD_SIZE_EXT
:
5526 *params
= (GLint
) (ctx
->Point
.Threshold
);
5528 case GL_DISTANCE_ATTENUATION_EXT
:
5529 params
[0] = (GLint
) (ctx
->Point
.Params
[0]);
5530 params
[1] = (GLint
) (ctx
->Point
.Params
[1]);
5531 params
[2] = (GLint
) (ctx
->Point
.Params
[2]);
5533 case GL_POLYGON_MODE
:
5534 params
[0] = (GLint
) ctx
->Polygon
.FrontMode
;
5535 params
[1] = (GLint
) ctx
->Polygon
.BackMode
;
5537 case GL_POLYGON_OFFSET_BIAS_EXT
: /* GL_EXT_polygon_offset */
5538 *params
= (GLint
) ctx
->Polygon
.OffsetUnits
;
5540 case GL_POLYGON_OFFSET_FACTOR
:
5541 *params
= (GLint
) ctx
->Polygon
.OffsetFactor
;
5543 case GL_POLYGON_OFFSET_UNITS
:
5544 *params
= (GLint
) ctx
->Polygon
.OffsetUnits
;
5546 case GL_POLYGON_SMOOTH
:
5547 *params
= (GLint
) ctx
->Polygon
.SmoothFlag
;
5549 case GL_POLYGON_SMOOTH_HINT
:
5550 *params
= (GLint
) ctx
->Hint
.PolygonSmooth
;
5552 case GL_POLYGON_STIPPLE
:
5553 *params
= (GLint
) ctx
->Polygon
.StippleFlag
;
5555 case GL_PROJECTION_MATRIX
:
5556 for (i
=0;i
<16;i
++) {
5557 params
[i
] = (GLint
) ctx
->ProjectionMatrixStack
.Top
->m
[i
];
5560 case GL_PROJECTION_STACK_DEPTH
:
5561 *params
= (GLint
) (ctx
->ProjectionMatrixStack
.Depth
+ 1);
5563 case GL_READ_BUFFER
:
5564 *params
= (GLint
) ctx
->Pixel
.ReadBuffer
;
5567 *params
= (GLint
) ctx
->Pixel
.RedBias
;
5570 *params
= (GLint
) ctx
->Visual
.redBits
;
5573 *params
= (GLint
) ctx
->Pixel
.RedScale
;
5575 case GL_RENDER_MODE
:
5576 *params
= (GLint
) ctx
->RenderMode
;
5578 case GL_RESCALE_NORMAL
:
5579 *params
= (GLint
) ctx
->Transform
.RescaleNormals
;
5582 *params
= (GLint
) ctx
->Visual
.rgbMode
;
5584 case GL_SCISSOR_BOX
:
5585 params
[0] = (GLint
) ctx
->Scissor
.X
;
5586 params
[1] = (GLint
) ctx
->Scissor
.Y
;
5587 params
[2] = (GLint
) ctx
->Scissor
.Width
;
5588 params
[3] = (GLint
) ctx
->Scissor
.Height
;
5590 case GL_SCISSOR_TEST
:
5591 *params
= (GLint
) ctx
->Scissor
.Enabled
;
5593 case GL_SELECTION_BUFFER_SIZE
:
5594 *params
= (GLint
) ctx
->Select
.BufferSize
;
5596 case GL_SHADE_MODEL
:
5597 *params
= (GLint
) ctx
->Light
.ShadeModel
;
5599 case GL_SHARED_TEXTURE_PALETTE_EXT
:
5600 *params
= (GLint
) ctx
->Texture
.SharedPalette
;
5602 case GL_STENCIL_BITS
:
5603 *params
= ctx
->Visual
.stencilBits
;
5605 case GL_STENCIL_CLEAR_VALUE
:
5606 *params
= (GLint
) ctx
->Stencil
.Clear
;
5608 case GL_STENCIL_FAIL
:
5609 *params
= (GLint
) ctx
->Stencil
.FailFunc
[ctx
->Stencil
.ActiveFace
];
5611 case GL_STENCIL_FUNC
:
5612 *params
= (GLint
) ctx
->Stencil
.Function
[ctx
->Stencil
.ActiveFace
];
5614 case GL_STENCIL_PASS_DEPTH_FAIL
:
5615 *params
= (GLint
) ctx
->Stencil
.ZFailFunc
[ctx
->Stencil
.ActiveFace
];
5617 case GL_STENCIL_PASS_DEPTH_PASS
:
5618 *params
= (GLint
) ctx
->Stencil
.ZPassFunc
[ctx
->Stencil
.ActiveFace
];
5620 case GL_STENCIL_REF
:
5621 *params
= (GLint
) ctx
->Stencil
.Ref
[ctx
->Stencil
.ActiveFace
];
5623 case GL_STENCIL_TEST
:
5624 *params
= (GLint
) ctx
->Stencil
.Enabled
;
5626 case GL_STENCIL_VALUE_MASK
:
5627 *params
= (GLint
) ctx
->Stencil
.ValueMask
[ctx
->Stencil
.ActiveFace
];
5629 case GL_STENCIL_WRITEMASK
:
5630 *params
= (GLint
) ctx
->Stencil
.WriteMask
[ctx
->Stencil
.ActiveFace
];
5633 *params
= (GLint
) ctx
->Visual
.stereoMode
;
5635 case GL_SUBPIXEL_BITS
:
5636 *params
= ctx
->Const
.SubPixelBits
;
5639 *params
= _mesa_IsEnabled(GL_TEXTURE_1D
) ? 1 : 0;
5642 *params
= _mesa_IsEnabled(GL_TEXTURE_2D
) ? 1 : 0;
5645 *params
= _mesa_IsEnabled(GL_TEXTURE_3D
) ? 1 : 0;
5647 case GL_TEXTURE_BINDING_1D
:
5648 *params
= textureUnit
->Current1D
->Name
;
5650 case GL_TEXTURE_BINDING_2D
:
5651 *params
= textureUnit
->Current2D
->Name
;
5653 case GL_TEXTURE_BINDING_3D
:
5654 *params
= textureUnit
->Current3D
->Name
;
5656 case GL_TEXTURE_ENV_COLOR
:
5657 params
[0] = FLOAT_TO_INT( textureUnit
->EnvColor
[0] );
5658 params
[1] = FLOAT_TO_INT( textureUnit
->EnvColor
[1] );
5659 params
[2] = FLOAT_TO_INT( textureUnit
->EnvColor
[2] );
5660 params
[3] = FLOAT_TO_INT( textureUnit
->EnvColor
[3] );
5662 case GL_TEXTURE_ENV_MODE
:
5663 *params
= (GLint
) textureUnit
->EnvMode
;
5665 case GL_TEXTURE_GEN_S
:
5666 *params
= (textureUnit
->TexGenEnabled
& S_BIT
) ? 1 : 0;
5668 case GL_TEXTURE_GEN_T
:
5669 *params
= (textureUnit
->TexGenEnabled
& T_BIT
) ? 1 : 0;
5671 case GL_TEXTURE_GEN_R
:
5672 *params
= (textureUnit
->TexGenEnabled
& R_BIT
) ? 1 : 0;
5674 case GL_TEXTURE_GEN_Q
:
5675 *params
= (textureUnit
->TexGenEnabled
& Q_BIT
) ? 1 : 0;
5677 case GL_TEXTURE_MATRIX
:
5678 for (i
=0;i
<16;i
++) {
5679 params
[i
] = (GLint
) ctx
->TextureMatrixStack
[texUnit
].Top
->m
[i
];
5682 case GL_TEXTURE_STACK_DEPTH
:
5683 *params
= (GLint
) (ctx
->TextureMatrixStack
[texUnit
].Depth
+ 1);
5685 case GL_UNPACK_ALIGNMENT
:
5686 *params
= ctx
->Unpack
.Alignment
;
5688 case GL_UNPACK_LSB_FIRST
:
5689 *params
= (GLint
) ctx
->Unpack
.LsbFirst
;
5691 case GL_UNPACK_ROW_LENGTH
:
5692 *params
= ctx
->Unpack
.RowLength
;
5694 case GL_UNPACK_SKIP_PIXELS
:
5695 *params
= ctx
->Unpack
.SkipPixels
;
5697 case GL_UNPACK_SKIP_ROWS
:
5698 *params
= ctx
->Unpack
.SkipRows
;
5700 case GL_UNPACK_SWAP_BYTES
:
5701 *params
= (GLint
) ctx
->Unpack
.SwapBytes
;
5703 case GL_UNPACK_SKIP_IMAGES_EXT
:
5704 *params
= ctx
->Unpack
.SkipImages
;
5706 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
5707 *params
= ctx
->Unpack
.ImageHeight
;
5709 case GL_UNPACK_CLIENT_STORAGE_APPLE
:
5710 *params
= ctx
->Unpack
.ClientStorage
;
5713 params
[0] = (GLint
) ctx
->Viewport
.X
;
5714 params
[1] = (GLint
) ctx
->Viewport
.Y
;
5715 params
[2] = (GLint
) ctx
->Viewport
.Width
;
5716 params
[3] = (GLint
) ctx
->Viewport
.Height
;
5719 *params
= (GLint
) ctx
->Pixel
.ZoomX
;
5722 *params
= (GLint
) ctx
->Pixel
.ZoomY
;
5724 case GL_VERTEX_ARRAY
:
5725 *params
= (GLint
) ctx
->Array
.Vertex
.Enabled
;
5727 case GL_VERTEX_ARRAY_SIZE
:
5728 *params
= ctx
->Array
.Vertex
.Size
;
5730 case GL_VERTEX_ARRAY_TYPE
:
5731 *params
= ctx
->Array
.Vertex
.Type
;
5733 case GL_VERTEX_ARRAY_STRIDE
:
5734 *params
= ctx
->Array
.Vertex
.Stride
;
5736 case GL_VERTEX_ARRAY_COUNT_EXT
:
5739 case GL_NORMAL_ARRAY
:
5740 *params
= (GLint
) ctx
->Array
.Normal
.Enabled
;
5742 case GL_NORMAL_ARRAY_TYPE
:
5743 *params
= ctx
->Array
.Normal
.Type
;
5745 case GL_NORMAL_ARRAY_STRIDE
:
5746 *params
= ctx
->Array
.Normal
.Stride
;
5748 case GL_NORMAL_ARRAY_COUNT_EXT
:
5751 case GL_COLOR_ARRAY
:
5752 *params
= (GLint
) ctx
->Array
.Color
.Enabled
;
5754 case GL_COLOR_ARRAY_SIZE
:
5755 *params
= ctx
->Array
.Color
.Size
;
5757 case GL_COLOR_ARRAY_TYPE
:
5758 *params
= ctx
->Array
.Color
.Type
;
5760 case GL_COLOR_ARRAY_STRIDE
:
5761 *params
= ctx
->Array
.Color
.Stride
;
5763 case GL_COLOR_ARRAY_COUNT_EXT
:
5766 case GL_INDEX_ARRAY
:
5767 *params
= (GLint
) ctx
->Array
.Index
.Enabled
;
5769 case GL_INDEX_ARRAY_TYPE
:
5770 *params
= ctx
->Array
.Index
.Type
;
5772 case GL_INDEX_ARRAY_STRIDE
:
5773 *params
= ctx
->Array
.Index
.Stride
;
5775 case GL_INDEX_ARRAY_COUNT_EXT
:
5778 case GL_TEXTURE_COORD_ARRAY
:
5779 *params
= (GLint
) ctx
->Array
.TexCoord
[clientUnit
].Enabled
;
5781 case GL_TEXTURE_COORD_ARRAY_SIZE
:
5782 *params
= ctx
->Array
.TexCoord
[clientUnit
].Size
;
5784 case GL_TEXTURE_COORD_ARRAY_TYPE
:
5785 *params
= ctx
->Array
.TexCoord
[clientUnit
].Type
;
5787 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
5788 *params
= ctx
->Array
.TexCoord
[clientUnit
].Stride
;
5790 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
5793 case GL_EDGE_FLAG_ARRAY
:
5794 *params
= (GLint
) ctx
->Array
.EdgeFlag
.Enabled
;
5796 case GL_EDGE_FLAG_ARRAY_STRIDE
:
5797 *params
= ctx
->Array
.EdgeFlag
.Stride
;
5799 case GL_EDGE_FLAG_ARRAY_COUNT_EXT
:
5803 /* GL_ARB_multitexture */
5804 case GL_MAX_TEXTURE_UNITS_ARB
:
5805 CHECK_EXTENSION_I(ARB_multitexture
, pname
);
5806 *params
= MIN2(ctx
->Const
.MaxTextureImageUnits
,
5807 ctx
->Const
.MaxTextureCoordUnits
);
5809 case GL_ACTIVE_TEXTURE_ARB
:
5810 CHECK_EXTENSION_I(ARB_multitexture
, pname
);
5811 *params
= GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
;
5813 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
5814 CHECK_EXTENSION_I(ARB_multitexture
, pname
);
5815 *params
= GL_TEXTURE0_ARB
+ clientUnit
;
5818 /* GL_ARB_texture_cube_map */
5819 case GL_TEXTURE_CUBE_MAP_ARB
:
5820 CHECK_EXTENSION_I(ARB_texture_cube_map
, pname
);
5821 *params
= (GLint
) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
);
5823 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
5824 CHECK_EXTENSION_I(ARB_texture_cube_map
, pname
);
5825 *params
= textureUnit
->CurrentCubeMap
->Name
;
5827 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
5828 CHECK_EXTENSION_I(ARB_texture_cube_map
, pname
);
5829 *params
= (1 << (ctx
->Const
.MaxCubeTextureLevels
- 1));
5832 /* GL_ARB_texture_compression */
5833 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
5834 CHECK_EXTENSION_I(ARB_texture_compression
, pname
);
5835 *params
= (GLint
) ctx
->Hint
.TextureCompression
;
5837 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
5838 CHECK_EXTENSION_I(ARB_texture_compression
, pname
);
5839 *params
= (GLint
) _mesa_get_compressed_formats(ctx
, NULL
);
5841 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
5842 CHECK_EXTENSION_I(ARB_texture_compression
, pname
);
5843 (void) _mesa_get_compressed_formats(ctx
, params
);
5846 /* GL_EXT_compiled_vertex_array */
5847 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
5848 CHECK_EXTENSION_I(EXT_compiled_vertex_array
, pname
);
5849 *params
= ctx
->Array
.LockFirst
;
5851 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
5852 CHECK_EXTENSION_I(EXT_compiled_vertex_array
, pname
);
5853 *params
= ctx
->Array
.LockCount
;
5856 /* GL_ARB_transpose_matrix */
5857 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
5861 _math_transposef(tm
, ctx
->ColorMatrixStack
.Top
->m
);
5862 for (i
=0;i
<16;i
++) {
5863 params
[i
] = (GLint
) tm
[i
];
5867 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
5871 _math_transposef(tm
, ctx
->ModelviewMatrixStack
.Top
->m
);
5872 for (i
=0;i
<16;i
++) {
5873 params
[i
] = (GLint
) tm
[i
];
5877 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
5881 _math_transposef(tm
, ctx
->ProjectionMatrixStack
.Top
->m
);
5882 for (i
=0;i
<16;i
++) {
5883 params
[i
] = (GLint
) tm
[i
];
5887 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
5891 _math_transposef(tm
, ctx
->TextureMatrixStack
[texUnit
].Top
->m
);
5892 for (i
=0;i
<16;i
++) {
5893 params
[i
] = (GLint
) tm
[i
];
5898 /* GL_HP_occlusion_test */
5899 case GL_OCCLUSION_TEST_HP
:
5900 CHECK_EXTENSION_I(HP_occlusion_test
, pname
);
5901 *params
= (GLint
) ctx
->Depth
.OcclusionTest
;
5903 case GL_OCCLUSION_TEST_RESULT_HP
:
5904 CHECK_EXTENSION_I(HP_occlusion_test
, pname
);
5905 if (ctx
->Depth
.OcclusionTest
)
5906 *params
= (GLint
) ctx
->OcclusionResult
;
5908 *params
= (GLint
) ctx
->OcclusionResultSaved
;
5909 /* reset flag now */
5910 ctx
->OcclusionResult
= GL_FALSE
;
5911 ctx
->OcclusionResultSaved
= GL_FALSE
;
5914 /* GL_SGIS_pixel_texture */
5915 case GL_PIXEL_TEXTURE_SGIS
:
5916 CHECK_EXTENSION_I(SGIS_pixel_texture
, pname
);
5917 *params
= (GLint
) ctx
->Pixel
.PixelTextureEnabled
;
5920 /* GL_SGIX_pixel_texture */
5921 case GL_PIXEL_TEX_GEN_SGIX
:
5922 CHECK_EXTENSION_I(SGIX_pixel_texture
, pname
);
5923 *params
= (GLint
) ctx
->Pixel
.PixelTextureEnabled
;
5925 case GL_PIXEL_TEX_GEN_MODE_SGIX
:
5926 CHECK_EXTENSION_I(SGIX_pixel_texture
, pname
);
5927 *params
= (GLint
) pixel_texgen_mode(ctx
);
5930 /* GL_SGI_color_matrix (also in 1.2 imaging) */
5931 case GL_COLOR_MATRIX_SGI
:
5932 CHECK_EXTENSION_I(SGI_color_matrix
, pname
);
5933 for (i
=0;i
<16;i
++) {
5934 params
[i
] = (GLint
) ctx
->ColorMatrixStack
.Top
->m
[i
];
5937 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
5938 CHECK_EXTENSION_I(SGI_color_matrix
, pname
);
5939 *params
= ctx
->ColorMatrixStack
.Depth
+ 1;
5941 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
5942 CHECK_EXTENSION_I(SGI_color_matrix
, pname
);
5943 *params
= MAX_COLOR_STACK_DEPTH
;
5945 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
5946 CHECK_EXTENSION_I(SGI_color_matrix
, pname
);
5947 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixScale
[0];
5949 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
5950 CHECK_EXTENSION_I(SGI_color_matrix
, pname
);
5951 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixScale
[1];
5953 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
5954 CHECK_EXTENSION_I(SGI_color_matrix
, pname
);
5955 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixScale
[2];
5957 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
5958 CHECK_EXTENSION_I(SGI_color_matrix
, pname
);
5959 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixScale
[3];
5961 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
5962 CHECK_EXTENSION_I(SGI_color_matrix
, pname
);
5963 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixBias
[0];
5965 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
5966 CHECK_EXTENSION_I(SGI_color_matrix
, pname
);
5967 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixBias
[1];
5969 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
5970 CHECK_EXTENSION_I(SGI_color_matrix
, pname
);
5971 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixBias
[2];
5973 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
5974 CHECK_EXTENSION_I(SGI_color_matrix
, pname
);
5975 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixBias
[3];
5978 /* GL_EXT_convolution (also in 1.2 imaging) */
5979 case GL_CONVOLUTION_1D_EXT
:
5980 CHECK_EXTENSION_I(EXT_convolution
, pname
);
5981 *params
= (GLint
) ctx
->Pixel
.Convolution1DEnabled
;
5983 case GL_CONVOLUTION_2D
:
5984 CHECK_EXTENSION_I(EXT_convolution
, pname
);
5985 *params
= (GLint
) ctx
->Pixel
.Convolution2DEnabled
;
5987 case GL_SEPARABLE_2D
:
5988 CHECK_EXTENSION_I(EXT_convolution
, pname
);
5989 *params
= (GLint
) ctx
->Pixel
.Separable2DEnabled
;
5991 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
5992 CHECK_EXTENSION_I(EXT_convolution
, pname
);
5993 *params
= (GLint
) ctx
->Pixel
.PostConvolutionScale
[0];
5995 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
5996 CHECK_EXTENSION_I(EXT_convolution
, pname
);
5997 *params
= (GLint
) ctx
->Pixel
.PostConvolutionScale
[1];
5999 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
6000 CHECK_EXTENSION_I(EXT_convolution
, pname
);
6001 *params
= (GLint
) ctx
->Pixel
.PostConvolutionScale
[2];
6003 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
6004 CHECK_EXTENSION_I(EXT_convolution
, pname
);
6005 *params
= (GLint
) ctx
->Pixel
.PostConvolutionScale
[3];
6007 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
6008 CHECK_EXTENSION_I(EXT_convolution
, pname
);
6009 *params
= (GLint
) ctx
->Pixel
.PostConvolutionBias
[0];
6011 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
6012 CHECK_EXTENSION_I(EXT_convolution
, pname
);
6013 *params
= (GLint
) ctx
->Pixel
.PostConvolutionBias
[1];
6015 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
6016 CHECK_EXTENSION_I(EXT_convolution
, pname
);
6017 *params
= (GLint
) ctx
->Pixel
.PostConvolutionBias
[2];
6019 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
6020 CHECK_EXTENSION_I(EXT_convolution
, pname
);
6021 *params
= (GLint
) ctx
->Pixel
.PostConvolutionBias
[2];
6024 /* GL_EXT_histogram (also in 1.2 imaging) */
6026 CHECK_EXTENSION_I(EXT_histogram
, pname
);
6027 *params
= (GLint
) ctx
->Pixel
.HistogramEnabled
;
6030 CHECK_EXTENSION_I(EXT_histogram
, pname
);
6031 *params
= (GLint
) ctx
->Pixel
.MinMaxEnabled
;
6034 /* GL_SGI_color_table (also in 1.2 imaging */
6035 case GL_COLOR_TABLE_SGI
:
6036 CHECK_EXTENSION_I(SGI_color_table
, pname
);
6037 *params
= (GLint
) ctx
->Pixel
.ColorTableEnabled
;
6039 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
6040 CHECK_EXTENSION_I(SGI_color_table
, pname
);
6041 *params
= (GLint
) ctx
->Pixel
.PostConvolutionColorTableEnabled
;
6043 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
6044 CHECK_EXTENSION_I(SGI_color_table
, pname
);
6045 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixColorTableEnabled
;
6048 /* GL_SGI_texture_color_table */
6049 case GL_TEXTURE_COLOR_TABLE_SGI
:
6050 CHECK_EXTENSION_I(SGI_texture_color_table
, pname
);
6051 *params
= (GLint
) textureUnit
->ColorTableEnabled
;
6054 /* GL_EXT_secondary_color */
6055 case GL_COLOR_SUM_EXT
:
6056 CHECK_EXTENSION_I(EXT_secondary_color
, pname
);
6057 *params
= (GLint
) ctx
->Fog
.ColorSumEnabled
;
6059 case GL_CURRENT_SECONDARY_COLOR_EXT
:
6060 CHECK_EXTENSION_I(EXT_secondary_color
, pname
);
6061 FLUSH_CURRENT(ctx
, 0);
6062 params
[0] = FLOAT_TO_INT( (ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][0]) );
6063 params
[1] = FLOAT_TO_INT( (ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][1]) );
6064 params
[2] = FLOAT_TO_INT( (ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][2]) );
6065 params
[3] = FLOAT_TO_INT( (ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
][3]) );
6067 case GL_SECONDARY_COLOR_ARRAY_EXT
:
6068 CHECK_EXTENSION_I(EXT_secondary_color
, pname
);
6069 *params
= (GLint
) ctx
->Array
.SecondaryColor
.Enabled
;
6071 case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT
:
6072 CHECK_EXTENSION_I(EXT_secondary_color
, pname
);
6073 *params
= (GLint
) ctx
->Array
.SecondaryColor
.Type
;
6075 case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT
:
6076 CHECK_EXTENSION_I(EXT_secondary_color
, pname
);
6077 *params
= (GLint
) ctx
->Array
.SecondaryColor
.Stride
;
6079 case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT
:
6080 CHECK_EXTENSION_I(EXT_secondary_color
, pname
);
6081 *params
= (GLint
) ctx
->Array
.SecondaryColor
.Size
;
6084 /* GL_EXT_fog_coord */
6085 case GL_CURRENT_FOG_COORDINATE_EXT
:
6086 CHECK_EXTENSION_I(EXT_fog_coord
, pname
);
6087 FLUSH_CURRENT(ctx
, 0);
6088 *params
= (GLint
) ctx
->Current
.Attrib
[VERT_ATTRIB_FOG
][0];
6090 case GL_FOG_COORDINATE_ARRAY_EXT
:
6091 CHECK_EXTENSION_I(EXT_fog_coord
, pname
);
6092 *params
= (GLint
) ctx
->Array
.FogCoord
.Enabled
;
6094 case GL_FOG_COORDINATE_ARRAY_TYPE_EXT
:
6095 CHECK_EXTENSION_I(EXT_fog_coord
, pname
);
6096 *params
= (GLint
) ctx
->Array
.FogCoord
.Type
;
6098 case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
:
6099 CHECK_EXTENSION_I(EXT_fog_coord
, pname
);
6100 *params
= (GLint
) ctx
->Array
.FogCoord
.Stride
;
6102 case GL_FOG_COORDINATE_SOURCE_EXT
:
6103 CHECK_EXTENSION_I(EXT_fog_coord
, pname
);
6104 *params
= (GLint
) ctx
->Fog
.FogCoordinateSource
;
6107 /* GL_EXT_texture_lod_bias */
6108 case GL_MAX_TEXTURE_LOD_BIAS_EXT
:
6109 *params
= (GLint
) ctx
->Const
.MaxTextureLodBias
;
6112 /* GL_EXT_texture_filter_anisotropic */
6113 case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
:
6114 CHECK_EXTENSION_I(EXT_texture_filter_anisotropic
, pname
);
6115 *params
= (GLint
) ctx
->Const
.MaxTextureMaxAnisotropy
;
6118 /* GL_ARB_multisample */
6119 case GL_MULTISAMPLE_ARB
:
6120 CHECK_EXTENSION_I(ARB_multisample
, pname
);
6121 *params
= (GLint
) ctx
->Multisample
.Enabled
;
6123 case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB
:
6124 CHECK_EXTENSION_I(ARB_multisample
, pname
);
6125 *params
= (GLint
) ctx
->Multisample
.SampleAlphaToCoverage
;
6127 case GL_SAMPLE_ALPHA_TO_ONE_ARB
:
6128 CHECK_EXTENSION_I(ARB_multisample
, pname
);
6129 *params
= (GLint
) ctx
->Multisample
.SampleAlphaToOne
;
6131 case GL_SAMPLE_COVERAGE_ARB
:
6132 CHECK_EXTENSION_I(ARB_multisample
, pname
);
6133 *params
= (GLint
) ctx
->Multisample
.SampleCoverage
;
6135 case GL_SAMPLE_COVERAGE_VALUE_ARB
:
6136 CHECK_EXTENSION_I(ARB_multisample
, pname
);
6137 *params
= (GLint
) ctx
->Multisample
.SampleCoverageValue
;
6139 case GL_SAMPLE_COVERAGE_INVERT_ARB
:
6140 CHECK_EXTENSION_I(ARB_multisample
, pname
);
6141 *params
= (GLint
) ctx
->Multisample
.SampleCoverageInvert
;
6143 case GL_SAMPLE_BUFFERS_ARB
:
6144 CHECK_EXTENSION_I(ARB_multisample
, pname
);
6145 *params
= 0; /* XXX fix someday */
6147 case GL_SAMPLES_ARB
:
6148 CHECK_EXTENSION_I(ARB_multisample
, pname
);
6149 *params
= 0; /* XXX fix someday */
6152 /* GL_IBM_rasterpos_clip */
6153 case GL_RASTER_POSITION_UNCLIPPED_IBM
:
6154 CHECK_EXTENSION_I(IBM_rasterpos_clip
, pname
);
6155 *params
= (GLint
) ctx
->Transform
.RasterPositionUnclipped
;
6158 /* GL_NV_point_sprite */
6159 case GL_POINT_SPRITE_NV
:
6160 CHECK_EXTENSION2_I(NV_point_sprite
, ARB_point_sprite
, pname
);
6161 *params
= (GLint
) ctx
->Point
.PointSprite
;
6163 case GL_POINT_SPRITE_R_MODE_NV
:
6164 CHECK_EXTENSION_I(NV_point_sprite
, pname
);
6165 *params
= (GLint
) ctx
->Point
.SpriteRMode
;
6167 case GL_POINT_SPRITE_COORD_ORIGIN
:
6168 CHECK_EXTENSION_I(ARB_point_sprite
, pname
);
6169 *params
= (GLint
) ctx
->Point
.SpriteOrigin
;
6172 /* GL_SGIS_generate_mipmap */
6173 case GL_GENERATE_MIPMAP_HINT_SGIS
:
6174 CHECK_EXTENSION_I(SGIS_generate_mipmap
, pname
);
6175 *params
= (GLint
) ctx
->Hint
.GenerateMipmap
;
6178 #if FEATURE_NV_vertex_program
6179 case GL_VERTEX_PROGRAM_NV
:
6180 CHECK_EXTENSION_I(NV_vertex_program
, pname
);
6181 *params
= (GLint
) ctx
->VertexProgram
.Enabled
;
6183 case GL_VERTEX_PROGRAM_POINT_SIZE_NV
:
6184 CHECK_EXTENSION_I(NV_vertex_program
, pname
);
6185 *params
= (GLint
) ctx
->VertexProgram
.PointSizeEnabled
;
6187 case GL_VERTEX_PROGRAM_TWO_SIDE_NV
:
6188 CHECK_EXTENSION_I(NV_vertex_program
, pname
);
6189 *params
= (GLint
) ctx
->VertexProgram
.TwoSideEnabled
;
6191 case GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV
:
6192 CHECK_EXTENSION_I(NV_vertex_program
, pname
);
6193 *params
= ctx
->Const
.MaxProgramMatrixStackDepth
;
6195 case GL_MAX_TRACK_MATRICES_NV
:
6196 CHECK_EXTENSION_I(NV_vertex_program
, pname
);
6197 *params
= ctx
->Const
.MaxProgramMatrices
;
6199 case GL_CURRENT_MATRIX_STACK_DEPTH_NV
:
6200 CHECK_EXTENSION_I(NV_vertex_program
, pname
);
6201 *params
= ctx
->CurrentStack
->Depth
+ 1;
6203 case GL_CURRENT_MATRIX_NV
:
6204 CHECK_EXTENSION_I(NV_vertex_program
, pname
);
6205 for (i
= 0; i
< 16; i
++)
6206 params
[i
] = (GLint
) ctx
->CurrentStack
->Top
->m
[i
];
6208 case GL_VERTEX_PROGRAM_BINDING_NV
:
6209 CHECK_EXTENSION_I(NV_vertex_program
, pname
);
6210 if (ctx
->VertexProgram
.Current
)
6211 *params
= (GLint
) ctx
->VertexProgram
.Current
->Base
.Id
;
6215 case GL_PROGRAM_ERROR_POSITION_NV
:
6216 CHECK_EXTENSION_I(NV_vertex_program
, pname
);
6217 *params
= (GLint
) ctx
->Program
.ErrorPos
;
6219 case GL_VERTEX_ATTRIB_ARRAY0_NV
:
6220 case GL_VERTEX_ATTRIB_ARRAY1_NV
:
6221 case GL_VERTEX_ATTRIB_ARRAY2_NV
:
6222 case GL_VERTEX_ATTRIB_ARRAY3_NV
:
6223 case GL_VERTEX_ATTRIB_ARRAY4_NV
:
6224 case GL_VERTEX_ATTRIB_ARRAY5_NV
:
6225 case GL_VERTEX_ATTRIB_ARRAY6_NV
:
6226 case GL_VERTEX_ATTRIB_ARRAY7_NV
:
6227 case GL_VERTEX_ATTRIB_ARRAY8_NV
:
6228 case GL_VERTEX_ATTRIB_ARRAY9_NV
:
6229 case GL_VERTEX_ATTRIB_ARRAY10_NV
:
6230 case GL_VERTEX_ATTRIB_ARRAY11_NV
:
6231 case GL_VERTEX_ATTRIB_ARRAY12_NV
:
6232 case GL_VERTEX_ATTRIB_ARRAY13_NV
:
6233 case GL_VERTEX_ATTRIB_ARRAY14_NV
:
6234 case GL_VERTEX_ATTRIB_ARRAY15_NV
:
6235 CHECK_EXTENSION_I(NV_vertex_program
, pname
);
6237 GLuint n
= (GLuint
) pname
- GL_VERTEX_ATTRIB_ARRAY0_NV
;
6238 *params
= (GLint
) ctx
->Array
.VertexAttrib
[n
].Enabled
;
6241 case GL_MAP1_VERTEX_ATTRIB0_4_NV
:
6242 case GL_MAP1_VERTEX_ATTRIB1_4_NV
:
6243 case GL_MAP1_VERTEX_ATTRIB2_4_NV
:
6244 case GL_MAP1_VERTEX_ATTRIB3_4_NV
:
6245 case GL_MAP1_VERTEX_ATTRIB4_4_NV
:
6246 case GL_MAP1_VERTEX_ATTRIB5_4_NV
:
6247 case GL_MAP1_VERTEX_ATTRIB6_4_NV
:
6248 case GL_MAP1_VERTEX_ATTRIB7_4_NV
:
6249 case GL_MAP1_VERTEX_ATTRIB8_4_NV
:
6250 case GL_MAP1_VERTEX_ATTRIB9_4_NV
:
6251 case GL_MAP1_VERTEX_ATTRIB10_4_NV
:
6252 case GL_MAP1_VERTEX_ATTRIB11_4_NV
:
6253 case GL_MAP1_VERTEX_ATTRIB12_4_NV
:
6254 case GL_MAP1_VERTEX_ATTRIB13_4_NV
:
6255 case GL_MAP1_VERTEX_ATTRIB14_4_NV
:
6256 case GL_MAP1_VERTEX_ATTRIB15_4_NV
:
6257 CHECK_EXTENSION_I(NV_vertex_program
, pname
);
6259 GLuint n
= (GLuint
) pname
- GL_MAP1_VERTEX_ATTRIB0_4_NV
;
6260 *params
= (GLint
) ctx
->Eval
.Map1Attrib
[n
];
6263 case GL_MAP2_VERTEX_ATTRIB0_4_NV
:
6264 case GL_MAP2_VERTEX_ATTRIB1_4_NV
:
6265 case GL_MAP2_VERTEX_ATTRIB2_4_NV
:
6266 case GL_MAP2_VERTEX_ATTRIB3_4_NV
:
6267 case GL_MAP2_VERTEX_ATTRIB4_4_NV
:
6268 case GL_MAP2_VERTEX_ATTRIB5_4_NV
:
6269 case GL_MAP2_VERTEX_ATTRIB6_4_NV
:
6270 case GL_MAP2_VERTEX_ATTRIB7_4_NV
:
6271 case GL_MAP2_VERTEX_ATTRIB8_4_NV
:
6272 case GL_MAP2_VERTEX_ATTRIB9_4_NV
:
6273 case GL_MAP2_VERTEX_ATTRIB10_4_NV
:
6274 case GL_MAP2_VERTEX_ATTRIB11_4_NV
:
6275 case GL_MAP2_VERTEX_ATTRIB12_4_NV
:
6276 case GL_MAP2_VERTEX_ATTRIB13_4_NV
:
6277 case GL_MAP2_VERTEX_ATTRIB14_4_NV
:
6278 case GL_MAP2_VERTEX_ATTRIB15_4_NV
:
6279 CHECK_EXTENSION_I(NV_vertex_program
, pname
);
6281 GLuint n
= (GLuint
) pname
- GL_MAP2_VERTEX_ATTRIB0_4_NV
;
6282 *params
= (GLint
) ctx
->Eval
.Map2Attrib
[n
];
6285 #endif /* FEATURE_NV_vertex_program */
6287 #if FEATURE_NV_fragment_program
6288 case GL_FRAGMENT_PROGRAM_NV
:
6289 CHECK_EXTENSION_I(NV_fragment_program
, pname
);
6290 *params
= (GLint
) ctx
->FragmentProgram
.Enabled
;
6292 case GL_MAX_TEXTURE_COORDS_NV
:
6293 CHECK_EXTENSION_I(NV_fragment_program
, pname
);
6294 *params
= (GLint
) ctx
->Const
.MaxTextureCoordUnits
;
6296 case GL_MAX_TEXTURE_IMAGE_UNITS_NV
:
6297 CHECK_EXTENSION_I(NV_fragment_program
, pname
);
6298 *params
= (GLint
) ctx
->Const
.MaxTextureImageUnits
;
6300 case GL_FRAGMENT_PROGRAM_BINDING_NV
:
6301 CHECK_EXTENSION_I(NV_fragment_program
, pname
);
6302 if (ctx
->FragmentProgram
.Current
)
6303 *params
= (GLint
) ctx
->FragmentProgram
.Current
->Base
.Id
;
6307 case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV
:
6308 CHECK_EXTENSION_I(NV_fragment_program
, pname
);
6309 *params
= MAX_NV_FRAGMENT_PROGRAM_PARAMS
;
6311 #endif /* FEATURE_NV_fragment_program */
6313 /* GL_NV_texture_rectangle */
6314 case GL_TEXTURE_RECTANGLE_NV
:
6315 CHECK_EXTENSION_I(NV_texture_rectangle
, pname
);
6316 *params
= (GLint
) _mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV
);
6318 case GL_TEXTURE_BINDING_RECTANGLE_NV
:
6319 CHECK_EXTENSION_I(NV_texture_rectangle
, pname
);
6320 *params
= (GLint
) textureUnit
->CurrentRect
->Name
;
6322 case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV
:
6323 CHECK_EXTENSION_I(NV_texture_rectangle
, pname
);
6324 *params
= (GLint
) ctx
->Const
.MaxTextureRectSize
;
6327 /* GL_EXT_stencil_two_side */
6328 case GL_STENCIL_TEST_TWO_SIDE_EXT
:
6329 CHECK_EXTENSION_I(EXT_stencil_two_side
, pname
);
6330 *params
= (GLint
) ctx
->Stencil
.TestTwoSide
;
6332 case GL_ACTIVE_STENCIL_FACE_EXT
:
6333 CHECK_EXTENSION_I(EXT_stencil_two_side
, pname
);
6334 *params
= (GLint
) (ctx
->Stencil
.ActiveFace
? GL_BACK
: GL_FRONT
);
6337 /* GL_NV_light_max_exponent */
6338 case GL_MAX_SHININESS_NV
:
6339 *params
= (GLint
) ctx
->Const
.MaxShininess
;
6341 case GL_MAX_SPOT_EXPONENT_NV
:
6342 *params
= (GLint
) ctx
->Const
.MaxSpotExponent
;
6345 #if FEATURE_ARB_vertex_buffer_object
6346 case GL_ARRAY_BUFFER_BINDING_ARB
:
6347 CHECK_EXTENSION_I(ARB_vertex_buffer_object
, pname
);
6348 *params
= (GLint
) ctx
->Array
.ArrayBufferObj
->Name
;
6350 case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB
:
6351 CHECK_EXTENSION_I(ARB_vertex_buffer_object
, pname
);
6352 *params
= (GLint
) ctx
->Array
.Vertex
.BufferObj
->Name
;
6354 case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB
:
6355 CHECK_EXTENSION_I(ARB_vertex_buffer_object
, pname
);
6356 *params
= (GLint
) ctx
->Array
.Normal
.BufferObj
->Name
;
6358 case GL_COLOR_ARRAY_BUFFER_BINDING_ARB
:
6359 CHECK_EXTENSION_I(ARB_vertex_buffer_object
, pname
);
6360 *params
= (GLint
) ctx
->Array
.Color
.BufferObj
->Name
;
6362 case GL_INDEX_ARRAY_BUFFER_BINDING_ARB
:
6363 CHECK_EXTENSION_I(ARB_vertex_buffer_object
, pname
);
6364 *params
= (GLint
) ctx
->Array
.Index
.BufferObj
->Name
;
6366 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB
:
6367 CHECK_EXTENSION_I(ARB_vertex_buffer_object
, pname
);
6368 *params
= (GLint
) ctx
->Array
.TexCoord
[clientUnit
].BufferObj
->Name
;
6370 case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB
:
6371 CHECK_EXTENSION_I(ARB_vertex_buffer_object
, pname
);
6372 *params
= (GLint
) ctx
->Array
.EdgeFlag
.BufferObj
->Name
;
6374 case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB
:
6375 CHECK_EXTENSION_I(ARB_vertex_buffer_object
, pname
);
6376 *params
= (GLint
) ctx
->Array
.SecondaryColor
.BufferObj
->Name
;
6378 case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB
:
6379 CHECK_EXTENSION_I(ARB_vertex_buffer_object
, pname
);
6380 *params
= (GLint
) ctx
->Array
.FogCoord
.BufferObj
->Name
;
6382 /*case GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB: - not supported */
6383 case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB
:
6384 CHECK_EXTENSION_I(ARB_vertex_buffer_object
, pname
);
6385 *params
= (GLint
) ctx
->Array
.ElementArrayBufferObj
->Name
;
6388 #if FEATURE_EXT_pixel_buffer_object
6389 case GL_PIXEL_PACK_BUFFER_BINDING_EXT
:
6390 CHECK_EXTENSION_I(EXT_pixel_buffer_object
, pname
);
6391 *params
= (GLint
) ctx
->Pack
.BufferObj
->Name
;
6393 case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT
:
6394 CHECK_EXTENSION_I(EXT_pixel_buffer_object
, pname
);
6395 *params
= (GLint
) ctx
->Unpack
.BufferObj
->Name
;
6399 #if FEATURE_ARB_vertex_program
6400 /* GL_NV_vertex_program and GL_ARB_fragment_program define others */
6401 case GL_MAX_VERTEX_ATTRIBS_ARB
:
6402 CHECK_EXTENSION_I(ARB_vertex_program
, pname
);
6403 *params
= (GLint
) ctx
->Const
.MaxVertexProgramAttribs
;
6407 #if FEATURE_ARB_fragment_program
6408 case GL_FRAGMENT_PROGRAM_ARB
:
6409 CHECK_EXTENSION_I(ARB_fragment_program
, pname
);
6410 *params
= ctx
->FragmentProgram
.Enabled
;
6412 case GL_TRANSPOSE_CURRENT_MATRIX_ARB
:
6413 CHECK_EXTENSION_I(ARB_fragment_program
, pname
);
6414 params
[0] = (GLint
) ctx
->CurrentStack
->Top
->m
[0];
6415 params
[1] = (GLint
) ctx
->CurrentStack
->Top
->m
[4];
6416 params
[2] = (GLint
) ctx
->CurrentStack
->Top
->m
[8];
6417 params
[3] = (GLint
) ctx
->CurrentStack
->Top
->m
[12];
6418 params
[4] = (GLint
) ctx
->CurrentStack
->Top
->m
[1];
6419 params
[5] = (GLint
) ctx
->CurrentStack
->Top
->m
[5];
6420 params
[6] = (GLint
) ctx
->CurrentStack
->Top
->m
[9];
6421 params
[7] = (GLint
) ctx
->CurrentStack
->Top
->m
[13];
6422 params
[8] = (GLint
) ctx
->CurrentStack
->Top
->m
[2];
6423 params
[9] = (GLint
) ctx
->CurrentStack
->Top
->m
[6];
6424 params
[10] = (GLint
) ctx
->CurrentStack
->Top
->m
[10];
6425 params
[11] = (GLint
) ctx
->CurrentStack
->Top
->m
[14];
6426 params
[12] = (GLint
) ctx
->CurrentStack
->Top
->m
[3];
6427 params
[13] = (GLint
) ctx
->CurrentStack
->Top
->m
[7];
6428 params
[14] = (GLint
) ctx
->CurrentStack
->Top
->m
[11];
6429 params
[15] = (GLint
) ctx
->CurrentStack
->Top
->m
[15];
6431 /* Remaining ARB_fragment_program queries alias with
6432 * the GL_NV_fragment_program queries.
6436 /* GL_EXT_depth_bounds_test */
6437 case GL_DEPTH_BOUNDS_TEST_EXT
:
6438 CHECK_EXTENSION_I(EXT_depth_bounds_test
, pname
);
6439 params
[0] = ctx
->Depth
.BoundsTest
;
6441 case GL_DEPTH_BOUNDS_EXT
:
6442 CHECK_EXTENSION_I(EXT_depth_bounds_test
, pname
);
6443 params
[0] = (GLint
) ctx
->Depth
.BoundsMin
;
6444 params
[1] = (GLint
) ctx
->Depth
.BoundsMax
;
6447 #if FEATURE_MESA_program_debug
6448 case GL_FRAGMENT_PROGRAM_CALLBACK_MESA
:
6449 CHECK_EXTENSION_I(MESA_program_debug
, pname
);
6450 *params
= (GLint
) ctx
->FragmentProgram
.CallbackEnabled
;
6452 case GL_VERTEX_PROGRAM_CALLBACK_MESA
:
6453 CHECK_EXTENSION_I(MESA_program_debug
, pname
);
6454 *params
= (GLint
) ctx
->VertexProgram
.CallbackEnabled
;
6456 case GL_FRAGMENT_PROGRAM_POSITION_MESA
:
6457 CHECK_EXTENSION_I(MESA_program_debug
, pname
);
6458 *params
= (GLint
) ctx
->FragmentProgram
.CurrentPosition
;
6460 case GL_VERTEX_PROGRAM_POSITION_MESA
:
6461 CHECK_EXTENSION_I(MESA_program_debug
, pname
);
6462 *params
= (GLint
) ctx
->VertexProgram
.CurrentPosition
;
6466 case GL_MAX_DRAW_BUFFERS_ARB
:
6467 CHECK_EXTENSION_I(ARB_draw_buffers
, pname
);
6468 *params
= ctx
->Const
.MaxDrawBuffers
;
6470 case GL_DRAW_BUFFER0_ARB
:
6471 case GL_DRAW_BUFFER1_ARB
:
6472 case GL_DRAW_BUFFER2_ARB
:
6473 case GL_DRAW_BUFFER3_ARB
:
6474 case GL_DRAW_BUFFER4_ARB
:
6475 case GL_DRAW_BUFFER5_ARB
:
6476 case GL_DRAW_BUFFER6_ARB
:
6477 case GL_DRAW_BUFFER7_ARB
:
6478 case GL_DRAW_BUFFER8_ARB
:
6479 case GL_DRAW_BUFFER9_ARB
:
6480 case GL_DRAW_BUFFER10_ARB
:
6481 case GL_DRAW_BUFFER11_ARB
:
6482 case GL_DRAW_BUFFER12_ARB
:
6483 case GL_DRAW_BUFFER13_ARB
:
6484 case GL_DRAW_BUFFER14_ARB
:
6485 case GL_DRAW_BUFFER15_ARB
:
6486 CHECK_EXTENSION_I(ARB_draw_buffers
, pname
);
6488 GLuint i
= pname
- GL_DRAW_BUFFER0_ARB
;
6489 if (i
>= ctx
->Const
.MaxDrawBuffers
) {
6490 _mesa_error(ctx
, GL_INVALID_ENUM
,
6491 "glGetIntegerv(GL_DRAW_BUFFERx_ARB)");
6494 *params
= (GLint
) ctx
->Color
.DrawBuffer
[i
];
6499 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv(pname=0x%x)", pname
);
6505 * Get the address of a selected pointer.
6507 * \param pname array or buffer to be returned.
6508 * \param params will hold the pointer speficifed by \p pname.
6510 * \sa glGetPointerv().
6512 * Tries to get the specified pointer via dd_function_table::GetPointerv,
6513 * otherwise gets the specified pointer from the current context.
6516 _mesa_GetPointerv( GLenum pname
, GLvoid
**params
)
6518 GET_CURRENT_CONTEXT(ctx
);
6519 const GLuint clientUnit
= ctx
->Array
.ActiveTexture
;
6520 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6525 if (MESA_VERBOSE
& VERBOSE_API
)
6526 _mesa_debug(ctx
, "glGetPointerv %s\n", _mesa_lookup_enum_by_nr(pname
));
6528 if (ctx
->Driver
.GetPointerv
6529 && (*ctx
->Driver
.GetPointerv
)(ctx
, pname
, params
))
6533 case GL_VERTEX_ARRAY_POINTER
:
6534 *params
= (GLvoid
*) ctx
->Array
.Vertex
.Ptr
;
6536 case GL_NORMAL_ARRAY_POINTER
:
6537 *params
= (GLvoid
*) ctx
->Array
.Normal
.Ptr
;
6539 case GL_COLOR_ARRAY_POINTER
:
6540 *params
= (GLvoid
*) ctx
->Array
.Color
.Ptr
;
6542 case GL_SECONDARY_COLOR_ARRAY_POINTER_EXT
:
6543 *params
= (GLvoid
*) ctx
->Array
.SecondaryColor
.Ptr
;
6545 case GL_FOG_COORDINATE_ARRAY_POINTER_EXT
:
6546 *params
= (GLvoid
*) ctx
->Array
.FogCoord
.Ptr
;
6548 case GL_INDEX_ARRAY_POINTER
:
6549 *params
= (GLvoid
*) ctx
->Array
.Index
.Ptr
;
6551 case GL_TEXTURE_COORD_ARRAY_POINTER
:
6552 *params
= (GLvoid
*) ctx
->Array
.TexCoord
[clientUnit
].Ptr
;
6554 case GL_EDGE_FLAG_ARRAY_POINTER
:
6555 *params
= (GLvoid
*) ctx
->Array
.EdgeFlag
.Ptr
;
6557 case GL_FEEDBACK_BUFFER_POINTER
:
6558 *params
= ctx
->Feedback
.Buffer
;
6560 case GL_SELECTION_BUFFER_POINTER
:
6561 *params
= ctx
->Select
.Buffer
;
6563 #if FEATURE_MESA_program_debug
6564 case GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA
:
6565 if (!ctx
->Extensions
.MESA_program_debug
) {
6566 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetPointerv");
6569 *params
= *(GLvoid
**) &ctx
->FragmentProgram
.Callback
;
6571 case GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA
:
6572 if (!ctx
->Extensions
.MESA_program_debug
) {
6573 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetPointerv");
6576 *params
= ctx
->FragmentProgram
.CallbackData
;
6578 case GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA
:
6579 if (!ctx
->Extensions
.MESA_program_debug
) {
6580 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetPointerv");
6583 *params
= *(GLvoid
**) &ctx
->VertexProgram
.Callback
;
6585 case GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA
:
6586 if (!ctx
->Extensions
.MESA_program_debug
) {
6587 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetPointerv");
6590 *params
= ctx
->VertexProgram
.CallbackData
;
6594 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetPointerv" );
6601 * Get a string describing the current GL connection.
6603 * \param name name symbolic constant.
6605 * \sa glGetString().
6607 * Tries to get the string from dd_function_table::GetString, otherwise returns
6608 * the hardcoded strings.
6610 const GLubyte
* GLAPIENTRY
6611 _mesa_GetString( GLenum name
)
6613 GET_CURRENT_CONTEXT(ctx
);
6614 static const char *vendor
= "Brian Paul";
6615 static const char *renderer
= "Mesa";
6616 static const char *version_1_2
= "1.2 Mesa " MESA_VERSION_STRING
;
6617 static const char *version_1_3
= "1.3 Mesa " MESA_VERSION_STRING
;
6618 static const char *version_1_4
= "1.4 Mesa " MESA_VERSION_STRING
;
6619 static const char *version_1_5
= "1.5 Mesa " MESA_VERSION_STRING
;
6620 static const char *version_2_0
= "1.5 Mesa " MESA_VERSION_STRING
;/*XXX FIX*/
6622 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
6624 /* this is a required driver function */
6625 assert(ctx
->Driver
.GetString
);
6627 const GLubyte
*str
= (*ctx
->Driver
.GetString
)(ctx
, name
);
6633 return (const GLubyte
*) vendor
;
6635 return (const GLubyte
*) renderer
;
6637 if (ctx
->Extensions
.ARB_multisample
&&
6638 ctx
->Extensions
.ARB_multitexture
&&
6639 ctx
->Extensions
.ARB_texture_border_clamp
&&
6640 ctx
->Extensions
.ARB_texture_compression
&&
6641 ctx
->Extensions
.ARB_texture_cube_map
&&
6642 ctx
->Extensions
.EXT_texture_env_add
&&
6643 ctx
->Extensions
.ARB_texture_env_combine
&&
6644 ctx
->Extensions
.ARB_texture_env_dot3
) {
6645 if (ctx
->Extensions
.ARB_depth_texture
&&
6646 ctx
->Extensions
.ARB_shadow
&&
6647 ctx
->Extensions
.ARB_texture_env_crossbar
&&
6648 ctx
->Extensions
.ARB_texture_mirrored_repeat
&&
6649 ctx
->Extensions
.ARB_window_pos
&&
6650 ctx
->Extensions
.EXT_blend_color
&&
6651 ctx
->Extensions
.EXT_blend_func_separate
&&
6652 ctx
->Extensions
.EXT_blend_logic_op
&&
6653 ctx
->Extensions
.EXT_blend_minmax
&&
6654 ctx
->Extensions
.EXT_blend_subtract
&&
6655 ctx
->Extensions
.EXT_fog_coord
&&
6656 ctx
->Extensions
.EXT_multi_draw_arrays
&&
6657 ctx
->Extensions
.EXT_point_parameters
&& /*aka ARB*/
6658 ctx
->Extensions
.EXT_secondary_color
&&
6659 ctx
->Extensions
.EXT_stencil_wrap
&&
6660 ctx
->Extensions
.EXT_texture_lod_bias
&&
6661 ctx
->Extensions
.SGIS_generate_mipmap
) {
6662 if (ctx
->Extensions
.ARB_occlusion_query
&&
6663 ctx
->Extensions
.ARB_vertex_buffer_object
&&
6664 ctx
->Extensions
.EXT_shadow_funcs
) {
6665 if (ctx
->Extensions
.ARB_draw_buffers
&&
6666 ctx
->Extensions
.ARB_point_sprite
&&
6667 ctx
->Extensions
.ARB_texture_non_power_of_two
&&
6668 ctx
->Extensions
.EXT_stencil_two_side
) {
6669 return (const GLubyte
*) version_2_0
;
6672 return (const GLubyte
*) version_1_5
;
6676 return (const GLubyte
*) version_1_4
;
6680 return (const GLubyte
*) version_1_3
;
6684 return (const GLubyte
*) version_1_2
;
6687 if (!ctx
->Extensions
.String
)
6688 ctx
->Extensions
.String
= _mesa_make_extension_string(ctx
);
6689 return (const GLubyte
*) ctx
->Extensions
.String
;
6690 #if FEATURE_NV_fragment_program
6691 case GL_PROGRAM_ERROR_STRING_NV
:
6692 if (ctx
->Extensions
.NV_fragment_program
) {
6693 return (const GLubyte
*) ctx
->Program
.ErrorString
;
6698 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetString" );
6699 return (const GLubyte
*) 0;
6706 * Execute a glGetError() command.
6708 * \return error number.
6710 * Returns __GLcontextRec::ErrorValue.
6713 _mesa_GetError( void )
6715 GET_CURRENT_CONTEXT(ctx
);
6716 GLenum e
= ctx
->ErrorValue
;
6717 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
6719 if (MESA_VERBOSE
& VERBOSE_API
)
6720 _mesa_debug(ctx
, "glGetError <-- %s\n", _mesa_lookup_enum_by_nr(e
));
6722 ctx
->ErrorValue
= (GLenum
) GL_NO_ERROR
;