1 /* $Id: get.c,v 1.30 2000/07/21 15:41:08 brianp Exp $ */
4 * Mesa 3-D graphics library
7 * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35 #include "extensions.h"
46 #define FLOAT_TO_BOOL(X) ( (X)==0.0F ? GL_FALSE : GL_TRUE )
47 #define INT_TO_BOOL(I) ( (I)==0 ? GL_FALSE : GL_TRUE )
48 #define ENUM_TO_BOOL(E) ( (E)==0 ? GL_FALSE : GL_TRUE )
51 /* Needed for an Amiga compiler */
52 #define ENUM_TO_FLOAT(X) ((GLfloat)(GLint)(X))
53 #define ENUM_TO_DOUBLE(X) ((GLdouble)(GLint)(X))
55 /* all other compilers */
56 #define ENUM_TO_FLOAT(X) ((GLfloat)(X))
57 #define ENUM_TO_DOUBLE(X) ((GLdouble)(X))
62 pixel_texgen_mode(const GLcontext
*ctx
)
64 if (ctx
->Pixel
.FragmentRgbSource
== GL_CURRENT_RASTER_POSITION
) {
65 if (ctx
->Pixel
.FragmentAlphaSource
== GL_CURRENT_RASTER_POSITION
) {
73 if (ctx
->Pixel
.FragmentAlphaSource
== GL_CURRENT_RASTER_POSITION
) {
85 _mesa_GetBooleanv( GLenum pname
, GLboolean
*params
)
87 GET_CURRENT_CONTEXT(ctx
);
89 GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
90 GLuint texTransformUnit
= ctx
->Texture
.CurrentTransformUnit
;
91 const struct gl_texture_unit
*textureUnit
= &ctx
->Texture
.Unit
[texUnit
];
93 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
, "glGetBooleanv");
95 if (MESA_VERBOSE
& VERBOSE_API
)
96 fprintf(stderr
, "glGetBooleanv %s\n", gl_lookup_enum_by_nr(pname
));
99 case GL_ACCUM_RED_BITS
:
100 *params
= INT_TO_BOOL(ctx
->Visual
->AccumRedBits
);
102 case GL_ACCUM_GREEN_BITS
:
103 *params
= INT_TO_BOOL(ctx
->Visual
->AccumGreenBits
);
105 case GL_ACCUM_BLUE_BITS
:
106 *params
= INT_TO_BOOL(ctx
->Visual
->AccumBlueBits
);
108 case GL_ACCUM_ALPHA_BITS
:
109 *params
= INT_TO_BOOL(ctx
->Visual
->AccumAlphaBits
);
111 case GL_ACCUM_CLEAR_VALUE
:
112 params
[0] = FLOAT_TO_BOOL(ctx
->Accum
.ClearColor
[0]);
113 params
[1] = FLOAT_TO_BOOL(ctx
->Accum
.ClearColor
[1]);
114 params
[2] = FLOAT_TO_BOOL(ctx
->Accum
.ClearColor
[2]);
115 params
[3] = FLOAT_TO_BOOL(ctx
->Accum
.ClearColor
[3]);
118 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.AlphaBias
);
121 *params
= INT_TO_BOOL(ctx
->Visual
->AlphaBits
);
124 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.AlphaScale
);
127 *params
= ctx
->Color
.AlphaEnabled
;
129 case GL_ALPHA_TEST_FUNC
:
130 *params
= ENUM_TO_BOOL(ctx
->Color
.AlphaFunc
);
132 case GL_ALPHA_TEST_REF
:
133 *params
= FLOAT_TO_BOOL((GLfloat
) ctx
->Color
.AlphaRef
/ 255.0);
135 case GL_ATTRIB_STACK_DEPTH
:
136 *params
= INT_TO_BOOL(ctx
->AttribStackDepth
);
139 *params
= ctx
->Eval
.AutoNormal
;
142 *params
= (ctx
->Const
.NumAuxBuffers
) ? GL_TRUE
: GL_FALSE
;
145 *params
= ctx
->Color
.BlendEnabled
;
148 *params
= ENUM_TO_BOOL(ctx
->Color
.BlendDstRGB
);
151 *params
= ENUM_TO_BOOL(ctx
->Color
.BlendSrcRGB
);
153 case GL_BLEND_SRC_RGB_EXT
:
154 *params
= ENUM_TO_BOOL(ctx
->Color
.BlendSrcRGB
);
156 case GL_BLEND_DST_RGB_EXT
:
157 *params
= ENUM_TO_BOOL(ctx
->Color
.BlendDstRGB
);
159 case GL_BLEND_SRC_ALPHA_EXT
:
160 *params
= ENUM_TO_BOOL(ctx
->Color
.BlendSrcA
);
162 case GL_BLEND_DST_ALPHA_EXT
:
163 *params
= ENUM_TO_BOOL(ctx
->Color
.BlendDstA
);
165 case GL_BLEND_EQUATION_EXT
:
166 *params
= ENUM_TO_BOOL( ctx
->Color
.BlendEquation
);
168 case GL_BLEND_COLOR_EXT
:
169 params
[0] = FLOAT_TO_BOOL( ctx
->Color
.BlendColor
[0] );
170 params
[1] = FLOAT_TO_BOOL( ctx
->Color
.BlendColor
[1] );
171 params
[2] = FLOAT_TO_BOOL( ctx
->Color
.BlendColor
[2] );
172 params
[3] = FLOAT_TO_BOOL( ctx
->Color
.BlendColor
[3] );
175 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.BlueBias
);
178 *params
= INT_TO_BOOL( ctx
->Visual
->BlueBits
);
181 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.BlueScale
);
183 case GL_CLIENT_ATTRIB_STACK_DEPTH
:
184 *params
= INT_TO_BOOL(ctx
->ClientAttribStackDepth
);
192 *params
= ctx
->Transform
.ClipEnabled
[pname
-GL_CLIP_PLANE0
];
194 case GL_COLOR_CLEAR_VALUE
:
195 params
[0] = FLOAT_TO_BOOL(ctx
->Color
.ClearColor
[0]);
196 params
[1] = FLOAT_TO_BOOL(ctx
->Color
.ClearColor
[1]);
197 params
[2] = FLOAT_TO_BOOL(ctx
->Color
.ClearColor
[2]);
198 params
[3] = FLOAT_TO_BOOL(ctx
->Color
.ClearColor
[3]);
200 case GL_COLOR_MATERIAL
:
201 *params
= ctx
->Light
.ColorMaterialEnabled
;
203 case GL_COLOR_MATERIAL_FACE
:
204 *params
= ENUM_TO_BOOL(ctx
->Light
.ColorMaterialFace
);
206 case GL_COLOR_MATERIAL_PARAMETER
:
207 *params
= ENUM_TO_BOOL(ctx
->Light
.ColorMaterialMode
);
209 case GL_COLOR_WRITEMASK
:
210 params
[0] = ctx
->Color
.ColorMask
[RCOMP
] ? GL_TRUE
: GL_FALSE
;
211 params
[1] = ctx
->Color
.ColorMask
[GCOMP
] ? GL_TRUE
: GL_FALSE
;
212 params
[2] = ctx
->Color
.ColorMask
[BCOMP
] ? GL_TRUE
: GL_FALSE
;
213 params
[3] = ctx
->Color
.ColorMask
[ACOMP
] ? GL_TRUE
: GL_FALSE
;
216 *params
= ctx
->Polygon
.CullFlag
;
218 case GL_CULL_FACE_MODE
:
219 *params
= ENUM_TO_BOOL(ctx
->Polygon
.CullFaceMode
);
221 case GL_CURRENT_COLOR
:
222 params
[0] = INT_TO_BOOL(ctx
->Current
.ByteColor
[0]);
223 params
[1] = INT_TO_BOOL(ctx
->Current
.ByteColor
[1]);
224 params
[2] = INT_TO_BOOL(ctx
->Current
.ByteColor
[2]);
225 params
[3] = INT_TO_BOOL(ctx
->Current
.ByteColor
[3]);
227 case GL_CURRENT_INDEX
:
228 *params
= INT_TO_BOOL(ctx
->Current
.Index
);
230 case GL_CURRENT_NORMAL
:
231 params
[0] = FLOAT_TO_BOOL(ctx
->Current
.Normal
[0]);
232 params
[1] = FLOAT_TO_BOOL(ctx
->Current
.Normal
[1]);
233 params
[2] = FLOAT_TO_BOOL(ctx
->Current
.Normal
[2]);
235 case GL_CURRENT_RASTER_COLOR
:
236 params
[0] = FLOAT_TO_BOOL(ctx
->Current
.RasterColor
[0]);
237 params
[1] = FLOAT_TO_BOOL(ctx
->Current
.RasterColor
[1]);
238 params
[2] = FLOAT_TO_BOOL(ctx
->Current
.RasterColor
[2]);
239 params
[3] = FLOAT_TO_BOOL(ctx
->Current
.RasterColor
[3]);
241 case GL_CURRENT_RASTER_DISTANCE
:
242 *params
= FLOAT_TO_BOOL(ctx
->Current
.RasterDistance
);
244 case GL_CURRENT_RASTER_INDEX
:
245 *params
= FLOAT_TO_BOOL(ctx
->Current
.RasterIndex
);
247 case GL_CURRENT_RASTER_POSITION
:
248 params
[0] = FLOAT_TO_BOOL(ctx
->Current
.RasterPos
[0]);
249 params
[1] = FLOAT_TO_BOOL(ctx
->Current
.RasterPos
[1]);
250 params
[2] = FLOAT_TO_BOOL(ctx
->Current
.RasterPos
[2]);
251 params
[3] = FLOAT_TO_BOOL(ctx
->Current
.RasterPos
[3]);
253 case GL_CURRENT_RASTER_TEXTURE_COORDS
:
254 params
[0] = FLOAT_TO_BOOL(ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][0]);
255 params
[1] = FLOAT_TO_BOOL(ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][1]);
256 params
[2] = FLOAT_TO_BOOL(ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][2]);
257 params
[3] = FLOAT_TO_BOOL(ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][3]);
259 case GL_CURRENT_RASTER_POSITION_VALID
:
260 *params
= ctx
->Current
.RasterPosValid
;
262 case GL_CURRENT_TEXTURE_COORDS
:
263 params
[0] = FLOAT_TO_BOOL(ctx
->Current
.Texcoord
[texTransformUnit
][0]);
264 params
[1] = FLOAT_TO_BOOL(ctx
->Current
.Texcoord
[texTransformUnit
][1]);
265 params
[2] = FLOAT_TO_BOOL(ctx
->Current
.Texcoord
[texTransformUnit
][2]);
266 params
[3] = FLOAT_TO_BOOL(ctx
->Current
.Texcoord
[texTransformUnit
][3]);
269 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.DepthBias
);
272 *params
= INT_TO_BOOL(ctx
->Visual
->DepthBits
);
274 case GL_DEPTH_CLEAR_VALUE
:
275 *params
= FLOAT_TO_BOOL(ctx
->Depth
.Clear
);
278 *params
= ENUM_TO_BOOL(ctx
->Depth
.Func
);
281 params
[0] = FLOAT_TO_BOOL(ctx
->Viewport
.Near
);
282 params
[1] = FLOAT_TO_BOOL(ctx
->Viewport
.Far
);
285 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.DepthScale
);
288 *params
= ctx
->Depth
.Test
;
290 case GL_DEPTH_WRITEMASK
:
291 *params
= ctx
->Depth
.Mask
;
294 *params
= ctx
->Color
.DitherFlag
;
296 case GL_DOUBLEBUFFER
:
297 *params
= ctx
->Visual
->DBflag
;
300 *params
= ENUM_TO_BOOL(ctx
->Color
.DrawBuffer
);
303 *params
= ctx
->Current
.EdgeFlag
;
305 case GL_FEEDBACK_BUFFER_SIZE
:
306 *params
= INT_TO_BOOL(ctx
->Feedback
.BufferSize
);
308 case GL_FEEDBACK_BUFFER_TYPE
:
309 *params
= INT_TO_BOOL(ctx
->Feedback
.Type
);
312 *params
= ctx
->Fog
.Enabled
;
315 params
[0] = FLOAT_TO_BOOL(ctx
->Fog
.Color
[0]);
316 params
[1] = FLOAT_TO_BOOL(ctx
->Fog
.Color
[1]);
317 params
[2] = FLOAT_TO_BOOL(ctx
->Fog
.Color
[2]);
318 params
[3] = FLOAT_TO_BOOL(ctx
->Fog
.Color
[3]);
321 *params
= FLOAT_TO_BOOL(ctx
->Fog
.Density
);
324 *params
= FLOAT_TO_BOOL(ctx
->Fog
.End
);
327 *params
= ENUM_TO_BOOL(ctx
->Hint
.Fog
);
330 *params
= FLOAT_TO_BOOL(ctx
->Fog
.Index
);
333 *params
= ENUM_TO_BOOL(ctx
->Fog
.Mode
);
336 *params
= FLOAT_TO_BOOL(ctx
->Fog
.End
);
339 *params
= ENUM_TO_BOOL(ctx
->Polygon
.FrontFace
);
342 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.GreenBias
);
345 *params
= INT_TO_BOOL( ctx
->Visual
->GreenBits
);
348 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.GreenScale
);
351 *params
= ctx
->Pixel
.HistogramEnabled
;
354 *params
= INT_TO_BOOL( ctx
->Visual
->IndexBits
);
356 case GL_INDEX_CLEAR_VALUE
:
357 *params
= INT_TO_BOOL(ctx
->Color
.ClearIndex
);
360 *params
= ctx
->Visual
->RGBAflag
? GL_FALSE
: GL_TRUE
;
362 case GL_INDEX_OFFSET
:
363 *params
= INT_TO_BOOL(ctx
->Pixel
.IndexOffset
);
366 *params
= INT_TO_BOOL(ctx
->Pixel
.IndexShift
);
368 case GL_INDEX_WRITEMASK
:
369 *params
= INT_TO_BOOL(ctx
->Color
.IndexMask
);
379 *params
= ctx
->Light
.Light
[pname
-GL_LIGHT0
].Enabled
;
382 *params
= ctx
->Light
.Enabled
;
384 case GL_LIGHT_MODEL_AMBIENT
:
385 params
[0] = FLOAT_TO_BOOL(ctx
->Light
.Model
.Ambient
[0]);
386 params
[1] = FLOAT_TO_BOOL(ctx
->Light
.Model
.Ambient
[1]);
387 params
[2] = FLOAT_TO_BOOL(ctx
->Light
.Model
.Ambient
[2]);
388 params
[3] = FLOAT_TO_BOOL(ctx
->Light
.Model
.Ambient
[3]);
390 case GL_LIGHT_MODEL_COLOR_CONTROL
:
391 params
[0] = ENUM_TO_BOOL(ctx
->Light
.Model
.ColorControl
);
393 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
394 *params
= ctx
->Light
.Model
.LocalViewer
;
396 case GL_LIGHT_MODEL_TWO_SIDE
:
397 *params
= ctx
->Light
.Model
.TwoSide
;
400 *params
= ctx
->Line
.SmoothFlag
;
402 case GL_LINE_SMOOTH_HINT
:
403 *params
= ENUM_TO_BOOL(ctx
->Hint
.LineSmooth
);
405 case GL_LINE_STIPPLE
:
406 *params
= ctx
->Line
.StippleFlag
;
408 case GL_LINE_STIPPLE_PATTERN
:
409 *params
= INT_TO_BOOL(ctx
->Line
.StipplePattern
);
411 case GL_LINE_STIPPLE_REPEAT
:
412 *params
= INT_TO_BOOL(ctx
->Line
.StippleFactor
);
415 *params
= FLOAT_TO_BOOL(ctx
->Line
.Width
);
417 case GL_LINE_WIDTH_GRANULARITY
:
418 *params
= FLOAT_TO_BOOL(ctx
->Const
.LineWidthGranularity
);
420 case GL_LINE_WIDTH_RANGE
:
421 params
[0] = FLOAT_TO_BOOL(ctx
->Const
.MinLineWidthAA
);
422 params
[1] = FLOAT_TO_BOOL(ctx
->Const
.MaxLineWidthAA
);
424 case GL_ALIASED_LINE_WIDTH_RANGE
:
425 params
[0] = FLOAT_TO_BOOL(ctx
->Const
.MinLineWidth
);
426 params
[1] = FLOAT_TO_BOOL(ctx
->Const
.MaxLineWidth
);
429 *params
= INT_TO_BOOL(ctx
->List
.ListBase
);
432 *params
= INT_TO_BOOL( ctx
->CurrentListNum
);
435 *params
= ENUM_TO_BOOL( ctx
->ExecuteFlag
436 ? GL_COMPILE_AND_EXECUTE
: GL_COMPILE
);
438 case GL_INDEX_LOGIC_OP
:
439 *params
= ctx
->Color
.IndexLogicOpEnabled
;
441 case GL_COLOR_LOGIC_OP
:
442 *params
= ctx
->Color
.ColorLogicOpEnabled
;
444 case GL_LOGIC_OP_MODE
:
445 *params
= ENUM_TO_BOOL(ctx
->Color
.LogicOp
);
447 case GL_MAP1_COLOR_4
:
448 *params
= ctx
->Eval
.Map1Color4
;
450 case GL_MAP1_GRID_DOMAIN
:
451 params
[0] = FLOAT_TO_BOOL(ctx
->Eval
.MapGrid1u1
);
452 params
[1] = FLOAT_TO_BOOL(ctx
->Eval
.MapGrid1u2
);
454 case GL_MAP1_GRID_SEGMENTS
:
455 *params
= INT_TO_BOOL(ctx
->Eval
.MapGrid1un
);
458 *params
= ctx
->Eval
.Map1Index
;
461 *params
= ctx
->Eval
.Map1Normal
;
463 case GL_MAP1_TEXTURE_COORD_1
:
464 *params
= ctx
->Eval
.Map1TextureCoord1
;
466 case GL_MAP1_TEXTURE_COORD_2
:
467 *params
= ctx
->Eval
.Map1TextureCoord2
;
469 case GL_MAP1_TEXTURE_COORD_3
:
470 *params
= ctx
->Eval
.Map1TextureCoord3
;
472 case GL_MAP1_TEXTURE_COORD_4
:
473 *params
= ctx
->Eval
.Map1TextureCoord4
;
475 case GL_MAP1_VERTEX_3
:
476 *params
= ctx
->Eval
.Map1Vertex3
;
478 case GL_MAP1_VERTEX_4
:
479 *params
= ctx
->Eval
.Map1Vertex4
;
481 case GL_MAP2_COLOR_4
:
482 *params
= ctx
->Eval
.Map2Color4
;
484 case GL_MAP2_GRID_DOMAIN
:
485 params
[0] = FLOAT_TO_BOOL(ctx
->Eval
.MapGrid2u1
);
486 params
[1] = FLOAT_TO_BOOL(ctx
->Eval
.MapGrid2u2
);
487 params
[2] = FLOAT_TO_BOOL(ctx
->Eval
.MapGrid2v1
);
488 params
[3] = FLOAT_TO_BOOL(ctx
->Eval
.MapGrid2v2
);
490 case GL_MAP2_GRID_SEGMENTS
:
491 params
[0] = INT_TO_BOOL(ctx
->Eval
.MapGrid2un
);
492 params
[1] = INT_TO_BOOL(ctx
->Eval
.MapGrid2vn
);
495 *params
= ctx
->Eval
.Map2Index
;
498 *params
= ctx
->Eval
.Map2Normal
;
500 case GL_MAP2_TEXTURE_COORD_1
:
501 *params
= ctx
->Eval
.Map2TextureCoord1
;
503 case GL_MAP2_TEXTURE_COORD_2
:
504 *params
= ctx
->Eval
.Map2TextureCoord2
;
506 case GL_MAP2_TEXTURE_COORD_3
:
507 *params
= ctx
->Eval
.Map2TextureCoord3
;
509 case GL_MAP2_TEXTURE_COORD_4
:
510 *params
= ctx
->Eval
.Map2TextureCoord4
;
512 case GL_MAP2_VERTEX_3
:
513 *params
= ctx
->Eval
.Map2Vertex3
;
515 case GL_MAP2_VERTEX_4
:
516 *params
= ctx
->Eval
.Map2Vertex4
;
519 *params
= ctx
->Pixel
.MapColorFlag
;
522 *params
= ctx
->Pixel
.MapStencilFlag
;
525 *params
= ENUM_TO_BOOL( ctx
->Transform
.MatrixMode
);
527 case GL_MAX_ATTRIB_STACK_DEPTH
:
528 *params
= INT_TO_BOOL(MAX_ATTRIB_STACK_DEPTH
);
530 case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
:
531 *params
= INT_TO_BOOL( MAX_CLIENT_ATTRIB_STACK_DEPTH
);
533 case GL_MAX_CLIP_PLANES
:
534 *params
= INT_TO_BOOL(MAX_CLIP_PLANES
);
536 case GL_MAX_ELEMENTS_VERTICES
: /* GL_VERSION_1_2 */
537 *params
= INT_TO_BOOL(VB_MAX
);
539 case GL_MAX_ELEMENTS_INDICES
: /* GL_VERSION_1_2 */
540 *params
= INT_TO_BOOL(VB_MAX
);
542 case GL_MAX_EVAL_ORDER
:
543 *params
= INT_TO_BOOL(MAX_EVAL_ORDER
);
546 *params
= INT_TO_BOOL(MAX_LIGHTS
);
548 case GL_MAX_LIST_NESTING
:
549 *params
= INT_TO_BOOL(MAX_LIST_NESTING
);
551 case GL_MAX_MODELVIEW_STACK_DEPTH
:
552 *params
= INT_TO_BOOL(MAX_MODELVIEW_STACK_DEPTH
);
554 case GL_MAX_NAME_STACK_DEPTH
:
555 *params
= INT_TO_BOOL(MAX_NAME_STACK_DEPTH
);
557 case GL_MAX_PIXEL_MAP_TABLE
:
558 *params
= INT_TO_BOOL(MAX_PIXEL_MAP_TABLE
);
560 case GL_MAX_PROJECTION_STACK_DEPTH
:
561 *params
= INT_TO_BOOL(MAX_PROJECTION_STACK_DEPTH
);
563 case GL_MAX_TEXTURE_SIZE
:
564 case GL_MAX_3D_TEXTURE_SIZE
:
565 *params
= INT_TO_BOOL(ctx
->Const
.MaxTextureSize
);
567 case GL_MAX_TEXTURE_STACK_DEPTH
:
568 *params
= INT_TO_BOOL(MAX_TEXTURE_STACK_DEPTH
);
570 case GL_MAX_VIEWPORT_DIMS
:
571 params
[0] = INT_TO_BOOL(MAX_WIDTH
);
572 params
[1] = INT_TO_BOOL(MAX_HEIGHT
);
575 *params
= ctx
->Pixel
.MinMaxEnabled
;
577 case GL_MODELVIEW_MATRIX
:
579 params
[i
] = FLOAT_TO_BOOL(ctx
->ModelView
.m
[i
]);
582 case GL_MODELVIEW_STACK_DEPTH
:
583 *params
= INT_TO_BOOL(ctx
->ModelViewStackDepth
+ 1);
585 case GL_NAME_STACK_DEPTH
:
586 *params
= INT_TO_BOOL(ctx
->Select
.NameStackDepth
);
589 *params
= ctx
->Transform
.Normalize
;
591 case GL_PACK_ALIGNMENT
:
592 *params
= INT_TO_BOOL(ctx
->Pack
.Alignment
);
594 case GL_PACK_LSB_FIRST
:
595 *params
= ctx
->Pack
.LsbFirst
;
597 case GL_PACK_ROW_LENGTH
:
598 *params
= INT_TO_BOOL(ctx
->Pack
.RowLength
);
600 case GL_PACK_SKIP_PIXELS
:
601 *params
= INT_TO_BOOL(ctx
->Pack
.SkipPixels
);
603 case GL_PACK_SKIP_ROWS
:
604 *params
= INT_TO_BOOL(ctx
->Pack
.SkipRows
);
606 case GL_PACK_SWAP_BYTES
:
607 *params
= ctx
->Pack
.SwapBytes
;
609 case GL_PACK_SKIP_IMAGES_EXT
:
610 *params
= ctx
->Pack
.SkipImages
;
612 case GL_PACK_IMAGE_HEIGHT_EXT
:
613 *params
= ctx
->Pack
.ImageHeight
;
615 case GL_PERSPECTIVE_CORRECTION_HINT
:
616 *params
= ENUM_TO_BOOL(ctx
->Hint
.PerspectiveCorrection
);
618 case GL_PIXEL_MAP_A_TO_A_SIZE
:
619 *params
= INT_TO_BOOL(ctx
->Pixel
.MapAtoAsize
);
621 case GL_PIXEL_MAP_B_TO_B_SIZE
:
622 *params
= INT_TO_BOOL(ctx
->Pixel
.MapBtoBsize
);
624 case GL_PIXEL_MAP_G_TO_G_SIZE
:
625 *params
= INT_TO_BOOL(ctx
->Pixel
.MapGtoGsize
);
627 case GL_PIXEL_MAP_I_TO_A_SIZE
:
628 *params
= INT_TO_BOOL(ctx
->Pixel
.MapItoAsize
);
630 case GL_PIXEL_MAP_I_TO_B_SIZE
:
631 *params
= INT_TO_BOOL(ctx
->Pixel
.MapItoBsize
);
633 case GL_PIXEL_MAP_I_TO_G_SIZE
:
634 *params
= INT_TO_BOOL(ctx
->Pixel
.MapItoGsize
);
636 case GL_PIXEL_MAP_I_TO_I_SIZE
:
637 *params
= INT_TO_BOOL(ctx
->Pixel
.MapItoIsize
);
639 case GL_PIXEL_MAP_I_TO_R_SIZE
:
640 *params
= INT_TO_BOOL(ctx
->Pixel
.MapItoRsize
);
642 case GL_PIXEL_MAP_R_TO_R_SIZE
:
643 *params
= INT_TO_BOOL(ctx
->Pixel
.MapRtoRsize
);
645 case GL_PIXEL_MAP_S_TO_S_SIZE
:
646 *params
= INT_TO_BOOL(ctx
->Pixel
.MapStoSsize
);
649 *params
= FLOAT_TO_BOOL(ctx
->Point
.UserSize
);
651 case GL_POINT_SIZE_GRANULARITY
:
652 *params
= FLOAT_TO_BOOL(ctx
->Const
.PointSizeGranularity
);
654 case GL_POINT_SIZE_RANGE
:
655 params
[0] = FLOAT_TO_BOOL(ctx
->Const
.MinPointSizeAA
);
656 params
[1] = FLOAT_TO_BOOL(ctx
->Const
.MaxPointSizeAA
);
658 case GL_ALIASED_POINT_SIZE_RANGE
:
659 params
[0] = FLOAT_TO_BOOL(ctx
->Const
.MinPointSize
);
660 params
[1] = FLOAT_TO_BOOL(ctx
->Const
.MaxPointSize
);
662 case GL_POINT_SMOOTH
:
663 *params
= ctx
->Point
.SmoothFlag
;
665 case GL_POINT_SMOOTH_HINT
:
666 *params
= ENUM_TO_BOOL(ctx
->Hint
.PointSmooth
);
668 case GL_POINT_SIZE_MIN_EXT
:
669 *params
= FLOAT_TO_BOOL(ctx
->Point
.MinSize
);
671 case GL_POINT_SIZE_MAX_EXT
:
672 *params
= FLOAT_TO_BOOL(ctx
->Point
.MaxSize
);
674 case GL_POINT_FADE_THRESHOLD_SIZE_EXT
:
675 *params
= FLOAT_TO_BOOL(ctx
->Point
.Threshold
);
677 case GL_DISTANCE_ATTENUATION_EXT
:
678 params
[0] = FLOAT_TO_BOOL(ctx
->Point
.Params
[0]);
679 params
[1] = FLOAT_TO_BOOL(ctx
->Point
.Params
[1]);
680 params
[2] = FLOAT_TO_BOOL(ctx
->Point
.Params
[2]);
682 case GL_POLYGON_MODE
:
683 params
[0] = ENUM_TO_BOOL(ctx
->Polygon
.FrontMode
);
684 params
[1] = ENUM_TO_BOOL(ctx
->Polygon
.BackMode
);
686 case GL_POLYGON_OFFSET_BIAS_EXT
: /* GL_EXT_polygon_offset */
687 *params
= FLOAT_TO_BOOL( ctx
->Polygon
.OffsetUnits
);
689 case GL_POLYGON_OFFSET_FACTOR
:
690 *params
= FLOAT_TO_BOOL( ctx
->Polygon
.OffsetFactor
);
692 case GL_POLYGON_OFFSET_UNITS
:
693 *params
= FLOAT_TO_BOOL( ctx
->Polygon
.OffsetUnits
);
695 case GL_POLYGON_SMOOTH
:
696 *params
= ctx
->Polygon
.SmoothFlag
;
698 case GL_POLYGON_SMOOTH_HINT
:
699 *params
= ENUM_TO_BOOL(ctx
->Hint
.PolygonSmooth
);
701 case GL_POLYGON_STIPPLE
:
702 *params
= ctx
->Polygon
.StippleFlag
;
704 case GL_PROJECTION_MATRIX
:
706 params
[i
] = FLOAT_TO_BOOL(ctx
->ProjectionMatrix
.m
[i
]);
709 case GL_PROJECTION_STACK_DEPTH
:
710 *params
= INT_TO_BOOL(ctx
->ProjectionStackDepth
+ 1);
713 *params
= ENUM_TO_BOOL(ctx
->Pixel
.ReadBuffer
);
716 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.RedBias
);
719 *params
= INT_TO_BOOL( ctx
->Visual
->RedBits
);
722 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.RedScale
);
725 *params
= ENUM_TO_BOOL(ctx
->RenderMode
);
728 *params
= ctx
->Visual
->RGBAflag
;
731 params
[0] = INT_TO_BOOL(ctx
->Scissor
.X
);
732 params
[1] = INT_TO_BOOL(ctx
->Scissor
.Y
);
733 params
[2] = INT_TO_BOOL(ctx
->Scissor
.Width
);
734 params
[3] = INT_TO_BOOL(ctx
->Scissor
.Height
);
736 case GL_SCISSOR_TEST
:
737 *params
= ctx
->Scissor
.Enabled
;
739 case GL_SELECTION_BUFFER_SIZE
:
740 *params
= INT_TO_BOOL(ctx
->Select
.BufferSize
);
743 *params
= ENUM_TO_BOOL(ctx
->Light
.ShadeModel
);
745 case GL_SHARED_TEXTURE_PALETTE_EXT
:
746 *params
= ctx
->Texture
.SharedPalette
;
748 case GL_STENCIL_BITS
:
749 *params
= INT_TO_BOOL(ctx
->Visual
->StencilBits
);
751 case GL_STENCIL_CLEAR_VALUE
:
752 *params
= INT_TO_BOOL(ctx
->Stencil
.Clear
);
754 case GL_STENCIL_FAIL
:
755 *params
= ENUM_TO_BOOL(ctx
->Stencil
.FailFunc
);
757 case GL_STENCIL_FUNC
:
758 *params
= ENUM_TO_BOOL(ctx
->Stencil
.Function
);
760 case GL_STENCIL_PASS_DEPTH_FAIL
:
761 *params
= ENUM_TO_BOOL(ctx
->Stencil
.ZFailFunc
);
763 case GL_STENCIL_PASS_DEPTH_PASS
:
764 *params
= ENUM_TO_BOOL(ctx
->Stencil
.ZPassFunc
);
767 *params
= INT_TO_BOOL(ctx
->Stencil
.Ref
);
769 case GL_STENCIL_TEST
:
770 *params
= ctx
->Stencil
.Enabled
;
772 case GL_STENCIL_VALUE_MASK
:
773 *params
= INT_TO_BOOL(ctx
->Stencil
.ValueMask
);
775 case GL_STENCIL_WRITEMASK
:
776 *params
= INT_TO_BOOL(ctx
->Stencil
.WriteMask
);
779 *params
= ctx
->Visual
->StereoFlag
;
781 case GL_SUBPIXEL_BITS
:
782 *params
= INT_TO_BOOL(ctx
->Const
.SubPixelBits
);
785 *params
= _mesa_IsEnabled(GL_TEXTURE_1D
);
788 *params
= _mesa_IsEnabled(GL_TEXTURE_2D
);
791 *params
= _mesa_IsEnabled(GL_TEXTURE_3D
);
793 case GL_TEXTURE_BINDING_1D
:
794 *params
= INT_TO_BOOL(textureUnit
->CurrentD
[1]->Name
);
796 case GL_TEXTURE_BINDING_2D
:
797 *params
= INT_TO_BOOL(textureUnit
->CurrentD
[2]->Name
);
799 case GL_TEXTURE_BINDING_3D
:
800 *params
= INT_TO_BOOL(textureUnit
->CurrentD
[3]->Name
);
802 case GL_TEXTURE_ENV_COLOR
:
804 params
[0] = FLOAT_TO_BOOL(textureUnit
->EnvColor
[0]);
805 params
[1] = FLOAT_TO_BOOL(textureUnit
->EnvColor
[1]);
806 params
[2] = FLOAT_TO_BOOL(textureUnit
->EnvColor
[2]);
807 params
[3] = FLOAT_TO_BOOL(textureUnit
->EnvColor
[3]);
810 case GL_TEXTURE_ENV_MODE
:
811 *params
= ENUM_TO_BOOL(textureUnit
->EnvMode
);
813 case GL_TEXTURE_GEN_S
:
814 *params
= (textureUnit
->TexGenEnabled
& S_BIT
) ? GL_TRUE
: GL_FALSE
;
816 case GL_TEXTURE_GEN_T
:
817 *params
= (textureUnit
->TexGenEnabled
& T_BIT
) ? GL_TRUE
: GL_FALSE
;
819 case GL_TEXTURE_GEN_R
:
820 *params
= (textureUnit
->TexGenEnabled
& R_BIT
) ? GL_TRUE
: GL_FALSE
;
822 case GL_TEXTURE_GEN_Q
:
823 *params
= (textureUnit
->TexGenEnabled
& Q_BIT
) ? GL_TRUE
: GL_FALSE
;
825 case GL_TEXTURE_MATRIX
:
828 FLOAT_TO_BOOL(ctx
->TextureMatrix
[texTransformUnit
].m
[i
]);
831 case GL_TEXTURE_STACK_DEPTH
:
832 *params
= INT_TO_BOOL(ctx
->TextureStackDepth
[texTransformUnit
] + 1);
834 case GL_UNPACK_ALIGNMENT
:
835 *params
= INT_TO_BOOL(ctx
->Unpack
.Alignment
);
837 case GL_UNPACK_LSB_FIRST
:
838 *params
= ctx
->Unpack
.LsbFirst
;
840 case GL_UNPACK_ROW_LENGTH
:
841 *params
= INT_TO_BOOL(ctx
->Unpack
.RowLength
);
843 case GL_UNPACK_SKIP_PIXELS
:
844 *params
= INT_TO_BOOL(ctx
->Unpack
.SkipPixels
);
846 case GL_UNPACK_SKIP_ROWS
:
847 *params
= INT_TO_BOOL(ctx
->Unpack
.SkipRows
);
849 case GL_UNPACK_SWAP_BYTES
:
850 *params
= ctx
->Unpack
.SwapBytes
;
852 case GL_UNPACK_SKIP_IMAGES_EXT
:
853 *params
= ctx
->Unpack
.SkipImages
;
855 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
856 *params
= ctx
->Unpack
.ImageHeight
;
859 params
[0] = INT_TO_BOOL(ctx
->Viewport
.X
);
860 params
[1] = INT_TO_BOOL(ctx
->Viewport
.Y
);
861 params
[2] = INT_TO_BOOL(ctx
->Viewport
.Width
);
862 params
[3] = INT_TO_BOOL(ctx
->Viewport
.Height
);
865 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.ZoomX
);
868 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.ZoomY
);
870 case GL_VERTEX_ARRAY
:
871 *params
= ctx
->Array
.Vertex
.Enabled
;
873 case GL_VERTEX_ARRAY_SIZE
:
874 *params
= INT_TO_BOOL(ctx
->Array
.Vertex
.Size
);
876 case GL_VERTEX_ARRAY_TYPE
:
877 *params
= ENUM_TO_BOOL(ctx
->Array
.Vertex
.Type
);
879 case GL_VERTEX_ARRAY_STRIDE
:
880 *params
= INT_TO_BOOL(ctx
->Array
.Vertex
.Stride
);
882 case GL_VERTEX_ARRAY_COUNT_EXT
:
883 *params
= INT_TO_BOOL(0);
885 case GL_NORMAL_ARRAY
:
886 *params
= ctx
->Array
.Normal
.Enabled
;
888 case GL_NORMAL_ARRAY_TYPE
:
889 *params
= ENUM_TO_BOOL(ctx
->Array
.Normal
.Type
);
891 case GL_NORMAL_ARRAY_STRIDE
:
892 *params
= INT_TO_BOOL(ctx
->Array
.Normal
.Stride
);
894 case GL_NORMAL_ARRAY_COUNT_EXT
:
895 *params
= INT_TO_BOOL(0);
898 *params
= ctx
->Array
.Color
.Enabled
;
900 case GL_COLOR_ARRAY_SIZE
:
901 *params
= INT_TO_BOOL(ctx
->Array
.Color
.Size
);
903 case GL_COLOR_ARRAY_TYPE
:
904 *params
= ENUM_TO_BOOL(ctx
->Array
.Color
.Type
);
906 case GL_COLOR_ARRAY_STRIDE
:
907 *params
= INT_TO_BOOL(ctx
->Array
.Color
.Stride
);
909 case GL_COLOR_ARRAY_COUNT_EXT
:
910 *params
= INT_TO_BOOL(0);
913 *params
= ctx
->Array
.Index
.Enabled
;
915 case GL_INDEX_ARRAY_TYPE
:
916 *params
= ENUM_TO_BOOL(ctx
->Array
.Index
.Type
);
918 case GL_INDEX_ARRAY_STRIDE
:
919 *params
= INT_TO_BOOL(ctx
->Array
.Index
.Stride
);
921 case GL_INDEX_ARRAY_COUNT_EXT
:
922 *params
= INT_TO_BOOL(0);
924 case GL_TEXTURE_COORD_ARRAY
:
925 *params
= ctx
->Array
.TexCoord
[texUnit
].Enabled
;
927 case GL_TEXTURE_COORD_ARRAY_SIZE
:
928 *params
= INT_TO_BOOL(ctx
->Array
.TexCoord
[texUnit
].Size
);
930 case GL_TEXTURE_COORD_ARRAY_TYPE
:
931 *params
= ENUM_TO_BOOL(ctx
->Array
.TexCoord
[texUnit
].Type
);
933 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
934 *params
= INT_TO_BOOL(ctx
->Array
.TexCoord
[texUnit
].Stride
);
936 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
937 *params
= INT_TO_BOOL(0);
939 case GL_EDGE_FLAG_ARRAY
:
940 *params
= ctx
->Array
.EdgeFlag
.Enabled
;
942 case GL_EDGE_FLAG_ARRAY_STRIDE
:
943 *params
= INT_TO_BOOL(ctx
->Array
.EdgeFlag
.Stride
);
946 /* GL_ARB_multitexture */
947 case GL_MAX_TEXTURE_UNITS_ARB
:
948 *params
= ctx
->Const
.MaxTextureUnits
;
950 case GL_ACTIVE_TEXTURE_ARB
:
951 *params
= INT_TO_BOOL(GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
);
953 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
954 *params
= INT_TO_BOOL(GL_TEXTURE0_ARB
+ ctx
->Array
.ActiveTexture
);
957 /* GL_ARB_texture_cube_map */
958 case GL_TEXTURE_CUBE_MAP_ARB
:
959 if (ctx
->Extensions
.HaveTextureCubeMap
)
960 *params
= _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
);
962 gl_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
964 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
965 if (ctx
->Extensions
.HaveTextureCubeMap
)
966 *params
= INT_TO_BOOL(textureUnit
->CurrentCubeMap
->Name
);
968 gl_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
970 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
971 if (ctx
->Extensions
.HaveTextureCubeMap
)
972 *params
= INT_TO_BOOL(ctx
->Const
.MaxCubeTextureSize
);
974 gl_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
977 /* GL_ARB_texture_compression */
978 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
979 if (ctx
->Extensions
.HaveTextureCompression
) {
980 *params
= INT_TO_BOOL(ctx
->Hint
.TextureCompression
);
983 gl_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
985 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
986 if (ctx
->Extensions
.HaveTextureCompression
) {
987 *params
= INT_TO_BOOL(ctx
->Const
.NumCompressedTextureFormats
);
990 gl_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
992 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
993 if (ctx
->Extensions
.HaveTextureCompression
) {
995 for (i
= 0; i
< ctx
->Const
.NumCompressedTextureFormats
; i
++)
996 params
[i
] = INT_TO_BOOL(ctx
->Const
.CompressedTextureFormats
[i
]);
999 gl_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
1002 /* GL_PGI_misc_hints */
1003 case GL_STRICT_DEPTHFUNC_HINT_PGI
:
1004 *params
= ENUM_TO_BOOL(GL_NICEST
);
1006 case GL_STRICT_LIGHTING_HINT_PGI
:
1007 *params
= ENUM_TO_BOOL(ctx
->Hint
.StrictLighting
);
1009 case GL_STRICT_SCISSOR_HINT_PGI
:
1010 case GL_FULL_STIPPLE_HINT_PGI
:
1011 *params
= ENUM_TO_BOOL(GL_TRUE
);
1013 case GL_CONSERVE_MEMORY_HINT_PGI
:
1014 *params
= ENUM_TO_BOOL(GL_FALSE
);
1016 case GL_ALWAYS_FAST_HINT_PGI
:
1017 *params
= (GLboolean
) (ctx
->Hint
.AllowDrawWin
== GL_TRUE
&&
1018 ctx
->Hint
.AllowDrawFrg
== GL_FALSE
&&
1019 ctx
->Hint
.AllowDrawMem
== GL_FALSE
);
1021 case GL_ALWAYS_SOFT_HINT_PGI
:
1022 *params
= (GLboolean
) (ctx
->Hint
.AllowDrawWin
== GL_TRUE
&&
1023 ctx
->Hint
.AllowDrawFrg
== GL_TRUE
&&
1024 ctx
->Hint
.AllowDrawMem
== GL_TRUE
);
1026 case GL_ALLOW_DRAW_OBJ_HINT_PGI
:
1027 *params
= (GLboolean
) GL_TRUE
;
1029 case GL_ALLOW_DRAW_WIN_HINT_PGI
:
1030 *params
= (GLboolean
) ctx
->Hint
.AllowDrawWin
;
1032 case GL_ALLOW_DRAW_FRG_HINT_PGI
:
1033 *params
= (GLboolean
) ctx
->Hint
.AllowDrawFrg
;
1035 case GL_ALLOW_DRAW_MEM_HINT_PGI
:
1036 *params
= (GLboolean
) ctx
->Hint
.AllowDrawMem
;
1038 case GL_CLIP_NEAR_HINT_PGI
:
1039 case GL_CLIP_FAR_HINT_PGI
:
1040 *params
= ENUM_TO_BOOL(GL_TRUE
);
1042 case GL_WIDE_LINE_HINT_PGI
:
1043 *params
= ENUM_TO_BOOL(GL_DONT_CARE
);
1045 case GL_BACK_NORMALS_HINT_PGI
:
1046 *params
= ENUM_TO_BOOL(GL_TRUE
);
1048 case GL_NATIVE_GRAPHICS_HANDLE_PGI
:
1052 /* GL_EXT_compiled_vertex_array */
1053 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
1054 *params
= ctx
->Array
.LockFirst
? GL_TRUE
: GL_FALSE
;
1056 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
1057 *params
= ctx
->Array
.LockCount
? GL_TRUE
: GL_FALSE
;
1060 /* GL_ARB_transpose_matrix */
1061 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
1065 gl_matrix_transposef(tm
, ctx
->ColorMatrix
.m
);
1066 for (i
=0;i
<16;i
++) {
1067 params
[i
] = FLOAT_TO_BOOL(tm
[i
]);
1071 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
1075 gl_matrix_transposef(tm
, ctx
->ModelView
.m
);
1076 for (i
=0;i
<16;i
++) {
1077 params
[i
] = FLOAT_TO_BOOL(tm
[i
]);
1081 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
1085 gl_matrix_transposef(tm
, ctx
->ProjectionMatrix
.m
);
1086 for (i
=0;i
<16;i
++) {
1087 params
[i
] = FLOAT_TO_BOOL(tm
[i
]);
1091 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
1095 gl_matrix_transposef(tm
, ctx
->TextureMatrix
[texTransformUnit
].m
);
1096 for (i
=0;i
<16;i
++) {
1097 params
[i
] = FLOAT_TO_BOOL(tm
[i
]);
1102 /* GL_HP_occlusion_test */
1103 case GL_OCCLUSION_TEST_HP
:
1104 if (ctx
->Extensions
.HaveHpOcclusionTest
) {
1105 *params
= ctx
->Depth
.OcclusionTest
;
1108 gl_error( ctx
, GL_INVALID_ENUM
, "glGetBooleanv" );
1111 case GL_OCCLUSION_TEST_RESULT_HP
:
1112 if (ctx
->Extensions
.HaveHpOcclusionTest
) {
1113 if (ctx
->Depth
.OcclusionTest
)
1114 *params
= ctx
->OcclusionResult
;
1116 *params
= ctx
->OcclusionResultSaved
;
1117 /* reset flag now */
1118 ctx
->OcclusionResult
= GL_FALSE
;
1119 ctx
->OcclusionResultSaved
= GL_FALSE
;
1122 gl_error( ctx
, GL_INVALID_ENUM
, "glGetBooleanv" );
1126 /* GL_SGIS_pixel_texture */
1127 case GL_PIXEL_TEXTURE_SGIS
:
1128 *params
= ctx
->Pixel
.PixelTextureEnabled
;
1131 /* GL_SGIX_pixel_texture */
1132 case GL_PIXEL_TEX_GEN_SGIX
:
1133 *params
= ctx
->Pixel
.PixelTextureEnabled
;
1135 case GL_PIXEL_TEX_GEN_MODE_SGIX
:
1136 *params
= (GLboolean
) pixel_texgen_mode(ctx
);
1139 /* GL_SGI_color_matrix (also in 1.2 imaging) */
1140 case GL_COLOR_MATRIX_SGI
:
1141 for (i
=0;i
<16;i
++) {
1142 params
[i
] = FLOAT_TO_BOOL(ctx
->ColorMatrix
.m
[i
]);
1145 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
1146 *params
= INT_TO_BOOL(ctx
->ColorStackDepth
+ 1);
1148 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
1149 *params
= FLOAT_TO_BOOL(MAX_COLOR_STACK_DEPTH
);
1151 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
1152 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixScale
[0]);
1154 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
1155 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixScale
[1]);
1157 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
1158 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixScale
[2]);
1160 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
1161 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixScale
[3]);
1163 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
1164 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixBias
[0]);
1166 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
1167 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixBias
[1]);
1169 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
1170 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixBias
[2]);
1172 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
1173 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixBias
[3]);
1176 /* GL_EXT_convolution (also in 1.2 imaging) */
1177 case GL_MAX_CONVOLUTION_WIDTH
:
1178 *params
= INT_TO_BOOL(ctx
->Const
.MaxConvolutionWidth
);
1180 case GL_MAX_CONVOLUTION_HEIGHT
:
1181 *params
= INT_TO_BOOL(ctx
->Const
.MaxConvolutionHeight
);
1183 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
1184 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionScale
[0]);
1186 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
1187 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionScale
[1]);
1189 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
1190 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionScale
[2]);
1192 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
1193 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionScale
[3]);
1195 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
1196 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionBias
[0]);
1198 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
1199 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionBias
[1]);
1201 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
1202 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionBias
[2]);
1204 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
1205 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionBias
[2]);
1208 /* GL_SGI_color_table (also in 1.2 imaging */
1209 case GL_COLOR_TABLE_SGI
:
1210 *params
= ctx
->Pixel
.ColorTableEnabled
;
1212 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
1213 *params
= ctx
->Pixel
.PostConvolutionColorTableEnabled
;
1215 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
1216 *params
= ctx
->Pixel
.PostColorMatrixColorTableEnabled
;
1220 gl_error( ctx
, GL_INVALID_ENUM
, "glGetBooleanv" );
1228 _mesa_GetDoublev( GLenum pname
, GLdouble
*params
)
1230 GET_CURRENT_CONTEXT(ctx
);
1232 GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
1233 GLuint texTransformUnit
= ctx
->Texture
.CurrentTransformUnit
;
1234 const struct gl_texture_unit
*textureUnit
= &ctx
->Texture
.Unit
[texUnit
];
1236 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
, "glGetDoublev");
1238 if (MESA_VERBOSE
& VERBOSE_API
)
1239 fprintf(stderr
, "glGetDoublev %s\n", gl_lookup_enum_by_nr(pname
));
1242 case GL_ACCUM_RED_BITS
:
1243 *params
= (GLdouble
) ctx
->Visual
->AccumRedBits
;
1245 case GL_ACCUM_GREEN_BITS
:
1246 *params
= (GLdouble
) ctx
->Visual
->AccumGreenBits
;
1248 case GL_ACCUM_BLUE_BITS
:
1249 *params
= (GLdouble
) ctx
->Visual
->AccumBlueBits
;
1251 case GL_ACCUM_ALPHA_BITS
:
1252 *params
= (GLdouble
) ctx
->Visual
->AccumAlphaBits
;
1254 case GL_ACCUM_CLEAR_VALUE
:
1255 params
[0] = (GLdouble
) ctx
->Accum
.ClearColor
[0];
1256 params
[1] = (GLdouble
) ctx
->Accum
.ClearColor
[1];
1257 params
[2] = (GLdouble
) ctx
->Accum
.ClearColor
[2];
1258 params
[3] = (GLdouble
) ctx
->Accum
.ClearColor
[3];
1261 *params
= (GLdouble
) ctx
->Pixel
.AlphaBias
;
1264 *params
= (GLdouble
) ctx
->Visual
->AlphaBits
;
1266 case GL_ALPHA_SCALE
:
1267 *params
= (GLdouble
) ctx
->Pixel
.AlphaScale
;
1270 *params
= (GLdouble
) ctx
->Color
.AlphaEnabled
;
1272 case GL_ALPHA_TEST_FUNC
:
1273 *params
= ENUM_TO_DOUBLE(ctx
->Color
.AlphaFunc
);
1275 case GL_ALPHA_TEST_REF
:
1276 *params
= (GLdouble
) ctx
->Color
.AlphaRef
/ 255.0;
1278 case GL_ATTRIB_STACK_DEPTH
:
1279 *params
= (GLdouble
) (ctx
->AttribStackDepth
);
1281 case GL_AUTO_NORMAL
:
1282 *params
= (GLdouble
) ctx
->Eval
.AutoNormal
;
1284 case GL_AUX_BUFFERS
:
1285 *params
= (GLdouble
) ctx
->Const
.NumAuxBuffers
;
1288 *params
= (GLdouble
) ctx
->Color
.BlendEnabled
;
1291 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendDstRGB
);
1294 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendSrcRGB
);
1296 case GL_BLEND_SRC_RGB_EXT
:
1297 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendSrcRGB
);
1299 case GL_BLEND_DST_RGB_EXT
:
1300 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendDstRGB
);
1302 case GL_BLEND_SRC_ALPHA_EXT
:
1303 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendSrcA
);
1305 case GL_BLEND_DST_ALPHA_EXT
:
1306 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendDstA
);
1308 case GL_BLEND_EQUATION_EXT
:
1309 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendEquation
);
1311 case GL_BLEND_COLOR_EXT
:
1312 params
[0] = (GLdouble
) ctx
->Color
.BlendColor
[0];
1313 params
[1] = (GLdouble
) ctx
->Color
.BlendColor
[1];
1314 params
[2] = (GLdouble
) ctx
->Color
.BlendColor
[2];
1315 params
[3] = (GLdouble
) ctx
->Color
.BlendColor
[3];
1318 *params
= (GLdouble
) ctx
->Pixel
.BlueBias
;
1321 *params
= (GLdouble
) ctx
->Visual
->BlueBits
;
1324 *params
= (GLdouble
) ctx
->Pixel
.BlueScale
;
1326 case GL_CLIENT_ATTRIB_STACK_DEPTH
:
1327 *params
= (GLdouble
) (ctx
->ClientAttribStackDepth
);
1329 case GL_CLIP_PLANE0
:
1330 case GL_CLIP_PLANE1
:
1331 case GL_CLIP_PLANE2
:
1332 case GL_CLIP_PLANE3
:
1333 case GL_CLIP_PLANE4
:
1334 case GL_CLIP_PLANE5
:
1335 *params
= (GLdouble
) ctx
->Transform
.ClipEnabled
[pname
-GL_CLIP_PLANE0
];
1337 case GL_COLOR_CLEAR_VALUE
:
1338 params
[0] = (GLdouble
) ctx
->Color
.ClearColor
[0];
1339 params
[1] = (GLdouble
) ctx
->Color
.ClearColor
[1];
1340 params
[2] = (GLdouble
) ctx
->Color
.ClearColor
[2];
1341 params
[3] = (GLdouble
) ctx
->Color
.ClearColor
[3];
1343 case GL_COLOR_MATERIAL
:
1344 *params
= (GLdouble
) ctx
->Light
.ColorMaterialEnabled
;
1346 case GL_COLOR_MATERIAL_FACE
:
1347 *params
= ENUM_TO_DOUBLE(ctx
->Light
.ColorMaterialFace
);
1349 case GL_COLOR_MATERIAL_PARAMETER
:
1350 *params
= ENUM_TO_DOUBLE(ctx
->Light
.ColorMaterialMode
);
1352 case GL_COLOR_WRITEMASK
:
1353 params
[0] = ctx
->Color
.ColorMask
[RCOMP
] ? 1.0 : 0.0;
1354 params
[1] = ctx
->Color
.ColorMask
[GCOMP
] ? 1.0 : 0.0;
1355 params
[2] = ctx
->Color
.ColorMask
[BCOMP
] ? 1.0 : 0.0;
1356 params
[3] = ctx
->Color
.ColorMask
[ACOMP
] ? 1.0 : 0.0;
1359 *params
= (GLdouble
) ctx
->Polygon
.CullFlag
;
1361 case GL_CULL_FACE_MODE
:
1362 *params
= ENUM_TO_DOUBLE(ctx
->Polygon
.CullFaceMode
);
1364 case GL_CURRENT_COLOR
:
1365 params
[0] = UBYTE_COLOR_TO_FLOAT_COLOR(ctx
->Current
.ByteColor
[0]);
1366 params
[1] = UBYTE_COLOR_TO_FLOAT_COLOR(ctx
->Current
.ByteColor
[1]);
1367 params
[2] = UBYTE_COLOR_TO_FLOAT_COLOR(ctx
->Current
.ByteColor
[2]);
1368 params
[3] = UBYTE_COLOR_TO_FLOAT_COLOR(ctx
->Current
.ByteColor
[3]);
1370 case GL_CURRENT_INDEX
:
1371 *params
= (GLdouble
) ctx
->Current
.Index
;
1373 case GL_CURRENT_NORMAL
:
1374 params
[0] = (GLdouble
) ctx
->Current
.Normal
[0];
1375 params
[1] = (GLdouble
) ctx
->Current
.Normal
[1];
1376 params
[2] = (GLdouble
) ctx
->Current
.Normal
[2];
1378 case GL_CURRENT_RASTER_COLOR
:
1379 params
[0] = (GLdouble
) ctx
->Current
.RasterColor
[0];
1380 params
[1] = (GLdouble
) ctx
->Current
.RasterColor
[1];
1381 params
[2] = (GLdouble
) ctx
->Current
.RasterColor
[2];
1382 params
[3] = (GLdouble
) ctx
->Current
.RasterColor
[3];
1384 case GL_CURRENT_RASTER_DISTANCE
:
1385 params
[0] = (GLdouble
) ctx
->Current
.RasterDistance
;
1387 case GL_CURRENT_RASTER_INDEX
:
1388 *params
= (GLdouble
) ctx
->Current
.RasterIndex
;
1390 case GL_CURRENT_RASTER_POSITION
:
1391 params
[0] = (GLdouble
) ctx
->Current
.RasterPos
[0];
1392 params
[1] = (GLdouble
) ctx
->Current
.RasterPos
[1];
1393 params
[2] = (GLdouble
) ctx
->Current
.RasterPos
[2];
1394 params
[3] = (GLdouble
) ctx
->Current
.RasterPos
[3];
1396 case GL_CURRENT_RASTER_TEXTURE_COORDS
:
1397 params
[0] = (GLdouble
) ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][0];
1398 params
[1] = (GLdouble
) ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][1];
1399 params
[2] = (GLdouble
) ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][2];
1400 params
[3] = (GLdouble
) ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][3];
1402 case GL_CURRENT_RASTER_POSITION_VALID
:
1403 *params
= (GLdouble
) ctx
->Current
.RasterPosValid
;
1405 case GL_CURRENT_TEXTURE_COORDS
:
1406 params
[0] = (GLdouble
) ctx
->Current
.Texcoord
[texTransformUnit
][0];
1407 params
[1] = (GLdouble
) ctx
->Current
.Texcoord
[texTransformUnit
][1];
1408 params
[2] = (GLdouble
) ctx
->Current
.Texcoord
[texTransformUnit
][2];
1409 params
[3] = (GLdouble
) ctx
->Current
.Texcoord
[texTransformUnit
][3];
1412 *params
= (GLdouble
) ctx
->Pixel
.DepthBias
;
1415 *params
= (GLdouble
) ctx
->Visual
->DepthBits
;
1417 case GL_DEPTH_CLEAR_VALUE
:
1418 *params
= (GLdouble
) ctx
->Depth
.Clear
;
1421 *params
= ENUM_TO_DOUBLE(ctx
->Depth
.Func
);
1423 case GL_DEPTH_RANGE
:
1424 params
[0] = (GLdouble
) ctx
->Viewport
.Near
;
1425 params
[1] = (GLdouble
) ctx
->Viewport
.Far
;
1427 case GL_DEPTH_SCALE
:
1428 *params
= (GLdouble
) ctx
->Pixel
.DepthScale
;
1431 *params
= (GLdouble
) ctx
->Depth
.Test
;
1433 case GL_DEPTH_WRITEMASK
:
1434 *params
= (GLdouble
) ctx
->Depth
.Mask
;
1437 *params
= (GLdouble
) ctx
->Color
.DitherFlag
;
1439 case GL_DOUBLEBUFFER
:
1440 *params
= (GLdouble
) ctx
->Visual
->DBflag
;
1442 case GL_DRAW_BUFFER
:
1443 *params
= ENUM_TO_DOUBLE(ctx
->Color
.DrawBuffer
);
1446 *params
= (GLdouble
) ctx
->Current
.EdgeFlag
;
1448 case GL_FEEDBACK_BUFFER_SIZE
:
1449 *params
= (GLdouble
) ctx
->Feedback
.BufferSize
;
1451 case GL_FEEDBACK_BUFFER_TYPE
:
1452 *params
= ENUM_TO_DOUBLE(ctx
->Feedback
.Type
);
1455 *params
= (GLdouble
) ctx
->Fog
.Enabled
;
1458 params
[0] = (GLdouble
) ctx
->Fog
.Color
[0];
1459 params
[1] = (GLdouble
) ctx
->Fog
.Color
[1];
1460 params
[2] = (GLdouble
) ctx
->Fog
.Color
[2];
1461 params
[3] = (GLdouble
) ctx
->Fog
.Color
[3];
1463 case GL_FOG_DENSITY
:
1464 *params
= (GLdouble
) ctx
->Fog
.Density
;
1467 *params
= (GLdouble
) ctx
->Fog
.End
;
1470 *params
= ENUM_TO_DOUBLE(ctx
->Hint
.Fog
);
1473 *params
= (GLdouble
) ctx
->Fog
.Index
;
1476 *params
= ENUM_TO_DOUBLE(ctx
->Fog
.Mode
);
1479 *params
= (GLdouble
) ctx
->Fog
.Start
;
1482 *params
= ENUM_TO_DOUBLE(ctx
->Polygon
.FrontFace
);
1485 *params
= (GLdouble
) ctx
->Pixel
.GreenBias
;
1488 *params
= (GLdouble
) ctx
->Visual
->GreenBits
;
1490 case GL_GREEN_SCALE
:
1491 *params
= (GLdouble
) ctx
->Pixel
.GreenScale
;
1494 *params
= (GLdouble
) ctx
->Pixel
.HistogramEnabled
;
1497 *params
= (GLdouble
) ctx
->Visual
->IndexBits
;
1499 case GL_INDEX_CLEAR_VALUE
:
1500 *params
= (GLdouble
) ctx
->Color
.ClearIndex
;
1503 *params
= ctx
->Visual
->RGBAflag
? 0.0 : 1.0;
1505 case GL_INDEX_OFFSET
:
1506 *params
= (GLdouble
) ctx
->Pixel
.IndexOffset
;
1508 case GL_INDEX_SHIFT
:
1509 *params
= (GLdouble
) ctx
->Pixel
.IndexShift
;
1511 case GL_INDEX_WRITEMASK
:
1512 *params
= (GLdouble
) ctx
->Color
.IndexMask
;
1522 *params
= (GLdouble
) ctx
->Light
.Light
[pname
-GL_LIGHT0
].Enabled
;
1525 *params
= (GLdouble
) ctx
->Light
.Enabled
;
1527 case GL_LIGHT_MODEL_AMBIENT
:
1528 params
[0] = (GLdouble
) ctx
->Light
.Model
.Ambient
[0];
1529 params
[1] = (GLdouble
) ctx
->Light
.Model
.Ambient
[1];
1530 params
[2] = (GLdouble
) ctx
->Light
.Model
.Ambient
[2];
1531 params
[3] = (GLdouble
) ctx
->Light
.Model
.Ambient
[3];
1533 case GL_LIGHT_MODEL_COLOR_CONTROL
:
1534 params
[0] = (GLdouble
) ctx
->Light
.Model
.ColorControl
;
1536 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
1537 *params
= (GLdouble
) ctx
->Light
.Model
.LocalViewer
;
1539 case GL_LIGHT_MODEL_TWO_SIDE
:
1540 *params
= (GLdouble
) ctx
->Light
.Model
.TwoSide
;
1542 case GL_LINE_SMOOTH
:
1543 *params
= (GLdouble
) ctx
->Line
.SmoothFlag
;
1545 case GL_LINE_SMOOTH_HINT
:
1546 *params
= ENUM_TO_DOUBLE(ctx
->Hint
.LineSmooth
);
1548 case GL_LINE_STIPPLE
:
1549 *params
= (GLdouble
) ctx
->Line
.StippleFlag
;
1551 case GL_LINE_STIPPLE_PATTERN
:
1552 *params
= (GLdouble
) ctx
->Line
.StipplePattern
;
1554 case GL_LINE_STIPPLE_REPEAT
:
1555 *params
= (GLdouble
) ctx
->Line
.StippleFactor
;
1558 *params
= (GLdouble
) ctx
->Line
.Width
;
1560 case GL_LINE_WIDTH_GRANULARITY
:
1561 *params
= (GLdouble
) ctx
->Const
.LineWidthGranularity
;
1563 case GL_LINE_WIDTH_RANGE
:
1564 params
[0] = (GLdouble
) ctx
->Const
.MinLineWidthAA
;
1565 params
[1] = (GLdouble
) ctx
->Const
.MaxLineWidthAA
;
1567 case GL_ALIASED_LINE_WIDTH_RANGE
:
1568 params
[0] = (GLdouble
) ctx
->Const
.MinLineWidth
;
1569 params
[1] = (GLdouble
) ctx
->Const
.MaxLineWidth
;
1572 *params
= (GLdouble
) ctx
->List
.ListBase
;
1575 *params
= (GLdouble
) ctx
->CurrentListNum
;
1578 *params
= ctx
->ExecuteFlag
? ENUM_TO_DOUBLE(GL_COMPILE_AND_EXECUTE
)
1579 : ENUM_TO_DOUBLE(GL_COMPILE
);
1581 case GL_INDEX_LOGIC_OP
:
1582 *params
= (GLdouble
) ctx
->Color
.IndexLogicOpEnabled
;
1584 case GL_COLOR_LOGIC_OP
:
1585 *params
= (GLdouble
) ctx
->Color
.ColorLogicOpEnabled
;
1587 case GL_LOGIC_OP_MODE
:
1588 *params
= ENUM_TO_DOUBLE(ctx
->Color
.LogicOp
);
1590 case GL_MAP1_COLOR_4
:
1591 *params
= (GLdouble
) ctx
->Eval
.Map1Color4
;
1593 case GL_MAP1_GRID_DOMAIN
:
1594 params
[0] = (GLdouble
) ctx
->Eval
.MapGrid1u1
;
1595 params
[1] = (GLdouble
) ctx
->Eval
.MapGrid1u2
;
1597 case GL_MAP1_GRID_SEGMENTS
:
1598 *params
= (GLdouble
) ctx
->Eval
.MapGrid1un
;
1601 *params
= (GLdouble
) ctx
->Eval
.Map1Index
;
1603 case GL_MAP1_NORMAL
:
1604 *params
= (GLdouble
) ctx
->Eval
.Map1Normal
;
1606 case GL_MAP1_TEXTURE_COORD_1
:
1607 *params
= (GLdouble
) ctx
->Eval
.Map1TextureCoord1
;
1609 case GL_MAP1_TEXTURE_COORD_2
:
1610 *params
= (GLdouble
) ctx
->Eval
.Map1TextureCoord2
;
1612 case GL_MAP1_TEXTURE_COORD_3
:
1613 *params
= (GLdouble
) ctx
->Eval
.Map1TextureCoord3
;
1615 case GL_MAP1_TEXTURE_COORD_4
:
1616 *params
= (GLdouble
) ctx
->Eval
.Map1TextureCoord4
;
1618 case GL_MAP1_VERTEX_3
:
1619 *params
= (GLdouble
) ctx
->Eval
.Map1Vertex3
;
1621 case GL_MAP1_VERTEX_4
:
1622 *params
= (GLdouble
) ctx
->Eval
.Map1Vertex4
;
1624 case GL_MAP2_COLOR_4
:
1625 *params
= (GLdouble
) ctx
->Eval
.Map2Color4
;
1627 case GL_MAP2_GRID_DOMAIN
:
1628 params
[0] = (GLdouble
) ctx
->Eval
.MapGrid2u1
;
1629 params
[1] = (GLdouble
) ctx
->Eval
.MapGrid2u2
;
1630 params
[2] = (GLdouble
) ctx
->Eval
.MapGrid2v1
;
1631 params
[3] = (GLdouble
) ctx
->Eval
.MapGrid2v2
;
1633 case GL_MAP2_GRID_SEGMENTS
:
1634 params
[0] = (GLdouble
) ctx
->Eval
.MapGrid2un
;
1635 params
[1] = (GLdouble
) ctx
->Eval
.MapGrid2vn
;
1638 *params
= (GLdouble
) ctx
->Eval
.Map2Index
;
1640 case GL_MAP2_NORMAL
:
1641 *params
= (GLdouble
) ctx
->Eval
.Map2Normal
;
1643 case GL_MAP2_TEXTURE_COORD_1
:
1644 *params
= (GLdouble
) ctx
->Eval
.Map2TextureCoord1
;
1646 case GL_MAP2_TEXTURE_COORD_2
:
1647 *params
= (GLdouble
) ctx
->Eval
.Map2TextureCoord2
;
1649 case GL_MAP2_TEXTURE_COORD_3
:
1650 *params
= (GLdouble
) ctx
->Eval
.Map2TextureCoord3
;
1652 case GL_MAP2_TEXTURE_COORD_4
:
1653 *params
= (GLdouble
) ctx
->Eval
.Map2TextureCoord4
;
1655 case GL_MAP2_VERTEX_3
:
1656 *params
= (GLdouble
) ctx
->Eval
.Map2Vertex3
;
1658 case GL_MAP2_VERTEX_4
:
1659 *params
= (GLdouble
) ctx
->Eval
.Map2Vertex4
;
1662 *params
= (GLdouble
) ctx
->Pixel
.MapColorFlag
;
1664 case GL_MAP_STENCIL
:
1665 *params
= (GLdouble
) ctx
->Pixel
.MapStencilFlag
;
1667 case GL_MATRIX_MODE
:
1668 *params
= ENUM_TO_DOUBLE(ctx
->Transform
.MatrixMode
);
1670 case GL_MAX_ATTRIB_STACK_DEPTH
:
1671 *params
= (GLdouble
) MAX_ATTRIB_STACK_DEPTH
;
1673 case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
:
1674 *params
= (GLdouble
) MAX_CLIENT_ATTRIB_STACK_DEPTH
;
1676 case GL_MAX_CLIP_PLANES
:
1677 *params
= (GLdouble
) MAX_CLIP_PLANES
;
1679 case GL_MAX_ELEMENTS_VERTICES
: /* GL_VERSION_1_2 */
1680 *params
= (GLdouble
) VB_MAX
;
1682 case GL_MAX_ELEMENTS_INDICES
: /* GL_VERSION_1_2 */
1683 *params
= (GLdouble
) VB_MAX
;
1685 case GL_MAX_EVAL_ORDER
:
1686 *params
= (GLdouble
) MAX_EVAL_ORDER
;
1689 *params
= (GLdouble
) MAX_LIGHTS
;
1691 case GL_MAX_LIST_NESTING
:
1692 *params
= (GLdouble
) MAX_LIST_NESTING
;
1694 case GL_MAX_MODELVIEW_STACK_DEPTH
:
1695 *params
= (GLdouble
) MAX_MODELVIEW_STACK_DEPTH
;
1697 case GL_MAX_NAME_STACK_DEPTH
:
1698 *params
= (GLdouble
) MAX_NAME_STACK_DEPTH
;
1700 case GL_MAX_PIXEL_MAP_TABLE
:
1701 *params
= (GLdouble
) MAX_PIXEL_MAP_TABLE
;
1703 case GL_MAX_PROJECTION_STACK_DEPTH
:
1704 *params
= (GLdouble
) MAX_PROJECTION_STACK_DEPTH
;
1706 case GL_MAX_TEXTURE_SIZE
:
1707 case GL_MAX_3D_TEXTURE_SIZE
:
1708 *params
= (GLdouble
) ctx
->Const
.MaxTextureSize
;
1710 case GL_MAX_TEXTURE_STACK_DEPTH
:
1711 *params
= (GLdouble
) MAX_TEXTURE_STACK_DEPTH
;
1713 case GL_MAX_VIEWPORT_DIMS
:
1714 params
[0] = (GLdouble
) MAX_WIDTH
;
1715 params
[1] = (GLdouble
) MAX_HEIGHT
;
1718 *params
= (GLdouble
) ctx
->Pixel
.MinMaxEnabled
;
1720 case GL_MODELVIEW_MATRIX
:
1721 for (i
=0;i
<16;i
++) {
1722 params
[i
] = (GLdouble
) ctx
->ModelView
.m
[i
];
1725 case GL_MODELVIEW_STACK_DEPTH
:
1726 *params
= (GLdouble
) (ctx
->ModelViewStackDepth
+ 1);
1728 case GL_NAME_STACK_DEPTH
:
1729 *params
= (GLdouble
) ctx
->Select
.NameStackDepth
;
1732 *params
= (GLdouble
) ctx
->Transform
.Normalize
;
1734 case GL_PACK_ALIGNMENT
:
1735 *params
= (GLdouble
) ctx
->Pack
.Alignment
;
1737 case GL_PACK_LSB_FIRST
:
1738 *params
= (GLdouble
) ctx
->Pack
.LsbFirst
;
1740 case GL_PACK_ROW_LENGTH
:
1741 *params
= (GLdouble
) ctx
->Pack
.RowLength
;
1743 case GL_PACK_SKIP_PIXELS
:
1744 *params
= (GLdouble
) ctx
->Pack
.SkipPixels
;
1746 case GL_PACK_SKIP_ROWS
:
1747 *params
= (GLdouble
) ctx
->Pack
.SkipRows
;
1749 case GL_PACK_SWAP_BYTES
:
1750 *params
= (GLdouble
) ctx
->Pack
.SwapBytes
;
1752 case GL_PACK_SKIP_IMAGES_EXT
:
1753 *params
= (GLdouble
) ctx
->Pack
.SkipImages
;
1755 case GL_PACK_IMAGE_HEIGHT_EXT
:
1756 *params
= (GLdouble
) ctx
->Pack
.ImageHeight
;
1758 case GL_PERSPECTIVE_CORRECTION_HINT
:
1759 *params
= ENUM_TO_DOUBLE(ctx
->Hint
.PerspectiveCorrection
);
1761 case GL_PIXEL_MAP_A_TO_A_SIZE
:
1762 *params
= (GLdouble
) ctx
->Pixel
.MapAtoAsize
;
1764 case GL_PIXEL_MAP_B_TO_B_SIZE
:
1765 *params
= (GLdouble
) ctx
->Pixel
.MapBtoBsize
;
1767 case GL_PIXEL_MAP_G_TO_G_SIZE
:
1768 *params
= (GLdouble
) ctx
->Pixel
.MapGtoGsize
;
1770 case GL_PIXEL_MAP_I_TO_A_SIZE
:
1771 *params
= (GLdouble
) ctx
->Pixel
.MapItoAsize
;
1773 case GL_PIXEL_MAP_I_TO_B_SIZE
:
1774 *params
= (GLdouble
) ctx
->Pixel
.MapItoBsize
;
1776 case GL_PIXEL_MAP_I_TO_G_SIZE
:
1777 *params
= (GLdouble
) ctx
->Pixel
.MapItoGsize
;
1779 case GL_PIXEL_MAP_I_TO_I_SIZE
:
1780 *params
= (GLdouble
) ctx
->Pixel
.MapItoIsize
;
1782 case GL_PIXEL_MAP_I_TO_R_SIZE
:
1783 *params
= (GLdouble
) ctx
->Pixel
.MapItoRsize
;
1785 case GL_PIXEL_MAP_R_TO_R_SIZE
:
1786 *params
= (GLdouble
) ctx
->Pixel
.MapRtoRsize
;
1788 case GL_PIXEL_MAP_S_TO_S_SIZE
:
1789 *params
= (GLdouble
) ctx
->Pixel
.MapStoSsize
;
1792 *params
= (GLdouble
) ctx
->Point
.UserSize
;
1794 case GL_POINT_SIZE_GRANULARITY
:
1795 *params
= (GLdouble
) ctx
->Const
.PointSizeGranularity
;
1797 case GL_POINT_SIZE_RANGE
:
1798 params
[0] = (GLdouble
) ctx
->Const
.MinPointSizeAA
;
1799 params
[1] = (GLdouble
) ctx
->Const
.MaxPointSizeAA
;
1801 case GL_ALIASED_POINT_SIZE_RANGE
:
1802 params
[0] = (GLdouble
) ctx
->Const
.MinPointSize
;
1803 params
[1] = (GLdouble
) ctx
->Const
.MaxPointSize
;
1805 case GL_POINT_SMOOTH
:
1806 *params
= (GLdouble
) ctx
->Point
.SmoothFlag
;
1808 case GL_POINT_SMOOTH_HINT
:
1809 *params
= ENUM_TO_DOUBLE(ctx
->Hint
.PointSmooth
);
1811 case GL_POINT_SIZE_MIN_EXT
:
1812 *params
= (GLdouble
) (ctx
->Point
.MinSize
);
1814 case GL_POINT_SIZE_MAX_EXT
:
1815 *params
= (GLdouble
) (ctx
->Point
.MaxSize
);
1817 case GL_POINT_FADE_THRESHOLD_SIZE_EXT
:
1818 *params
= (GLdouble
) (ctx
->Point
.Threshold
);
1820 case GL_DISTANCE_ATTENUATION_EXT
:
1821 params
[0] = (GLdouble
) (ctx
->Point
.Params
[0]);
1822 params
[1] = (GLdouble
) (ctx
->Point
.Params
[1]);
1823 params
[2] = (GLdouble
) (ctx
->Point
.Params
[2]);
1825 case GL_POLYGON_MODE
:
1826 params
[0] = ENUM_TO_DOUBLE(ctx
->Polygon
.FrontMode
);
1827 params
[1] = ENUM_TO_DOUBLE(ctx
->Polygon
.BackMode
);
1829 case GL_POLYGON_OFFSET_BIAS_EXT
: /* GL_EXT_polygon_offset */
1830 *params
= (GLdouble
) ctx
->Polygon
.OffsetUnits
;
1832 case GL_POLYGON_OFFSET_FACTOR
:
1833 *params
= (GLdouble
) ctx
->Polygon
.OffsetFactor
;
1835 case GL_POLYGON_OFFSET_UNITS
:
1836 *params
= (GLdouble
) ctx
->Polygon
.OffsetUnits
;
1838 case GL_POLYGON_SMOOTH
:
1839 *params
= (GLdouble
) ctx
->Polygon
.SmoothFlag
;
1841 case GL_POLYGON_SMOOTH_HINT
:
1842 *params
= ENUM_TO_DOUBLE(ctx
->Hint
.PolygonSmooth
);
1844 case GL_POLYGON_STIPPLE
:
1845 *params
= (GLdouble
) ctx
->Polygon
.StippleFlag
;
1847 case GL_PROJECTION_MATRIX
:
1848 for (i
=0;i
<16;i
++) {
1849 params
[i
] = (GLdouble
) ctx
->ProjectionMatrix
.m
[i
];
1852 case GL_PROJECTION_STACK_DEPTH
:
1853 *params
= (GLdouble
) (ctx
->ProjectionStackDepth
+ 1);
1855 case GL_READ_BUFFER
:
1856 *params
= ENUM_TO_DOUBLE(ctx
->Pixel
.ReadBuffer
);
1859 *params
= (GLdouble
) ctx
->Pixel
.RedBias
;
1862 *params
= (GLdouble
) ctx
->Visual
->RedBits
;
1865 *params
= (GLdouble
) ctx
->Pixel
.RedScale
;
1867 case GL_RENDER_MODE
:
1868 *params
= ENUM_TO_DOUBLE(ctx
->RenderMode
);
1871 *params
= (GLdouble
) ctx
->Visual
->RGBAflag
;
1873 case GL_SCISSOR_BOX
:
1874 params
[0] = (GLdouble
) ctx
->Scissor
.X
;
1875 params
[1] = (GLdouble
) ctx
->Scissor
.Y
;
1876 params
[2] = (GLdouble
) ctx
->Scissor
.Width
;
1877 params
[3] = (GLdouble
) ctx
->Scissor
.Height
;
1879 case GL_SCISSOR_TEST
:
1880 *params
= (GLdouble
) ctx
->Scissor
.Enabled
;
1882 case GL_SELECTION_BUFFER_SIZE
:
1883 *params
= (GLdouble
) ctx
->Select
.BufferSize
;
1885 case GL_SHADE_MODEL
:
1886 *params
= ENUM_TO_DOUBLE(ctx
->Light
.ShadeModel
);
1888 case GL_SHARED_TEXTURE_PALETTE_EXT
:
1889 *params
= (GLdouble
) ctx
->Texture
.SharedPalette
;
1891 case GL_STENCIL_BITS
:
1892 *params
= (GLdouble
) ctx
->Visual
->StencilBits
;
1894 case GL_STENCIL_CLEAR_VALUE
:
1895 *params
= (GLdouble
) ctx
->Stencil
.Clear
;
1897 case GL_STENCIL_FAIL
:
1898 *params
= ENUM_TO_DOUBLE(ctx
->Stencil
.FailFunc
);
1900 case GL_STENCIL_FUNC
:
1901 *params
= ENUM_TO_DOUBLE(ctx
->Stencil
.Function
);
1903 case GL_STENCIL_PASS_DEPTH_FAIL
:
1904 *params
= ENUM_TO_DOUBLE(ctx
->Stencil
.ZFailFunc
);
1906 case GL_STENCIL_PASS_DEPTH_PASS
:
1907 *params
= ENUM_TO_DOUBLE(ctx
->Stencil
.ZPassFunc
);
1909 case GL_STENCIL_REF
:
1910 *params
= (GLdouble
) ctx
->Stencil
.Ref
;
1912 case GL_STENCIL_TEST
:
1913 *params
= (GLdouble
) ctx
->Stencil
.Enabled
;
1915 case GL_STENCIL_VALUE_MASK
:
1916 *params
= (GLdouble
) ctx
->Stencil
.ValueMask
;
1918 case GL_STENCIL_WRITEMASK
:
1919 *params
= (GLdouble
) ctx
->Stencil
.WriteMask
;
1922 *params
= (GLdouble
) ctx
->Visual
->StereoFlag
;
1924 case GL_SUBPIXEL_BITS
:
1925 *params
= (GLdouble
) ctx
->Const
.SubPixelBits
;
1928 *params
= _mesa_IsEnabled(GL_TEXTURE_1D
) ? 1.0 : 0.0;
1931 *params
= _mesa_IsEnabled(GL_TEXTURE_2D
) ? 1.0 : 0.0;
1934 *params
= _mesa_IsEnabled(GL_TEXTURE_3D
) ? 1.0 : 0.0;
1936 case GL_TEXTURE_BINDING_1D
:
1937 *params
= (GLdouble
) textureUnit
->CurrentD
[1]->Name
;
1939 case GL_TEXTURE_BINDING_2D
:
1940 *params
= (GLdouble
) textureUnit
->CurrentD
[2]->Name
;
1942 case GL_TEXTURE_BINDING_3D
:
1943 *params
= (GLdouble
) textureUnit
->CurrentD
[3]->Name
;
1945 case GL_TEXTURE_ENV_COLOR
:
1946 params
[0] = (GLdouble
) textureUnit
->EnvColor
[0];
1947 params
[1] = (GLdouble
) textureUnit
->EnvColor
[1];
1948 params
[2] = (GLdouble
) textureUnit
->EnvColor
[2];
1949 params
[3] = (GLdouble
) textureUnit
->EnvColor
[3];
1951 case GL_TEXTURE_ENV_MODE
:
1952 *params
= ENUM_TO_DOUBLE(textureUnit
->EnvMode
);
1954 case GL_TEXTURE_GEN_S
:
1955 *params
= (textureUnit
->TexGenEnabled
& S_BIT
) ? 1.0 : 0.0;
1957 case GL_TEXTURE_GEN_T
:
1958 *params
= (textureUnit
->TexGenEnabled
& T_BIT
) ? 1.0 : 0.0;
1960 case GL_TEXTURE_GEN_R
:
1961 *params
= (textureUnit
->TexGenEnabled
& R_BIT
) ? 1.0 : 0.0;
1963 case GL_TEXTURE_GEN_Q
:
1964 *params
= (textureUnit
->TexGenEnabled
& Q_BIT
) ? 1.0 : 0.0;
1966 case GL_TEXTURE_MATRIX
:
1967 for (i
=0;i
<16;i
++) {
1968 params
[i
] = (GLdouble
) ctx
->TextureMatrix
[texTransformUnit
].m
[i
];
1971 case GL_TEXTURE_STACK_DEPTH
:
1972 *params
= (GLdouble
) (ctx
->TextureStackDepth
[texTransformUnit
] + 1);
1974 case GL_UNPACK_ALIGNMENT
:
1975 *params
= (GLdouble
) ctx
->Unpack
.Alignment
;
1977 case GL_UNPACK_LSB_FIRST
:
1978 *params
= (GLdouble
) ctx
->Unpack
.LsbFirst
;
1980 case GL_UNPACK_ROW_LENGTH
:
1981 *params
= (GLdouble
) ctx
->Unpack
.RowLength
;
1983 case GL_UNPACK_SKIP_PIXELS
:
1984 *params
= (GLdouble
) ctx
->Unpack
.SkipPixels
;
1986 case GL_UNPACK_SKIP_ROWS
:
1987 *params
= (GLdouble
) ctx
->Unpack
.SkipRows
;
1989 case GL_UNPACK_SWAP_BYTES
:
1990 *params
= (GLdouble
) ctx
->Unpack
.SwapBytes
;
1992 case GL_UNPACK_SKIP_IMAGES_EXT
:
1993 *params
= (GLdouble
) ctx
->Unpack
.SkipImages
;
1995 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
1996 *params
= (GLdouble
) ctx
->Unpack
.ImageHeight
;
1999 params
[0] = (GLdouble
) ctx
->Viewport
.X
;
2000 params
[1] = (GLdouble
) ctx
->Viewport
.Y
;
2001 params
[2] = (GLdouble
) ctx
->Viewport
.Width
;
2002 params
[3] = (GLdouble
) ctx
->Viewport
.Height
;
2005 *params
= (GLdouble
) ctx
->Pixel
.ZoomX
;
2008 *params
= (GLdouble
) ctx
->Pixel
.ZoomY
;
2010 case GL_VERTEX_ARRAY
:
2011 *params
= (GLdouble
) ctx
->Array
.Vertex
.Enabled
;
2013 case GL_VERTEX_ARRAY_SIZE
:
2014 *params
= (GLdouble
) ctx
->Array
.Vertex
.Size
;
2016 case GL_VERTEX_ARRAY_TYPE
:
2017 *params
= ENUM_TO_DOUBLE(ctx
->Array
.Vertex
.Type
);
2019 case GL_VERTEX_ARRAY_STRIDE
:
2020 *params
= (GLdouble
) ctx
->Array
.Vertex
.Stride
;
2022 case GL_VERTEX_ARRAY_COUNT_EXT
:
2025 case GL_NORMAL_ARRAY
:
2026 *params
= (GLdouble
) ctx
->Array
.Normal
.Enabled
;
2028 case GL_NORMAL_ARRAY_TYPE
:
2029 *params
= ENUM_TO_DOUBLE(ctx
->Array
.Normal
.Type
);
2031 case GL_NORMAL_ARRAY_STRIDE
:
2032 *params
= (GLdouble
) ctx
->Array
.Normal
.Stride
;
2034 case GL_NORMAL_ARRAY_COUNT_EXT
:
2037 case GL_COLOR_ARRAY
:
2038 *params
= (GLdouble
) ctx
->Array
.Color
.Enabled
;
2040 case GL_COLOR_ARRAY_SIZE
:
2041 *params
= (GLdouble
) ctx
->Array
.Color
.Size
;
2043 case GL_COLOR_ARRAY_TYPE
:
2044 *params
= ENUM_TO_DOUBLE(ctx
->Array
.Color
.Type
);
2046 case GL_COLOR_ARRAY_STRIDE
:
2047 *params
= (GLdouble
) ctx
->Array
.Color
.Stride
;
2049 case GL_COLOR_ARRAY_COUNT_EXT
:
2052 case GL_INDEX_ARRAY
:
2053 *params
= (GLdouble
) ctx
->Array
.Index
.Enabled
;
2055 case GL_INDEX_ARRAY_TYPE
:
2056 *params
= ENUM_TO_DOUBLE(ctx
->Array
.Index
.Type
);
2058 case GL_INDEX_ARRAY_STRIDE
:
2059 *params
= (GLdouble
) ctx
->Array
.Index
.Stride
;
2061 case GL_INDEX_ARRAY_COUNT_EXT
:
2064 case GL_TEXTURE_COORD_ARRAY
:
2065 *params
= (GLdouble
) ctx
->Array
.TexCoord
[texUnit
].Enabled
;
2067 case GL_TEXTURE_COORD_ARRAY_SIZE
:
2068 *params
= (GLdouble
) ctx
->Array
.TexCoord
[texUnit
].Size
;
2070 case GL_TEXTURE_COORD_ARRAY_TYPE
:
2071 *params
= ENUM_TO_DOUBLE(ctx
->Array
.TexCoord
[texUnit
].Type
);
2073 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
2074 *params
= (GLdouble
) ctx
->Array
.TexCoord
[texUnit
].Stride
;
2076 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
2079 case GL_EDGE_FLAG_ARRAY
:
2080 *params
= (GLdouble
) ctx
->Array
.EdgeFlag
.Enabled
;
2082 case GL_EDGE_FLAG_ARRAY_STRIDE
:
2083 *params
= (GLdouble
) ctx
->Array
.EdgeFlag
.Stride
;
2085 case GL_EDGE_FLAG_ARRAY_COUNT_EXT
:
2089 /* GL_ARB_multitexture */
2090 case GL_MAX_TEXTURE_UNITS_ARB
:
2091 *params
= (GLdouble
) ctx
->Const
.MaxTextureUnits
;
2093 case GL_ACTIVE_TEXTURE_ARB
:
2094 *params
= (GLdouble
) (GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
);
2096 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
2097 *params
= (GLdouble
) (GL_TEXTURE0_ARB
+ ctx
->Array
.ActiveTexture
);
2100 /* GL_ARB_texture_cube_map */
2101 case GL_TEXTURE_CUBE_MAP_ARB
:
2102 if (ctx
->Extensions
.HaveTextureCubeMap
)
2103 *params
= (GLdouble
) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
);
2105 gl_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2107 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
2108 if (ctx
->Extensions
.HaveTextureCubeMap
)
2109 *params
= (GLdouble
) textureUnit
->CurrentCubeMap
->Name
;
2111 gl_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2113 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
2114 if (ctx
->Extensions
.HaveTextureCubeMap
)
2115 *params
= (GLdouble
) ctx
->Const
.MaxCubeTextureSize
;
2117 gl_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2120 /* GL_ARB_texture_compression */
2121 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
2122 if (ctx
->Extensions
.HaveTextureCompression
) {
2123 *params
= (GLdouble
) ctx
->Hint
.TextureCompression
;
2126 gl_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2128 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
2129 if (ctx
->Extensions
.HaveTextureCompression
) {
2130 *params
= (GLdouble
) ctx
->Const
.NumCompressedTextureFormats
;
2133 gl_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2135 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
2136 if (ctx
->Extensions
.HaveTextureCompression
) {
2138 for (i
= 0; i
< ctx
->Const
.NumCompressedTextureFormats
; i
++)
2139 params
[i
] = (GLdouble
) ctx
->Const
.CompressedTextureFormats
[i
];
2142 gl_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2145 /* GL_PGI_misc_hints */
2146 case GL_STRICT_DEPTHFUNC_HINT_PGI
:
2147 *params
= ENUM_TO_DOUBLE(GL_NICEST
);
2149 case GL_STRICT_LIGHTING_HINT_PGI
:
2150 *params
= ENUM_TO_DOUBLE(ctx
->Hint
.StrictLighting
);
2152 case GL_STRICT_SCISSOR_HINT_PGI
:
2153 case GL_FULL_STIPPLE_HINT_PGI
:
2154 *params
= ENUM_TO_DOUBLE(GL_TRUE
);
2156 case GL_CONSERVE_MEMORY_HINT_PGI
:
2157 *params
= ENUM_TO_DOUBLE(GL_FALSE
);
2159 case GL_ALWAYS_FAST_HINT_PGI
:
2160 *params
= (GLdouble
) (ctx
->Hint
.AllowDrawWin
== GL_TRUE
&&
2161 ctx
->Hint
.AllowDrawFrg
== GL_FALSE
&&
2162 ctx
->Hint
.AllowDrawMem
== GL_FALSE
);
2164 case GL_ALWAYS_SOFT_HINT_PGI
:
2165 *params
= (GLdouble
) (ctx
->Hint
.AllowDrawWin
== GL_TRUE
&&
2166 ctx
->Hint
.AllowDrawFrg
== GL_TRUE
&&
2167 ctx
->Hint
.AllowDrawMem
== GL_TRUE
);
2169 case GL_ALLOW_DRAW_OBJ_HINT_PGI
:
2170 *params
= (GLdouble
) GL_TRUE
;
2172 case GL_ALLOW_DRAW_WIN_HINT_PGI
:
2173 *params
= (GLdouble
) ctx
->Hint
.AllowDrawWin
;
2175 case GL_ALLOW_DRAW_FRG_HINT_PGI
:
2176 *params
= (GLdouble
) ctx
->Hint
.AllowDrawFrg
;
2178 case GL_ALLOW_DRAW_MEM_HINT_PGI
:
2179 *params
= (GLdouble
) ctx
->Hint
.AllowDrawMem
;
2181 case GL_CLIP_NEAR_HINT_PGI
:
2182 case GL_CLIP_FAR_HINT_PGI
:
2183 *params
= ENUM_TO_DOUBLE(GL_TRUE
);
2185 case GL_WIDE_LINE_HINT_PGI
:
2186 *params
= ENUM_TO_DOUBLE(GL_DONT_CARE
);
2188 case GL_BACK_NORMALS_HINT_PGI
:
2189 *params
= ENUM_TO_DOUBLE(GL_TRUE
);
2191 case GL_NATIVE_GRAPHICS_HANDLE_PGI
:
2195 /* GL_EXT_compiled_vertex_array */
2196 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
2197 *params
= (GLdouble
) ctx
->Array
.LockFirst
;
2199 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
2200 *params
= (GLdouble
) ctx
->Array
.LockCount
;
2203 /* GL_ARB_transpose_matrix */
2204 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
2208 gl_matrix_transposef(tm
, ctx
->ColorMatrix
.m
);
2209 for (i
=0;i
<16;i
++) {
2210 params
[i
] = (GLdouble
) tm
[i
];
2214 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
2218 gl_matrix_transposef(tm
, ctx
->ModelView
.m
);
2219 for (i
=0;i
<16;i
++) {
2220 params
[i
] = (GLdouble
) tm
[i
];
2224 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
2228 gl_matrix_transposef(tm
, ctx
->ProjectionMatrix
.m
);
2229 for (i
=0;i
<16;i
++) {
2230 params
[i
] = (GLdouble
) tm
[i
];
2234 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
2238 gl_matrix_transposef(tm
, ctx
->TextureMatrix
[texTransformUnit
].m
);
2239 for (i
=0;i
<16;i
++) {
2240 params
[i
] = (GLdouble
) tm
[i
];
2245 /* GL_HP_occlusion_test */
2246 case GL_OCCLUSION_TEST_HP
:
2247 if (ctx
->Extensions
.HaveHpOcclusionTest
) {
2248 *params
= (GLdouble
) ctx
->Depth
.OcclusionTest
;
2251 gl_error( ctx
, GL_INVALID_ENUM
, "glGetDoublev" );
2254 case GL_OCCLUSION_TEST_RESULT_HP
:
2255 if (ctx
->Extensions
.HaveHpOcclusionTest
) {
2256 if (ctx
->Depth
.OcclusionTest
)
2257 *params
= (GLdouble
) ctx
->OcclusionResult
;
2259 *params
= (GLdouble
) ctx
->OcclusionResultSaved
;
2260 /* reset flag now */
2261 ctx
->OcclusionResult
= GL_FALSE
;
2262 ctx
->OcclusionResultSaved
= GL_FALSE
;
2265 gl_error( ctx
, GL_INVALID_ENUM
, "glGetDoublev" );
2269 /* GL_SGIS_pixel_texture */
2270 case GL_PIXEL_TEXTURE_SGIS
:
2271 *params
= (GLdouble
) ctx
->Pixel
.PixelTextureEnabled
;
2274 /* GL_SGIX_pixel_texture */
2275 case GL_PIXEL_TEX_GEN_SGIX
:
2276 *params
= (GLdouble
) ctx
->Pixel
.PixelTextureEnabled
;
2278 case GL_PIXEL_TEX_GEN_MODE_SGIX
:
2279 *params
= (GLdouble
) pixel_texgen_mode(ctx
);
2282 /* GL_SGI_color_matrix (also in 1.2 imaging) */
2283 case GL_COLOR_MATRIX_SGI
:
2284 for (i
=0;i
<16;i
++) {
2285 params
[i
] = (GLdouble
) ctx
->ColorMatrix
.m
[i
];
2288 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
2289 *params
= (GLdouble
) (ctx
->ColorStackDepth
+ 1);
2291 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
2292 *params
= (GLdouble
) MAX_COLOR_STACK_DEPTH
;
2294 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
2295 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixScale
[0];
2297 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
2298 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixScale
[1];
2300 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
2301 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixScale
[2];
2303 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
2304 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixScale
[3];
2306 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
2307 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixBias
[0];
2309 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
2310 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixBias
[1];
2312 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
2313 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixBias
[2];
2315 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
2316 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixBias
[3];
2319 /* GL_EXT_convolution (also in 1.2 imaging) */
2320 case GL_MAX_CONVOLUTION_WIDTH
:
2321 *params
= (GLdouble
) ctx
->Const
.MaxConvolutionWidth
;
2323 case GL_MAX_CONVOLUTION_HEIGHT
:
2324 *params
= (GLdouble
) ctx
->Const
.MaxConvolutionHeight
;
2326 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
2327 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionScale
[0];
2329 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
2330 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionScale
[1];
2332 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
2333 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionScale
[2];
2335 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
2336 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionScale
[3];
2338 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
2339 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionBias
[0];
2341 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
2342 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionBias
[1];
2344 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
2345 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionBias
[2];
2347 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
2348 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionBias
[2];
2351 /* GL_SGI_color_table (also in 1.2 imaging */
2352 case GL_COLOR_TABLE_SGI
:
2353 *params
= (GLdouble
) ctx
->Pixel
.ColorTableEnabled
;
2355 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
2356 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionColorTableEnabled
;
2358 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
2359 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixColorTableEnabled
;
2363 gl_error( ctx
, GL_INVALID_ENUM
, "glGetDoublev" );
2371 _mesa_GetFloatv( GLenum pname
, GLfloat
*params
)
2373 GET_CURRENT_CONTEXT(ctx
);
2375 GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
2376 GLuint texTransformUnit
= ctx
->Texture
.CurrentTransformUnit
;
2377 const struct gl_texture_unit
*textureUnit
= &ctx
->Texture
.Unit
[texUnit
];
2379 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
, "glGetFloatv");
2381 if (MESA_VERBOSE
& VERBOSE_API
)
2382 fprintf(stderr
, "glGetFloatv %s\n", gl_lookup_enum_by_nr(pname
));
2385 case GL_ACCUM_RED_BITS
:
2386 *params
= (GLfloat
) ctx
->Visual
->AccumRedBits
;
2388 case GL_ACCUM_GREEN_BITS
:
2389 *params
= (GLfloat
) ctx
->Visual
->AccumGreenBits
;
2391 case GL_ACCUM_BLUE_BITS
:
2392 *params
= (GLfloat
) ctx
->Visual
->AccumBlueBits
;
2394 case GL_ACCUM_ALPHA_BITS
:
2395 *params
= (GLfloat
) ctx
->Visual
->AccumAlphaBits
;
2397 case GL_ACCUM_CLEAR_VALUE
:
2398 params
[0] = ctx
->Accum
.ClearColor
[0];
2399 params
[1] = ctx
->Accum
.ClearColor
[1];
2400 params
[2] = ctx
->Accum
.ClearColor
[2];
2401 params
[3] = ctx
->Accum
.ClearColor
[3];
2404 *params
= ctx
->Pixel
.AlphaBias
;
2407 *params
= (GLfloat
) ctx
->Visual
->AlphaBits
;
2409 case GL_ALPHA_SCALE
:
2410 *params
= ctx
->Pixel
.AlphaScale
;
2413 *params
= (GLfloat
) ctx
->Color
.AlphaEnabled
;
2415 case GL_ALPHA_TEST_FUNC
:
2416 *params
= ENUM_TO_FLOAT(ctx
->Color
.AlphaFunc
);
2418 case GL_ALPHA_TEST_REF
:
2419 *params
= (GLfloat
) ctx
->Color
.AlphaRef
/ 255.0;
2421 case GL_ATTRIB_STACK_DEPTH
:
2422 *params
= (GLfloat
) (ctx
->AttribStackDepth
);
2424 case GL_AUTO_NORMAL
:
2425 *params
= (GLfloat
) ctx
->Eval
.AutoNormal
;
2427 case GL_AUX_BUFFERS
:
2428 *params
= (GLfloat
) ctx
->Const
.NumAuxBuffers
;
2431 *params
= (GLfloat
) ctx
->Color
.BlendEnabled
;
2434 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendDstRGB
);
2437 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendSrcRGB
);
2439 case GL_BLEND_SRC_RGB_EXT
:
2440 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendSrcRGB
);
2442 case GL_BLEND_DST_RGB_EXT
:
2443 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendDstRGB
);
2445 case GL_BLEND_SRC_ALPHA_EXT
:
2446 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendSrcA
);
2448 case GL_BLEND_DST_ALPHA_EXT
:
2449 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendDstA
);
2451 case GL_BLEND_EQUATION_EXT
:
2452 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendEquation
);
2454 case GL_BLEND_COLOR_EXT
:
2455 params
[0] = ctx
->Color
.BlendColor
[0];
2456 params
[1] = ctx
->Color
.BlendColor
[1];
2457 params
[2] = ctx
->Color
.BlendColor
[2];
2458 params
[3] = ctx
->Color
.BlendColor
[3];
2461 *params
= ctx
->Pixel
.BlueBias
;
2464 *params
= (GLfloat
) ctx
->Visual
->BlueBits
;
2467 *params
= ctx
->Pixel
.BlueScale
;
2469 case GL_CLIENT_ATTRIB_STACK_DEPTH
:
2470 *params
= (GLfloat
) (ctx
->ClientAttribStackDepth
);
2472 case GL_CLIP_PLANE0
:
2473 case GL_CLIP_PLANE1
:
2474 case GL_CLIP_PLANE2
:
2475 case GL_CLIP_PLANE3
:
2476 case GL_CLIP_PLANE4
:
2477 case GL_CLIP_PLANE5
:
2478 *params
= (GLfloat
) ctx
->Transform
.ClipEnabled
[pname
-GL_CLIP_PLANE0
];
2480 case GL_COLOR_CLEAR_VALUE
:
2481 params
[0] = (GLfloat
) ctx
->Color
.ClearColor
[0];
2482 params
[1] = (GLfloat
) ctx
->Color
.ClearColor
[1];
2483 params
[2] = (GLfloat
) ctx
->Color
.ClearColor
[2];
2484 params
[3] = (GLfloat
) ctx
->Color
.ClearColor
[3];
2486 case GL_COLOR_MATERIAL
:
2487 *params
= (GLfloat
) ctx
->Light
.ColorMaterialEnabled
;
2489 case GL_COLOR_MATERIAL_FACE
:
2490 *params
= ENUM_TO_FLOAT(ctx
->Light
.ColorMaterialFace
);
2492 case GL_COLOR_MATERIAL_PARAMETER
:
2493 *params
= ENUM_TO_FLOAT(ctx
->Light
.ColorMaterialMode
);
2495 case GL_COLOR_WRITEMASK
:
2496 params
[0] = ctx
->Color
.ColorMask
[RCOMP
] ? 1.0F
: 0.0F
;
2497 params
[1] = ctx
->Color
.ColorMask
[GCOMP
] ? 1.0F
: 0.0F
;
2498 params
[2] = ctx
->Color
.ColorMask
[BCOMP
] ? 1.0F
: 0.0F
;
2499 params
[3] = ctx
->Color
.ColorMask
[ACOMP
] ? 1.0F
: 0.0F
;
2502 *params
= (GLfloat
) ctx
->Polygon
.CullFlag
;
2504 case GL_CULL_FACE_MODE
:
2505 *params
= ENUM_TO_FLOAT(ctx
->Polygon
.CullFaceMode
);
2507 case GL_CURRENT_COLOR
:
2508 UBYTE_RGBA_TO_FLOAT_RGBA(params
, ctx
->Current
.ByteColor
);
2510 case GL_CURRENT_INDEX
:
2511 *params
= (GLfloat
) ctx
->Current
.Index
;
2513 case GL_CURRENT_NORMAL
:
2514 params
[0] = ctx
->Current
.Normal
[0];
2515 params
[1] = ctx
->Current
.Normal
[1];
2516 params
[2] = ctx
->Current
.Normal
[2];
2518 case GL_CURRENT_RASTER_COLOR
:
2519 params
[0] = ctx
->Current
.RasterColor
[0];
2520 params
[1] = ctx
->Current
.RasterColor
[1];
2521 params
[2] = ctx
->Current
.RasterColor
[2];
2522 params
[3] = ctx
->Current
.RasterColor
[3];
2524 case GL_CURRENT_RASTER_DISTANCE
:
2525 params
[0] = ctx
->Current
.RasterDistance
;
2527 case GL_CURRENT_RASTER_INDEX
:
2528 *params
= (GLfloat
) ctx
->Current
.RasterIndex
;
2530 case GL_CURRENT_RASTER_POSITION
:
2531 params
[0] = ctx
->Current
.RasterPos
[0];
2532 params
[1] = ctx
->Current
.RasterPos
[1];
2533 params
[2] = ctx
->Current
.RasterPos
[2];
2534 params
[3] = ctx
->Current
.RasterPos
[3];
2536 case GL_CURRENT_RASTER_TEXTURE_COORDS
:
2537 params
[0] = ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][0];
2538 params
[1] = ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][1];
2539 params
[2] = ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][2];
2540 params
[3] = ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][3];
2542 case GL_CURRENT_RASTER_POSITION_VALID
:
2543 *params
= (GLfloat
) ctx
->Current
.RasterPosValid
;
2545 case GL_CURRENT_TEXTURE_COORDS
:
2546 params
[0] = (GLfloat
) ctx
->Current
.Texcoord
[texTransformUnit
][0];
2547 params
[1] = (GLfloat
) ctx
->Current
.Texcoord
[texTransformUnit
][1];
2548 params
[2] = (GLfloat
) ctx
->Current
.Texcoord
[texTransformUnit
][2];
2549 params
[3] = (GLfloat
) ctx
->Current
.Texcoord
[texTransformUnit
][3];
2552 *params
= (GLfloat
) ctx
->Pixel
.DepthBias
;
2555 *params
= (GLfloat
) ctx
->Visual
->DepthBits
;
2557 case GL_DEPTH_CLEAR_VALUE
:
2558 *params
= (GLfloat
) ctx
->Depth
.Clear
;
2561 *params
= ENUM_TO_FLOAT(ctx
->Depth
.Func
);
2563 case GL_DEPTH_RANGE
:
2564 params
[0] = (GLfloat
) ctx
->Viewport
.Near
;
2565 params
[1] = (GLfloat
) ctx
->Viewport
.Far
;
2567 case GL_DEPTH_SCALE
:
2568 *params
= (GLfloat
) ctx
->Pixel
.DepthScale
;
2571 *params
= (GLfloat
) ctx
->Depth
.Test
;
2573 case GL_DEPTH_WRITEMASK
:
2574 *params
= (GLfloat
) ctx
->Depth
.Mask
;
2577 *params
= (GLfloat
) ctx
->Color
.DitherFlag
;
2579 case GL_DOUBLEBUFFER
:
2580 *params
= (GLfloat
) ctx
->Visual
->DBflag
;
2582 case GL_DRAW_BUFFER
:
2583 *params
= ENUM_TO_FLOAT(ctx
->Color
.DrawBuffer
);
2586 *params
= (GLfloat
) ctx
->Current
.EdgeFlag
;
2588 case GL_FEEDBACK_BUFFER_SIZE
:
2589 *params
= (GLfloat
) ctx
->Feedback
.BufferSize
;
2591 case GL_FEEDBACK_BUFFER_TYPE
:
2592 *params
= ENUM_TO_FLOAT(ctx
->Feedback
.Type
);
2595 *params
= (GLfloat
) ctx
->Fog
.Enabled
;
2598 params
[0] = ctx
->Fog
.Color
[0];
2599 params
[1] = ctx
->Fog
.Color
[1];
2600 params
[2] = ctx
->Fog
.Color
[2];
2601 params
[3] = ctx
->Fog
.Color
[3];
2603 case GL_FOG_DENSITY
:
2604 *params
= ctx
->Fog
.Density
;
2607 *params
= ctx
->Fog
.End
;
2610 *params
= ENUM_TO_FLOAT(ctx
->Hint
.Fog
);
2613 *params
= ctx
->Fog
.Index
;
2616 *params
= ENUM_TO_FLOAT(ctx
->Fog
.Mode
);
2619 *params
= ctx
->Fog
.Start
;
2622 *params
= ENUM_TO_FLOAT(ctx
->Polygon
.FrontFace
);
2625 *params
= (GLfloat
) ctx
->Pixel
.GreenBias
;
2628 *params
= (GLfloat
) ctx
->Visual
->GreenBits
;
2630 case GL_GREEN_SCALE
:
2631 *params
= (GLfloat
) ctx
->Pixel
.GreenScale
;
2634 *params
= (GLfloat
) ctx
->Pixel
.HistogramEnabled
;
2637 *params
= (GLfloat
) ctx
->Visual
->IndexBits
;
2639 case GL_INDEX_CLEAR_VALUE
:
2640 *params
= (GLfloat
) ctx
->Color
.ClearIndex
;
2643 *params
= ctx
->Visual
->RGBAflag
? 0.0F
: 1.0F
;
2645 case GL_INDEX_OFFSET
:
2646 *params
= (GLfloat
) ctx
->Pixel
.IndexOffset
;
2648 case GL_INDEX_SHIFT
:
2649 *params
= (GLfloat
) ctx
->Pixel
.IndexShift
;
2651 case GL_INDEX_WRITEMASK
:
2652 *params
= (GLfloat
) ctx
->Color
.IndexMask
;
2662 *params
= (GLfloat
) ctx
->Light
.Light
[pname
-GL_LIGHT0
].Enabled
;
2665 *params
= (GLfloat
) ctx
->Light
.Enabled
;
2667 case GL_LIGHT_MODEL_AMBIENT
:
2668 params
[0] = ctx
->Light
.Model
.Ambient
[0];
2669 params
[1] = ctx
->Light
.Model
.Ambient
[1];
2670 params
[2] = ctx
->Light
.Model
.Ambient
[2];
2671 params
[3] = ctx
->Light
.Model
.Ambient
[3];
2673 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2674 params
[0] = ENUM_TO_FLOAT(ctx
->Light
.Model
.ColorControl
);
2676 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2677 *params
= (GLfloat
) ctx
->Light
.Model
.LocalViewer
;
2679 case GL_LIGHT_MODEL_TWO_SIDE
:
2680 *params
= (GLfloat
) ctx
->Light
.Model
.TwoSide
;
2682 case GL_LINE_SMOOTH
:
2683 *params
= (GLfloat
) ctx
->Line
.SmoothFlag
;
2685 case GL_LINE_SMOOTH_HINT
:
2686 *params
= ENUM_TO_FLOAT(ctx
->Hint
.LineSmooth
);
2688 case GL_LINE_STIPPLE
:
2689 *params
= (GLfloat
) ctx
->Line
.StippleFlag
;
2691 case GL_LINE_STIPPLE_PATTERN
:
2692 *params
= (GLfloat
) ctx
->Line
.StipplePattern
;
2694 case GL_LINE_STIPPLE_REPEAT
:
2695 *params
= (GLfloat
) ctx
->Line
.StippleFactor
;
2698 *params
= (GLfloat
) ctx
->Line
.Width
;
2700 case GL_LINE_WIDTH_GRANULARITY
:
2701 *params
= (GLfloat
) ctx
->Const
.LineWidthGranularity
;
2703 case GL_LINE_WIDTH_RANGE
:
2704 params
[0] = (GLfloat
) ctx
->Const
.MinLineWidthAA
;
2705 params
[1] = (GLfloat
) ctx
->Const
.MaxLineWidthAA
;
2707 case GL_ALIASED_LINE_WIDTH_RANGE
:
2708 params
[0] = (GLfloat
) ctx
->Const
.MinLineWidth
;
2709 params
[1] = (GLfloat
) ctx
->Const
.MaxLineWidth
;
2712 *params
= (GLfloat
) ctx
->List
.ListBase
;
2715 *params
= (GLfloat
) ctx
->CurrentListNum
;
2718 *params
= ctx
->ExecuteFlag
? ENUM_TO_FLOAT(GL_COMPILE_AND_EXECUTE
)
2719 : ENUM_TO_FLOAT(GL_COMPILE
);
2721 case GL_INDEX_LOGIC_OP
:
2722 *params
= (GLfloat
) ctx
->Color
.IndexLogicOpEnabled
;
2724 case GL_COLOR_LOGIC_OP
:
2725 *params
= (GLfloat
) ctx
->Color
.ColorLogicOpEnabled
;
2727 case GL_LOGIC_OP_MODE
:
2728 *params
= ENUM_TO_FLOAT(ctx
->Color
.LogicOp
);
2730 case GL_MAP1_COLOR_4
:
2731 *params
= (GLfloat
) ctx
->Eval
.Map1Color4
;
2733 case GL_MAP1_GRID_DOMAIN
:
2734 params
[0] = ctx
->Eval
.MapGrid1u1
;
2735 params
[1] = ctx
->Eval
.MapGrid1u2
;
2737 case GL_MAP1_GRID_SEGMENTS
:
2738 *params
= (GLfloat
) ctx
->Eval
.MapGrid1un
;
2741 *params
= (GLfloat
) ctx
->Eval
.Map1Index
;
2743 case GL_MAP1_NORMAL
:
2744 *params
= (GLfloat
) ctx
->Eval
.Map1Normal
;
2746 case GL_MAP1_TEXTURE_COORD_1
:
2747 *params
= (GLfloat
) ctx
->Eval
.Map1TextureCoord1
;
2749 case GL_MAP1_TEXTURE_COORD_2
:
2750 *params
= (GLfloat
) ctx
->Eval
.Map1TextureCoord2
;
2752 case GL_MAP1_TEXTURE_COORD_3
:
2753 *params
= (GLfloat
) ctx
->Eval
.Map1TextureCoord3
;
2755 case GL_MAP1_TEXTURE_COORD_4
:
2756 *params
= (GLfloat
) ctx
->Eval
.Map1TextureCoord4
;
2758 case GL_MAP1_VERTEX_3
:
2759 *params
= (GLfloat
) ctx
->Eval
.Map1Vertex3
;
2761 case GL_MAP1_VERTEX_4
:
2762 *params
= (GLfloat
) ctx
->Eval
.Map1Vertex4
;
2764 case GL_MAP2_COLOR_4
:
2765 *params
= (GLfloat
) ctx
->Eval
.Map2Color4
;
2767 case GL_MAP2_GRID_DOMAIN
:
2768 params
[0] = ctx
->Eval
.MapGrid2u1
;
2769 params
[1] = ctx
->Eval
.MapGrid2u2
;
2770 params
[2] = ctx
->Eval
.MapGrid2v1
;
2771 params
[3] = ctx
->Eval
.MapGrid2v2
;
2773 case GL_MAP2_GRID_SEGMENTS
:
2774 params
[0] = (GLfloat
) ctx
->Eval
.MapGrid2un
;
2775 params
[1] = (GLfloat
) ctx
->Eval
.MapGrid2vn
;
2778 *params
= (GLfloat
) ctx
->Eval
.Map2Index
;
2780 case GL_MAP2_NORMAL
:
2781 *params
= (GLfloat
) ctx
->Eval
.Map2Normal
;
2783 case GL_MAP2_TEXTURE_COORD_1
:
2784 *params
= ctx
->Eval
.Map2TextureCoord1
;
2786 case GL_MAP2_TEXTURE_COORD_2
:
2787 *params
= ctx
->Eval
.Map2TextureCoord2
;
2789 case GL_MAP2_TEXTURE_COORD_3
:
2790 *params
= ctx
->Eval
.Map2TextureCoord3
;
2792 case GL_MAP2_TEXTURE_COORD_4
:
2793 *params
= ctx
->Eval
.Map2TextureCoord4
;
2795 case GL_MAP2_VERTEX_3
:
2796 *params
= (GLfloat
) ctx
->Eval
.Map2Vertex3
;
2798 case GL_MAP2_VERTEX_4
:
2799 *params
= (GLfloat
) ctx
->Eval
.Map2Vertex4
;
2802 *params
= (GLfloat
) ctx
->Pixel
.MapColorFlag
;
2804 case GL_MAP_STENCIL
:
2805 *params
= (GLfloat
) ctx
->Pixel
.MapStencilFlag
;
2807 case GL_MATRIX_MODE
:
2808 *params
= ENUM_TO_FLOAT(ctx
->Transform
.MatrixMode
);
2810 case GL_MAX_ATTRIB_STACK_DEPTH
:
2811 *params
= (GLfloat
) MAX_ATTRIB_STACK_DEPTH
;
2813 case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
:
2814 *params
= (GLfloat
) MAX_CLIENT_ATTRIB_STACK_DEPTH
;
2816 case GL_MAX_CLIP_PLANES
:
2817 *params
= (GLfloat
) MAX_CLIP_PLANES
;
2819 case GL_MAX_ELEMENTS_VERTICES
: /* GL_VERSION_1_2 */
2820 *params
= (GLfloat
) VB_MAX
;
2822 case GL_MAX_ELEMENTS_INDICES
: /* GL_VERSION_1_2 */
2823 *params
= (GLfloat
) VB_MAX
;
2825 case GL_MAX_EVAL_ORDER
:
2826 *params
= (GLfloat
) MAX_EVAL_ORDER
;
2829 *params
= (GLfloat
) MAX_LIGHTS
;
2831 case GL_MAX_LIST_NESTING
:
2832 *params
= (GLfloat
) MAX_LIST_NESTING
;
2834 case GL_MAX_MODELVIEW_STACK_DEPTH
:
2835 *params
= (GLfloat
) MAX_MODELVIEW_STACK_DEPTH
;
2837 case GL_MAX_NAME_STACK_DEPTH
:
2838 *params
= (GLfloat
) MAX_NAME_STACK_DEPTH
;
2840 case GL_MAX_PIXEL_MAP_TABLE
:
2841 *params
= (GLfloat
) MAX_PIXEL_MAP_TABLE
;
2843 case GL_MAX_PROJECTION_STACK_DEPTH
:
2844 *params
= (GLfloat
) MAX_PROJECTION_STACK_DEPTH
;
2846 case GL_MAX_TEXTURE_SIZE
:
2847 case GL_MAX_3D_TEXTURE_SIZE
:
2848 *params
= (GLfloat
) ctx
->Const
.MaxTextureSize
;
2850 case GL_MAX_TEXTURE_STACK_DEPTH
:
2851 *params
= (GLfloat
) MAX_TEXTURE_STACK_DEPTH
;
2853 case GL_MAX_VIEWPORT_DIMS
:
2854 params
[0] = (GLfloat
) MAX_WIDTH
;
2855 params
[1] = (GLfloat
) MAX_HEIGHT
;
2858 *params
= (GLfloat
) ctx
->Pixel
.MinMaxEnabled
;
2860 case GL_MODELVIEW_MATRIX
:
2861 for (i
=0;i
<16;i
++) {
2862 params
[i
] = ctx
->ModelView
.m
[i
];
2865 case GL_MODELVIEW_STACK_DEPTH
:
2866 *params
= (GLfloat
) (ctx
->ModelViewStackDepth
+ 1);
2868 case GL_NAME_STACK_DEPTH
:
2869 *params
= (GLfloat
) ctx
->Select
.NameStackDepth
;
2872 *params
= (GLfloat
) ctx
->Transform
.Normalize
;
2874 case GL_PACK_ALIGNMENT
:
2875 *params
= (GLfloat
) ctx
->Pack
.Alignment
;
2877 case GL_PACK_LSB_FIRST
:
2878 *params
= (GLfloat
) ctx
->Pack
.LsbFirst
;
2880 case GL_PACK_ROW_LENGTH
:
2881 *params
= (GLfloat
) ctx
->Pack
.RowLength
;
2883 case GL_PACK_SKIP_PIXELS
:
2884 *params
= (GLfloat
) ctx
->Pack
.SkipPixels
;
2886 case GL_PACK_SKIP_ROWS
:
2887 *params
= (GLfloat
) ctx
->Pack
.SkipRows
;
2889 case GL_PACK_SWAP_BYTES
:
2890 *params
= (GLfloat
) ctx
->Pack
.SwapBytes
;
2892 case GL_PACK_SKIP_IMAGES_EXT
:
2893 *params
= (GLfloat
) ctx
->Pack
.SkipImages
;
2895 case GL_PACK_IMAGE_HEIGHT_EXT
:
2896 *params
= (GLfloat
) ctx
->Pack
.ImageHeight
;
2898 case GL_PERSPECTIVE_CORRECTION_HINT
:
2899 *params
= ENUM_TO_FLOAT(ctx
->Hint
.PerspectiveCorrection
);
2901 case GL_PIXEL_MAP_A_TO_A_SIZE
:
2902 *params
= (GLfloat
) ctx
->Pixel
.MapAtoAsize
;
2904 case GL_PIXEL_MAP_B_TO_B_SIZE
:
2905 *params
= (GLfloat
) ctx
->Pixel
.MapBtoBsize
;
2907 case GL_PIXEL_MAP_G_TO_G_SIZE
:
2908 *params
= (GLfloat
) ctx
->Pixel
.MapGtoGsize
;
2910 case GL_PIXEL_MAP_I_TO_A_SIZE
:
2911 *params
= (GLfloat
) ctx
->Pixel
.MapItoAsize
;
2913 case GL_PIXEL_MAP_I_TO_B_SIZE
:
2914 *params
= (GLfloat
) ctx
->Pixel
.MapItoBsize
;
2916 case GL_PIXEL_MAP_I_TO_G_SIZE
:
2917 *params
= (GLfloat
) ctx
->Pixel
.MapItoGsize
;
2919 case GL_PIXEL_MAP_I_TO_I_SIZE
:
2920 *params
= (GLfloat
) ctx
->Pixel
.MapItoIsize
;
2922 case GL_PIXEL_MAP_I_TO_R_SIZE
:
2923 *params
= (GLfloat
) ctx
->Pixel
.MapItoRsize
;
2925 case GL_PIXEL_MAP_R_TO_R_SIZE
:
2926 *params
= (GLfloat
) ctx
->Pixel
.MapRtoRsize
;
2928 case GL_PIXEL_MAP_S_TO_S_SIZE
:
2929 *params
= (GLfloat
) ctx
->Pixel
.MapStoSsize
;
2932 *params
= (GLfloat
) ctx
->Point
.UserSize
;
2934 case GL_POINT_SIZE_GRANULARITY
:
2935 *params
= (GLfloat
) ctx
->Const
.PointSizeGranularity
;
2937 case GL_POINT_SIZE_RANGE
:
2938 params
[0] = (GLfloat
) ctx
->Const
.MinPointSizeAA
;
2939 params
[1] = (GLfloat
) ctx
->Const
.MaxPointSizeAA
;
2941 case GL_ALIASED_POINT_SIZE_RANGE
:
2942 params
[0] = (GLfloat
) ctx
->Const
.MinPointSize
;
2943 params
[1] = (GLfloat
) ctx
->Const
.MaxPointSize
;
2945 case GL_POINT_SMOOTH
:
2946 *params
= (GLfloat
) ctx
->Point
.SmoothFlag
;
2948 case GL_POINT_SMOOTH_HINT
:
2949 *params
= ENUM_TO_FLOAT(ctx
->Hint
.PointSmooth
);
2951 case GL_POINT_SIZE_MIN_EXT
:
2952 *params
= (GLfloat
) (ctx
->Point
.MinSize
);
2954 case GL_POINT_SIZE_MAX_EXT
:
2955 *params
= (GLfloat
) (ctx
->Point
.MaxSize
);
2957 case GL_POINT_FADE_THRESHOLD_SIZE_EXT
:
2958 *params
= (GLfloat
) (ctx
->Point
.Threshold
);
2960 case GL_DISTANCE_ATTENUATION_EXT
:
2961 params
[0] = (GLfloat
) (ctx
->Point
.Params
[0]);
2962 params
[1] = (GLfloat
) (ctx
->Point
.Params
[1]);
2963 params
[2] = (GLfloat
) (ctx
->Point
.Params
[2]);
2965 case GL_POLYGON_MODE
:
2966 params
[0] = ENUM_TO_FLOAT(ctx
->Polygon
.FrontMode
);
2967 params
[1] = ENUM_TO_FLOAT(ctx
->Polygon
.BackMode
);
2969 #ifdef GL_EXT_polygon_offset
2970 case GL_POLYGON_OFFSET_BIAS_EXT
:
2971 *params
= ctx
->Polygon
.OffsetUnits
;
2974 case GL_POLYGON_OFFSET_FACTOR
:
2975 *params
= ctx
->Polygon
.OffsetFactor
;
2977 case GL_POLYGON_OFFSET_UNITS
:
2978 *params
= ctx
->Polygon
.OffsetUnits
;
2980 case GL_POLYGON_SMOOTH
:
2981 *params
= (GLfloat
) ctx
->Polygon
.SmoothFlag
;
2983 case GL_POLYGON_SMOOTH_HINT
:
2984 *params
= ENUM_TO_FLOAT(ctx
->Hint
.PolygonSmooth
);
2986 case GL_POLYGON_STIPPLE
:
2987 *params
= (GLfloat
) ctx
->Polygon
.StippleFlag
;
2989 case GL_PROJECTION_MATRIX
:
2990 for (i
=0;i
<16;i
++) {
2991 params
[i
] = ctx
->ProjectionMatrix
.m
[i
];
2994 case GL_PROJECTION_STACK_DEPTH
:
2995 *params
= (GLfloat
) (ctx
->ProjectionStackDepth
+ 1);
2997 case GL_READ_BUFFER
:
2998 *params
= ENUM_TO_FLOAT(ctx
->Pixel
.ReadBuffer
);
3001 *params
= ctx
->Pixel
.RedBias
;
3004 *params
= (GLfloat
) ctx
->Visual
->RedBits
;
3007 *params
= ctx
->Pixel
.RedScale
;
3009 case GL_RENDER_MODE
:
3010 *params
= ENUM_TO_FLOAT(ctx
->RenderMode
);
3013 *params
= (GLfloat
) ctx
->Visual
->RGBAflag
;
3015 case GL_SCISSOR_BOX
:
3016 params
[0] = (GLfloat
) ctx
->Scissor
.X
;
3017 params
[1] = (GLfloat
) ctx
->Scissor
.Y
;
3018 params
[2] = (GLfloat
) ctx
->Scissor
.Width
;
3019 params
[3] = (GLfloat
) ctx
->Scissor
.Height
;
3021 case GL_SCISSOR_TEST
:
3022 *params
= (GLfloat
) ctx
->Scissor
.Enabled
;
3024 case GL_SELECTION_BUFFER_SIZE
:
3025 *params
= (GLfloat
) ctx
->Select
.BufferSize
;
3027 case GL_SHADE_MODEL
:
3028 *params
= ENUM_TO_FLOAT(ctx
->Light
.ShadeModel
);
3030 case GL_SHARED_TEXTURE_PALETTE_EXT
:
3031 *params
= (GLfloat
) ctx
->Texture
.SharedPalette
;
3033 case GL_STENCIL_BITS
:
3034 *params
= (GLfloat
) ctx
->Visual
->StencilBits
;
3036 case GL_STENCIL_CLEAR_VALUE
:
3037 *params
= (GLfloat
) ctx
->Stencil
.Clear
;
3039 case GL_STENCIL_FAIL
:
3040 *params
= ENUM_TO_FLOAT(ctx
->Stencil
.FailFunc
);
3042 case GL_STENCIL_FUNC
:
3043 *params
= ENUM_TO_FLOAT(ctx
->Stencil
.Function
);
3045 case GL_STENCIL_PASS_DEPTH_FAIL
:
3046 *params
= ENUM_TO_FLOAT(ctx
->Stencil
.ZFailFunc
);
3048 case GL_STENCIL_PASS_DEPTH_PASS
:
3049 *params
= ENUM_TO_FLOAT(ctx
->Stencil
.ZPassFunc
);
3051 case GL_STENCIL_REF
:
3052 *params
= (GLfloat
) ctx
->Stencil
.Ref
;
3054 case GL_STENCIL_TEST
:
3055 *params
= (GLfloat
) ctx
->Stencil
.Enabled
;
3057 case GL_STENCIL_VALUE_MASK
:
3058 *params
= (GLfloat
) ctx
->Stencil
.ValueMask
;
3060 case GL_STENCIL_WRITEMASK
:
3061 *params
= (GLfloat
) ctx
->Stencil
.WriteMask
;
3064 *params
= (GLfloat
) ctx
->Visual
->StereoFlag
;
3066 case GL_SUBPIXEL_BITS
:
3067 *params
= (GLfloat
) ctx
->Const
.SubPixelBits
;
3070 *params
= _mesa_IsEnabled(GL_TEXTURE_1D
) ? 1.0 : 0.0;
3073 *params
= _mesa_IsEnabled(GL_TEXTURE_2D
) ? 1.0 : 0.0;
3076 *params
= _mesa_IsEnabled(GL_TEXTURE_3D
) ? 1.0 : 0.0;
3078 case GL_TEXTURE_BINDING_1D
:
3079 *params
= (GLfloat
) textureUnit
->CurrentD
[1]->Name
;
3081 case GL_TEXTURE_BINDING_2D
:
3082 *params
= (GLfloat
) textureUnit
->CurrentD
[2]->Name
;
3084 case GL_TEXTURE_BINDING_3D
:
3085 *params
= (GLfloat
) textureUnit
->CurrentD
[2]->Name
;
3087 case GL_TEXTURE_ENV_COLOR
:
3088 params
[0] = textureUnit
->EnvColor
[0];
3089 params
[1] = textureUnit
->EnvColor
[1];
3090 params
[2] = textureUnit
->EnvColor
[2];
3091 params
[3] = textureUnit
->EnvColor
[3];
3093 case GL_TEXTURE_ENV_MODE
:
3094 *params
= ENUM_TO_FLOAT(textureUnit
->EnvMode
);
3096 case GL_TEXTURE_GEN_S
:
3097 *params
= (textureUnit
->TexGenEnabled
& S_BIT
) ? 1.0 : 0.0;
3099 case GL_TEXTURE_GEN_T
:
3100 *params
= (textureUnit
->TexGenEnabled
& T_BIT
) ? 1.0 : 0.0;
3102 case GL_TEXTURE_GEN_R
:
3103 *params
= (textureUnit
->TexGenEnabled
& R_BIT
) ? 1.0 : 0.0;
3105 case GL_TEXTURE_GEN_Q
:
3106 *params
= (textureUnit
->TexGenEnabled
& Q_BIT
) ? 1.0 : 0.0;
3108 case GL_TEXTURE_MATRIX
:
3109 for (i
=0;i
<16;i
++) {
3110 params
[i
] = ctx
->TextureMatrix
[texTransformUnit
].m
[i
];
3113 case GL_TEXTURE_STACK_DEPTH
:
3114 *params
= (GLfloat
) (ctx
->TextureStackDepth
[texTransformUnit
] + 1);
3116 case GL_UNPACK_ALIGNMENT
:
3117 *params
= (GLfloat
) ctx
->Unpack
.Alignment
;
3119 case GL_UNPACK_LSB_FIRST
:
3120 *params
= (GLfloat
) ctx
->Unpack
.LsbFirst
;
3122 case GL_UNPACK_ROW_LENGTH
:
3123 *params
= (GLfloat
) ctx
->Unpack
.RowLength
;
3125 case GL_UNPACK_SKIP_PIXELS
:
3126 *params
= (GLfloat
) ctx
->Unpack
.SkipPixels
;
3128 case GL_UNPACK_SKIP_ROWS
:
3129 *params
= (GLfloat
) ctx
->Unpack
.SkipRows
;
3131 case GL_UNPACK_SWAP_BYTES
:
3132 *params
= (GLfloat
) ctx
->Unpack
.SwapBytes
;
3134 case GL_UNPACK_SKIP_IMAGES_EXT
:
3135 *params
= (GLfloat
) ctx
->Unpack
.SkipImages
;
3137 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
3138 *params
= (GLfloat
) ctx
->Unpack
.ImageHeight
;
3141 params
[0] = (GLfloat
) ctx
->Viewport
.X
;
3142 params
[1] = (GLfloat
) ctx
->Viewport
.Y
;
3143 params
[2] = (GLfloat
) ctx
->Viewport
.Width
;
3144 params
[3] = (GLfloat
) ctx
->Viewport
.Height
;
3147 *params
= (GLfloat
) ctx
->Pixel
.ZoomX
;
3150 *params
= (GLfloat
) ctx
->Pixel
.ZoomY
;
3152 case GL_VERTEX_ARRAY
:
3153 *params
= (GLfloat
) ctx
->Array
.Vertex
.Enabled
;
3155 case GL_VERTEX_ARRAY_SIZE
:
3156 *params
= (GLfloat
) ctx
->Array
.Vertex
.Size
;
3158 case GL_VERTEX_ARRAY_TYPE
:
3159 *params
= ENUM_TO_FLOAT(ctx
->Array
.Vertex
.Type
);
3161 case GL_VERTEX_ARRAY_STRIDE
:
3162 *params
= (GLfloat
) ctx
->Array
.Vertex
.Stride
;
3164 case GL_VERTEX_ARRAY_COUNT_EXT
:
3167 case GL_NORMAL_ARRAY
:
3168 *params
= (GLfloat
) ctx
->Array
.Normal
.Enabled
;
3170 case GL_NORMAL_ARRAY_TYPE
:
3171 *params
= ENUM_TO_FLOAT(ctx
->Array
.Normal
.Type
);
3173 case GL_NORMAL_ARRAY_STRIDE
:
3174 *params
= (GLfloat
) ctx
->Array
.Normal
.Stride
;
3176 case GL_NORMAL_ARRAY_COUNT_EXT
:
3179 case GL_COLOR_ARRAY
:
3180 *params
= (GLfloat
) ctx
->Array
.Color
.Enabled
;
3182 case GL_COLOR_ARRAY_SIZE
:
3183 *params
= (GLfloat
) ctx
->Array
.Color
.Size
;
3185 case GL_COLOR_ARRAY_TYPE
:
3186 *params
= ENUM_TO_FLOAT(ctx
->Array
.Color
.Type
);
3188 case GL_COLOR_ARRAY_STRIDE
:
3189 *params
= (GLfloat
) ctx
->Array
.Color
.Stride
;
3191 case GL_COLOR_ARRAY_COUNT_EXT
:
3194 case GL_INDEX_ARRAY
:
3195 *params
= (GLfloat
) ctx
->Array
.Index
.Enabled
;
3197 case GL_INDEX_ARRAY_TYPE
:
3198 *params
= ENUM_TO_FLOAT(ctx
->Array
.Index
.Type
);
3200 case GL_INDEX_ARRAY_STRIDE
:
3201 *params
= (GLfloat
) ctx
->Array
.Index
.Stride
;
3203 case GL_INDEX_ARRAY_COUNT_EXT
:
3206 case GL_TEXTURE_COORD_ARRAY
:
3207 *params
= (GLfloat
) ctx
->Array
.TexCoord
[texUnit
].Enabled
;
3209 case GL_TEXTURE_COORD_ARRAY_SIZE
:
3210 *params
= (GLfloat
) ctx
->Array
.TexCoord
[texUnit
].Size
;
3212 case GL_TEXTURE_COORD_ARRAY_TYPE
:
3213 *params
= ENUM_TO_FLOAT(ctx
->Array
.TexCoord
[texUnit
].Type
);
3215 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
3216 *params
= (GLfloat
) ctx
->Array
.TexCoord
[texUnit
].Stride
;
3218 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
3221 case GL_EDGE_FLAG_ARRAY
:
3222 *params
= (GLfloat
) ctx
->Array
.EdgeFlag
.Enabled
;
3224 case GL_EDGE_FLAG_ARRAY_STRIDE
:
3225 *params
= (GLfloat
) ctx
->Array
.EdgeFlag
.Stride
;
3227 case GL_EDGE_FLAG_ARRAY_COUNT_EXT
:
3231 /* GL_ARB_multitexture */
3232 case GL_MAX_TEXTURE_UNITS_ARB
:
3233 *params
= (GLfloat
) ctx
->Const
.MaxTextureUnits
;
3235 case GL_ACTIVE_TEXTURE_ARB
:
3236 *params
= (GLfloat
) (GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
);
3238 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
3239 *params
= (GLfloat
) (GL_TEXTURE0_ARB
+ ctx
->Array
.ActiveTexture
);
3242 /* GL_ARB_texture_cube_map */
3243 case GL_TEXTURE_CUBE_MAP_ARB
:
3244 if (ctx
->Extensions
.HaveTextureCubeMap
)
3245 *params
= (GLfloat
) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
);
3247 gl_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3249 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
3250 if (ctx
->Extensions
.HaveTextureCubeMap
)
3251 *params
= (GLfloat
) textureUnit
->CurrentCubeMap
->Name
;
3253 gl_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3255 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
3256 if (ctx
->Extensions
.HaveTextureCubeMap
)
3257 *params
= (GLfloat
) ctx
->Const
.MaxCubeTextureSize
;
3259 gl_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3262 /* GL_ARB_texture_compression */
3263 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
3264 if (ctx
->Extensions
.HaveTextureCompression
) {
3265 *params
= (GLfloat
) ctx
->Hint
.TextureCompression
;
3268 gl_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3270 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
3271 if (ctx
->Extensions
.HaveTextureCompression
) {
3272 *params
= (GLfloat
) ctx
->Const
.NumCompressedTextureFormats
;
3275 gl_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3277 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
3278 if (ctx
->Extensions
.HaveTextureCompression
) {
3280 for (i
= 0; i
< ctx
->Const
.NumCompressedTextureFormats
; i
++)
3281 params
[i
] = (GLfloat
) ctx
->Const
.CompressedTextureFormats
[i
];
3284 gl_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3287 /* GL_PGI_misc_hints */
3288 case GL_STRICT_DEPTHFUNC_HINT_PGI
:
3289 *params
= ENUM_TO_FLOAT(GL_NICEST
);
3291 case GL_STRICT_LIGHTING_HINT_PGI
:
3292 *params
= ENUM_TO_FLOAT(ctx
->Hint
.StrictLighting
);
3294 case GL_STRICT_SCISSOR_HINT_PGI
:
3295 case GL_FULL_STIPPLE_HINT_PGI
:
3296 *params
= ENUM_TO_FLOAT(GL_TRUE
);
3298 case GL_CONSERVE_MEMORY_HINT_PGI
:
3299 *params
= ENUM_TO_FLOAT(GL_FALSE
);
3301 case GL_ALWAYS_FAST_HINT_PGI
:
3302 *params
= (GLfloat
) (ctx
->Hint
.AllowDrawWin
== GL_TRUE
&&
3303 ctx
->Hint
.AllowDrawFrg
== GL_FALSE
&&
3304 ctx
->Hint
.AllowDrawMem
== GL_FALSE
);
3306 case GL_ALWAYS_SOFT_HINT_PGI
:
3307 *params
= (GLfloat
) (ctx
->Hint
.AllowDrawWin
== GL_TRUE
&&
3308 ctx
->Hint
.AllowDrawFrg
== GL_TRUE
&&
3309 ctx
->Hint
.AllowDrawMem
== GL_TRUE
);
3311 case GL_ALLOW_DRAW_OBJ_HINT_PGI
:
3312 *params
= (GLfloat
) GL_TRUE
;
3314 case GL_ALLOW_DRAW_WIN_HINT_PGI
:
3315 *params
= (GLfloat
) ctx
->Hint
.AllowDrawWin
;
3317 case GL_ALLOW_DRAW_FRG_HINT_PGI
:
3318 *params
= (GLfloat
) ctx
->Hint
.AllowDrawFrg
;
3320 case GL_ALLOW_DRAW_MEM_HINT_PGI
:
3321 *params
= (GLfloat
) ctx
->Hint
.AllowDrawMem
;
3323 case GL_CLIP_NEAR_HINT_PGI
:
3324 case GL_CLIP_FAR_HINT_PGI
:
3325 *params
= ENUM_TO_FLOAT(GL_TRUE
);
3327 case GL_WIDE_LINE_HINT_PGI
:
3328 *params
= ENUM_TO_FLOAT(GL_DONT_CARE
);
3330 case GL_BACK_NORMALS_HINT_PGI
:
3331 *params
= ENUM_TO_FLOAT(GL_TRUE
);
3333 case GL_NATIVE_GRAPHICS_HANDLE_PGI
:
3337 /* GL_EXT_compiled_vertex_array */
3338 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
3339 *params
= (GLfloat
) ctx
->Array
.LockFirst
;
3341 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
3342 *params
= (GLfloat
) ctx
->Array
.LockCount
;
3345 /* GL_ARB_transpose_matrix */
3346 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
3347 gl_matrix_transposef(params
, ctx
->ColorMatrix
.m
);
3349 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
3350 gl_matrix_transposef(params
, ctx
->ModelView
.m
);
3352 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
3353 gl_matrix_transposef(params
, ctx
->ProjectionMatrix
.m
);
3355 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
3356 gl_matrix_transposef(params
, ctx
->TextureMatrix
[texTransformUnit
].m
);
3359 /* GL_HP_occlusion_test */
3360 case GL_OCCLUSION_TEST_HP
:
3361 if (ctx
->Extensions
.HaveHpOcclusionTest
) {
3362 *params
= (GLfloat
) ctx
->Depth
.OcclusionTest
;
3365 gl_error( ctx
, GL_INVALID_ENUM
, "glGetFloatv" );
3368 case GL_OCCLUSION_TEST_RESULT_HP
:
3369 if (ctx
->Extensions
.HaveHpOcclusionTest
) {
3370 if (ctx
->Depth
.OcclusionTest
)
3371 *params
= (GLfloat
) ctx
->OcclusionResult
;
3373 *params
= (GLfloat
) ctx
->OcclusionResultSaved
;
3374 /* reset flag now */
3375 ctx
->OcclusionResult
= GL_FALSE
;
3376 ctx
->OcclusionResultSaved
= GL_FALSE
;
3379 gl_error( ctx
, GL_INVALID_ENUM
, "glGetFloatv" );
3383 /* GL_SGIS_pixel_texture */
3384 case GL_PIXEL_TEXTURE_SGIS
:
3385 *params
= (GLfloat
) ctx
->Pixel
.PixelTextureEnabled
;
3388 /* GL_SGIX_pixel_texture */
3389 case GL_PIXEL_TEX_GEN_SGIX
:
3390 *params
= (GLfloat
) ctx
->Pixel
.PixelTextureEnabled
;
3392 case GL_PIXEL_TEX_GEN_MODE_SGIX
:
3393 *params
= (GLfloat
) pixel_texgen_mode(ctx
);
3396 /* GL_SGI_color_matrix (also in 1.2 imaging) */
3397 case GL_COLOR_MATRIX_SGI
:
3398 for (i
=0;i
<16;i
++) {
3399 params
[i
] = ctx
->ColorMatrix
.m
[i
];
3402 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
3403 *params
= (GLfloat
) (ctx
->ColorStackDepth
+ 1);
3405 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
3406 *params
= (GLfloat
) MAX_COLOR_STACK_DEPTH
;
3408 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
3409 *params
= ctx
->Pixel
.PostColorMatrixScale
[0];
3411 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
3412 *params
= ctx
->Pixel
.PostColorMatrixScale
[1];
3414 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
3415 *params
= ctx
->Pixel
.PostColorMatrixScale
[2];
3417 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
3418 *params
= ctx
->Pixel
.PostColorMatrixScale
[3];
3420 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
3421 *params
= ctx
->Pixel
.PostColorMatrixBias
[0];
3423 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
3424 *params
= ctx
->Pixel
.PostColorMatrixBias
[1];
3426 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
3427 *params
= ctx
->Pixel
.PostColorMatrixBias
[2];
3429 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
3430 *params
= ctx
->Pixel
.PostColorMatrixBias
[3];
3433 /* GL_EXT_convolution (also in 1.2 imaging) */
3434 case GL_MAX_CONVOLUTION_WIDTH
:
3435 *params
= (GLfloat
) ctx
->Const
.MaxConvolutionWidth
;
3437 case GL_MAX_CONVOLUTION_HEIGHT
:
3438 *params
= (GLfloat
) ctx
->Const
.MaxConvolutionHeight
;
3440 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
3441 *params
= ctx
->Pixel
.PostConvolutionScale
[0];
3443 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
3444 *params
= ctx
->Pixel
.PostConvolutionScale
[1];
3446 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
3447 *params
= ctx
->Pixel
.PostConvolutionScale
[2];
3449 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
3450 *params
= ctx
->Pixel
.PostConvolutionScale
[3];
3452 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
3453 *params
= ctx
->Pixel
.PostConvolutionBias
[0];
3455 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
3456 *params
= ctx
->Pixel
.PostConvolutionBias
[1];
3458 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
3459 *params
= ctx
->Pixel
.PostConvolutionBias
[2];
3461 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
3462 *params
= ctx
->Pixel
.PostConvolutionBias
[2];
3465 /* GL_SGI_color_table (also in 1.2 imaging */
3466 case GL_COLOR_TABLE_SGI
:
3467 *params
= (GLfloat
) ctx
->Pixel
.ColorTableEnabled
;
3469 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
3470 *params
= (GLfloat
) ctx
->Pixel
.PostConvolutionColorTableEnabled
;
3472 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
3473 *params
= (GLfloat
) ctx
->Pixel
.PostColorMatrixColorTableEnabled
;
3477 gl_error( ctx
, GL_INVALID_ENUM
, "glGetFloatv" );
3485 _mesa_GetIntegerv( GLenum pname
, GLint
*params
)
3487 GET_CURRENT_CONTEXT(ctx
);
3489 GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
3490 GLuint texTransformUnit
= ctx
->Texture
.CurrentTransformUnit
;
3491 const struct gl_texture_unit
*textureUnit
= &ctx
->Texture
.Unit
[texUnit
];
3493 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
, "glGetIntegerv");
3495 if (MESA_VERBOSE
& VERBOSE_API
)
3496 fprintf(stderr
, "glGetIntegerv %s\n", gl_lookup_enum_by_nr(pname
));
3499 case GL_ACCUM_RED_BITS
:
3500 *params
= (GLint
) ctx
->Visual
->AccumRedBits
;
3502 case GL_ACCUM_GREEN_BITS
:
3503 *params
= (GLint
) ctx
->Visual
->AccumGreenBits
;
3505 case GL_ACCUM_BLUE_BITS
:
3506 *params
= (GLint
) ctx
->Visual
->AccumBlueBits
;
3508 case GL_ACCUM_ALPHA_BITS
:
3509 *params
= (GLint
) ctx
->Visual
->AccumAlphaBits
;
3511 case GL_ACCUM_CLEAR_VALUE
:
3512 params
[0] = FLOAT_TO_INT( ctx
->Accum
.ClearColor
[0] );
3513 params
[1] = FLOAT_TO_INT( ctx
->Accum
.ClearColor
[1] );
3514 params
[2] = FLOAT_TO_INT( ctx
->Accum
.ClearColor
[2] );
3515 params
[3] = FLOAT_TO_INT( ctx
->Accum
.ClearColor
[3] );
3518 *params
= (GLint
) ctx
->Pixel
.AlphaBias
;
3521 *params
= ctx
->Visual
->AlphaBits
;
3523 case GL_ALPHA_SCALE
:
3524 *params
= (GLint
) ctx
->Pixel
.AlphaScale
;
3527 *params
= (GLint
) ctx
->Color
.AlphaEnabled
;
3529 case GL_ALPHA_TEST_REF
:
3530 *params
= FLOAT_TO_INT( (GLfloat
) ctx
->Color
.AlphaRef
/ 255.0 );
3532 case GL_ALPHA_TEST_FUNC
:
3533 *params
= (GLint
) ctx
->Color
.AlphaFunc
;
3535 case GL_ATTRIB_STACK_DEPTH
:
3536 *params
= (GLint
) (ctx
->AttribStackDepth
);
3538 case GL_AUTO_NORMAL
:
3539 *params
= (GLint
) ctx
->Eval
.AutoNormal
;
3541 case GL_AUX_BUFFERS
:
3542 *params
= (GLint
) ctx
->Const
.NumAuxBuffers
;
3545 *params
= (GLint
) ctx
->Color
.BlendEnabled
;
3548 *params
= (GLint
) ctx
->Color
.BlendDstRGB
;
3551 *params
= (GLint
) ctx
->Color
.BlendSrcRGB
;
3553 case GL_BLEND_SRC_RGB_EXT
:
3554 *params
= (GLint
) ctx
->Color
.BlendSrcRGB
;
3556 case GL_BLEND_DST_RGB_EXT
:
3557 *params
= (GLint
) ctx
->Color
.BlendDstRGB
;
3559 case GL_BLEND_SRC_ALPHA_EXT
:
3560 *params
= (GLint
) ctx
->Color
.BlendSrcA
;
3562 case GL_BLEND_DST_ALPHA_EXT
:
3563 *params
= (GLint
) ctx
->Color
.BlendDstA
;
3565 case GL_BLEND_EQUATION_EXT
:
3566 *params
= (GLint
) ctx
->Color
.BlendEquation
;
3568 case GL_BLEND_COLOR_EXT
:
3569 params
[0] = FLOAT_TO_INT( ctx
->Color
.BlendColor
[0] );
3570 params
[1] = FLOAT_TO_INT( ctx
->Color
.BlendColor
[1] );
3571 params
[2] = FLOAT_TO_INT( ctx
->Color
.BlendColor
[2] );
3572 params
[3] = FLOAT_TO_INT( ctx
->Color
.BlendColor
[3] );
3575 *params
= (GLint
) ctx
->Pixel
.BlueBias
;
3578 *params
= (GLint
) ctx
->Visual
->BlueBits
;
3581 *params
= (GLint
) ctx
->Pixel
.BlueScale
;
3583 case GL_CLIENT_ATTRIB_STACK_DEPTH
:
3584 *params
= (GLint
) (ctx
->ClientAttribStackDepth
);
3586 case GL_CLIP_PLANE0
:
3587 case GL_CLIP_PLANE1
:
3588 case GL_CLIP_PLANE2
:
3589 case GL_CLIP_PLANE3
:
3590 case GL_CLIP_PLANE4
:
3591 case GL_CLIP_PLANE5
:
3592 i
= (GLint
) (pname
- GL_CLIP_PLANE0
);
3593 *params
= (GLint
) ctx
->Transform
.ClipEnabled
[i
];
3595 case GL_COLOR_CLEAR_VALUE
:
3596 params
[0] = FLOAT_TO_INT( ctx
->Color
.ClearColor
[0] );
3597 params
[1] = FLOAT_TO_INT( ctx
->Color
.ClearColor
[1] );
3598 params
[2] = FLOAT_TO_INT( ctx
->Color
.ClearColor
[2] );
3599 params
[3] = FLOAT_TO_INT( ctx
->Color
.ClearColor
[3] );
3601 case GL_COLOR_MATERIAL
:
3602 *params
= (GLint
) ctx
->Light
.ColorMaterialEnabled
;
3604 case GL_COLOR_MATERIAL_FACE
:
3605 *params
= (GLint
) ctx
->Light
.ColorMaterialFace
;
3607 case GL_COLOR_MATERIAL_PARAMETER
:
3608 *params
= (GLint
) ctx
->Light
.ColorMaterialMode
;
3610 case GL_COLOR_WRITEMASK
:
3611 params
[0] = ctx
->Color
.ColorMask
[RCOMP
] ? 1 : 0;
3612 params
[1] = ctx
->Color
.ColorMask
[GCOMP
] ? 1 : 0;
3613 params
[2] = ctx
->Color
.ColorMask
[BCOMP
] ? 1 : 0;
3614 params
[3] = ctx
->Color
.ColorMask
[ACOMP
] ? 1 : 0;
3617 *params
= (GLint
) ctx
->Polygon
.CullFlag
;
3619 case GL_CULL_FACE_MODE
:
3620 *params
= (GLint
) ctx
->Polygon
.CullFaceMode
;
3622 case GL_CURRENT_COLOR
:
3623 params
[0] = FLOAT_TO_INT( UBYTE_COLOR_TO_FLOAT_COLOR( ctx
->Current
.ByteColor
[0] ) );
3624 params
[1] = FLOAT_TO_INT( UBYTE_COLOR_TO_FLOAT_COLOR( ctx
->Current
.ByteColor
[1] ) );
3625 params
[2] = FLOAT_TO_INT( UBYTE_COLOR_TO_FLOAT_COLOR( ctx
->Current
.ByteColor
[2] ) );
3626 params
[3] = FLOAT_TO_INT( UBYTE_COLOR_TO_FLOAT_COLOR( ctx
->Current
.ByteColor
[3] ) );
3628 case GL_CURRENT_INDEX
:
3629 *params
= (GLint
) ctx
->Current
.Index
;
3631 case GL_CURRENT_NORMAL
:
3632 params
[0] = FLOAT_TO_INT( ctx
->Current
.Normal
[0] );
3633 params
[1] = FLOAT_TO_INT( ctx
->Current
.Normal
[1] );
3634 params
[2] = FLOAT_TO_INT( ctx
->Current
.Normal
[2] );
3636 case GL_CURRENT_RASTER_COLOR
:
3637 params
[0] = FLOAT_TO_INT( ctx
->Current
.RasterColor
[0] );
3638 params
[1] = FLOAT_TO_INT( ctx
->Current
.RasterColor
[1] );
3639 params
[2] = FLOAT_TO_INT( ctx
->Current
.RasterColor
[2] );
3640 params
[3] = FLOAT_TO_INT( ctx
->Current
.RasterColor
[3] );
3642 case GL_CURRENT_RASTER_DISTANCE
:
3643 params
[0] = (GLint
) ctx
->Current
.RasterDistance
;
3645 case GL_CURRENT_RASTER_INDEX
:
3646 *params
= (GLint
) ctx
->Current
.RasterIndex
;
3648 case GL_CURRENT_RASTER_POSITION
:
3649 params
[0] = (GLint
) ctx
->Current
.RasterPos
[0];
3650 params
[1] = (GLint
) ctx
->Current
.RasterPos
[1];
3651 params
[2] = (GLint
) ctx
->Current
.RasterPos
[2];
3652 params
[3] = (GLint
) ctx
->Current
.RasterPos
[3];
3654 case GL_CURRENT_RASTER_TEXTURE_COORDS
:
3655 params
[0] = (GLint
) ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][0];
3656 params
[1] = (GLint
) ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][1];
3657 params
[2] = (GLint
) ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][2];
3658 params
[3] = (GLint
) ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][3];
3660 case GL_CURRENT_RASTER_POSITION_VALID
:
3661 *params
= (GLint
) ctx
->Current
.RasterPosValid
;
3663 case GL_CURRENT_TEXTURE_COORDS
:
3664 params
[0] = (GLint
) ctx
->Current
.Texcoord
[texTransformUnit
][0];
3665 params
[1] = (GLint
) ctx
->Current
.Texcoord
[texTransformUnit
][1];
3666 params
[2] = (GLint
) ctx
->Current
.Texcoord
[texTransformUnit
][2];
3667 params
[3] = (GLint
) ctx
->Current
.Texcoord
[texTransformUnit
][3];
3670 *params
= (GLint
) ctx
->Pixel
.DepthBias
;
3673 *params
= ctx
->Visual
->DepthBits
;
3675 case GL_DEPTH_CLEAR_VALUE
:
3676 *params
= (GLint
) ctx
->Depth
.Clear
;
3679 *params
= (GLint
) ctx
->Depth
.Func
;
3681 case GL_DEPTH_RANGE
:
3682 params
[0] = (GLint
) ctx
->Viewport
.Near
;
3683 params
[1] = (GLint
) ctx
->Viewport
.Far
;
3685 case GL_DEPTH_SCALE
:
3686 *params
= (GLint
) ctx
->Pixel
.DepthScale
;
3689 *params
= (GLint
) ctx
->Depth
.Test
;
3691 case GL_DEPTH_WRITEMASK
:
3692 *params
= (GLint
) ctx
->Depth
.Mask
;
3695 *params
= (GLint
) ctx
->Color
.DitherFlag
;
3697 case GL_DOUBLEBUFFER
:
3698 *params
= (GLint
) ctx
->Visual
->DBflag
;
3700 case GL_DRAW_BUFFER
:
3701 *params
= (GLint
) ctx
->Color
.DrawBuffer
;
3704 *params
= (GLint
) ctx
->Current
.EdgeFlag
;
3706 case GL_FEEDBACK_BUFFER_SIZE
:
3707 *params
= ctx
->Feedback
.BufferSize
;
3709 case GL_FEEDBACK_BUFFER_TYPE
:
3710 *params
= ctx
->Feedback
.Type
;
3713 *params
= (GLint
) ctx
->Fog
.Enabled
;
3716 params
[0] = FLOAT_TO_INT( ctx
->Fog
.Color
[0] );
3717 params
[1] = FLOAT_TO_INT( ctx
->Fog
.Color
[1] );
3718 params
[2] = FLOAT_TO_INT( ctx
->Fog
.Color
[2] );
3719 params
[3] = FLOAT_TO_INT( ctx
->Fog
.Color
[3] );
3721 case GL_FOG_DENSITY
:
3722 *params
= (GLint
) ctx
->Fog
.Density
;
3725 *params
= (GLint
) ctx
->Fog
.End
;
3728 *params
= (GLint
) ctx
->Hint
.Fog
;
3731 *params
= (GLint
) ctx
->Fog
.Index
;
3734 *params
= (GLint
) ctx
->Fog
.Mode
;
3737 *params
= (GLint
) ctx
->Fog
.Start
;
3740 *params
= (GLint
) ctx
->Polygon
.FrontFace
;
3743 *params
= (GLint
) ctx
->Pixel
.GreenBias
;
3746 *params
= (GLint
) ctx
->Visual
->GreenBits
;
3748 case GL_GREEN_SCALE
:
3749 *params
= (GLint
) ctx
->Pixel
.GreenScale
;
3752 *params
= (GLint
) ctx
->Pixel
.HistogramEnabled
;
3755 *params
= (GLint
) ctx
->Visual
->IndexBits
;
3757 case GL_INDEX_CLEAR_VALUE
:
3758 *params
= (GLint
) ctx
->Color
.ClearIndex
;
3761 *params
= ctx
->Visual
->RGBAflag
? 0 : 1;
3763 case GL_INDEX_OFFSET
:
3764 *params
= ctx
->Pixel
.IndexOffset
;
3766 case GL_INDEX_SHIFT
:
3767 *params
= ctx
->Pixel
.IndexShift
;
3769 case GL_INDEX_WRITEMASK
:
3770 *params
= (GLint
) ctx
->Color
.IndexMask
;
3780 *params
= (GLint
) ctx
->Light
.Light
[pname
-GL_LIGHT0
].Enabled
;
3783 *params
= (GLint
) ctx
->Light
.Enabled
;
3785 case GL_LIGHT_MODEL_AMBIENT
:
3786 params
[0] = FLOAT_TO_INT( ctx
->Light
.Model
.Ambient
[0] );
3787 params
[1] = FLOAT_TO_INT( ctx
->Light
.Model
.Ambient
[1] );
3788 params
[2] = FLOAT_TO_INT( ctx
->Light
.Model
.Ambient
[2] );
3789 params
[3] = FLOAT_TO_INT( ctx
->Light
.Model
.Ambient
[3] );
3791 case GL_LIGHT_MODEL_COLOR_CONTROL
:
3792 params
[0] = (GLint
) ctx
->Light
.Model
.ColorControl
;
3794 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
3795 *params
= (GLint
) ctx
->Light
.Model
.LocalViewer
;
3797 case GL_LIGHT_MODEL_TWO_SIDE
:
3798 *params
= (GLint
) ctx
->Light
.Model
.TwoSide
;
3800 case GL_LINE_SMOOTH
:
3801 *params
= (GLint
) ctx
->Line
.SmoothFlag
;
3803 case GL_LINE_SMOOTH_HINT
:
3804 *params
= (GLint
) ctx
->Hint
.LineSmooth
;
3806 case GL_LINE_STIPPLE
:
3807 *params
= (GLint
) ctx
->Line
.StippleFlag
;
3809 case GL_LINE_STIPPLE_PATTERN
:
3810 *params
= (GLint
) ctx
->Line
.StipplePattern
;
3812 case GL_LINE_STIPPLE_REPEAT
:
3813 *params
= (GLint
) ctx
->Line
.StippleFactor
;
3816 *params
= (GLint
) ctx
->Line
.Width
;
3818 case GL_LINE_WIDTH_GRANULARITY
:
3819 *params
= (GLint
) ctx
->Const
.LineWidthGranularity
;
3821 case GL_LINE_WIDTH_RANGE
:
3822 params
[0] = (GLint
) ctx
->Const
.MinLineWidthAA
;
3823 params
[1] = (GLint
) ctx
->Const
.MaxLineWidthAA
;
3825 case GL_ALIASED_LINE_WIDTH_RANGE
:
3826 params
[0] = (GLint
) ctx
->Const
.MinLineWidth
;
3827 params
[1] = (GLint
) ctx
->Const
.MaxLineWidth
;
3830 *params
= (GLint
) ctx
->List
.ListBase
;
3833 *params
= (GLint
) ctx
->CurrentListNum
;
3836 *params
= ctx
->ExecuteFlag
? (GLint
) GL_COMPILE_AND_EXECUTE
3837 : (GLint
) GL_COMPILE
;
3839 case GL_INDEX_LOGIC_OP
:
3840 *params
= (GLint
) ctx
->Color
.IndexLogicOpEnabled
;
3842 case GL_COLOR_LOGIC_OP
:
3843 *params
= (GLint
) ctx
->Color
.ColorLogicOpEnabled
;
3845 case GL_LOGIC_OP_MODE
:
3846 *params
= (GLint
) ctx
->Color
.LogicOp
;
3848 case GL_MAP1_COLOR_4
:
3849 *params
= (GLint
) ctx
->Eval
.Map1Color4
;
3851 case GL_MAP1_GRID_DOMAIN
:
3852 params
[0] = (GLint
) ctx
->Eval
.MapGrid1u1
;
3853 params
[1] = (GLint
) ctx
->Eval
.MapGrid1u2
;
3855 case GL_MAP1_GRID_SEGMENTS
:
3856 *params
= (GLint
) ctx
->Eval
.MapGrid1un
;
3859 *params
= (GLint
) ctx
->Eval
.Map1Index
;
3861 case GL_MAP1_NORMAL
:
3862 *params
= (GLint
) ctx
->Eval
.Map1Normal
;
3864 case GL_MAP1_TEXTURE_COORD_1
:
3865 *params
= (GLint
) ctx
->Eval
.Map1TextureCoord1
;
3867 case GL_MAP1_TEXTURE_COORD_2
:
3868 *params
= (GLint
) ctx
->Eval
.Map1TextureCoord2
;
3870 case GL_MAP1_TEXTURE_COORD_3
:
3871 *params
= (GLint
) ctx
->Eval
.Map1TextureCoord3
;
3873 case GL_MAP1_TEXTURE_COORD_4
:
3874 *params
= (GLint
) ctx
->Eval
.Map1TextureCoord4
;
3876 case GL_MAP1_VERTEX_3
:
3877 *params
= (GLint
) ctx
->Eval
.Map1Vertex3
;
3879 case GL_MAP1_VERTEX_4
:
3880 *params
= (GLint
) ctx
->Eval
.Map1Vertex4
;
3882 case GL_MAP2_COLOR_4
:
3883 *params
= (GLint
) ctx
->Eval
.Map2Color4
;
3885 case GL_MAP2_GRID_DOMAIN
:
3886 params
[0] = (GLint
) ctx
->Eval
.MapGrid2u1
;
3887 params
[1] = (GLint
) ctx
->Eval
.MapGrid2u2
;
3888 params
[2] = (GLint
) ctx
->Eval
.MapGrid2v1
;
3889 params
[3] = (GLint
) ctx
->Eval
.MapGrid2v2
;
3891 case GL_MAP2_GRID_SEGMENTS
:
3892 params
[0] = (GLint
) ctx
->Eval
.MapGrid2un
;
3893 params
[1] = (GLint
) ctx
->Eval
.MapGrid2vn
;
3896 *params
= (GLint
) ctx
->Eval
.Map2Index
;
3898 case GL_MAP2_NORMAL
:
3899 *params
= (GLint
) ctx
->Eval
.Map2Normal
;
3901 case GL_MAP2_TEXTURE_COORD_1
:
3902 *params
= (GLint
) ctx
->Eval
.Map2TextureCoord1
;
3904 case GL_MAP2_TEXTURE_COORD_2
:
3905 *params
= (GLint
) ctx
->Eval
.Map2TextureCoord2
;
3907 case GL_MAP2_TEXTURE_COORD_3
:
3908 *params
= (GLint
) ctx
->Eval
.Map2TextureCoord3
;
3910 case GL_MAP2_TEXTURE_COORD_4
:
3911 *params
= (GLint
) ctx
->Eval
.Map2TextureCoord4
;
3913 case GL_MAP2_VERTEX_3
:
3914 *params
= (GLint
) ctx
->Eval
.Map2Vertex3
;
3916 case GL_MAP2_VERTEX_4
:
3917 *params
= (GLint
) ctx
->Eval
.Map2Vertex4
;
3920 *params
= (GLint
) ctx
->Pixel
.MapColorFlag
;
3922 case GL_MAP_STENCIL
:
3923 *params
= (GLint
) ctx
->Pixel
.MapStencilFlag
;
3925 case GL_MATRIX_MODE
:
3926 *params
= (GLint
) ctx
->Transform
.MatrixMode
;
3928 case GL_MAX_ATTRIB_STACK_DEPTH
:
3929 *params
= (GLint
) MAX_ATTRIB_STACK_DEPTH
;
3931 case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
:
3932 *params
= (GLint
) MAX_CLIENT_ATTRIB_STACK_DEPTH
;
3934 case GL_MAX_CLIP_PLANES
:
3935 *params
= (GLint
) MAX_CLIP_PLANES
;
3937 case GL_MAX_ELEMENTS_VERTICES
: /* GL_VERSION_1_2 */
3940 case GL_MAX_ELEMENTS_INDICES
: /* GL_VERSION_1_2 */
3943 case GL_MAX_EVAL_ORDER
:
3944 *params
= (GLint
) MAX_EVAL_ORDER
;
3947 *params
= (GLint
) MAX_LIGHTS
;
3949 case GL_MAX_LIST_NESTING
:
3950 *params
= (GLint
) MAX_LIST_NESTING
;
3952 case GL_MAX_MODELVIEW_STACK_DEPTH
:
3953 *params
= (GLint
) MAX_MODELVIEW_STACK_DEPTH
;
3955 case GL_MAX_NAME_STACK_DEPTH
:
3956 *params
= (GLint
) MAX_NAME_STACK_DEPTH
;
3958 case GL_MAX_PIXEL_MAP_TABLE
:
3959 *params
= (GLint
) MAX_PIXEL_MAP_TABLE
;
3961 case GL_MAX_PROJECTION_STACK_DEPTH
:
3962 *params
= (GLint
) MAX_PROJECTION_STACK_DEPTH
;
3964 case GL_MAX_TEXTURE_SIZE
:
3965 case GL_MAX_3D_TEXTURE_SIZE
:
3966 *params
= ctx
->Const
.MaxTextureSize
;
3968 case GL_MAX_TEXTURE_STACK_DEPTH
:
3969 *params
= (GLint
) MAX_TEXTURE_STACK_DEPTH
;
3971 case GL_MAX_VIEWPORT_DIMS
:
3972 params
[0] = (GLint
) MAX_WIDTH
;
3973 params
[1] = (GLint
) MAX_HEIGHT
;
3976 *params
= (GLint
) ctx
->Pixel
.MinMaxEnabled
;
3978 case GL_MODELVIEW_MATRIX
:
3979 for (i
=0;i
<16;i
++) {
3980 params
[i
] = (GLint
) ctx
->ModelView
.m
[i
];
3983 case GL_MODELVIEW_STACK_DEPTH
:
3984 *params
= (GLint
) (ctx
->ModelViewStackDepth
+ 1);
3986 case GL_NAME_STACK_DEPTH
:
3987 *params
= (GLint
) ctx
->Select
.NameStackDepth
;
3990 *params
= (GLint
) ctx
->Transform
.Normalize
;
3992 case GL_PACK_ALIGNMENT
:
3993 *params
= ctx
->Pack
.Alignment
;
3995 case GL_PACK_LSB_FIRST
:
3996 *params
= (GLint
) ctx
->Pack
.LsbFirst
;
3998 case GL_PACK_ROW_LENGTH
:
3999 *params
= ctx
->Pack
.RowLength
;
4001 case GL_PACK_SKIP_PIXELS
:
4002 *params
= ctx
->Pack
.SkipPixels
;
4004 case GL_PACK_SKIP_ROWS
:
4005 *params
= ctx
->Pack
.SkipRows
;
4007 case GL_PACK_SWAP_BYTES
:
4008 *params
= (GLint
) ctx
->Pack
.SwapBytes
;
4010 case GL_PACK_SKIP_IMAGES_EXT
:
4011 *params
= ctx
->Pack
.SkipImages
;
4013 case GL_PACK_IMAGE_HEIGHT_EXT
:
4014 *params
= ctx
->Pack
.ImageHeight
;
4016 case GL_PERSPECTIVE_CORRECTION_HINT
:
4017 *params
= (GLint
) ctx
->Hint
.PerspectiveCorrection
;
4019 case GL_PIXEL_MAP_A_TO_A_SIZE
:
4020 *params
= ctx
->Pixel
.MapAtoAsize
;
4022 case GL_PIXEL_MAP_B_TO_B_SIZE
:
4023 *params
= ctx
->Pixel
.MapBtoBsize
;
4025 case GL_PIXEL_MAP_G_TO_G_SIZE
:
4026 *params
= ctx
->Pixel
.MapGtoGsize
;
4028 case GL_PIXEL_MAP_I_TO_A_SIZE
:
4029 *params
= ctx
->Pixel
.MapItoAsize
;
4031 case GL_PIXEL_MAP_I_TO_B_SIZE
:
4032 *params
= ctx
->Pixel
.MapItoBsize
;
4034 case GL_PIXEL_MAP_I_TO_G_SIZE
:
4035 *params
= ctx
->Pixel
.MapItoGsize
;
4037 case GL_PIXEL_MAP_I_TO_I_SIZE
:
4038 *params
= ctx
->Pixel
.MapItoIsize
;
4040 case GL_PIXEL_MAP_I_TO_R_SIZE
:
4041 *params
= ctx
->Pixel
.MapItoRsize
;
4043 case GL_PIXEL_MAP_R_TO_R_SIZE
:
4044 *params
= ctx
->Pixel
.MapRtoRsize
;
4046 case GL_PIXEL_MAP_S_TO_S_SIZE
:
4047 *params
= ctx
->Pixel
.MapStoSsize
;
4050 *params
= (GLint
) ctx
->Point
.UserSize
;
4052 case GL_POINT_SIZE_GRANULARITY
:
4053 *params
= (GLint
) ctx
->Const
.PointSizeGranularity
;
4055 case GL_POINT_SIZE_RANGE
:
4056 params
[0] = (GLint
) ctx
->Const
.MinPointSizeAA
;
4057 params
[1] = (GLint
) ctx
->Const
.MaxPointSizeAA
;
4059 case GL_ALIASED_POINT_SIZE_RANGE
:
4060 params
[0] = (GLint
) ctx
->Const
.MinPointSize
;
4061 params
[1] = (GLint
) ctx
->Const
.MaxPointSize
;
4063 case GL_POINT_SMOOTH
:
4064 *params
= (GLint
) ctx
->Point
.SmoothFlag
;
4066 case GL_POINT_SMOOTH_HINT
:
4067 *params
= (GLint
) ctx
->Hint
.PointSmooth
;
4069 case GL_POINT_SIZE_MIN_EXT
:
4070 *params
= (GLint
) (ctx
->Point
.MinSize
);
4072 case GL_POINT_SIZE_MAX_EXT
:
4073 *params
= (GLint
) (ctx
->Point
.MaxSize
);
4075 case GL_POINT_FADE_THRESHOLD_SIZE_EXT
:
4076 *params
= (GLint
) (ctx
->Point
.Threshold
);
4078 case GL_DISTANCE_ATTENUATION_EXT
:
4079 params
[0] = (GLint
) (ctx
->Point
.Params
[0]);
4080 params
[1] = (GLint
) (ctx
->Point
.Params
[1]);
4081 params
[2] = (GLint
) (ctx
->Point
.Params
[2]);
4083 case GL_POLYGON_MODE
:
4084 params
[0] = (GLint
) ctx
->Polygon
.FrontMode
;
4085 params
[1] = (GLint
) ctx
->Polygon
.BackMode
;
4087 case GL_POLYGON_OFFSET_BIAS_EXT
: /* GL_EXT_polygon_offset */
4088 *params
= (GLint
) ctx
->Polygon
.OffsetUnits
;
4090 case GL_POLYGON_OFFSET_FACTOR
:
4091 *params
= (GLint
) ctx
->Polygon
.OffsetFactor
;
4093 case GL_POLYGON_OFFSET_UNITS
:
4094 *params
= (GLint
) ctx
->Polygon
.OffsetUnits
;
4096 case GL_POLYGON_SMOOTH
:
4097 *params
= (GLint
) ctx
->Polygon
.SmoothFlag
;
4099 case GL_POLYGON_SMOOTH_HINT
:
4100 *params
= (GLint
) ctx
->Hint
.PolygonSmooth
;
4102 case GL_POLYGON_STIPPLE
:
4103 *params
= (GLint
) ctx
->Polygon
.StippleFlag
;
4105 case GL_PROJECTION_MATRIX
:
4106 for (i
=0;i
<16;i
++) {
4107 params
[i
] = (GLint
) ctx
->ProjectionMatrix
.m
[i
];
4110 case GL_PROJECTION_STACK_DEPTH
:
4111 *params
= (GLint
) (ctx
->ProjectionStackDepth
+ 1);
4113 case GL_READ_BUFFER
:
4114 *params
= (GLint
) ctx
->Pixel
.ReadBuffer
;
4117 *params
= (GLint
) ctx
->Pixel
.RedBias
;
4120 *params
= (GLint
) ctx
->Visual
->RedBits
;
4123 *params
= (GLint
) ctx
->Pixel
.RedScale
;
4125 case GL_RENDER_MODE
:
4126 *params
= (GLint
) ctx
->RenderMode
;
4129 *params
= (GLint
) ctx
->Visual
->RGBAflag
;
4131 case GL_SCISSOR_BOX
:
4132 params
[0] = (GLint
) ctx
->Scissor
.X
;
4133 params
[1] = (GLint
) ctx
->Scissor
.Y
;
4134 params
[2] = (GLint
) ctx
->Scissor
.Width
;
4135 params
[3] = (GLint
) ctx
->Scissor
.Height
;
4137 case GL_SCISSOR_TEST
:
4138 *params
= (GLint
) ctx
->Scissor
.Enabled
;
4140 case GL_SELECTION_BUFFER_SIZE
:
4141 *params
= (GLint
) ctx
->Select
.BufferSize
;
4143 case GL_SHADE_MODEL
:
4144 *params
= (GLint
) ctx
->Light
.ShadeModel
;
4146 case GL_SHARED_TEXTURE_PALETTE_EXT
:
4147 *params
= (GLint
) ctx
->Texture
.SharedPalette
;
4149 case GL_STENCIL_BITS
:
4150 *params
= ctx
->Visual
->StencilBits
;
4152 case GL_STENCIL_CLEAR_VALUE
:
4153 *params
= (GLint
) ctx
->Stencil
.Clear
;
4155 case GL_STENCIL_FAIL
:
4156 *params
= (GLint
) ctx
->Stencil
.FailFunc
;
4158 case GL_STENCIL_FUNC
:
4159 *params
= (GLint
) ctx
->Stencil
.Function
;
4161 case GL_STENCIL_PASS_DEPTH_FAIL
:
4162 *params
= (GLint
) ctx
->Stencil
.ZFailFunc
;
4164 case GL_STENCIL_PASS_DEPTH_PASS
:
4165 *params
= (GLint
) ctx
->Stencil
.ZPassFunc
;
4167 case GL_STENCIL_REF
:
4168 *params
= (GLint
) ctx
->Stencil
.Ref
;
4170 case GL_STENCIL_TEST
:
4171 *params
= (GLint
) ctx
->Stencil
.Enabled
;
4173 case GL_STENCIL_VALUE_MASK
:
4174 *params
= (GLint
) ctx
->Stencil
.ValueMask
;
4176 case GL_STENCIL_WRITEMASK
:
4177 *params
= (GLint
) ctx
->Stencil
.WriteMask
;
4180 *params
= (GLint
) ctx
->Visual
->StereoFlag
;
4182 case GL_SUBPIXEL_BITS
:
4183 *params
= ctx
->Const
.SubPixelBits
;
4186 *params
= _mesa_IsEnabled(GL_TEXTURE_1D
) ? 1 : 0;
4189 *params
= _mesa_IsEnabled(GL_TEXTURE_2D
) ? 1 : 0;
4192 *params
= _mesa_IsEnabled(GL_TEXTURE_3D
) ? 1 : 0;
4194 case GL_TEXTURE_BINDING_1D
:
4195 *params
= textureUnit
->CurrentD
[1]->Name
;
4197 case GL_TEXTURE_BINDING_2D
:
4198 *params
= textureUnit
->CurrentD
[2]->Name
;
4200 case GL_TEXTURE_BINDING_3D
:
4201 *params
= textureUnit
->CurrentD
[3]->Name
;
4203 case GL_TEXTURE_ENV_COLOR
:
4204 params
[0] = FLOAT_TO_INT( textureUnit
->EnvColor
[0] );
4205 params
[1] = FLOAT_TO_INT( textureUnit
->EnvColor
[1] );
4206 params
[2] = FLOAT_TO_INT( textureUnit
->EnvColor
[2] );
4207 params
[3] = FLOAT_TO_INT( textureUnit
->EnvColor
[3] );
4209 case GL_TEXTURE_ENV_MODE
:
4210 *params
= (GLint
) textureUnit
->EnvMode
;
4212 case GL_TEXTURE_GEN_S
:
4213 *params
= (textureUnit
->TexGenEnabled
& S_BIT
) ? 1 : 0;
4215 case GL_TEXTURE_GEN_T
:
4216 *params
= (textureUnit
->TexGenEnabled
& T_BIT
) ? 1 : 0;
4218 case GL_TEXTURE_GEN_R
:
4219 *params
= (textureUnit
->TexGenEnabled
& R_BIT
) ? 1 : 0;
4221 case GL_TEXTURE_GEN_Q
:
4222 *params
= (textureUnit
->TexGenEnabled
& Q_BIT
) ? 1 : 0;
4224 case GL_TEXTURE_MATRIX
:
4225 for (i
=0;i
<16;i
++) {
4226 params
[i
] = (GLint
) ctx
->TextureMatrix
[texTransformUnit
].m
[i
];
4229 case GL_TEXTURE_STACK_DEPTH
:
4230 *params
= (GLint
) (ctx
->TextureStackDepth
[texTransformUnit
] + 1);
4232 case GL_UNPACK_ALIGNMENT
:
4233 *params
= ctx
->Unpack
.Alignment
;
4235 case GL_UNPACK_LSB_FIRST
:
4236 *params
= (GLint
) ctx
->Unpack
.LsbFirst
;
4238 case GL_UNPACK_ROW_LENGTH
:
4239 *params
= ctx
->Unpack
.RowLength
;
4241 case GL_UNPACK_SKIP_PIXELS
:
4242 *params
= ctx
->Unpack
.SkipPixels
;
4244 case GL_UNPACK_SKIP_ROWS
:
4245 *params
= ctx
->Unpack
.SkipRows
;
4247 case GL_UNPACK_SWAP_BYTES
:
4248 *params
= (GLint
) ctx
->Unpack
.SwapBytes
;
4250 case GL_UNPACK_SKIP_IMAGES_EXT
:
4251 *params
= ctx
->Unpack
.SkipImages
;
4253 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
4254 *params
= ctx
->Unpack
.ImageHeight
;
4257 params
[0] = (GLint
) ctx
->Viewport
.X
;
4258 params
[1] = (GLint
) ctx
->Viewport
.Y
;
4259 params
[2] = (GLint
) ctx
->Viewport
.Width
;
4260 params
[3] = (GLint
) ctx
->Viewport
.Height
;
4263 *params
= (GLint
) ctx
->Pixel
.ZoomX
;
4266 *params
= (GLint
) ctx
->Pixel
.ZoomY
;
4268 case GL_VERTEX_ARRAY
:
4269 *params
= (GLint
) ctx
->Array
.Vertex
.Enabled
;
4271 case GL_VERTEX_ARRAY_SIZE
:
4272 *params
= ctx
->Array
.Vertex
.Size
;
4274 case GL_VERTEX_ARRAY_TYPE
:
4275 *params
= ctx
->Array
.Vertex
.Type
;
4277 case GL_VERTEX_ARRAY_STRIDE
:
4278 *params
= ctx
->Array
.Vertex
.Stride
;
4280 case GL_VERTEX_ARRAY_COUNT_EXT
:
4283 case GL_NORMAL_ARRAY
:
4284 *params
= (GLint
) ctx
->Array
.Normal
.Enabled
;
4286 case GL_NORMAL_ARRAY_TYPE
:
4287 *params
= ctx
->Array
.Normal
.Type
;
4289 case GL_NORMAL_ARRAY_STRIDE
:
4290 *params
= ctx
->Array
.Normal
.Stride
;
4292 case GL_NORMAL_ARRAY_COUNT_EXT
:
4295 case GL_COLOR_ARRAY
:
4296 *params
= (GLint
) ctx
->Array
.Color
.Enabled
;
4298 case GL_COLOR_ARRAY_SIZE
:
4299 *params
= ctx
->Array
.Color
.Size
;
4301 case GL_COLOR_ARRAY_TYPE
:
4302 *params
= ctx
->Array
.Color
.Type
;
4304 case GL_COLOR_ARRAY_STRIDE
:
4305 *params
= ctx
->Array
.Color
.Stride
;
4307 case GL_COLOR_ARRAY_COUNT_EXT
:
4310 case GL_INDEX_ARRAY
:
4311 *params
= (GLint
) ctx
->Array
.Index
.Enabled
;
4313 case GL_INDEX_ARRAY_TYPE
:
4314 *params
= ctx
->Array
.Index
.Type
;
4316 case GL_INDEX_ARRAY_STRIDE
:
4317 *params
= ctx
->Array
.Index
.Stride
;
4319 case GL_INDEX_ARRAY_COUNT_EXT
:
4322 case GL_TEXTURE_COORD_ARRAY
:
4323 *params
= (GLint
) ctx
->Array
.TexCoord
[texUnit
].Enabled
;
4325 case GL_TEXTURE_COORD_ARRAY_SIZE
:
4326 *params
= ctx
->Array
.TexCoord
[texUnit
].Size
;
4328 case GL_TEXTURE_COORD_ARRAY_TYPE
:
4329 *params
= ctx
->Array
.TexCoord
[texUnit
].Type
;
4331 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
4332 *params
= ctx
->Array
.TexCoord
[texUnit
].Stride
;
4334 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
4337 case GL_EDGE_FLAG_ARRAY
:
4338 *params
= (GLint
) ctx
->Array
.EdgeFlag
.Enabled
;
4340 case GL_EDGE_FLAG_ARRAY_STRIDE
:
4341 *params
= ctx
->Array
.EdgeFlag
.Stride
;
4343 case GL_EDGE_FLAG_ARRAY_COUNT_EXT
:
4347 /* GL_ARB_multitexture */
4348 case GL_MAX_TEXTURE_UNITS_ARB
:
4349 *params
= ctx
->Const
.MaxTextureUnits
;
4351 case GL_ACTIVE_TEXTURE_ARB
:
4352 *params
= GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
;
4354 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
4355 *params
= GL_TEXTURE0_ARB
+ ctx
->Array
.ActiveTexture
;
4358 /* GL_ARB_texture_cube_map */
4359 case GL_TEXTURE_CUBE_MAP_ARB
:
4360 if (ctx
->Extensions
.HaveTextureCubeMap
)
4361 *params
= (GLint
) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
);
4363 gl_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
4365 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
4366 if (ctx
->Extensions
.HaveTextureCubeMap
)
4367 *params
= textureUnit
->CurrentCubeMap
->Name
;
4369 gl_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
4371 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
4372 if (ctx
->Extensions
.HaveTextureCubeMap
)
4373 *params
= ctx
->Const
.MaxCubeTextureSize
;
4375 gl_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
4378 /* GL_ARB_texture_compression */
4379 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
4380 if (ctx
->Extensions
.HaveTextureCompression
) {
4381 *params
= (GLint
) ctx
->Hint
.TextureCompression
;
4384 gl_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
4386 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
4387 if (ctx
->Extensions
.HaveTextureCompression
) {
4388 *params
= (GLint
) ctx
->Const
.NumCompressedTextureFormats
;
4391 gl_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
4393 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
4394 if (ctx
->Extensions
.HaveTextureCompression
) {
4396 for (i
= 0; i
< ctx
->Const
.NumCompressedTextureFormats
; i
++)
4397 params
[i
] = (GLint
) ctx
->Const
.CompressedTextureFormats
[i
];
4400 gl_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
4403 /* GL_PGI_misc_hints */
4404 case GL_STRICT_DEPTHFUNC_HINT_PGI
:
4405 *params
= (GL_NICEST
);
4407 case GL_STRICT_LIGHTING_HINT_PGI
:
4408 *params
= (ctx
->Hint
.StrictLighting
);
4410 case GL_STRICT_SCISSOR_HINT_PGI
:
4411 case GL_FULL_STIPPLE_HINT_PGI
:
4414 case GL_CONSERVE_MEMORY_HINT_PGI
:
4417 case GL_ALWAYS_FAST_HINT_PGI
:
4418 *params
= (ctx
->Hint
.AllowDrawWin
== GL_TRUE
&&
4419 ctx
->Hint
.AllowDrawFrg
== GL_FALSE
&&
4420 ctx
->Hint
.AllowDrawMem
== GL_FALSE
);
4422 case GL_ALWAYS_SOFT_HINT_PGI
:
4423 *params
= (ctx
->Hint
.AllowDrawWin
== GL_TRUE
&&
4424 ctx
->Hint
.AllowDrawFrg
== GL_TRUE
&&
4425 ctx
->Hint
.AllowDrawMem
== GL_TRUE
);
4427 case GL_ALLOW_DRAW_OBJ_HINT_PGI
:
4430 case GL_ALLOW_DRAW_WIN_HINT_PGI
:
4431 *params
= ctx
->Hint
.AllowDrawWin
;
4433 case GL_ALLOW_DRAW_FRG_HINT_PGI
:
4434 *params
= ctx
->Hint
.AllowDrawFrg
;
4436 case GL_ALLOW_DRAW_MEM_HINT_PGI
:
4437 *params
= ctx
->Hint
.AllowDrawMem
;
4439 case GL_CLIP_NEAR_HINT_PGI
:
4440 case GL_CLIP_FAR_HINT_PGI
:
4443 case GL_WIDE_LINE_HINT_PGI
:
4444 *params
= GL_DONT_CARE
;
4446 case GL_BACK_NORMALS_HINT_PGI
:
4449 case GL_NATIVE_GRAPHICS_HANDLE_PGI
:
4453 /* GL_EXT_compiled_vertex_array */
4454 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
4455 *params
= ctx
->Array
.LockFirst
;
4457 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
4458 *params
= ctx
->Array
.LockCount
;
4461 /* GL_ARB_transpose_matrix */
4462 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
4466 gl_matrix_transposef(tm
, ctx
->ColorMatrix
.m
);
4467 for (i
=0;i
<16;i
++) {
4468 params
[i
] = (GLint
) tm
[i
];
4472 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
4476 gl_matrix_transposef(tm
, ctx
->ModelView
.m
);
4477 for (i
=0;i
<16;i
++) {
4478 params
[i
] = (GLint
) tm
[i
];
4482 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
4486 gl_matrix_transposef(tm
, ctx
->ProjectionMatrix
.m
);
4487 for (i
=0;i
<16;i
++) {
4488 params
[i
] = (GLint
) tm
[i
];
4492 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
4496 gl_matrix_transposef(tm
, ctx
->TextureMatrix
[texTransformUnit
].m
);
4497 for (i
=0;i
<16;i
++) {
4498 params
[i
] = (GLint
) tm
[i
];
4503 /* GL_HP_occlusion_test */
4504 case GL_OCCLUSION_TEST_HP
:
4505 if (ctx
->Extensions
.HaveHpOcclusionTest
) {
4506 *params
= (GLint
) ctx
->Depth
.OcclusionTest
;
4509 gl_error( ctx
, GL_INVALID_ENUM
, "glGetIntegerv" );
4512 case GL_OCCLUSION_TEST_RESULT_HP
:
4513 if (ctx
->Extensions
.HaveHpOcclusionTest
) {
4514 if (ctx
->Depth
.OcclusionTest
)
4515 *params
= (GLint
) ctx
->OcclusionResult
;
4517 *params
= (GLint
) ctx
->OcclusionResultSaved
;
4518 /* reset flag now */
4519 ctx
->OcclusionResult
= GL_FALSE
;
4520 ctx
->OcclusionResultSaved
= GL_FALSE
;
4523 gl_error( ctx
, GL_INVALID_ENUM
, "glGetIntegerv" );
4527 /* GL_SGIS_pixel_texture */
4528 case GL_PIXEL_TEXTURE_SGIS
:
4529 *params
= (GLint
) ctx
->Pixel
.PixelTextureEnabled
;
4532 /* GL_SGIX_pixel_texture */
4533 case GL_PIXEL_TEX_GEN_SGIX
:
4534 *params
= (GLint
) ctx
->Pixel
.PixelTextureEnabled
;
4536 case GL_PIXEL_TEX_GEN_MODE_SGIX
:
4537 *params
= (GLint
) pixel_texgen_mode(ctx
);
4540 /* GL_SGI_color_matrix (also in 1.2 imaging) */
4541 case GL_COLOR_MATRIX_SGI
:
4542 for (i
=0;i
<16;i
++) {
4543 params
[i
] = (GLint
) ctx
->ColorMatrix
.m
[i
];
4546 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
4547 *params
= ctx
->ColorStackDepth
+ 1;
4549 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
4550 *params
= MAX_COLOR_STACK_DEPTH
;
4552 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
4553 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixScale
[0];
4555 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
4556 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixScale
[1];
4558 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
4559 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixScale
[2];
4561 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
4562 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixScale
[3];
4564 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
4565 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixBias
[0];
4567 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
4568 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixBias
[1];
4570 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
4571 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixBias
[2];
4573 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
4574 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixBias
[3];
4577 /* GL_EXT_convolution (also in 1.2 imaging) */
4578 case GL_MAX_CONVOLUTION_WIDTH
:
4579 *params
= ctx
->Const
.MaxConvolutionWidth
;
4581 case GL_MAX_CONVOLUTION_HEIGHT
:
4582 *params
= ctx
->Const
.MaxConvolutionHeight
;
4584 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
4585 *params
= (GLint
) ctx
->Pixel
.PostConvolutionScale
[0];
4587 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
4588 *params
= (GLint
) ctx
->Pixel
.PostConvolutionScale
[1];
4590 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
4591 *params
= (GLint
) ctx
->Pixel
.PostConvolutionScale
[2];
4593 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
4594 *params
= (GLint
) ctx
->Pixel
.PostConvolutionScale
[3];
4596 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
4597 *params
= (GLint
) ctx
->Pixel
.PostConvolutionBias
[0];
4599 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
4600 *params
= (GLint
) ctx
->Pixel
.PostConvolutionBias
[1];
4602 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
4603 *params
= (GLint
) ctx
->Pixel
.PostConvolutionBias
[2];
4605 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
4606 *params
= (GLint
) ctx
->Pixel
.PostConvolutionBias
[2];
4609 /* GL_SGI_color_table (also in 1.2 imaging */
4610 case GL_COLOR_TABLE_SGI
:
4611 *params
= (GLint
) ctx
->Pixel
.ColorTableEnabled
;
4613 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
4614 *params
= (GLint
) ctx
->Pixel
.PostConvolutionColorTableEnabled
;
4616 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
4617 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixColorTableEnabled
;
4621 gl_error( ctx
, GL_INVALID_ENUM
, "glGetIntegerv" );
4628 _mesa_GetPointerv( GLenum pname
, GLvoid
**params
)
4630 GET_CURRENT_CONTEXT(ctx
);
4631 GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
4632 /*GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit;*/
4634 if (MESA_VERBOSE
& VERBOSE_API
)
4635 fprintf(stderr
, "glGetPointerv %s\n", gl_lookup_enum_by_nr(pname
));
4638 case GL_VERTEX_ARRAY_POINTER
:
4639 *params
= ctx
->Array
.Vertex
.Ptr
;
4641 case GL_NORMAL_ARRAY_POINTER
:
4642 *params
= ctx
->Array
.Normal
.Ptr
;
4644 case GL_COLOR_ARRAY_POINTER
:
4645 *params
= ctx
->Array
.Color
.Ptr
;
4647 case GL_INDEX_ARRAY_POINTER
:
4648 *params
= ctx
->Array
.Index
.Ptr
;
4650 case GL_TEXTURE_COORD_ARRAY_POINTER
:
4651 *params
= ctx
->Array
.TexCoord
[texUnit
].Ptr
;
4653 case GL_EDGE_FLAG_ARRAY_POINTER
:
4654 *params
= ctx
->Array
.EdgeFlag
.Ptr
;
4656 case GL_FEEDBACK_BUFFER_POINTER
:
4657 *params
= ctx
->Feedback
.Buffer
;
4659 case GL_SELECTION_BUFFER_POINTER
:
4660 *params
= ctx
->Select
.Buffer
;
4663 gl_error( ctx
, GL_INVALID_ENUM
, "glGetPointerv" );
4671 _mesa_GetString( GLenum name
)
4673 GET_CURRENT_CONTEXT(ctx
);
4674 static const char *vendor
= "Brian Paul";
4675 static const char *renderer
= "Mesa";
4676 static const char *version
= "1.2 Mesa 3.3";
4678 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx
, "glGetString", 0);
4680 /* this is a required driver function */
4681 assert(ctx
->Driver
.GetString
);
4683 const GLubyte
*str
= (*ctx
->Driver
.GetString
)(ctx
, name
);
4689 return (const GLubyte
*) vendor
;
4691 return (const GLubyte
*) renderer
;
4693 return (const GLubyte
*) version
;
4695 return (GLubyte
*) gl_extensions_get_string( ctx
);
4697 gl_error( ctx
, GL_INVALID_ENUM
, "glGetString" );
4698 return (GLubyte
*) 0;
4705 * Execute a glGetError command
4708 _mesa_GetError( void )
4710 GET_CURRENT_CONTEXT(ctx
);
4712 GLenum e
= ctx
->ErrorValue
;
4714 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL( ctx
, "glGetError", (GLenum
) 0);
4716 if (MESA_VERBOSE
& VERBOSE_API
)
4717 fprintf(stderr
, "glGetError <-- %s\n", gl_lookup_enum_by_nr(e
));
4719 ctx
->ErrorValue
= (GLenum
) GL_NO_ERROR
;