1 /* $Id: get.c,v 1.33 2000/09/15 19:57:51 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");
98 if (MESA_VERBOSE
& VERBOSE_API
)
99 fprintf(stderr
, "glGetBooleanv %s\n", gl_lookup_enum_by_nr(pname
));
101 if (ctx
->Driver
.GetBooleanv
102 && (*ctx
->Driver
.GetBooleanv
)(ctx
, pname
, params
))
106 case GL_ACCUM_RED_BITS
:
107 *params
= INT_TO_BOOL(ctx
->Visual
->AccumRedBits
);
109 case GL_ACCUM_GREEN_BITS
:
110 *params
= INT_TO_BOOL(ctx
->Visual
->AccumGreenBits
);
112 case GL_ACCUM_BLUE_BITS
:
113 *params
= INT_TO_BOOL(ctx
->Visual
->AccumBlueBits
);
115 case GL_ACCUM_ALPHA_BITS
:
116 *params
= INT_TO_BOOL(ctx
->Visual
->AccumAlphaBits
);
118 case GL_ACCUM_CLEAR_VALUE
:
119 params
[0] = FLOAT_TO_BOOL(ctx
->Accum
.ClearColor
[0]);
120 params
[1] = FLOAT_TO_BOOL(ctx
->Accum
.ClearColor
[1]);
121 params
[2] = FLOAT_TO_BOOL(ctx
->Accum
.ClearColor
[2]);
122 params
[3] = FLOAT_TO_BOOL(ctx
->Accum
.ClearColor
[3]);
125 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.AlphaBias
);
128 *params
= INT_TO_BOOL(ctx
->Visual
->AlphaBits
);
131 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.AlphaScale
);
134 *params
= ctx
->Color
.AlphaEnabled
;
136 case GL_ALPHA_TEST_FUNC
:
137 *params
= ENUM_TO_BOOL(ctx
->Color
.AlphaFunc
);
139 case GL_ALPHA_TEST_REF
:
140 *params
= FLOAT_TO_BOOL((GLfloat
) ctx
->Color
.AlphaRef
/ 255.0);
142 case GL_ATTRIB_STACK_DEPTH
:
143 *params
= INT_TO_BOOL(ctx
->AttribStackDepth
);
146 *params
= ctx
->Eval
.AutoNormal
;
149 *params
= (ctx
->Const
.NumAuxBuffers
) ? GL_TRUE
: GL_FALSE
;
152 *params
= ctx
->Color
.BlendEnabled
;
155 *params
= ENUM_TO_BOOL(ctx
->Color
.BlendDstRGB
);
158 *params
= ENUM_TO_BOOL(ctx
->Color
.BlendSrcRGB
);
160 case GL_BLEND_SRC_RGB_EXT
:
161 *params
= ENUM_TO_BOOL(ctx
->Color
.BlendSrcRGB
);
163 case GL_BLEND_DST_RGB_EXT
:
164 *params
= ENUM_TO_BOOL(ctx
->Color
.BlendDstRGB
);
166 case GL_BLEND_SRC_ALPHA_EXT
:
167 *params
= ENUM_TO_BOOL(ctx
->Color
.BlendSrcA
);
169 case GL_BLEND_DST_ALPHA_EXT
:
170 *params
= ENUM_TO_BOOL(ctx
->Color
.BlendDstA
);
172 case GL_BLEND_EQUATION_EXT
:
173 *params
= ENUM_TO_BOOL( ctx
->Color
.BlendEquation
);
175 case GL_BLEND_COLOR_EXT
:
176 params
[0] = FLOAT_TO_BOOL( ctx
->Color
.BlendColor
[0] );
177 params
[1] = FLOAT_TO_BOOL( ctx
->Color
.BlendColor
[1] );
178 params
[2] = FLOAT_TO_BOOL( ctx
->Color
.BlendColor
[2] );
179 params
[3] = FLOAT_TO_BOOL( ctx
->Color
.BlendColor
[3] );
182 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.BlueBias
);
185 *params
= INT_TO_BOOL( ctx
->Visual
->BlueBits
);
188 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.BlueScale
);
190 case GL_CLIENT_ATTRIB_STACK_DEPTH
:
191 *params
= INT_TO_BOOL(ctx
->ClientAttribStackDepth
);
199 *params
= ctx
->Transform
.ClipEnabled
[pname
-GL_CLIP_PLANE0
];
201 case GL_COLOR_CLEAR_VALUE
:
202 params
[0] = FLOAT_TO_BOOL(ctx
->Color
.ClearColor
[0]);
203 params
[1] = FLOAT_TO_BOOL(ctx
->Color
.ClearColor
[1]);
204 params
[2] = FLOAT_TO_BOOL(ctx
->Color
.ClearColor
[2]);
205 params
[3] = FLOAT_TO_BOOL(ctx
->Color
.ClearColor
[3]);
207 case GL_COLOR_MATERIAL
:
208 *params
= ctx
->Light
.ColorMaterialEnabled
;
210 case GL_COLOR_MATERIAL_FACE
:
211 *params
= ENUM_TO_BOOL(ctx
->Light
.ColorMaterialFace
);
213 case GL_COLOR_MATERIAL_PARAMETER
:
214 *params
= ENUM_TO_BOOL(ctx
->Light
.ColorMaterialMode
);
216 case GL_COLOR_WRITEMASK
:
217 params
[0] = ctx
->Color
.ColorMask
[RCOMP
] ? GL_TRUE
: GL_FALSE
;
218 params
[1] = ctx
->Color
.ColorMask
[GCOMP
] ? GL_TRUE
: GL_FALSE
;
219 params
[2] = ctx
->Color
.ColorMask
[BCOMP
] ? GL_TRUE
: GL_FALSE
;
220 params
[3] = ctx
->Color
.ColorMask
[ACOMP
] ? GL_TRUE
: GL_FALSE
;
223 *params
= ctx
->Polygon
.CullFlag
;
225 case GL_CULL_FACE_MODE
:
226 *params
= ENUM_TO_BOOL(ctx
->Polygon
.CullFaceMode
);
228 case GL_CURRENT_COLOR
:
229 params
[0] = INT_TO_BOOL(ctx
->Current
.ByteColor
[0]);
230 params
[1] = INT_TO_BOOL(ctx
->Current
.ByteColor
[1]);
231 params
[2] = INT_TO_BOOL(ctx
->Current
.ByteColor
[2]);
232 params
[3] = INT_TO_BOOL(ctx
->Current
.ByteColor
[3]);
234 case GL_CURRENT_INDEX
:
235 *params
= INT_TO_BOOL(ctx
->Current
.Index
);
237 case GL_CURRENT_NORMAL
:
238 params
[0] = FLOAT_TO_BOOL(ctx
->Current
.Normal
[0]);
239 params
[1] = FLOAT_TO_BOOL(ctx
->Current
.Normal
[1]);
240 params
[2] = FLOAT_TO_BOOL(ctx
->Current
.Normal
[2]);
242 case GL_CURRENT_RASTER_COLOR
:
243 params
[0] = FLOAT_TO_BOOL(ctx
->Current
.RasterColor
[0]);
244 params
[1] = FLOAT_TO_BOOL(ctx
->Current
.RasterColor
[1]);
245 params
[2] = FLOAT_TO_BOOL(ctx
->Current
.RasterColor
[2]);
246 params
[3] = FLOAT_TO_BOOL(ctx
->Current
.RasterColor
[3]);
248 case GL_CURRENT_RASTER_DISTANCE
:
249 *params
= FLOAT_TO_BOOL(ctx
->Current
.RasterDistance
);
251 case GL_CURRENT_RASTER_INDEX
:
252 *params
= FLOAT_TO_BOOL(ctx
->Current
.RasterIndex
);
254 case GL_CURRENT_RASTER_POSITION
:
255 params
[0] = FLOAT_TO_BOOL(ctx
->Current
.RasterPos
[0]);
256 params
[1] = FLOAT_TO_BOOL(ctx
->Current
.RasterPos
[1]);
257 params
[2] = FLOAT_TO_BOOL(ctx
->Current
.RasterPos
[2]);
258 params
[3] = FLOAT_TO_BOOL(ctx
->Current
.RasterPos
[3]);
260 case GL_CURRENT_RASTER_TEXTURE_COORDS
:
261 params
[0] = FLOAT_TO_BOOL(ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][0]);
262 params
[1] = FLOAT_TO_BOOL(ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][1]);
263 params
[2] = FLOAT_TO_BOOL(ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][2]);
264 params
[3] = FLOAT_TO_BOOL(ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][3]);
266 case GL_CURRENT_RASTER_POSITION_VALID
:
267 *params
= ctx
->Current
.RasterPosValid
;
269 case GL_CURRENT_TEXTURE_COORDS
:
270 params
[0] = FLOAT_TO_BOOL(ctx
->Current
.Texcoord
[texTransformUnit
][0]);
271 params
[1] = FLOAT_TO_BOOL(ctx
->Current
.Texcoord
[texTransformUnit
][1]);
272 params
[2] = FLOAT_TO_BOOL(ctx
->Current
.Texcoord
[texTransformUnit
][2]);
273 params
[3] = FLOAT_TO_BOOL(ctx
->Current
.Texcoord
[texTransformUnit
][3]);
276 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.DepthBias
);
279 *params
= INT_TO_BOOL(ctx
->Visual
->DepthBits
);
281 case GL_DEPTH_CLEAR_VALUE
:
282 *params
= FLOAT_TO_BOOL(ctx
->Depth
.Clear
);
285 *params
= ENUM_TO_BOOL(ctx
->Depth
.Func
);
288 params
[0] = FLOAT_TO_BOOL(ctx
->Viewport
.Near
);
289 params
[1] = FLOAT_TO_BOOL(ctx
->Viewport
.Far
);
292 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.DepthScale
);
295 *params
= ctx
->Depth
.Test
;
297 case GL_DEPTH_WRITEMASK
:
298 *params
= ctx
->Depth
.Mask
;
301 *params
= ctx
->Color
.DitherFlag
;
303 case GL_DOUBLEBUFFER
:
304 *params
= ctx
->Visual
->DBflag
;
307 *params
= ENUM_TO_BOOL(ctx
->Color
.DrawBuffer
);
310 *params
= ctx
->Current
.EdgeFlag
;
312 case GL_FEEDBACK_BUFFER_SIZE
:
313 *params
= INT_TO_BOOL(ctx
->Feedback
.BufferSize
);
315 case GL_FEEDBACK_BUFFER_TYPE
:
316 *params
= INT_TO_BOOL(ctx
->Feedback
.Type
);
319 *params
= ctx
->Fog
.Enabled
;
322 params
[0] = FLOAT_TO_BOOL(ctx
->Fog
.Color
[0]);
323 params
[1] = FLOAT_TO_BOOL(ctx
->Fog
.Color
[1]);
324 params
[2] = FLOAT_TO_BOOL(ctx
->Fog
.Color
[2]);
325 params
[3] = FLOAT_TO_BOOL(ctx
->Fog
.Color
[3]);
328 *params
= FLOAT_TO_BOOL(ctx
->Fog
.Density
);
331 *params
= FLOAT_TO_BOOL(ctx
->Fog
.End
);
334 *params
= ENUM_TO_BOOL(ctx
->Hint
.Fog
);
337 *params
= FLOAT_TO_BOOL(ctx
->Fog
.Index
);
340 *params
= ENUM_TO_BOOL(ctx
->Fog
.Mode
);
343 *params
= FLOAT_TO_BOOL(ctx
->Fog
.End
);
346 *params
= ENUM_TO_BOOL(ctx
->Polygon
.FrontFace
);
349 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.GreenBias
);
352 *params
= INT_TO_BOOL( ctx
->Visual
->GreenBits
);
355 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.GreenScale
);
358 if (ctx
->Extensions
.HaveHistogram
) {
359 *params
= ctx
->Pixel
.HistogramEnabled
;
362 gl_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
367 *params
= INT_TO_BOOL( ctx
->Visual
->IndexBits
);
369 case GL_INDEX_CLEAR_VALUE
:
370 *params
= INT_TO_BOOL(ctx
->Color
.ClearIndex
);
373 *params
= ctx
->Visual
->RGBAflag
? GL_FALSE
: GL_TRUE
;
375 case GL_INDEX_OFFSET
:
376 *params
= INT_TO_BOOL(ctx
->Pixel
.IndexOffset
);
379 *params
= INT_TO_BOOL(ctx
->Pixel
.IndexShift
);
381 case GL_INDEX_WRITEMASK
:
382 *params
= INT_TO_BOOL(ctx
->Color
.IndexMask
);
392 *params
= ctx
->Light
.Light
[pname
-GL_LIGHT0
].Enabled
;
395 *params
= ctx
->Light
.Enabled
;
397 case GL_LIGHT_MODEL_AMBIENT
:
398 params
[0] = FLOAT_TO_BOOL(ctx
->Light
.Model
.Ambient
[0]);
399 params
[1] = FLOAT_TO_BOOL(ctx
->Light
.Model
.Ambient
[1]);
400 params
[2] = FLOAT_TO_BOOL(ctx
->Light
.Model
.Ambient
[2]);
401 params
[3] = FLOAT_TO_BOOL(ctx
->Light
.Model
.Ambient
[3]);
403 case GL_LIGHT_MODEL_COLOR_CONTROL
:
404 params
[0] = ENUM_TO_BOOL(ctx
->Light
.Model
.ColorControl
);
406 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
407 *params
= ctx
->Light
.Model
.LocalViewer
;
409 case GL_LIGHT_MODEL_TWO_SIDE
:
410 *params
= ctx
->Light
.Model
.TwoSide
;
413 *params
= ctx
->Line
.SmoothFlag
;
415 case GL_LINE_SMOOTH_HINT
:
416 *params
= ENUM_TO_BOOL(ctx
->Hint
.LineSmooth
);
418 case GL_LINE_STIPPLE
:
419 *params
= ctx
->Line
.StippleFlag
;
421 case GL_LINE_STIPPLE_PATTERN
:
422 *params
= INT_TO_BOOL(ctx
->Line
.StipplePattern
);
424 case GL_LINE_STIPPLE_REPEAT
:
425 *params
= INT_TO_BOOL(ctx
->Line
.StippleFactor
);
428 *params
= FLOAT_TO_BOOL(ctx
->Line
.Width
);
430 case GL_LINE_WIDTH_GRANULARITY
:
431 *params
= FLOAT_TO_BOOL(ctx
->Const
.LineWidthGranularity
);
433 case GL_LINE_WIDTH_RANGE
:
434 params
[0] = FLOAT_TO_BOOL(ctx
->Const
.MinLineWidthAA
);
435 params
[1] = FLOAT_TO_BOOL(ctx
->Const
.MaxLineWidthAA
);
437 case GL_ALIASED_LINE_WIDTH_RANGE
:
438 params
[0] = FLOAT_TO_BOOL(ctx
->Const
.MinLineWidth
);
439 params
[1] = FLOAT_TO_BOOL(ctx
->Const
.MaxLineWidth
);
442 *params
= INT_TO_BOOL(ctx
->List
.ListBase
);
445 *params
= INT_TO_BOOL( ctx
->CurrentListNum
);
448 *params
= ENUM_TO_BOOL( ctx
->ExecuteFlag
449 ? GL_COMPILE_AND_EXECUTE
: GL_COMPILE
);
451 case GL_INDEX_LOGIC_OP
:
452 *params
= ctx
->Color
.IndexLogicOpEnabled
;
454 case GL_COLOR_LOGIC_OP
:
455 *params
= ctx
->Color
.ColorLogicOpEnabled
;
457 case GL_LOGIC_OP_MODE
:
458 *params
= ENUM_TO_BOOL(ctx
->Color
.LogicOp
);
460 case GL_MAP1_COLOR_4
:
461 *params
= ctx
->Eval
.Map1Color4
;
463 case GL_MAP1_GRID_DOMAIN
:
464 params
[0] = FLOAT_TO_BOOL(ctx
->Eval
.MapGrid1u1
);
465 params
[1] = FLOAT_TO_BOOL(ctx
->Eval
.MapGrid1u2
);
467 case GL_MAP1_GRID_SEGMENTS
:
468 *params
= INT_TO_BOOL(ctx
->Eval
.MapGrid1un
);
471 *params
= ctx
->Eval
.Map1Index
;
474 *params
= ctx
->Eval
.Map1Normal
;
476 case GL_MAP1_TEXTURE_COORD_1
:
477 *params
= ctx
->Eval
.Map1TextureCoord1
;
479 case GL_MAP1_TEXTURE_COORD_2
:
480 *params
= ctx
->Eval
.Map1TextureCoord2
;
482 case GL_MAP1_TEXTURE_COORD_3
:
483 *params
= ctx
->Eval
.Map1TextureCoord3
;
485 case GL_MAP1_TEXTURE_COORD_4
:
486 *params
= ctx
->Eval
.Map1TextureCoord4
;
488 case GL_MAP1_VERTEX_3
:
489 *params
= ctx
->Eval
.Map1Vertex3
;
491 case GL_MAP1_VERTEX_4
:
492 *params
= ctx
->Eval
.Map1Vertex4
;
494 case GL_MAP2_COLOR_4
:
495 *params
= ctx
->Eval
.Map2Color4
;
497 case GL_MAP2_GRID_DOMAIN
:
498 params
[0] = FLOAT_TO_BOOL(ctx
->Eval
.MapGrid2u1
);
499 params
[1] = FLOAT_TO_BOOL(ctx
->Eval
.MapGrid2u2
);
500 params
[2] = FLOAT_TO_BOOL(ctx
->Eval
.MapGrid2v1
);
501 params
[3] = FLOAT_TO_BOOL(ctx
->Eval
.MapGrid2v2
);
503 case GL_MAP2_GRID_SEGMENTS
:
504 params
[0] = INT_TO_BOOL(ctx
->Eval
.MapGrid2un
);
505 params
[1] = INT_TO_BOOL(ctx
->Eval
.MapGrid2vn
);
508 *params
= ctx
->Eval
.Map2Index
;
511 *params
= ctx
->Eval
.Map2Normal
;
513 case GL_MAP2_TEXTURE_COORD_1
:
514 *params
= ctx
->Eval
.Map2TextureCoord1
;
516 case GL_MAP2_TEXTURE_COORD_2
:
517 *params
= ctx
->Eval
.Map2TextureCoord2
;
519 case GL_MAP2_TEXTURE_COORD_3
:
520 *params
= ctx
->Eval
.Map2TextureCoord3
;
522 case GL_MAP2_TEXTURE_COORD_4
:
523 *params
= ctx
->Eval
.Map2TextureCoord4
;
525 case GL_MAP2_VERTEX_3
:
526 *params
= ctx
->Eval
.Map2Vertex3
;
528 case GL_MAP2_VERTEX_4
:
529 *params
= ctx
->Eval
.Map2Vertex4
;
532 *params
= ctx
->Pixel
.MapColorFlag
;
535 *params
= ctx
->Pixel
.MapStencilFlag
;
538 *params
= ENUM_TO_BOOL( ctx
->Transform
.MatrixMode
);
540 case GL_MAX_ATTRIB_STACK_DEPTH
:
541 *params
= INT_TO_BOOL(MAX_ATTRIB_STACK_DEPTH
);
543 case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
:
544 *params
= INT_TO_BOOL( MAX_CLIENT_ATTRIB_STACK_DEPTH
);
546 case GL_MAX_CLIP_PLANES
:
547 *params
= INT_TO_BOOL(MAX_CLIP_PLANES
);
549 case GL_MAX_ELEMENTS_VERTICES
: /* GL_VERSION_1_2 */
550 *params
= INT_TO_BOOL(VB_MAX
);
552 case GL_MAX_ELEMENTS_INDICES
: /* GL_VERSION_1_2 */
553 *params
= INT_TO_BOOL(VB_MAX
);
555 case GL_MAX_EVAL_ORDER
:
556 *params
= INT_TO_BOOL(MAX_EVAL_ORDER
);
559 *params
= INT_TO_BOOL(MAX_LIGHTS
);
561 case GL_MAX_LIST_NESTING
:
562 *params
= INT_TO_BOOL(MAX_LIST_NESTING
);
564 case GL_MAX_MODELVIEW_STACK_DEPTH
:
565 *params
= INT_TO_BOOL(MAX_MODELVIEW_STACK_DEPTH
);
567 case GL_MAX_NAME_STACK_DEPTH
:
568 *params
= INT_TO_BOOL(MAX_NAME_STACK_DEPTH
);
570 case GL_MAX_PIXEL_MAP_TABLE
:
571 *params
= INT_TO_BOOL(MAX_PIXEL_MAP_TABLE
);
573 case GL_MAX_PROJECTION_STACK_DEPTH
:
574 *params
= INT_TO_BOOL(MAX_PROJECTION_STACK_DEPTH
);
576 case GL_MAX_TEXTURE_SIZE
:
577 case GL_MAX_3D_TEXTURE_SIZE
:
578 *params
= INT_TO_BOOL(ctx
->Const
.MaxTextureSize
);
580 case GL_MAX_TEXTURE_STACK_DEPTH
:
581 *params
= INT_TO_BOOL(MAX_TEXTURE_STACK_DEPTH
);
583 case GL_MAX_VIEWPORT_DIMS
:
584 params
[0] = INT_TO_BOOL(MAX_WIDTH
);
585 params
[1] = INT_TO_BOOL(MAX_HEIGHT
);
588 *params
= ctx
->Pixel
.MinMaxEnabled
;
590 case GL_MODELVIEW_MATRIX
:
592 params
[i
] = FLOAT_TO_BOOL(ctx
->ModelView
.m
[i
]);
595 case GL_MODELVIEW_STACK_DEPTH
:
596 *params
= INT_TO_BOOL(ctx
->ModelViewStackDepth
+ 1);
598 case GL_NAME_STACK_DEPTH
:
599 *params
= INT_TO_BOOL(ctx
->Select
.NameStackDepth
);
602 *params
= ctx
->Transform
.Normalize
;
604 case GL_PACK_ALIGNMENT
:
605 *params
= INT_TO_BOOL(ctx
->Pack
.Alignment
);
607 case GL_PACK_LSB_FIRST
:
608 *params
= ctx
->Pack
.LsbFirst
;
610 case GL_PACK_ROW_LENGTH
:
611 *params
= INT_TO_BOOL(ctx
->Pack
.RowLength
);
613 case GL_PACK_SKIP_PIXELS
:
614 *params
= INT_TO_BOOL(ctx
->Pack
.SkipPixels
);
616 case GL_PACK_SKIP_ROWS
:
617 *params
= INT_TO_BOOL(ctx
->Pack
.SkipRows
);
619 case GL_PACK_SWAP_BYTES
:
620 *params
= ctx
->Pack
.SwapBytes
;
622 case GL_PACK_SKIP_IMAGES_EXT
:
623 *params
= ctx
->Pack
.SkipImages
;
625 case GL_PACK_IMAGE_HEIGHT_EXT
:
626 *params
= ctx
->Pack
.ImageHeight
;
628 case GL_PERSPECTIVE_CORRECTION_HINT
:
629 *params
= ENUM_TO_BOOL(ctx
->Hint
.PerspectiveCorrection
);
631 case GL_PIXEL_MAP_A_TO_A_SIZE
:
632 *params
= INT_TO_BOOL(ctx
->Pixel
.MapAtoAsize
);
634 case GL_PIXEL_MAP_B_TO_B_SIZE
:
635 *params
= INT_TO_BOOL(ctx
->Pixel
.MapBtoBsize
);
637 case GL_PIXEL_MAP_G_TO_G_SIZE
:
638 *params
= INT_TO_BOOL(ctx
->Pixel
.MapGtoGsize
);
640 case GL_PIXEL_MAP_I_TO_A_SIZE
:
641 *params
= INT_TO_BOOL(ctx
->Pixel
.MapItoAsize
);
643 case GL_PIXEL_MAP_I_TO_B_SIZE
:
644 *params
= INT_TO_BOOL(ctx
->Pixel
.MapItoBsize
);
646 case GL_PIXEL_MAP_I_TO_G_SIZE
:
647 *params
= INT_TO_BOOL(ctx
->Pixel
.MapItoGsize
);
649 case GL_PIXEL_MAP_I_TO_I_SIZE
:
650 *params
= INT_TO_BOOL(ctx
->Pixel
.MapItoIsize
);
652 case GL_PIXEL_MAP_I_TO_R_SIZE
:
653 *params
= INT_TO_BOOL(ctx
->Pixel
.MapItoRsize
);
655 case GL_PIXEL_MAP_R_TO_R_SIZE
:
656 *params
= INT_TO_BOOL(ctx
->Pixel
.MapRtoRsize
);
658 case GL_PIXEL_MAP_S_TO_S_SIZE
:
659 *params
= INT_TO_BOOL(ctx
->Pixel
.MapStoSsize
);
662 *params
= FLOAT_TO_BOOL(ctx
->Point
.UserSize
);
664 case GL_POINT_SIZE_GRANULARITY
:
665 *params
= FLOAT_TO_BOOL(ctx
->Const
.PointSizeGranularity
);
667 case GL_POINT_SIZE_RANGE
:
668 params
[0] = FLOAT_TO_BOOL(ctx
->Const
.MinPointSizeAA
);
669 params
[1] = FLOAT_TO_BOOL(ctx
->Const
.MaxPointSizeAA
);
671 case GL_ALIASED_POINT_SIZE_RANGE
:
672 params
[0] = FLOAT_TO_BOOL(ctx
->Const
.MinPointSize
);
673 params
[1] = FLOAT_TO_BOOL(ctx
->Const
.MaxPointSize
);
675 case GL_POINT_SMOOTH
:
676 *params
= ctx
->Point
.SmoothFlag
;
678 case GL_POINT_SMOOTH_HINT
:
679 *params
= ENUM_TO_BOOL(ctx
->Hint
.PointSmooth
);
681 case GL_POINT_SIZE_MIN_EXT
:
682 *params
= FLOAT_TO_BOOL(ctx
->Point
.MinSize
);
684 case GL_POINT_SIZE_MAX_EXT
:
685 *params
= FLOAT_TO_BOOL(ctx
->Point
.MaxSize
);
687 case GL_POINT_FADE_THRESHOLD_SIZE_EXT
:
688 *params
= FLOAT_TO_BOOL(ctx
->Point
.Threshold
);
690 case GL_DISTANCE_ATTENUATION_EXT
:
691 params
[0] = FLOAT_TO_BOOL(ctx
->Point
.Params
[0]);
692 params
[1] = FLOAT_TO_BOOL(ctx
->Point
.Params
[1]);
693 params
[2] = FLOAT_TO_BOOL(ctx
->Point
.Params
[2]);
695 case GL_POLYGON_MODE
:
696 params
[0] = ENUM_TO_BOOL(ctx
->Polygon
.FrontMode
);
697 params
[1] = ENUM_TO_BOOL(ctx
->Polygon
.BackMode
);
699 case GL_POLYGON_OFFSET_BIAS_EXT
: /* GL_EXT_polygon_offset */
700 *params
= FLOAT_TO_BOOL( ctx
->Polygon
.OffsetUnits
);
702 case GL_POLYGON_OFFSET_FACTOR
:
703 *params
= FLOAT_TO_BOOL( ctx
->Polygon
.OffsetFactor
);
705 case GL_POLYGON_OFFSET_UNITS
:
706 *params
= FLOAT_TO_BOOL( ctx
->Polygon
.OffsetUnits
);
708 case GL_POLYGON_SMOOTH
:
709 *params
= ctx
->Polygon
.SmoothFlag
;
711 case GL_POLYGON_SMOOTH_HINT
:
712 *params
= ENUM_TO_BOOL(ctx
->Hint
.PolygonSmooth
);
714 case GL_POLYGON_STIPPLE
:
715 *params
= ctx
->Polygon
.StippleFlag
;
717 case GL_PROJECTION_MATRIX
:
719 params
[i
] = FLOAT_TO_BOOL(ctx
->ProjectionMatrix
.m
[i
]);
722 case GL_PROJECTION_STACK_DEPTH
:
723 *params
= INT_TO_BOOL(ctx
->ProjectionStackDepth
+ 1);
726 *params
= ENUM_TO_BOOL(ctx
->Pixel
.ReadBuffer
);
729 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.RedBias
);
732 *params
= INT_TO_BOOL( ctx
->Visual
->RedBits
);
735 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.RedScale
);
738 *params
= ENUM_TO_BOOL(ctx
->RenderMode
);
741 *params
= ctx
->Visual
->RGBAflag
;
744 params
[0] = INT_TO_BOOL(ctx
->Scissor
.X
);
745 params
[1] = INT_TO_BOOL(ctx
->Scissor
.Y
);
746 params
[2] = INT_TO_BOOL(ctx
->Scissor
.Width
);
747 params
[3] = INT_TO_BOOL(ctx
->Scissor
.Height
);
749 case GL_SCISSOR_TEST
:
750 *params
= ctx
->Scissor
.Enabled
;
752 case GL_SELECTION_BUFFER_SIZE
:
753 *params
= INT_TO_BOOL(ctx
->Select
.BufferSize
);
756 *params
= ENUM_TO_BOOL(ctx
->Light
.ShadeModel
);
758 case GL_SHARED_TEXTURE_PALETTE_EXT
:
759 *params
= ctx
->Texture
.SharedPalette
;
761 case GL_STENCIL_BITS
:
762 *params
= INT_TO_BOOL(ctx
->Visual
->StencilBits
);
764 case GL_STENCIL_CLEAR_VALUE
:
765 *params
= INT_TO_BOOL(ctx
->Stencil
.Clear
);
767 case GL_STENCIL_FAIL
:
768 *params
= ENUM_TO_BOOL(ctx
->Stencil
.FailFunc
);
770 case GL_STENCIL_FUNC
:
771 *params
= ENUM_TO_BOOL(ctx
->Stencil
.Function
);
773 case GL_STENCIL_PASS_DEPTH_FAIL
:
774 *params
= ENUM_TO_BOOL(ctx
->Stencil
.ZFailFunc
);
776 case GL_STENCIL_PASS_DEPTH_PASS
:
777 *params
= ENUM_TO_BOOL(ctx
->Stencil
.ZPassFunc
);
780 *params
= INT_TO_BOOL(ctx
->Stencil
.Ref
);
782 case GL_STENCIL_TEST
:
783 *params
= ctx
->Stencil
.Enabled
;
785 case GL_STENCIL_VALUE_MASK
:
786 *params
= INT_TO_BOOL(ctx
->Stencil
.ValueMask
);
788 case GL_STENCIL_WRITEMASK
:
789 *params
= INT_TO_BOOL(ctx
->Stencil
.WriteMask
);
792 *params
= ctx
->Visual
->StereoFlag
;
794 case GL_SUBPIXEL_BITS
:
795 *params
= INT_TO_BOOL(ctx
->Const
.SubPixelBits
);
798 *params
= _mesa_IsEnabled(GL_TEXTURE_1D
);
801 *params
= _mesa_IsEnabled(GL_TEXTURE_2D
);
804 *params
= _mesa_IsEnabled(GL_TEXTURE_3D
);
806 case GL_TEXTURE_BINDING_1D
:
807 *params
= INT_TO_BOOL(textureUnit
->CurrentD
[1]->Name
);
809 case GL_TEXTURE_BINDING_2D
:
810 *params
= INT_TO_BOOL(textureUnit
->CurrentD
[2]->Name
);
812 case GL_TEXTURE_BINDING_3D
:
813 *params
= INT_TO_BOOL(textureUnit
->CurrentD
[3]->Name
);
815 case GL_TEXTURE_ENV_COLOR
:
817 params
[0] = FLOAT_TO_BOOL(textureUnit
->EnvColor
[0]);
818 params
[1] = FLOAT_TO_BOOL(textureUnit
->EnvColor
[1]);
819 params
[2] = FLOAT_TO_BOOL(textureUnit
->EnvColor
[2]);
820 params
[3] = FLOAT_TO_BOOL(textureUnit
->EnvColor
[3]);
823 case GL_TEXTURE_ENV_MODE
:
824 *params
= ENUM_TO_BOOL(textureUnit
->EnvMode
);
826 case GL_TEXTURE_GEN_S
:
827 *params
= (textureUnit
->TexGenEnabled
& S_BIT
) ? GL_TRUE
: GL_FALSE
;
829 case GL_TEXTURE_GEN_T
:
830 *params
= (textureUnit
->TexGenEnabled
& T_BIT
) ? GL_TRUE
: GL_FALSE
;
832 case GL_TEXTURE_GEN_R
:
833 *params
= (textureUnit
->TexGenEnabled
& R_BIT
) ? GL_TRUE
: GL_FALSE
;
835 case GL_TEXTURE_GEN_Q
:
836 *params
= (textureUnit
->TexGenEnabled
& Q_BIT
) ? GL_TRUE
: GL_FALSE
;
838 case GL_TEXTURE_MATRIX
:
841 FLOAT_TO_BOOL(ctx
->TextureMatrix
[texTransformUnit
].m
[i
]);
844 case GL_TEXTURE_STACK_DEPTH
:
845 *params
= INT_TO_BOOL(ctx
->TextureStackDepth
[texTransformUnit
] + 1);
847 case GL_UNPACK_ALIGNMENT
:
848 *params
= INT_TO_BOOL(ctx
->Unpack
.Alignment
);
850 case GL_UNPACK_LSB_FIRST
:
851 *params
= ctx
->Unpack
.LsbFirst
;
853 case GL_UNPACK_ROW_LENGTH
:
854 *params
= INT_TO_BOOL(ctx
->Unpack
.RowLength
);
856 case GL_UNPACK_SKIP_PIXELS
:
857 *params
= INT_TO_BOOL(ctx
->Unpack
.SkipPixels
);
859 case GL_UNPACK_SKIP_ROWS
:
860 *params
= INT_TO_BOOL(ctx
->Unpack
.SkipRows
);
862 case GL_UNPACK_SWAP_BYTES
:
863 *params
= ctx
->Unpack
.SwapBytes
;
865 case GL_UNPACK_SKIP_IMAGES_EXT
:
866 *params
= ctx
->Unpack
.SkipImages
;
868 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
869 *params
= ctx
->Unpack
.ImageHeight
;
872 params
[0] = INT_TO_BOOL(ctx
->Viewport
.X
);
873 params
[1] = INT_TO_BOOL(ctx
->Viewport
.Y
);
874 params
[2] = INT_TO_BOOL(ctx
->Viewport
.Width
);
875 params
[3] = INT_TO_BOOL(ctx
->Viewport
.Height
);
878 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.ZoomX
);
881 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.ZoomY
);
883 case GL_VERTEX_ARRAY
:
884 *params
= ctx
->Array
.Vertex
.Enabled
;
886 case GL_VERTEX_ARRAY_SIZE
:
887 *params
= INT_TO_BOOL(ctx
->Array
.Vertex
.Size
);
889 case GL_VERTEX_ARRAY_TYPE
:
890 *params
= ENUM_TO_BOOL(ctx
->Array
.Vertex
.Type
);
892 case GL_VERTEX_ARRAY_STRIDE
:
893 *params
= INT_TO_BOOL(ctx
->Array
.Vertex
.Stride
);
895 case GL_VERTEX_ARRAY_COUNT_EXT
:
896 *params
= INT_TO_BOOL(0);
898 case GL_NORMAL_ARRAY
:
899 *params
= ctx
->Array
.Normal
.Enabled
;
901 case GL_NORMAL_ARRAY_TYPE
:
902 *params
= ENUM_TO_BOOL(ctx
->Array
.Normal
.Type
);
904 case GL_NORMAL_ARRAY_STRIDE
:
905 *params
= INT_TO_BOOL(ctx
->Array
.Normal
.Stride
);
907 case GL_NORMAL_ARRAY_COUNT_EXT
:
908 *params
= INT_TO_BOOL(0);
911 *params
= ctx
->Array
.Color
.Enabled
;
913 case GL_COLOR_ARRAY_SIZE
:
914 *params
= INT_TO_BOOL(ctx
->Array
.Color
.Size
);
916 case GL_COLOR_ARRAY_TYPE
:
917 *params
= ENUM_TO_BOOL(ctx
->Array
.Color
.Type
);
919 case GL_COLOR_ARRAY_STRIDE
:
920 *params
= INT_TO_BOOL(ctx
->Array
.Color
.Stride
);
922 case GL_COLOR_ARRAY_COUNT_EXT
:
923 *params
= INT_TO_BOOL(0);
926 *params
= ctx
->Array
.Index
.Enabled
;
928 case GL_INDEX_ARRAY_TYPE
:
929 *params
= ENUM_TO_BOOL(ctx
->Array
.Index
.Type
);
931 case GL_INDEX_ARRAY_STRIDE
:
932 *params
= INT_TO_BOOL(ctx
->Array
.Index
.Stride
);
934 case GL_INDEX_ARRAY_COUNT_EXT
:
935 *params
= INT_TO_BOOL(0);
937 case GL_TEXTURE_COORD_ARRAY
:
938 *params
= ctx
->Array
.TexCoord
[texUnit
].Enabled
;
940 case GL_TEXTURE_COORD_ARRAY_SIZE
:
941 *params
= INT_TO_BOOL(ctx
->Array
.TexCoord
[texUnit
].Size
);
943 case GL_TEXTURE_COORD_ARRAY_TYPE
:
944 *params
= ENUM_TO_BOOL(ctx
->Array
.TexCoord
[texUnit
].Type
);
946 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
947 *params
= INT_TO_BOOL(ctx
->Array
.TexCoord
[texUnit
].Stride
);
949 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
950 *params
= INT_TO_BOOL(0);
952 case GL_EDGE_FLAG_ARRAY
:
953 *params
= ctx
->Array
.EdgeFlag
.Enabled
;
955 case GL_EDGE_FLAG_ARRAY_STRIDE
:
956 *params
= INT_TO_BOOL(ctx
->Array
.EdgeFlag
.Stride
);
959 /* GL_ARB_multitexture */
960 case GL_MAX_TEXTURE_UNITS_ARB
:
961 *params
= ctx
->Const
.MaxTextureUnits
;
963 case GL_ACTIVE_TEXTURE_ARB
:
964 *params
= INT_TO_BOOL(GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
);
966 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
967 *params
= INT_TO_BOOL(GL_TEXTURE0_ARB
+ ctx
->Array
.ActiveTexture
);
970 /* GL_ARB_texture_cube_map */
971 case GL_TEXTURE_CUBE_MAP_ARB
:
972 if (ctx
->Extensions
.HaveTextureCubeMap
)
973 *params
= _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
);
975 gl_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
977 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
978 if (ctx
->Extensions
.HaveTextureCubeMap
)
979 *params
= INT_TO_BOOL(textureUnit
->CurrentCubeMap
->Name
);
981 gl_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
983 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
984 if (ctx
->Extensions
.HaveTextureCubeMap
)
985 *params
= INT_TO_BOOL(ctx
->Const
.MaxCubeTextureSize
);
987 gl_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
990 /* GL_ARB_texture_compression */
991 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
992 if (ctx
->Extensions
.HaveTextureCompression
) {
993 *params
= INT_TO_BOOL(ctx
->Hint
.TextureCompression
);
996 gl_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
998 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
999 if (ctx
->Extensions
.HaveTextureCompression
) {
1000 *params
= INT_TO_BOOL(ctx
->Const
.NumCompressedTextureFormats
);
1003 gl_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
1005 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
1006 if (ctx
->Extensions
.HaveTextureCompression
) {
1008 for (i
= 0; i
< ctx
->Const
.NumCompressedTextureFormats
; i
++)
1009 params
[i
] = INT_TO_BOOL(ctx
->Const
.CompressedTextureFormats
[i
]);
1012 gl_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
1015 /* GL_PGI_misc_hints */
1016 case GL_STRICT_DEPTHFUNC_HINT_PGI
:
1017 *params
= ENUM_TO_BOOL(GL_NICEST
);
1019 case GL_STRICT_LIGHTING_HINT_PGI
:
1020 *params
= ENUM_TO_BOOL(ctx
->Hint
.StrictLighting
);
1022 case GL_STRICT_SCISSOR_HINT_PGI
:
1023 case GL_FULL_STIPPLE_HINT_PGI
:
1024 *params
= ENUM_TO_BOOL(GL_TRUE
);
1026 case GL_CONSERVE_MEMORY_HINT_PGI
:
1027 *params
= ENUM_TO_BOOL(GL_FALSE
);
1029 case GL_ALWAYS_FAST_HINT_PGI
:
1030 *params
= (GLboolean
) (ctx
->Hint
.AllowDrawWin
== GL_TRUE
&&
1031 ctx
->Hint
.AllowDrawFrg
== GL_FALSE
&&
1032 ctx
->Hint
.AllowDrawMem
== GL_FALSE
);
1034 case GL_ALWAYS_SOFT_HINT_PGI
:
1035 *params
= (GLboolean
) (ctx
->Hint
.AllowDrawWin
== GL_TRUE
&&
1036 ctx
->Hint
.AllowDrawFrg
== GL_TRUE
&&
1037 ctx
->Hint
.AllowDrawMem
== GL_TRUE
);
1039 case GL_ALLOW_DRAW_OBJ_HINT_PGI
:
1040 *params
= (GLboolean
) GL_TRUE
;
1042 case GL_ALLOW_DRAW_WIN_HINT_PGI
:
1043 *params
= (GLboolean
) ctx
->Hint
.AllowDrawWin
;
1045 case GL_ALLOW_DRAW_FRG_HINT_PGI
:
1046 *params
= (GLboolean
) ctx
->Hint
.AllowDrawFrg
;
1048 case GL_ALLOW_DRAW_MEM_HINT_PGI
:
1049 *params
= (GLboolean
) ctx
->Hint
.AllowDrawMem
;
1051 case GL_CLIP_NEAR_HINT_PGI
:
1052 case GL_CLIP_FAR_HINT_PGI
:
1053 *params
= ENUM_TO_BOOL(GL_TRUE
);
1055 case GL_WIDE_LINE_HINT_PGI
:
1056 *params
= ENUM_TO_BOOL(GL_DONT_CARE
);
1058 case GL_BACK_NORMALS_HINT_PGI
:
1059 *params
= ENUM_TO_BOOL(GL_TRUE
);
1061 case GL_NATIVE_GRAPHICS_HANDLE_PGI
:
1065 /* GL_EXT_compiled_vertex_array */
1066 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
1067 *params
= ctx
->Array
.LockFirst
? GL_TRUE
: GL_FALSE
;
1069 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
1070 *params
= ctx
->Array
.LockCount
? GL_TRUE
: GL_FALSE
;
1073 /* GL_ARB_transpose_matrix */
1074 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
1078 gl_matrix_transposef(tm
, ctx
->ColorMatrix
.m
);
1079 for (i
=0;i
<16;i
++) {
1080 params
[i
] = FLOAT_TO_BOOL(tm
[i
]);
1084 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
1088 gl_matrix_transposef(tm
, ctx
->ModelView
.m
);
1089 for (i
=0;i
<16;i
++) {
1090 params
[i
] = FLOAT_TO_BOOL(tm
[i
]);
1094 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
1098 gl_matrix_transposef(tm
, ctx
->ProjectionMatrix
.m
);
1099 for (i
=0;i
<16;i
++) {
1100 params
[i
] = FLOAT_TO_BOOL(tm
[i
]);
1104 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
1108 gl_matrix_transposef(tm
, ctx
->TextureMatrix
[texTransformUnit
].m
);
1109 for (i
=0;i
<16;i
++) {
1110 params
[i
] = FLOAT_TO_BOOL(tm
[i
]);
1115 /* GL_HP_occlusion_test */
1116 case GL_OCCLUSION_TEST_HP
:
1117 if (ctx
->Extensions
.HaveHpOcclusionTest
) {
1118 *params
= ctx
->Depth
.OcclusionTest
;
1121 gl_error( ctx
, GL_INVALID_ENUM
, "glGetBooleanv" );
1124 case GL_OCCLUSION_TEST_RESULT_HP
:
1125 if (ctx
->Extensions
.HaveHpOcclusionTest
) {
1126 if (ctx
->Depth
.OcclusionTest
)
1127 *params
= ctx
->OcclusionResult
;
1129 *params
= ctx
->OcclusionResultSaved
;
1130 /* reset flag now */
1131 ctx
->OcclusionResult
= GL_FALSE
;
1132 ctx
->OcclusionResultSaved
= GL_FALSE
;
1135 gl_error( ctx
, GL_INVALID_ENUM
, "glGetBooleanv" );
1139 /* GL_SGIS_pixel_texture */
1140 case GL_PIXEL_TEXTURE_SGIS
:
1141 *params
= ctx
->Pixel
.PixelTextureEnabled
;
1144 /* GL_SGIX_pixel_texture */
1145 case GL_PIXEL_TEX_GEN_SGIX
:
1146 *params
= ctx
->Pixel
.PixelTextureEnabled
;
1148 case GL_PIXEL_TEX_GEN_MODE_SGIX
:
1149 *params
= (GLboolean
) pixel_texgen_mode(ctx
);
1152 /* GL_SGI_color_matrix (also in 1.2 imaging) */
1153 case GL_COLOR_MATRIX_SGI
:
1154 for (i
=0;i
<16;i
++) {
1155 params
[i
] = FLOAT_TO_BOOL(ctx
->ColorMatrix
.m
[i
]);
1158 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
1159 *params
= INT_TO_BOOL(ctx
->ColorStackDepth
+ 1);
1161 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
1162 *params
= FLOAT_TO_BOOL(MAX_COLOR_STACK_DEPTH
);
1164 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
1165 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixScale
[0]);
1167 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
1168 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixScale
[1]);
1170 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
1171 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixScale
[2]);
1173 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
1174 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixScale
[3]);
1176 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
1177 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixBias
[0]);
1179 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
1180 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixBias
[1]);
1182 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
1183 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixBias
[2]);
1185 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
1186 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixBias
[3]);
1189 /* GL_EXT_convolution (also in 1.2 imaging) */
1190 case GL_MAX_CONVOLUTION_WIDTH
:
1191 *params
= INT_TO_BOOL(ctx
->Const
.MaxConvolutionWidth
);
1193 case GL_MAX_CONVOLUTION_HEIGHT
:
1194 *params
= INT_TO_BOOL(ctx
->Const
.MaxConvolutionHeight
);
1196 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
1197 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionScale
[0]);
1199 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
1200 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionScale
[1]);
1202 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
1203 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionScale
[2]);
1205 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
1206 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionScale
[3]);
1208 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
1209 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionBias
[0]);
1211 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
1212 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionBias
[1]);
1214 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
1215 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionBias
[2]);
1217 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
1218 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionBias
[2]);
1221 /* GL_SGI_color_table (also in 1.2 imaging */
1222 case GL_COLOR_TABLE_SGI
:
1223 *params
= ctx
->Pixel
.ColorTableEnabled
;
1225 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
1226 *params
= ctx
->Pixel
.PostConvolutionColorTableEnabled
;
1228 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
1229 *params
= ctx
->Pixel
.PostColorMatrixColorTableEnabled
;
1233 gl_error( ctx
, GL_INVALID_ENUM
, "glGetBooleanv" );
1241 _mesa_GetDoublev( GLenum pname
, GLdouble
*params
)
1243 GET_CURRENT_CONTEXT(ctx
);
1245 GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
1246 GLuint texTransformUnit
= ctx
->Texture
.CurrentTransformUnit
;
1247 const struct gl_texture_unit
*textureUnit
= &ctx
->Texture
.Unit
[texUnit
];
1249 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
, "glGetDoublev");
1254 if (MESA_VERBOSE
& VERBOSE_API
)
1255 fprintf(stderr
, "glGetDoublev %s\n", gl_lookup_enum_by_nr(pname
));
1257 if (ctx
->Driver
.GetDoublev
&& (*ctx
->Driver
.GetDoublev
)(ctx
, pname
, params
))
1261 case GL_ACCUM_RED_BITS
:
1262 *params
= (GLdouble
) ctx
->Visual
->AccumRedBits
;
1264 case GL_ACCUM_GREEN_BITS
:
1265 *params
= (GLdouble
) ctx
->Visual
->AccumGreenBits
;
1267 case GL_ACCUM_BLUE_BITS
:
1268 *params
= (GLdouble
) ctx
->Visual
->AccumBlueBits
;
1270 case GL_ACCUM_ALPHA_BITS
:
1271 *params
= (GLdouble
) ctx
->Visual
->AccumAlphaBits
;
1273 case GL_ACCUM_CLEAR_VALUE
:
1274 params
[0] = (GLdouble
) ctx
->Accum
.ClearColor
[0];
1275 params
[1] = (GLdouble
) ctx
->Accum
.ClearColor
[1];
1276 params
[2] = (GLdouble
) ctx
->Accum
.ClearColor
[2];
1277 params
[3] = (GLdouble
) ctx
->Accum
.ClearColor
[3];
1280 *params
= (GLdouble
) ctx
->Pixel
.AlphaBias
;
1283 *params
= (GLdouble
) ctx
->Visual
->AlphaBits
;
1285 case GL_ALPHA_SCALE
:
1286 *params
= (GLdouble
) ctx
->Pixel
.AlphaScale
;
1289 *params
= (GLdouble
) ctx
->Color
.AlphaEnabled
;
1291 case GL_ALPHA_TEST_FUNC
:
1292 *params
= ENUM_TO_DOUBLE(ctx
->Color
.AlphaFunc
);
1294 case GL_ALPHA_TEST_REF
:
1295 *params
= (GLdouble
) ctx
->Color
.AlphaRef
/ 255.0;
1297 case GL_ATTRIB_STACK_DEPTH
:
1298 *params
= (GLdouble
) (ctx
->AttribStackDepth
);
1300 case GL_AUTO_NORMAL
:
1301 *params
= (GLdouble
) ctx
->Eval
.AutoNormal
;
1303 case GL_AUX_BUFFERS
:
1304 *params
= (GLdouble
) ctx
->Const
.NumAuxBuffers
;
1307 *params
= (GLdouble
) ctx
->Color
.BlendEnabled
;
1310 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendDstRGB
);
1313 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendSrcRGB
);
1315 case GL_BLEND_SRC_RGB_EXT
:
1316 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendSrcRGB
);
1318 case GL_BLEND_DST_RGB_EXT
:
1319 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendDstRGB
);
1321 case GL_BLEND_SRC_ALPHA_EXT
:
1322 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendSrcA
);
1324 case GL_BLEND_DST_ALPHA_EXT
:
1325 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendDstA
);
1327 case GL_BLEND_EQUATION_EXT
:
1328 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendEquation
);
1330 case GL_BLEND_COLOR_EXT
:
1331 params
[0] = (GLdouble
) ctx
->Color
.BlendColor
[0];
1332 params
[1] = (GLdouble
) ctx
->Color
.BlendColor
[1];
1333 params
[2] = (GLdouble
) ctx
->Color
.BlendColor
[2];
1334 params
[3] = (GLdouble
) ctx
->Color
.BlendColor
[3];
1337 *params
= (GLdouble
) ctx
->Pixel
.BlueBias
;
1340 *params
= (GLdouble
) ctx
->Visual
->BlueBits
;
1343 *params
= (GLdouble
) ctx
->Pixel
.BlueScale
;
1345 case GL_CLIENT_ATTRIB_STACK_DEPTH
:
1346 *params
= (GLdouble
) (ctx
->ClientAttribStackDepth
);
1348 case GL_CLIP_PLANE0
:
1349 case GL_CLIP_PLANE1
:
1350 case GL_CLIP_PLANE2
:
1351 case GL_CLIP_PLANE3
:
1352 case GL_CLIP_PLANE4
:
1353 case GL_CLIP_PLANE5
:
1354 *params
= (GLdouble
) ctx
->Transform
.ClipEnabled
[pname
-GL_CLIP_PLANE0
];
1356 case GL_COLOR_CLEAR_VALUE
:
1357 params
[0] = (GLdouble
) ctx
->Color
.ClearColor
[0];
1358 params
[1] = (GLdouble
) ctx
->Color
.ClearColor
[1];
1359 params
[2] = (GLdouble
) ctx
->Color
.ClearColor
[2];
1360 params
[3] = (GLdouble
) ctx
->Color
.ClearColor
[3];
1362 case GL_COLOR_MATERIAL
:
1363 *params
= (GLdouble
) ctx
->Light
.ColorMaterialEnabled
;
1365 case GL_COLOR_MATERIAL_FACE
:
1366 *params
= ENUM_TO_DOUBLE(ctx
->Light
.ColorMaterialFace
);
1368 case GL_COLOR_MATERIAL_PARAMETER
:
1369 *params
= ENUM_TO_DOUBLE(ctx
->Light
.ColorMaterialMode
);
1371 case GL_COLOR_WRITEMASK
:
1372 params
[0] = ctx
->Color
.ColorMask
[RCOMP
] ? 1.0 : 0.0;
1373 params
[1] = ctx
->Color
.ColorMask
[GCOMP
] ? 1.0 : 0.0;
1374 params
[2] = ctx
->Color
.ColorMask
[BCOMP
] ? 1.0 : 0.0;
1375 params
[3] = ctx
->Color
.ColorMask
[ACOMP
] ? 1.0 : 0.0;
1378 *params
= (GLdouble
) ctx
->Polygon
.CullFlag
;
1380 case GL_CULL_FACE_MODE
:
1381 *params
= ENUM_TO_DOUBLE(ctx
->Polygon
.CullFaceMode
);
1383 case GL_CURRENT_COLOR
:
1384 params
[0] = UBYTE_COLOR_TO_FLOAT_COLOR(ctx
->Current
.ByteColor
[0]);
1385 params
[1] = UBYTE_COLOR_TO_FLOAT_COLOR(ctx
->Current
.ByteColor
[1]);
1386 params
[2] = UBYTE_COLOR_TO_FLOAT_COLOR(ctx
->Current
.ByteColor
[2]);
1387 params
[3] = UBYTE_COLOR_TO_FLOAT_COLOR(ctx
->Current
.ByteColor
[3]);
1389 case GL_CURRENT_INDEX
:
1390 *params
= (GLdouble
) ctx
->Current
.Index
;
1392 case GL_CURRENT_NORMAL
:
1393 params
[0] = (GLdouble
) ctx
->Current
.Normal
[0];
1394 params
[1] = (GLdouble
) ctx
->Current
.Normal
[1];
1395 params
[2] = (GLdouble
) ctx
->Current
.Normal
[2];
1397 case GL_CURRENT_RASTER_COLOR
:
1398 params
[0] = (GLdouble
) ctx
->Current
.RasterColor
[0];
1399 params
[1] = (GLdouble
) ctx
->Current
.RasterColor
[1];
1400 params
[2] = (GLdouble
) ctx
->Current
.RasterColor
[2];
1401 params
[3] = (GLdouble
) ctx
->Current
.RasterColor
[3];
1403 case GL_CURRENT_RASTER_DISTANCE
:
1404 params
[0] = (GLdouble
) ctx
->Current
.RasterDistance
;
1406 case GL_CURRENT_RASTER_INDEX
:
1407 *params
= (GLdouble
) ctx
->Current
.RasterIndex
;
1409 case GL_CURRENT_RASTER_POSITION
:
1410 params
[0] = (GLdouble
) ctx
->Current
.RasterPos
[0];
1411 params
[1] = (GLdouble
) ctx
->Current
.RasterPos
[1];
1412 params
[2] = (GLdouble
) ctx
->Current
.RasterPos
[2];
1413 params
[3] = (GLdouble
) ctx
->Current
.RasterPos
[3];
1415 case GL_CURRENT_RASTER_TEXTURE_COORDS
:
1416 params
[0] = (GLdouble
) ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][0];
1417 params
[1] = (GLdouble
) ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][1];
1418 params
[2] = (GLdouble
) ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][2];
1419 params
[3] = (GLdouble
) ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][3];
1421 case GL_CURRENT_RASTER_POSITION_VALID
:
1422 *params
= (GLdouble
) ctx
->Current
.RasterPosValid
;
1424 case GL_CURRENT_TEXTURE_COORDS
:
1425 params
[0] = (GLdouble
) ctx
->Current
.Texcoord
[texTransformUnit
][0];
1426 params
[1] = (GLdouble
) ctx
->Current
.Texcoord
[texTransformUnit
][1];
1427 params
[2] = (GLdouble
) ctx
->Current
.Texcoord
[texTransformUnit
][2];
1428 params
[3] = (GLdouble
) ctx
->Current
.Texcoord
[texTransformUnit
][3];
1431 *params
= (GLdouble
) ctx
->Pixel
.DepthBias
;
1434 *params
= (GLdouble
) ctx
->Visual
->DepthBits
;
1436 case GL_DEPTH_CLEAR_VALUE
:
1437 *params
= (GLdouble
) ctx
->Depth
.Clear
;
1440 *params
= ENUM_TO_DOUBLE(ctx
->Depth
.Func
);
1442 case GL_DEPTH_RANGE
:
1443 params
[0] = (GLdouble
) ctx
->Viewport
.Near
;
1444 params
[1] = (GLdouble
) ctx
->Viewport
.Far
;
1446 case GL_DEPTH_SCALE
:
1447 *params
= (GLdouble
) ctx
->Pixel
.DepthScale
;
1450 *params
= (GLdouble
) ctx
->Depth
.Test
;
1452 case GL_DEPTH_WRITEMASK
:
1453 *params
= (GLdouble
) ctx
->Depth
.Mask
;
1456 *params
= (GLdouble
) ctx
->Color
.DitherFlag
;
1458 case GL_DOUBLEBUFFER
:
1459 *params
= (GLdouble
) ctx
->Visual
->DBflag
;
1461 case GL_DRAW_BUFFER
:
1462 *params
= ENUM_TO_DOUBLE(ctx
->Color
.DrawBuffer
);
1465 *params
= (GLdouble
) ctx
->Current
.EdgeFlag
;
1467 case GL_FEEDBACK_BUFFER_SIZE
:
1468 *params
= (GLdouble
) ctx
->Feedback
.BufferSize
;
1470 case GL_FEEDBACK_BUFFER_TYPE
:
1471 *params
= ENUM_TO_DOUBLE(ctx
->Feedback
.Type
);
1474 *params
= (GLdouble
) ctx
->Fog
.Enabled
;
1477 params
[0] = (GLdouble
) ctx
->Fog
.Color
[0];
1478 params
[1] = (GLdouble
) ctx
->Fog
.Color
[1];
1479 params
[2] = (GLdouble
) ctx
->Fog
.Color
[2];
1480 params
[3] = (GLdouble
) ctx
->Fog
.Color
[3];
1482 case GL_FOG_DENSITY
:
1483 *params
= (GLdouble
) ctx
->Fog
.Density
;
1486 *params
= (GLdouble
) ctx
->Fog
.End
;
1489 *params
= ENUM_TO_DOUBLE(ctx
->Hint
.Fog
);
1492 *params
= (GLdouble
) ctx
->Fog
.Index
;
1495 *params
= ENUM_TO_DOUBLE(ctx
->Fog
.Mode
);
1498 *params
= (GLdouble
) ctx
->Fog
.Start
;
1501 *params
= ENUM_TO_DOUBLE(ctx
->Polygon
.FrontFace
);
1504 *params
= (GLdouble
) ctx
->Pixel
.GreenBias
;
1507 *params
= (GLdouble
) ctx
->Visual
->GreenBits
;
1509 case GL_GREEN_SCALE
:
1510 *params
= (GLdouble
) ctx
->Pixel
.GreenScale
;
1513 if (ctx
->Extensions
.HaveHistogram
) {
1514 *params
= (GLdouble
) ctx
->Pixel
.HistogramEnabled
;
1517 gl_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
1522 *params
= (GLdouble
) ctx
->Visual
->IndexBits
;
1524 case GL_INDEX_CLEAR_VALUE
:
1525 *params
= (GLdouble
) ctx
->Color
.ClearIndex
;
1528 *params
= ctx
->Visual
->RGBAflag
? 0.0 : 1.0;
1530 case GL_INDEX_OFFSET
:
1531 *params
= (GLdouble
) ctx
->Pixel
.IndexOffset
;
1533 case GL_INDEX_SHIFT
:
1534 *params
= (GLdouble
) ctx
->Pixel
.IndexShift
;
1536 case GL_INDEX_WRITEMASK
:
1537 *params
= (GLdouble
) ctx
->Color
.IndexMask
;
1547 *params
= (GLdouble
) ctx
->Light
.Light
[pname
-GL_LIGHT0
].Enabled
;
1550 *params
= (GLdouble
) ctx
->Light
.Enabled
;
1552 case GL_LIGHT_MODEL_AMBIENT
:
1553 params
[0] = (GLdouble
) ctx
->Light
.Model
.Ambient
[0];
1554 params
[1] = (GLdouble
) ctx
->Light
.Model
.Ambient
[1];
1555 params
[2] = (GLdouble
) ctx
->Light
.Model
.Ambient
[2];
1556 params
[3] = (GLdouble
) ctx
->Light
.Model
.Ambient
[3];
1558 case GL_LIGHT_MODEL_COLOR_CONTROL
:
1559 params
[0] = (GLdouble
) ctx
->Light
.Model
.ColorControl
;
1561 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
1562 *params
= (GLdouble
) ctx
->Light
.Model
.LocalViewer
;
1564 case GL_LIGHT_MODEL_TWO_SIDE
:
1565 *params
= (GLdouble
) ctx
->Light
.Model
.TwoSide
;
1567 case GL_LINE_SMOOTH
:
1568 *params
= (GLdouble
) ctx
->Line
.SmoothFlag
;
1570 case GL_LINE_SMOOTH_HINT
:
1571 *params
= ENUM_TO_DOUBLE(ctx
->Hint
.LineSmooth
);
1573 case GL_LINE_STIPPLE
:
1574 *params
= (GLdouble
) ctx
->Line
.StippleFlag
;
1576 case GL_LINE_STIPPLE_PATTERN
:
1577 *params
= (GLdouble
) ctx
->Line
.StipplePattern
;
1579 case GL_LINE_STIPPLE_REPEAT
:
1580 *params
= (GLdouble
) ctx
->Line
.StippleFactor
;
1583 *params
= (GLdouble
) ctx
->Line
.Width
;
1585 case GL_LINE_WIDTH_GRANULARITY
:
1586 *params
= (GLdouble
) ctx
->Const
.LineWidthGranularity
;
1588 case GL_LINE_WIDTH_RANGE
:
1589 params
[0] = (GLdouble
) ctx
->Const
.MinLineWidthAA
;
1590 params
[1] = (GLdouble
) ctx
->Const
.MaxLineWidthAA
;
1592 case GL_ALIASED_LINE_WIDTH_RANGE
:
1593 params
[0] = (GLdouble
) ctx
->Const
.MinLineWidth
;
1594 params
[1] = (GLdouble
) ctx
->Const
.MaxLineWidth
;
1597 *params
= (GLdouble
) ctx
->List
.ListBase
;
1600 *params
= (GLdouble
) ctx
->CurrentListNum
;
1603 *params
= ctx
->ExecuteFlag
? ENUM_TO_DOUBLE(GL_COMPILE_AND_EXECUTE
)
1604 : ENUM_TO_DOUBLE(GL_COMPILE
);
1606 case GL_INDEX_LOGIC_OP
:
1607 *params
= (GLdouble
) ctx
->Color
.IndexLogicOpEnabled
;
1609 case GL_COLOR_LOGIC_OP
:
1610 *params
= (GLdouble
) ctx
->Color
.ColorLogicOpEnabled
;
1612 case GL_LOGIC_OP_MODE
:
1613 *params
= ENUM_TO_DOUBLE(ctx
->Color
.LogicOp
);
1615 case GL_MAP1_COLOR_4
:
1616 *params
= (GLdouble
) ctx
->Eval
.Map1Color4
;
1618 case GL_MAP1_GRID_DOMAIN
:
1619 params
[0] = (GLdouble
) ctx
->Eval
.MapGrid1u1
;
1620 params
[1] = (GLdouble
) ctx
->Eval
.MapGrid1u2
;
1622 case GL_MAP1_GRID_SEGMENTS
:
1623 *params
= (GLdouble
) ctx
->Eval
.MapGrid1un
;
1626 *params
= (GLdouble
) ctx
->Eval
.Map1Index
;
1628 case GL_MAP1_NORMAL
:
1629 *params
= (GLdouble
) ctx
->Eval
.Map1Normal
;
1631 case GL_MAP1_TEXTURE_COORD_1
:
1632 *params
= (GLdouble
) ctx
->Eval
.Map1TextureCoord1
;
1634 case GL_MAP1_TEXTURE_COORD_2
:
1635 *params
= (GLdouble
) ctx
->Eval
.Map1TextureCoord2
;
1637 case GL_MAP1_TEXTURE_COORD_3
:
1638 *params
= (GLdouble
) ctx
->Eval
.Map1TextureCoord3
;
1640 case GL_MAP1_TEXTURE_COORD_4
:
1641 *params
= (GLdouble
) ctx
->Eval
.Map1TextureCoord4
;
1643 case GL_MAP1_VERTEX_3
:
1644 *params
= (GLdouble
) ctx
->Eval
.Map1Vertex3
;
1646 case GL_MAP1_VERTEX_4
:
1647 *params
= (GLdouble
) ctx
->Eval
.Map1Vertex4
;
1649 case GL_MAP2_COLOR_4
:
1650 *params
= (GLdouble
) ctx
->Eval
.Map2Color4
;
1652 case GL_MAP2_GRID_DOMAIN
:
1653 params
[0] = (GLdouble
) ctx
->Eval
.MapGrid2u1
;
1654 params
[1] = (GLdouble
) ctx
->Eval
.MapGrid2u2
;
1655 params
[2] = (GLdouble
) ctx
->Eval
.MapGrid2v1
;
1656 params
[3] = (GLdouble
) ctx
->Eval
.MapGrid2v2
;
1658 case GL_MAP2_GRID_SEGMENTS
:
1659 params
[0] = (GLdouble
) ctx
->Eval
.MapGrid2un
;
1660 params
[1] = (GLdouble
) ctx
->Eval
.MapGrid2vn
;
1663 *params
= (GLdouble
) ctx
->Eval
.Map2Index
;
1665 case GL_MAP2_NORMAL
:
1666 *params
= (GLdouble
) ctx
->Eval
.Map2Normal
;
1668 case GL_MAP2_TEXTURE_COORD_1
:
1669 *params
= (GLdouble
) ctx
->Eval
.Map2TextureCoord1
;
1671 case GL_MAP2_TEXTURE_COORD_2
:
1672 *params
= (GLdouble
) ctx
->Eval
.Map2TextureCoord2
;
1674 case GL_MAP2_TEXTURE_COORD_3
:
1675 *params
= (GLdouble
) ctx
->Eval
.Map2TextureCoord3
;
1677 case GL_MAP2_TEXTURE_COORD_4
:
1678 *params
= (GLdouble
) ctx
->Eval
.Map2TextureCoord4
;
1680 case GL_MAP2_VERTEX_3
:
1681 *params
= (GLdouble
) ctx
->Eval
.Map2Vertex3
;
1683 case GL_MAP2_VERTEX_4
:
1684 *params
= (GLdouble
) ctx
->Eval
.Map2Vertex4
;
1687 *params
= (GLdouble
) ctx
->Pixel
.MapColorFlag
;
1689 case GL_MAP_STENCIL
:
1690 *params
= (GLdouble
) ctx
->Pixel
.MapStencilFlag
;
1692 case GL_MATRIX_MODE
:
1693 *params
= ENUM_TO_DOUBLE(ctx
->Transform
.MatrixMode
);
1695 case GL_MAX_ATTRIB_STACK_DEPTH
:
1696 *params
= (GLdouble
) MAX_ATTRIB_STACK_DEPTH
;
1698 case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
:
1699 *params
= (GLdouble
) MAX_CLIENT_ATTRIB_STACK_DEPTH
;
1701 case GL_MAX_CLIP_PLANES
:
1702 *params
= (GLdouble
) MAX_CLIP_PLANES
;
1704 case GL_MAX_ELEMENTS_VERTICES
: /* GL_VERSION_1_2 */
1705 *params
= (GLdouble
) VB_MAX
;
1707 case GL_MAX_ELEMENTS_INDICES
: /* GL_VERSION_1_2 */
1708 *params
= (GLdouble
) VB_MAX
;
1710 case GL_MAX_EVAL_ORDER
:
1711 *params
= (GLdouble
) MAX_EVAL_ORDER
;
1714 *params
= (GLdouble
) MAX_LIGHTS
;
1716 case GL_MAX_LIST_NESTING
:
1717 *params
= (GLdouble
) MAX_LIST_NESTING
;
1719 case GL_MAX_MODELVIEW_STACK_DEPTH
:
1720 *params
= (GLdouble
) MAX_MODELVIEW_STACK_DEPTH
;
1722 case GL_MAX_NAME_STACK_DEPTH
:
1723 *params
= (GLdouble
) MAX_NAME_STACK_DEPTH
;
1725 case GL_MAX_PIXEL_MAP_TABLE
:
1726 *params
= (GLdouble
) MAX_PIXEL_MAP_TABLE
;
1728 case GL_MAX_PROJECTION_STACK_DEPTH
:
1729 *params
= (GLdouble
) MAX_PROJECTION_STACK_DEPTH
;
1731 case GL_MAX_TEXTURE_SIZE
:
1732 case GL_MAX_3D_TEXTURE_SIZE
:
1733 *params
= (GLdouble
) ctx
->Const
.MaxTextureSize
;
1735 case GL_MAX_TEXTURE_STACK_DEPTH
:
1736 *params
= (GLdouble
) MAX_TEXTURE_STACK_DEPTH
;
1738 case GL_MAX_VIEWPORT_DIMS
:
1739 params
[0] = (GLdouble
) MAX_WIDTH
;
1740 params
[1] = (GLdouble
) MAX_HEIGHT
;
1743 *params
= (GLdouble
) ctx
->Pixel
.MinMaxEnabled
;
1745 case GL_MODELVIEW_MATRIX
:
1746 for (i
=0;i
<16;i
++) {
1747 params
[i
] = (GLdouble
) ctx
->ModelView
.m
[i
];
1750 case GL_MODELVIEW_STACK_DEPTH
:
1751 *params
= (GLdouble
) (ctx
->ModelViewStackDepth
+ 1);
1753 case GL_NAME_STACK_DEPTH
:
1754 *params
= (GLdouble
) ctx
->Select
.NameStackDepth
;
1757 *params
= (GLdouble
) ctx
->Transform
.Normalize
;
1759 case GL_PACK_ALIGNMENT
:
1760 *params
= (GLdouble
) ctx
->Pack
.Alignment
;
1762 case GL_PACK_LSB_FIRST
:
1763 *params
= (GLdouble
) ctx
->Pack
.LsbFirst
;
1765 case GL_PACK_ROW_LENGTH
:
1766 *params
= (GLdouble
) ctx
->Pack
.RowLength
;
1768 case GL_PACK_SKIP_PIXELS
:
1769 *params
= (GLdouble
) ctx
->Pack
.SkipPixels
;
1771 case GL_PACK_SKIP_ROWS
:
1772 *params
= (GLdouble
) ctx
->Pack
.SkipRows
;
1774 case GL_PACK_SWAP_BYTES
:
1775 *params
= (GLdouble
) ctx
->Pack
.SwapBytes
;
1777 case GL_PACK_SKIP_IMAGES_EXT
:
1778 *params
= (GLdouble
) ctx
->Pack
.SkipImages
;
1780 case GL_PACK_IMAGE_HEIGHT_EXT
:
1781 *params
= (GLdouble
) ctx
->Pack
.ImageHeight
;
1783 case GL_PERSPECTIVE_CORRECTION_HINT
:
1784 *params
= ENUM_TO_DOUBLE(ctx
->Hint
.PerspectiveCorrection
);
1786 case GL_PIXEL_MAP_A_TO_A_SIZE
:
1787 *params
= (GLdouble
) ctx
->Pixel
.MapAtoAsize
;
1789 case GL_PIXEL_MAP_B_TO_B_SIZE
:
1790 *params
= (GLdouble
) ctx
->Pixel
.MapBtoBsize
;
1792 case GL_PIXEL_MAP_G_TO_G_SIZE
:
1793 *params
= (GLdouble
) ctx
->Pixel
.MapGtoGsize
;
1795 case GL_PIXEL_MAP_I_TO_A_SIZE
:
1796 *params
= (GLdouble
) ctx
->Pixel
.MapItoAsize
;
1798 case GL_PIXEL_MAP_I_TO_B_SIZE
:
1799 *params
= (GLdouble
) ctx
->Pixel
.MapItoBsize
;
1801 case GL_PIXEL_MAP_I_TO_G_SIZE
:
1802 *params
= (GLdouble
) ctx
->Pixel
.MapItoGsize
;
1804 case GL_PIXEL_MAP_I_TO_I_SIZE
:
1805 *params
= (GLdouble
) ctx
->Pixel
.MapItoIsize
;
1807 case GL_PIXEL_MAP_I_TO_R_SIZE
:
1808 *params
= (GLdouble
) ctx
->Pixel
.MapItoRsize
;
1810 case GL_PIXEL_MAP_R_TO_R_SIZE
:
1811 *params
= (GLdouble
) ctx
->Pixel
.MapRtoRsize
;
1813 case GL_PIXEL_MAP_S_TO_S_SIZE
:
1814 *params
= (GLdouble
) ctx
->Pixel
.MapStoSsize
;
1817 *params
= (GLdouble
) ctx
->Point
.UserSize
;
1819 case GL_POINT_SIZE_GRANULARITY
:
1820 *params
= (GLdouble
) ctx
->Const
.PointSizeGranularity
;
1822 case GL_POINT_SIZE_RANGE
:
1823 params
[0] = (GLdouble
) ctx
->Const
.MinPointSizeAA
;
1824 params
[1] = (GLdouble
) ctx
->Const
.MaxPointSizeAA
;
1826 case GL_ALIASED_POINT_SIZE_RANGE
:
1827 params
[0] = (GLdouble
) ctx
->Const
.MinPointSize
;
1828 params
[1] = (GLdouble
) ctx
->Const
.MaxPointSize
;
1830 case GL_POINT_SMOOTH
:
1831 *params
= (GLdouble
) ctx
->Point
.SmoothFlag
;
1833 case GL_POINT_SMOOTH_HINT
:
1834 *params
= ENUM_TO_DOUBLE(ctx
->Hint
.PointSmooth
);
1836 case GL_POINT_SIZE_MIN_EXT
:
1837 *params
= (GLdouble
) (ctx
->Point
.MinSize
);
1839 case GL_POINT_SIZE_MAX_EXT
:
1840 *params
= (GLdouble
) (ctx
->Point
.MaxSize
);
1842 case GL_POINT_FADE_THRESHOLD_SIZE_EXT
:
1843 *params
= (GLdouble
) (ctx
->Point
.Threshold
);
1845 case GL_DISTANCE_ATTENUATION_EXT
:
1846 params
[0] = (GLdouble
) (ctx
->Point
.Params
[0]);
1847 params
[1] = (GLdouble
) (ctx
->Point
.Params
[1]);
1848 params
[2] = (GLdouble
) (ctx
->Point
.Params
[2]);
1850 case GL_POLYGON_MODE
:
1851 params
[0] = ENUM_TO_DOUBLE(ctx
->Polygon
.FrontMode
);
1852 params
[1] = ENUM_TO_DOUBLE(ctx
->Polygon
.BackMode
);
1854 case GL_POLYGON_OFFSET_BIAS_EXT
: /* GL_EXT_polygon_offset */
1855 *params
= (GLdouble
) ctx
->Polygon
.OffsetUnits
;
1857 case GL_POLYGON_OFFSET_FACTOR
:
1858 *params
= (GLdouble
) ctx
->Polygon
.OffsetFactor
;
1860 case GL_POLYGON_OFFSET_UNITS
:
1861 *params
= (GLdouble
) ctx
->Polygon
.OffsetUnits
;
1863 case GL_POLYGON_SMOOTH
:
1864 *params
= (GLdouble
) ctx
->Polygon
.SmoothFlag
;
1866 case GL_POLYGON_SMOOTH_HINT
:
1867 *params
= ENUM_TO_DOUBLE(ctx
->Hint
.PolygonSmooth
);
1869 case GL_POLYGON_STIPPLE
:
1870 *params
= (GLdouble
) ctx
->Polygon
.StippleFlag
;
1872 case GL_PROJECTION_MATRIX
:
1873 for (i
=0;i
<16;i
++) {
1874 params
[i
] = (GLdouble
) ctx
->ProjectionMatrix
.m
[i
];
1877 case GL_PROJECTION_STACK_DEPTH
:
1878 *params
= (GLdouble
) (ctx
->ProjectionStackDepth
+ 1);
1880 case GL_READ_BUFFER
:
1881 *params
= ENUM_TO_DOUBLE(ctx
->Pixel
.ReadBuffer
);
1884 *params
= (GLdouble
) ctx
->Pixel
.RedBias
;
1887 *params
= (GLdouble
) ctx
->Visual
->RedBits
;
1890 *params
= (GLdouble
) ctx
->Pixel
.RedScale
;
1892 case GL_RENDER_MODE
:
1893 *params
= ENUM_TO_DOUBLE(ctx
->RenderMode
);
1896 *params
= (GLdouble
) ctx
->Visual
->RGBAflag
;
1898 case GL_SCISSOR_BOX
:
1899 params
[0] = (GLdouble
) ctx
->Scissor
.X
;
1900 params
[1] = (GLdouble
) ctx
->Scissor
.Y
;
1901 params
[2] = (GLdouble
) ctx
->Scissor
.Width
;
1902 params
[3] = (GLdouble
) ctx
->Scissor
.Height
;
1904 case GL_SCISSOR_TEST
:
1905 *params
= (GLdouble
) ctx
->Scissor
.Enabled
;
1907 case GL_SELECTION_BUFFER_SIZE
:
1908 *params
= (GLdouble
) ctx
->Select
.BufferSize
;
1910 case GL_SHADE_MODEL
:
1911 *params
= ENUM_TO_DOUBLE(ctx
->Light
.ShadeModel
);
1913 case GL_SHARED_TEXTURE_PALETTE_EXT
:
1914 *params
= (GLdouble
) ctx
->Texture
.SharedPalette
;
1916 case GL_STENCIL_BITS
:
1917 *params
= (GLdouble
) ctx
->Visual
->StencilBits
;
1919 case GL_STENCIL_CLEAR_VALUE
:
1920 *params
= (GLdouble
) ctx
->Stencil
.Clear
;
1922 case GL_STENCIL_FAIL
:
1923 *params
= ENUM_TO_DOUBLE(ctx
->Stencil
.FailFunc
);
1925 case GL_STENCIL_FUNC
:
1926 *params
= ENUM_TO_DOUBLE(ctx
->Stencil
.Function
);
1928 case GL_STENCIL_PASS_DEPTH_FAIL
:
1929 *params
= ENUM_TO_DOUBLE(ctx
->Stencil
.ZFailFunc
);
1931 case GL_STENCIL_PASS_DEPTH_PASS
:
1932 *params
= ENUM_TO_DOUBLE(ctx
->Stencil
.ZPassFunc
);
1934 case GL_STENCIL_REF
:
1935 *params
= (GLdouble
) ctx
->Stencil
.Ref
;
1937 case GL_STENCIL_TEST
:
1938 *params
= (GLdouble
) ctx
->Stencil
.Enabled
;
1940 case GL_STENCIL_VALUE_MASK
:
1941 *params
= (GLdouble
) ctx
->Stencil
.ValueMask
;
1943 case GL_STENCIL_WRITEMASK
:
1944 *params
= (GLdouble
) ctx
->Stencil
.WriteMask
;
1947 *params
= (GLdouble
) ctx
->Visual
->StereoFlag
;
1949 case GL_SUBPIXEL_BITS
:
1950 *params
= (GLdouble
) ctx
->Const
.SubPixelBits
;
1953 *params
= _mesa_IsEnabled(GL_TEXTURE_1D
) ? 1.0 : 0.0;
1956 *params
= _mesa_IsEnabled(GL_TEXTURE_2D
) ? 1.0 : 0.0;
1959 *params
= _mesa_IsEnabled(GL_TEXTURE_3D
) ? 1.0 : 0.0;
1961 case GL_TEXTURE_BINDING_1D
:
1962 *params
= (GLdouble
) textureUnit
->CurrentD
[1]->Name
;
1964 case GL_TEXTURE_BINDING_2D
:
1965 *params
= (GLdouble
) textureUnit
->CurrentD
[2]->Name
;
1967 case GL_TEXTURE_BINDING_3D
:
1968 *params
= (GLdouble
) textureUnit
->CurrentD
[3]->Name
;
1970 case GL_TEXTURE_ENV_COLOR
:
1971 params
[0] = (GLdouble
) textureUnit
->EnvColor
[0];
1972 params
[1] = (GLdouble
) textureUnit
->EnvColor
[1];
1973 params
[2] = (GLdouble
) textureUnit
->EnvColor
[2];
1974 params
[3] = (GLdouble
) textureUnit
->EnvColor
[3];
1976 case GL_TEXTURE_ENV_MODE
:
1977 *params
= ENUM_TO_DOUBLE(textureUnit
->EnvMode
);
1979 case GL_TEXTURE_GEN_S
:
1980 *params
= (textureUnit
->TexGenEnabled
& S_BIT
) ? 1.0 : 0.0;
1982 case GL_TEXTURE_GEN_T
:
1983 *params
= (textureUnit
->TexGenEnabled
& T_BIT
) ? 1.0 : 0.0;
1985 case GL_TEXTURE_GEN_R
:
1986 *params
= (textureUnit
->TexGenEnabled
& R_BIT
) ? 1.0 : 0.0;
1988 case GL_TEXTURE_GEN_Q
:
1989 *params
= (textureUnit
->TexGenEnabled
& Q_BIT
) ? 1.0 : 0.0;
1991 case GL_TEXTURE_MATRIX
:
1992 for (i
=0;i
<16;i
++) {
1993 params
[i
] = (GLdouble
) ctx
->TextureMatrix
[texTransformUnit
].m
[i
];
1996 case GL_TEXTURE_STACK_DEPTH
:
1997 *params
= (GLdouble
) (ctx
->TextureStackDepth
[texTransformUnit
] + 1);
1999 case GL_UNPACK_ALIGNMENT
:
2000 *params
= (GLdouble
) ctx
->Unpack
.Alignment
;
2002 case GL_UNPACK_LSB_FIRST
:
2003 *params
= (GLdouble
) ctx
->Unpack
.LsbFirst
;
2005 case GL_UNPACK_ROW_LENGTH
:
2006 *params
= (GLdouble
) ctx
->Unpack
.RowLength
;
2008 case GL_UNPACK_SKIP_PIXELS
:
2009 *params
= (GLdouble
) ctx
->Unpack
.SkipPixels
;
2011 case GL_UNPACK_SKIP_ROWS
:
2012 *params
= (GLdouble
) ctx
->Unpack
.SkipRows
;
2014 case GL_UNPACK_SWAP_BYTES
:
2015 *params
= (GLdouble
) ctx
->Unpack
.SwapBytes
;
2017 case GL_UNPACK_SKIP_IMAGES_EXT
:
2018 *params
= (GLdouble
) ctx
->Unpack
.SkipImages
;
2020 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
2021 *params
= (GLdouble
) ctx
->Unpack
.ImageHeight
;
2024 params
[0] = (GLdouble
) ctx
->Viewport
.X
;
2025 params
[1] = (GLdouble
) ctx
->Viewport
.Y
;
2026 params
[2] = (GLdouble
) ctx
->Viewport
.Width
;
2027 params
[3] = (GLdouble
) ctx
->Viewport
.Height
;
2030 *params
= (GLdouble
) ctx
->Pixel
.ZoomX
;
2033 *params
= (GLdouble
) ctx
->Pixel
.ZoomY
;
2035 case GL_VERTEX_ARRAY
:
2036 *params
= (GLdouble
) ctx
->Array
.Vertex
.Enabled
;
2038 case GL_VERTEX_ARRAY_SIZE
:
2039 *params
= (GLdouble
) ctx
->Array
.Vertex
.Size
;
2041 case GL_VERTEX_ARRAY_TYPE
:
2042 *params
= ENUM_TO_DOUBLE(ctx
->Array
.Vertex
.Type
);
2044 case GL_VERTEX_ARRAY_STRIDE
:
2045 *params
= (GLdouble
) ctx
->Array
.Vertex
.Stride
;
2047 case GL_VERTEX_ARRAY_COUNT_EXT
:
2050 case GL_NORMAL_ARRAY
:
2051 *params
= (GLdouble
) ctx
->Array
.Normal
.Enabled
;
2053 case GL_NORMAL_ARRAY_TYPE
:
2054 *params
= ENUM_TO_DOUBLE(ctx
->Array
.Normal
.Type
);
2056 case GL_NORMAL_ARRAY_STRIDE
:
2057 *params
= (GLdouble
) ctx
->Array
.Normal
.Stride
;
2059 case GL_NORMAL_ARRAY_COUNT_EXT
:
2062 case GL_COLOR_ARRAY
:
2063 *params
= (GLdouble
) ctx
->Array
.Color
.Enabled
;
2065 case GL_COLOR_ARRAY_SIZE
:
2066 *params
= (GLdouble
) ctx
->Array
.Color
.Size
;
2068 case GL_COLOR_ARRAY_TYPE
:
2069 *params
= ENUM_TO_DOUBLE(ctx
->Array
.Color
.Type
);
2071 case GL_COLOR_ARRAY_STRIDE
:
2072 *params
= (GLdouble
) ctx
->Array
.Color
.Stride
;
2074 case GL_COLOR_ARRAY_COUNT_EXT
:
2077 case GL_INDEX_ARRAY
:
2078 *params
= (GLdouble
) ctx
->Array
.Index
.Enabled
;
2080 case GL_INDEX_ARRAY_TYPE
:
2081 *params
= ENUM_TO_DOUBLE(ctx
->Array
.Index
.Type
);
2083 case GL_INDEX_ARRAY_STRIDE
:
2084 *params
= (GLdouble
) ctx
->Array
.Index
.Stride
;
2086 case GL_INDEX_ARRAY_COUNT_EXT
:
2089 case GL_TEXTURE_COORD_ARRAY
:
2090 *params
= (GLdouble
) ctx
->Array
.TexCoord
[texUnit
].Enabled
;
2092 case GL_TEXTURE_COORD_ARRAY_SIZE
:
2093 *params
= (GLdouble
) ctx
->Array
.TexCoord
[texUnit
].Size
;
2095 case GL_TEXTURE_COORD_ARRAY_TYPE
:
2096 *params
= ENUM_TO_DOUBLE(ctx
->Array
.TexCoord
[texUnit
].Type
);
2098 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
2099 *params
= (GLdouble
) ctx
->Array
.TexCoord
[texUnit
].Stride
;
2101 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
2104 case GL_EDGE_FLAG_ARRAY
:
2105 *params
= (GLdouble
) ctx
->Array
.EdgeFlag
.Enabled
;
2107 case GL_EDGE_FLAG_ARRAY_STRIDE
:
2108 *params
= (GLdouble
) ctx
->Array
.EdgeFlag
.Stride
;
2110 case GL_EDGE_FLAG_ARRAY_COUNT_EXT
:
2114 /* GL_ARB_multitexture */
2115 case GL_MAX_TEXTURE_UNITS_ARB
:
2116 *params
= (GLdouble
) ctx
->Const
.MaxTextureUnits
;
2118 case GL_ACTIVE_TEXTURE_ARB
:
2119 *params
= (GLdouble
) (GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
);
2121 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
2122 *params
= (GLdouble
) (GL_TEXTURE0_ARB
+ ctx
->Array
.ActiveTexture
);
2125 /* GL_ARB_texture_cube_map */
2126 case GL_TEXTURE_CUBE_MAP_ARB
:
2127 if (ctx
->Extensions
.HaveTextureCubeMap
)
2128 *params
= (GLdouble
) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
);
2130 gl_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2132 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
2133 if (ctx
->Extensions
.HaveTextureCubeMap
)
2134 *params
= (GLdouble
) textureUnit
->CurrentCubeMap
->Name
;
2136 gl_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2138 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
2139 if (ctx
->Extensions
.HaveTextureCubeMap
)
2140 *params
= (GLdouble
) ctx
->Const
.MaxCubeTextureSize
;
2142 gl_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2145 /* GL_ARB_texture_compression */
2146 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
2147 if (ctx
->Extensions
.HaveTextureCompression
) {
2148 *params
= (GLdouble
) ctx
->Hint
.TextureCompression
;
2151 gl_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2153 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
2154 if (ctx
->Extensions
.HaveTextureCompression
) {
2155 *params
= (GLdouble
) ctx
->Const
.NumCompressedTextureFormats
;
2158 gl_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2160 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
2161 if (ctx
->Extensions
.HaveTextureCompression
) {
2163 for (i
= 0; i
< ctx
->Const
.NumCompressedTextureFormats
; i
++)
2164 params
[i
] = (GLdouble
) ctx
->Const
.CompressedTextureFormats
[i
];
2167 gl_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2170 /* GL_PGI_misc_hints */
2171 case GL_STRICT_DEPTHFUNC_HINT_PGI
:
2172 *params
= ENUM_TO_DOUBLE(GL_NICEST
);
2174 case GL_STRICT_LIGHTING_HINT_PGI
:
2175 *params
= ENUM_TO_DOUBLE(ctx
->Hint
.StrictLighting
);
2177 case GL_STRICT_SCISSOR_HINT_PGI
:
2178 case GL_FULL_STIPPLE_HINT_PGI
:
2179 *params
= ENUM_TO_DOUBLE(GL_TRUE
);
2181 case GL_CONSERVE_MEMORY_HINT_PGI
:
2182 *params
= ENUM_TO_DOUBLE(GL_FALSE
);
2184 case GL_ALWAYS_FAST_HINT_PGI
:
2185 *params
= (GLdouble
) (ctx
->Hint
.AllowDrawWin
== GL_TRUE
&&
2186 ctx
->Hint
.AllowDrawFrg
== GL_FALSE
&&
2187 ctx
->Hint
.AllowDrawMem
== GL_FALSE
);
2189 case GL_ALWAYS_SOFT_HINT_PGI
:
2190 *params
= (GLdouble
) (ctx
->Hint
.AllowDrawWin
== GL_TRUE
&&
2191 ctx
->Hint
.AllowDrawFrg
== GL_TRUE
&&
2192 ctx
->Hint
.AllowDrawMem
== GL_TRUE
);
2194 case GL_ALLOW_DRAW_OBJ_HINT_PGI
:
2195 *params
= (GLdouble
) GL_TRUE
;
2197 case GL_ALLOW_DRAW_WIN_HINT_PGI
:
2198 *params
= (GLdouble
) ctx
->Hint
.AllowDrawWin
;
2200 case GL_ALLOW_DRAW_FRG_HINT_PGI
:
2201 *params
= (GLdouble
) ctx
->Hint
.AllowDrawFrg
;
2203 case GL_ALLOW_DRAW_MEM_HINT_PGI
:
2204 *params
= (GLdouble
) ctx
->Hint
.AllowDrawMem
;
2206 case GL_CLIP_NEAR_HINT_PGI
:
2207 case GL_CLIP_FAR_HINT_PGI
:
2208 *params
= ENUM_TO_DOUBLE(GL_TRUE
);
2210 case GL_WIDE_LINE_HINT_PGI
:
2211 *params
= ENUM_TO_DOUBLE(GL_DONT_CARE
);
2213 case GL_BACK_NORMALS_HINT_PGI
:
2214 *params
= ENUM_TO_DOUBLE(GL_TRUE
);
2216 case GL_NATIVE_GRAPHICS_HANDLE_PGI
:
2220 /* GL_EXT_compiled_vertex_array */
2221 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
2222 *params
= (GLdouble
) ctx
->Array
.LockFirst
;
2224 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
2225 *params
= (GLdouble
) ctx
->Array
.LockCount
;
2228 /* GL_ARB_transpose_matrix */
2229 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
2233 gl_matrix_transposef(tm
, ctx
->ColorMatrix
.m
);
2234 for (i
=0;i
<16;i
++) {
2235 params
[i
] = (GLdouble
) tm
[i
];
2239 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
2243 gl_matrix_transposef(tm
, ctx
->ModelView
.m
);
2244 for (i
=0;i
<16;i
++) {
2245 params
[i
] = (GLdouble
) tm
[i
];
2249 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
2253 gl_matrix_transposef(tm
, ctx
->ProjectionMatrix
.m
);
2254 for (i
=0;i
<16;i
++) {
2255 params
[i
] = (GLdouble
) tm
[i
];
2259 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
2263 gl_matrix_transposef(tm
, ctx
->TextureMatrix
[texTransformUnit
].m
);
2264 for (i
=0;i
<16;i
++) {
2265 params
[i
] = (GLdouble
) tm
[i
];
2270 /* GL_HP_occlusion_test */
2271 case GL_OCCLUSION_TEST_HP
:
2272 if (ctx
->Extensions
.HaveHpOcclusionTest
) {
2273 *params
= (GLdouble
) ctx
->Depth
.OcclusionTest
;
2276 gl_error( ctx
, GL_INVALID_ENUM
, "glGetDoublev" );
2279 case GL_OCCLUSION_TEST_RESULT_HP
:
2280 if (ctx
->Extensions
.HaveHpOcclusionTest
) {
2281 if (ctx
->Depth
.OcclusionTest
)
2282 *params
= (GLdouble
) ctx
->OcclusionResult
;
2284 *params
= (GLdouble
) ctx
->OcclusionResultSaved
;
2285 /* reset flag now */
2286 ctx
->OcclusionResult
= GL_FALSE
;
2287 ctx
->OcclusionResultSaved
= GL_FALSE
;
2290 gl_error( ctx
, GL_INVALID_ENUM
, "glGetDoublev" );
2294 /* GL_SGIS_pixel_texture */
2295 case GL_PIXEL_TEXTURE_SGIS
:
2296 *params
= (GLdouble
) ctx
->Pixel
.PixelTextureEnabled
;
2299 /* GL_SGIX_pixel_texture */
2300 case GL_PIXEL_TEX_GEN_SGIX
:
2301 *params
= (GLdouble
) ctx
->Pixel
.PixelTextureEnabled
;
2303 case GL_PIXEL_TEX_GEN_MODE_SGIX
:
2304 *params
= (GLdouble
) pixel_texgen_mode(ctx
);
2307 /* GL_SGI_color_matrix (also in 1.2 imaging) */
2308 case GL_COLOR_MATRIX_SGI
:
2309 for (i
=0;i
<16;i
++) {
2310 params
[i
] = (GLdouble
) ctx
->ColorMatrix
.m
[i
];
2313 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
2314 *params
= (GLdouble
) (ctx
->ColorStackDepth
+ 1);
2316 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
2317 *params
= (GLdouble
) MAX_COLOR_STACK_DEPTH
;
2319 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
2320 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixScale
[0];
2322 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
2323 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixScale
[1];
2325 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
2326 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixScale
[2];
2328 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
2329 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixScale
[3];
2331 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
2332 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixBias
[0];
2334 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
2335 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixBias
[1];
2337 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
2338 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixBias
[2];
2340 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
2341 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixBias
[3];
2344 /* GL_EXT_convolution (also in 1.2 imaging) */
2345 case GL_MAX_CONVOLUTION_WIDTH
:
2346 *params
= (GLdouble
) ctx
->Const
.MaxConvolutionWidth
;
2348 case GL_MAX_CONVOLUTION_HEIGHT
:
2349 *params
= (GLdouble
) ctx
->Const
.MaxConvolutionHeight
;
2351 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
2352 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionScale
[0];
2354 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
2355 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionScale
[1];
2357 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
2358 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionScale
[2];
2360 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
2361 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionScale
[3];
2363 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
2364 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionBias
[0];
2366 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
2367 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionBias
[1];
2369 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
2370 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionBias
[2];
2372 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
2373 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionBias
[2];
2376 /* GL_SGI_color_table (also in 1.2 imaging */
2377 case GL_COLOR_TABLE_SGI
:
2378 *params
= (GLdouble
) ctx
->Pixel
.ColorTableEnabled
;
2380 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
2381 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionColorTableEnabled
;
2383 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
2384 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixColorTableEnabled
;
2388 gl_error( ctx
, GL_INVALID_ENUM
, "glGetDoublev" );
2396 _mesa_GetFloatv( GLenum pname
, GLfloat
*params
)
2398 GET_CURRENT_CONTEXT(ctx
);
2400 GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
2401 GLuint texTransformUnit
= ctx
->Texture
.CurrentTransformUnit
;
2402 const struct gl_texture_unit
*textureUnit
= &ctx
->Texture
.Unit
[texUnit
];
2404 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
, "glGetFloatv");
2409 if (MESA_VERBOSE
& VERBOSE_API
)
2410 fprintf(stderr
, "glGetFloatv %s\n", gl_lookup_enum_by_nr(pname
));
2412 if (ctx
->Driver
.GetFloatv
&& (*ctx
->Driver
.GetFloatv
)(ctx
, pname
, params
))
2416 case GL_ACCUM_RED_BITS
:
2417 *params
= (GLfloat
) ctx
->Visual
->AccumRedBits
;
2419 case GL_ACCUM_GREEN_BITS
:
2420 *params
= (GLfloat
) ctx
->Visual
->AccumGreenBits
;
2422 case GL_ACCUM_BLUE_BITS
:
2423 *params
= (GLfloat
) ctx
->Visual
->AccumBlueBits
;
2425 case GL_ACCUM_ALPHA_BITS
:
2426 *params
= (GLfloat
) ctx
->Visual
->AccumAlphaBits
;
2428 case GL_ACCUM_CLEAR_VALUE
:
2429 params
[0] = ctx
->Accum
.ClearColor
[0];
2430 params
[1] = ctx
->Accum
.ClearColor
[1];
2431 params
[2] = ctx
->Accum
.ClearColor
[2];
2432 params
[3] = ctx
->Accum
.ClearColor
[3];
2435 *params
= ctx
->Pixel
.AlphaBias
;
2438 *params
= (GLfloat
) ctx
->Visual
->AlphaBits
;
2440 case GL_ALPHA_SCALE
:
2441 *params
= ctx
->Pixel
.AlphaScale
;
2444 *params
= (GLfloat
) ctx
->Color
.AlphaEnabled
;
2446 case GL_ALPHA_TEST_FUNC
:
2447 *params
= ENUM_TO_FLOAT(ctx
->Color
.AlphaFunc
);
2449 case GL_ALPHA_TEST_REF
:
2450 *params
= (GLfloat
) ctx
->Color
.AlphaRef
/ 255.0;
2452 case GL_ATTRIB_STACK_DEPTH
:
2453 *params
= (GLfloat
) (ctx
->AttribStackDepth
);
2455 case GL_AUTO_NORMAL
:
2456 *params
= (GLfloat
) ctx
->Eval
.AutoNormal
;
2458 case GL_AUX_BUFFERS
:
2459 *params
= (GLfloat
) ctx
->Const
.NumAuxBuffers
;
2462 *params
= (GLfloat
) ctx
->Color
.BlendEnabled
;
2465 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendDstRGB
);
2468 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendSrcRGB
);
2470 case GL_BLEND_SRC_RGB_EXT
:
2471 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendSrcRGB
);
2473 case GL_BLEND_DST_RGB_EXT
:
2474 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendDstRGB
);
2476 case GL_BLEND_SRC_ALPHA_EXT
:
2477 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendSrcA
);
2479 case GL_BLEND_DST_ALPHA_EXT
:
2480 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendDstA
);
2482 case GL_BLEND_EQUATION_EXT
:
2483 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendEquation
);
2485 case GL_BLEND_COLOR_EXT
:
2486 params
[0] = ctx
->Color
.BlendColor
[0];
2487 params
[1] = ctx
->Color
.BlendColor
[1];
2488 params
[2] = ctx
->Color
.BlendColor
[2];
2489 params
[3] = ctx
->Color
.BlendColor
[3];
2492 *params
= ctx
->Pixel
.BlueBias
;
2495 *params
= (GLfloat
) ctx
->Visual
->BlueBits
;
2498 *params
= ctx
->Pixel
.BlueScale
;
2500 case GL_CLIENT_ATTRIB_STACK_DEPTH
:
2501 *params
= (GLfloat
) (ctx
->ClientAttribStackDepth
);
2503 case GL_CLIP_PLANE0
:
2504 case GL_CLIP_PLANE1
:
2505 case GL_CLIP_PLANE2
:
2506 case GL_CLIP_PLANE3
:
2507 case GL_CLIP_PLANE4
:
2508 case GL_CLIP_PLANE5
:
2509 *params
= (GLfloat
) ctx
->Transform
.ClipEnabled
[pname
-GL_CLIP_PLANE0
];
2511 case GL_COLOR_CLEAR_VALUE
:
2512 params
[0] = (GLfloat
) ctx
->Color
.ClearColor
[0];
2513 params
[1] = (GLfloat
) ctx
->Color
.ClearColor
[1];
2514 params
[2] = (GLfloat
) ctx
->Color
.ClearColor
[2];
2515 params
[3] = (GLfloat
) ctx
->Color
.ClearColor
[3];
2517 case GL_COLOR_MATERIAL
:
2518 *params
= (GLfloat
) ctx
->Light
.ColorMaterialEnabled
;
2520 case GL_COLOR_MATERIAL_FACE
:
2521 *params
= ENUM_TO_FLOAT(ctx
->Light
.ColorMaterialFace
);
2523 case GL_COLOR_MATERIAL_PARAMETER
:
2524 *params
= ENUM_TO_FLOAT(ctx
->Light
.ColorMaterialMode
);
2526 case GL_COLOR_WRITEMASK
:
2527 params
[0] = ctx
->Color
.ColorMask
[RCOMP
] ? 1.0F
: 0.0F
;
2528 params
[1] = ctx
->Color
.ColorMask
[GCOMP
] ? 1.0F
: 0.0F
;
2529 params
[2] = ctx
->Color
.ColorMask
[BCOMP
] ? 1.0F
: 0.0F
;
2530 params
[3] = ctx
->Color
.ColorMask
[ACOMP
] ? 1.0F
: 0.0F
;
2533 *params
= (GLfloat
) ctx
->Polygon
.CullFlag
;
2535 case GL_CULL_FACE_MODE
:
2536 *params
= ENUM_TO_FLOAT(ctx
->Polygon
.CullFaceMode
);
2538 case GL_CURRENT_COLOR
:
2539 UBYTE_RGBA_TO_FLOAT_RGBA(params
, ctx
->Current
.ByteColor
);
2541 case GL_CURRENT_INDEX
:
2542 *params
= (GLfloat
) ctx
->Current
.Index
;
2544 case GL_CURRENT_NORMAL
:
2545 params
[0] = ctx
->Current
.Normal
[0];
2546 params
[1] = ctx
->Current
.Normal
[1];
2547 params
[2] = ctx
->Current
.Normal
[2];
2549 case GL_CURRENT_RASTER_COLOR
:
2550 params
[0] = ctx
->Current
.RasterColor
[0];
2551 params
[1] = ctx
->Current
.RasterColor
[1];
2552 params
[2] = ctx
->Current
.RasterColor
[2];
2553 params
[3] = ctx
->Current
.RasterColor
[3];
2555 case GL_CURRENT_RASTER_DISTANCE
:
2556 params
[0] = ctx
->Current
.RasterDistance
;
2558 case GL_CURRENT_RASTER_INDEX
:
2559 *params
= (GLfloat
) ctx
->Current
.RasterIndex
;
2561 case GL_CURRENT_RASTER_POSITION
:
2562 params
[0] = ctx
->Current
.RasterPos
[0];
2563 params
[1] = ctx
->Current
.RasterPos
[1];
2564 params
[2] = ctx
->Current
.RasterPos
[2];
2565 params
[3] = ctx
->Current
.RasterPos
[3];
2567 case GL_CURRENT_RASTER_TEXTURE_COORDS
:
2568 params
[0] = ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][0];
2569 params
[1] = ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][1];
2570 params
[2] = ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][2];
2571 params
[3] = ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][3];
2573 case GL_CURRENT_RASTER_POSITION_VALID
:
2574 *params
= (GLfloat
) ctx
->Current
.RasterPosValid
;
2576 case GL_CURRENT_TEXTURE_COORDS
:
2577 params
[0] = (GLfloat
) ctx
->Current
.Texcoord
[texTransformUnit
][0];
2578 params
[1] = (GLfloat
) ctx
->Current
.Texcoord
[texTransformUnit
][1];
2579 params
[2] = (GLfloat
) ctx
->Current
.Texcoord
[texTransformUnit
][2];
2580 params
[3] = (GLfloat
) ctx
->Current
.Texcoord
[texTransformUnit
][3];
2583 *params
= (GLfloat
) ctx
->Pixel
.DepthBias
;
2586 *params
= (GLfloat
) ctx
->Visual
->DepthBits
;
2588 case GL_DEPTH_CLEAR_VALUE
:
2589 *params
= (GLfloat
) ctx
->Depth
.Clear
;
2592 *params
= ENUM_TO_FLOAT(ctx
->Depth
.Func
);
2594 case GL_DEPTH_RANGE
:
2595 params
[0] = (GLfloat
) ctx
->Viewport
.Near
;
2596 params
[1] = (GLfloat
) ctx
->Viewport
.Far
;
2598 case GL_DEPTH_SCALE
:
2599 *params
= (GLfloat
) ctx
->Pixel
.DepthScale
;
2602 *params
= (GLfloat
) ctx
->Depth
.Test
;
2604 case GL_DEPTH_WRITEMASK
:
2605 *params
= (GLfloat
) ctx
->Depth
.Mask
;
2608 *params
= (GLfloat
) ctx
->Color
.DitherFlag
;
2610 case GL_DOUBLEBUFFER
:
2611 *params
= (GLfloat
) ctx
->Visual
->DBflag
;
2613 case GL_DRAW_BUFFER
:
2614 *params
= ENUM_TO_FLOAT(ctx
->Color
.DrawBuffer
);
2617 *params
= (GLfloat
) ctx
->Current
.EdgeFlag
;
2619 case GL_FEEDBACK_BUFFER_SIZE
:
2620 *params
= (GLfloat
) ctx
->Feedback
.BufferSize
;
2622 case GL_FEEDBACK_BUFFER_TYPE
:
2623 *params
= ENUM_TO_FLOAT(ctx
->Feedback
.Type
);
2626 *params
= (GLfloat
) ctx
->Fog
.Enabled
;
2629 params
[0] = ctx
->Fog
.Color
[0];
2630 params
[1] = ctx
->Fog
.Color
[1];
2631 params
[2] = ctx
->Fog
.Color
[2];
2632 params
[3] = ctx
->Fog
.Color
[3];
2634 case GL_FOG_DENSITY
:
2635 *params
= ctx
->Fog
.Density
;
2638 *params
= ctx
->Fog
.End
;
2641 *params
= ENUM_TO_FLOAT(ctx
->Hint
.Fog
);
2644 *params
= ctx
->Fog
.Index
;
2647 *params
= ENUM_TO_FLOAT(ctx
->Fog
.Mode
);
2650 *params
= ctx
->Fog
.Start
;
2653 *params
= ENUM_TO_FLOAT(ctx
->Polygon
.FrontFace
);
2656 *params
= (GLfloat
) ctx
->Pixel
.GreenBias
;
2659 *params
= (GLfloat
) ctx
->Visual
->GreenBits
;
2661 case GL_GREEN_SCALE
:
2662 *params
= (GLfloat
) ctx
->Pixel
.GreenScale
;
2665 if (ctx
->Extensions
.HaveHistogram
) {
2666 *params
= (GLfloat
) ctx
->Pixel
.HistogramEnabled
;
2669 gl_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
2674 *params
= (GLfloat
) ctx
->Visual
->IndexBits
;
2676 case GL_INDEX_CLEAR_VALUE
:
2677 *params
= (GLfloat
) ctx
->Color
.ClearIndex
;
2680 *params
= ctx
->Visual
->RGBAflag
? 0.0F
: 1.0F
;
2682 case GL_INDEX_OFFSET
:
2683 *params
= (GLfloat
) ctx
->Pixel
.IndexOffset
;
2685 case GL_INDEX_SHIFT
:
2686 *params
= (GLfloat
) ctx
->Pixel
.IndexShift
;
2688 case GL_INDEX_WRITEMASK
:
2689 *params
= (GLfloat
) ctx
->Color
.IndexMask
;
2699 *params
= (GLfloat
) ctx
->Light
.Light
[pname
-GL_LIGHT0
].Enabled
;
2702 *params
= (GLfloat
) ctx
->Light
.Enabled
;
2704 case GL_LIGHT_MODEL_AMBIENT
:
2705 params
[0] = ctx
->Light
.Model
.Ambient
[0];
2706 params
[1] = ctx
->Light
.Model
.Ambient
[1];
2707 params
[2] = ctx
->Light
.Model
.Ambient
[2];
2708 params
[3] = ctx
->Light
.Model
.Ambient
[3];
2710 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2711 params
[0] = ENUM_TO_FLOAT(ctx
->Light
.Model
.ColorControl
);
2713 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2714 *params
= (GLfloat
) ctx
->Light
.Model
.LocalViewer
;
2716 case GL_LIGHT_MODEL_TWO_SIDE
:
2717 *params
= (GLfloat
) ctx
->Light
.Model
.TwoSide
;
2719 case GL_LINE_SMOOTH
:
2720 *params
= (GLfloat
) ctx
->Line
.SmoothFlag
;
2722 case GL_LINE_SMOOTH_HINT
:
2723 *params
= ENUM_TO_FLOAT(ctx
->Hint
.LineSmooth
);
2725 case GL_LINE_STIPPLE
:
2726 *params
= (GLfloat
) ctx
->Line
.StippleFlag
;
2728 case GL_LINE_STIPPLE_PATTERN
:
2729 *params
= (GLfloat
) ctx
->Line
.StipplePattern
;
2731 case GL_LINE_STIPPLE_REPEAT
:
2732 *params
= (GLfloat
) ctx
->Line
.StippleFactor
;
2735 *params
= (GLfloat
) ctx
->Line
.Width
;
2737 case GL_LINE_WIDTH_GRANULARITY
:
2738 *params
= (GLfloat
) ctx
->Const
.LineWidthGranularity
;
2740 case GL_LINE_WIDTH_RANGE
:
2741 params
[0] = (GLfloat
) ctx
->Const
.MinLineWidthAA
;
2742 params
[1] = (GLfloat
) ctx
->Const
.MaxLineWidthAA
;
2744 case GL_ALIASED_LINE_WIDTH_RANGE
:
2745 params
[0] = (GLfloat
) ctx
->Const
.MinLineWidth
;
2746 params
[1] = (GLfloat
) ctx
->Const
.MaxLineWidth
;
2749 *params
= (GLfloat
) ctx
->List
.ListBase
;
2752 *params
= (GLfloat
) ctx
->CurrentListNum
;
2755 *params
= ctx
->ExecuteFlag
? ENUM_TO_FLOAT(GL_COMPILE_AND_EXECUTE
)
2756 : ENUM_TO_FLOAT(GL_COMPILE
);
2758 case GL_INDEX_LOGIC_OP
:
2759 *params
= (GLfloat
) ctx
->Color
.IndexLogicOpEnabled
;
2761 case GL_COLOR_LOGIC_OP
:
2762 *params
= (GLfloat
) ctx
->Color
.ColorLogicOpEnabled
;
2764 case GL_LOGIC_OP_MODE
:
2765 *params
= ENUM_TO_FLOAT(ctx
->Color
.LogicOp
);
2767 case GL_MAP1_COLOR_4
:
2768 *params
= (GLfloat
) ctx
->Eval
.Map1Color4
;
2770 case GL_MAP1_GRID_DOMAIN
:
2771 params
[0] = ctx
->Eval
.MapGrid1u1
;
2772 params
[1] = ctx
->Eval
.MapGrid1u2
;
2774 case GL_MAP1_GRID_SEGMENTS
:
2775 *params
= (GLfloat
) ctx
->Eval
.MapGrid1un
;
2778 *params
= (GLfloat
) ctx
->Eval
.Map1Index
;
2780 case GL_MAP1_NORMAL
:
2781 *params
= (GLfloat
) ctx
->Eval
.Map1Normal
;
2783 case GL_MAP1_TEXTURE_COORD_1
:
2784 *params
= (GLfloat
) ctx
->Eval
.Map1TextureCoord1
;
2786 case GL_MAP1_TEXTURE_COORD_2
:
2787 *params
= (GLfloat
) ctx
->Eval
.Map1TextureCoord2
;
2789 case GL_MAP1_TEXTURE_COORD_3
:
2790 *params
= (GLfloat
) ctx
->Eval
.Map1TextureCoord3
;
2792 case GL_MAP1_TEXTURE_COORD_4
:
2793 *params
= (GLfloat
) ctx
->Eval
.Map1TextureCoord4
;
2795 case GL_MAP1_VERTEX_3
:
2796 *params
= (GLfloat
) ctx
->Eval
.Map1Vertex3
;
2798 case GL_MAP1_VERTEX_4
:
2799 *params
= (GLfloat
) ctx
->Eval
.Map1Vertex4
;
2801 case GL_MAP2_COLOR_4
:
2802 *params
= (GLfloat
) ctx
->Eval
.Map2Color4
;
2804 case GL_MAP2_GRID_DOMAIN
:
2805 params
[0] = ctx
->Eval
.MapGrid2u1
;
2806 params
[1] = ctx
->Eval
.MapGrid2u2
;
2807 params
[2] = ctx
->Eval
.MapGrid2v1
;
2808 params
[3] = ctx
->Eval
.MapGrid2v2
;
2810 case GL_MAP2_GRID_SEGMENTS
:
2811 params
[0] = (GLfloat
) ctx
->Eval
.MapGrid2un
;
2812 params
[1] = (GLfloat
) ctx
->Eval
.MapGrid2vn
;
2815 *params
= (GLfloat
) ctx
->Eval
.Map2Index
;
2817 case GL_MAP2_NORMAL
:
2818 *params
= (GLfloat
) ctx
->Eval
.Map2Normal
;
2820 case GL_MAP2_TEXTURE_COORD_1
:
2821 *params
= ctx
->Eval
.Map2TextureCoord1
;
2823 case GL_MAP2_TEXTURE_COORD_2
:
2824 *params
= ctx
->Eval
.Map2TextureCoord2
;
2826 case GL_MAP2_TEXTURE_COORD_3
:
2827 *params
= ctx
->Eval
.Map2TextureCoord3
;
2829 case GL_MAP2_TEXTURE_COORD_4
:
2830 *params
= ctx
->Eval
.Map2TextureCoord4
;
2832 case GL_MAP2_VERTEX_3
:
2833 *params
= (GLfloat
) ctx
->Eval
.Map2Vertex3
;
2835 case GL_MAP2_VERTEX_4
:
2836 *params
= (GLfloat
) ctx
->Eval
.Map2Vertex4
;
2839 *params
= (GLfloat
) ctx
->Pixel
.MapColorFlag
;
2841 case GL_MAP_STENCIL
:
2842 *params
= (GLfloat
) ctx
->Pixel
.MapStencilFlag
;
2844 case GL_MATRIX_MODE
:
2845 *params
= ENUM_TO_FLOAT(ctx
->Transform
.MatrixMode
);
2847 case GL_MAX_ATTRIB_STACK_DEPTH
:
2848 *params
= (GLfloat
) MAX_ATTRIB_STACK_DEPTH
;
2850 case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
:
2851 *params
= (GLfloat
) MAX_CLIENT_ATTRIB_STACK_DEPTH
;
2853 case GL_MAX_CLIP_PLANES
:
2854 *params
= (GLfloat
) MAX_CLIP_PLANES
;
2856 case GL_MAX_ELEMENTS_VERTICES
: /* GL_VERSION_1_2 */
2857 *params
= (GLfloat
) VB_MAX
;
2859 case GL_MAX_ELEMENTS_INDICES
: /* GL_VERSION_1_2 */
2860 *params
= (GLfloat
) VB_MAX
;
2862 case GL_MAX_EVAL_ORDER
:
2863 *params
= (GLfloat
) MAX_EVAL_ORDER
;
2866 *params
= (GLfloat
) MAX_LIGHTS
;
2868 case GL_MAX_LIST_NESTING
:
2869 *params
= (GLfloat
) MAX_LIST_NESTING
;
2871 case GL_MAX_MODELVIEW_STACK_DEPTH
:
2872 *params
= (GLfloat
) MAX_MODELVIEW_STACK_DEPTH
;
2874 case GL_MAX_NAME_STACK_DEPTH
:
2875 *params
= (GLfloat
) MAX_NAME_STACK_DEPTH
;
2877 case GL_MAX_PIXEL_MAP_TABLE
:
2878 *params
= (GLfloat
) MAX_PIXEL_MAP_TABLE
;
2880 case GL_MAX_PROJECTION_STACK_DEPTH
:
2881 *params
= (GLfloat
) MAX_PROJECTION_STACK_DEPTH
;
2883 case GL_MAX_TEXTURE_SIZE
:
2884 case GL_MAX_3D_TEXTURE_SIZE
:
2885 *params
= (GLfloat
) ctx
->Const
.MaxTextureSize
;
2887 case GL_MAX_TEXTURE_STACK_DEPTH
:
2888 *params
= (GLfloat
) MAX_TEXTURE_STACK_DEPTH
;
2890 case GL_MAX_VIEWPORT_DIMS
:
2891 params
[0] = (GLfloat
) MAX_WIDTH
;
2892 params
[1] = (GLfloat
) MAX_HEIGHT
;
2895 *params
= (GLfloat
) ctx
->Pixel
.MinMaxEnabled
;
2897 case GL_MODELVIEW_MATRIX
:
2898 for (i
=0;i
<16;i
++) {
2899 params
[i
] = ctx
->ModelView
.m
[i
];
2902 case GL_MODELVIEW_STACK_DEPTH
:
2903 *params
= (GLfloat
) (ctx
->ModelViewStackDepth
+ 1);
2905 case GL_NAME_STACK_DEPTH
:
2906 *params
= (GLfloat
) ctx
->Select
.NameStackDepth
;
2909 *params
= (GLfloat
) ctx
->Transform
.Normalize
;
2911 case GL_PACK_ALIGNMENT
:
2912 *params
= (GLfloat
) ctx
->Pack
.Alignment
;
2914 case GL_PACK_LSB_FIRST
:
2915 *params
= (GLfloat
) ctx
->Pack
.LsbFirst
;
2917 case GL_PACK_ROW_LENGTH
:
2918 *params
= (GLfloat
) ctx
->Pack
.RowLength
;
2920 case GL_PACK_SKIP_PIXELS
:
2921 *params
= (GLfloat
) ctx
->Pack
.SkipPixels
;
2923 case GL_PACK_SKIP_ROWS
:
2924 *params
= (GLfloat
) ctx
->Pack
.SkipRows
;
2926 case GL_PACK_SWAP_BYTES
:
2927 *params
= (GLfloat
) ctx
->Pack
.SwapBytes
;
2929 case GL_PACK_SKIP_IMAGES_EXT
:
2930 *params
= (GLfloat
) ctx
->Pack
.SkipImages
;
2932 case GL_PACK_IMAGE_HEIGHT_EXT
:
2933 *params
= (GLfloat
) ctx
->Pack
.ImageHeight
;
2935 case GL_PERSPECTIVE_CORRECTION_HINT
:
2936 *params
= ENUM_TO_FLOAT(ctx
->Hint
.PerspectiveCorrection
);
2938 case GL_PIXEL_MAP_A_TO_A_SIZE
:
2939 *params
= (GLfloat
) ctx
->Pixel
.MapAtoAsize
;
2941 case GL_PIXEL_MAP_B_TO_B_SIZE
:
2942 *params
= (GLfloat
) ctx
->Pixel
.MapBtoBsize
;
2944 case GL_PIXEL_MAP_G_TO_G_SIZE
:
2945 *params
= (GLfloat
) ctx
->Pixel
.MapGtoGsize
;
2947 case GL_PIXEL_MAP_I_TO_A_SIZE
:
2948 *params
= (GLfloat
) ctx
->Pixel
.MapItoAsize
;
2950 case GL_PIXEL_MAP_I_TO_B_SIZE
:
2951 *params
= (GLfloat
) ctx
->Pixel
.MapItoBsize
;
2953 case GL_PIXEL_MAP_I_TO_G_SIZE
:
2954 *params
= (GLfloat
) ctx
->Pixel
.MapItoGsize
;
2956 case GL_PIXEL_MAP_I_TO_I_SIZE
:
2957 *params
= (GLfloat
) ctx
->Pixel
.MapItoIsize
;
2959 case GL_PIXEL_MAP_I_TO_R_SIZE
:
2960 *params
= (GLfloat
) ctx
->Pixel
.MapItoRsize
;
2962 case GL_PIXEL_MAP_R_TO_R_SIZE
:
2963 *params
= (GLfloat
) ctx
->Pixel
.MapRtoRsize
;
2965 case GL_PIXEL_MAP_S_TO_S_SIZE
:
2966 *params
= (GLfloat
) ctx
->Pixel
.MapStoSsize
;
2969 *params
= (GLfloat
) ctx
->Point
.UserSize
;
2971 case GL_POINT_SIZE_GRANULARITY
:
2972 *params
= (GLfloat
) ctx
->Const
.PointSizeGranularity
;
2974 case GL_POINT_SIZE_RANGE
:
2975 params
[0] = (GLfloat
) ctx
->Const
.MinPointSizeAA
;
2976 params
[1] = (GLfloat
) ctx
->Const
.MaxPointSizeAA
;
2978 case GL_ALIASED_POINT_SIZE_RANGE
:
2979 params
[0] = (GLfloat
) ctx
->Const
.MinPointSize
;
2980 params
[1] = (GLfloat
) ctx
->Const
.MaxPointSize
;
2982 case GL_POINT_SMOOTH
:
2983 *params
= (GLfloat
) ctx
->Point
.SmoothFlag
;
2985 case GL_POINT_SMOOTH_HINT
:
2986 *params
= ENUM_TO_FLOAT(ctx
->Hint
.PointSmooth
);
2988 case GL_POINT_SIZE_MIN_EXT
:
2989 *params
= (GLfloat
) (ctx
->Point
.MinSize
);
2991 case GL_POINT_SIZE_MAX_EXT
:
2992 *params
= (GLfloat
) (ctx
->Point
.MaxSize
);
2994 case GL_POINT_FADE_THRESHOLD_SIZE_EXT
:
2995 *params
= (GLfloat
) (ctx
->Point
.Threshold
);
2997 case GL_DISTANCE_ATTENUATION_EXT
:
2998 params
[0] = (GLfloat
) (ctx
->Point
.Params
[0]);
2999 params
[1] = (GLfloat
) (ctx
->Point
.Params
[1]);
3000 params
[2] = (GLfloat
) (ctx
->Point
.Params
[2]);
3002 case GL_POLYGON_MODE
:
3003 params
[0] = ENUM_TO_FLOAT(ctx
->Polygon
.FrontMode
);
3004 params
[1] = ENUM_TO_FLOAT(ctx
->Polygon
.BackMode
);
3006 #ifdef GL_EXT_polygon_offset
3007 case GL_POLYGON_OFFSET_BIAS_EXT
:
3008 *params
= ctx
->Polygon
.OffsetUnits
;
3011 case GL_POLYGON_OFFSET_FACTOR
:
3012 *params
= ctx
->Polygon
.OffsetFactor
;
3014 case GL_POLYGON_OFFSET_UNITS
:
3015 *params
= ctx
->Polygon
.OffsetUnits
;
3017 case GL_POLYGON_SMOOTH
:
3018 *params
= (GLfloat
) ctx
->Polygon
.SmoothFlag
;
3020 case GL_POLYGON_SMOOTH_HINT
:
3021 *params
= ENUM_TO_FLOAT(ctx
->Hint
.PolygonSmooth
);
3023 case GL_POLYGON_STIPPLE
:
3024 *params
= (GLfloat
) ctx
->Polygon
.StippleFlag
;
3026 case GL_PROJECTION_MATRIX
:
3027 for (i
=0;i
<16;i
++) {
3028 params
[i
] = ctx
->ProjectionMatrix
.m
[i
];
3031 case GL_PROJECTION_STACK_DEPTH
:
3032 *params
= (GLfloat
) (ctx
->ProjectionStackDepth
+ 1);
3034 case GL_READ_BUFFER
:
3035 *params
= ENUM_TO_FLOAT(ctx
->Pixel
.ReadBuffer
);
3038 *params
= ctx
->Pixel
.RedBias
;
3041 *params
= (GLfloat
) ctx
->Visual
->RedBits
;
3044 *params
= ctx
->Pixel
.RedScale
;
3046 case GL_RENDER_MODE
:
3047 *params
= ENUM_TO_FLOAT(ctx
->RenderMode
);
3050 *params
= (GLfloat
) ctx
->Visual
->RGBAflag
;
3052 case GL_SCISSOR_BOX
:
3053 params
[0] = (GLfloat
) ctx
->Scissor
.X
;
3054 params
[1] = (GLfloat
) ctx
->Scissor
.Y
;
3055 params
[2] = (GLfloat
) ctx
->Scissor
.Width
;
3056 params
[3] = (GLfloat
) ctx
->Scissor
.Height
;
3058 case GL_SCISSOR_TEST
:
3059 *params
= (GLfloat
) ctx
->Scissor
.Enabled
;
3061 case GL_SELECTION_BUFFER_SIZE
:
3062 *params
= (GLfloat
) ctx
->Select
.BufferSize
;
3064 case GL_SHADE_MODEL
:
3065 *params
= ENUM_TO_FLOAT(ctx
->Light
.ShadeModel
);
3067 case GL_SHARED_TEXTURE_PALETTE_EXT
:
3068 *params
= (GLfloat
) ctx
->Texture
.SharedPalette
;
3070 case GL_STENCIL_BITS
:
3071 *params
= (GLfloat
) ctx
->Visual
->StencilBits
;
3073 case GL_STENCIL_CLEAR_VALUE
:
3074 *params
= (GLfloat
) ctx
->Stencil
.Clear
;
3076 case GL_STENCIL_FAIL
:
3077 *params
= ENUM_TO_FLOAT(ctx
->Stencil
.FailFunc
);
3079 case GL_STENCIL_FUNC
:
3080 *params
= ENUM_TO_FLOAT(ctx
->Stencil
.Function
);
3082 case GL_STENCIL_PASS_DEPTH_FAIL
:
3083 *params
= ENUM_TO_FLOAT(ctx
->Stencil
.ZFailFunc
);
3085 case GL_STENCIL_PASS_DEPTH_PASS
:
3086 *params
= ENUM_TO_FLOAT(ctx
->Stencil
.ZPassFunc
);
3088 case GL_STENCIL_REF
:
3089 *params
= (GLfloat
) ctx
->Stencil
.Ref
;
3091 case GL_STENCIL_TEST
:
3092 *params
= (GLfloat
) ctx
->Stencil
.Enabled
;
3094 case GL_STENCIL_VALUE_MASK
:
3095 *params
= (GLfloat
) ctx
->Stencil
.ValueMask
;
3097 case GL_STENCIL_WRITEMASK
:
3098 *params
= (GLfloat
) ctx
->Stencil
.WriteMask
;
3101 *params
= (GLfloat
) ctx
->Visual
->StereoFlag
;
3103 case GL_SUBPIXEL_BITS
:
3104 *params
= (GLfloat
) ctx
->Const
.SubPixelBits
;
3107 *params
= _mesa_IsEnabled(GL_TEXTURE_1D
) ? 1.0 : 0.0;
3110 *params
= _mesa_IsEnabled(GL_TEXTURE_2D
) ? 1.0 : 0.0;
3113 *params
= _mesa_IsEnabled(GL_TEXTURE_3D
) ? 1.0 : 0.0;
3115 case GL_TEXTURE_BINDING_1D
:
3116 *params
= (GLfloat
) textureUnit
->CurrentD
[1]->Name
;
3118 case GL_TEXTURE_BINDING_2D
:
3119 *params
= (GLfloat
) textureUnit
->CurrentD
[2]->Name
;
3121 case GL_TEXTURE_BINDING_3D
:
3122 *params
= (GLfloat
) textureUnit
->CurrentD
[2]->Name
;
3124 case GL_TEXTURE_ENV_COLOR
:
3125 params
[0] = textureUnit
->EnvColor
[0];
3126 params
[1] = textureUnit
->EnvColor
[1];
3127 params
[2] = textureUnit
->EnvColor
[2];
3128 params
[3] = textureUnit
->EnvColor
[3];
3130 case GL_TEXTURE_ENV_MODE
:
3131 *params
= ENUM_TO_FLOAT(textureUnit
->EnvMode
);
3133 case GL_TEXTURE_GEN_S
:
3134 *params
= (textureUnit
->TexGenEnabled
& S_BIT
) ? 1.0 : 0.0;
3136 case GL_TEXTURE_GEN_T
:
3137 *params
= (textureUnit
->TexGenEnabled
& T_BIT
) ? 1.0 : 0.0;
3139 case GL_TEXTURE_GEN_R
:
3140 *params
= (textureUnit
->TexGenEnabled
& R_BIT
) ? 1.0 : 0.0;
3142 case GL_TEXTURE_GEN_Q
:
3143 *params
= (textureUnit
->TexGenEnabled
& Q_BIT
) ? 1.0 : 0.0;
3145 case GL_TEXTURE_MATRIX
:
3146 for (i
=0;i
<16;i
++) {
3147 params
[i
] = ctx
->TextureMatrix
[texTransformUnit
].m
[i
];
3150 case GL_TEXTURE_STACK_DEPTH
:
3151 *params
= (GLfloat
) (ctx
->TextureStackDepth
[texTransformUnit
] + 1);
3153 case GL_UNPACK_ALIGNMENT
:
3154 *params
= (GLfloat
) ctx
->Unpack
.Alignment
;
3156 case GL_UNPACK_LSB_FIRST
:
3157 *params
= (GLfloat
) ctx
->Unpack
.LsbFirst
;
3159 case GL_UNPACK_ROW_LENGTH
:
3160 *params
= (GLfloat
) ctx
->Unpack
.RowLength
;
3162 case GL_UNPACK_SKIP_PIXELS
:
3163 *params
= (GLfloat
) ctx
->Unpack
.SkipPixels
;
3165 case GL_UNPACK_SKIP_ROWS
:
3166 *params
= (GLfloat
) ctx
->Unpack
.SkipRows
;
3168 case GL_UNPACK_SWAP_BYTES
:
3169 *params
= (GLfloat
) ctx
->Unpack
.SwapBytes
;
3171 case GL_UNPACK_SKIP_IMAGES_EXT
:
3172 *params
= (GLfloat
) ctx
->Unpack
.SkipImages
;
3174 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
3175 *params
= (GLfloat
) ctx
->Unpack
.ImageHeight
;
3178 params
[0] = (GLfloat
) ctx
->Viewport
.X
;
3179 params
[1] = (GLfloat
) ctx
->Viewport
.Y
;
3180 params
[2] = (GLfloat
) ctx
->Viewport
.Width
;
3181 params
[3] = (GLfloat
) ctx
->Viewport
.Height
;
3184 *params
= (GLfloat
) ctx
->Pixel
.ZoomX
;
3187 *params
= (GLfloat
) ctx
->Pixel
.ZoomY
;
3189 case GL_VERTEX_ARRAY
:
3190 *params
= (GLfloat
) ctx
->Array
.Vertex
.Enabled
;
3192 case GL_VERTEX_ARRAY_SIZE
:
3193 *params
= (GLfloat
) ctx
->Array
.Vertex
.Size
;
3195 case GL_VERTEX_ARRAY_TYPE
:
3196 *params
= ENUM_TO_FLOAT(ctx
->Array
.Vertex
.Type
);
3198 case GL_VERTEX_ARRAY_STRIDE
:
3199 *params
= (GLfloat
) ctx
->Array
.Vertex
.Stride
;
3201 case GL_VERTEX_ARRAY_COUNT_EXT
:
3204 case GL_NORMAL_ARRAY
:
3205 *params
= (GLfloat
) ctx
->Array
.Normal
.Enabled
;
3207 case GL_NORMAL_ARRAY_TYPE
:
3208 *params
= ENUM_TO_FLOAT(ctx
->Array
.Normal
.Type
);
3210 case GL_NORMAL_ARRAY_STRIDE
:
3211 *params
= (GLfloat
) ctx
->Array
.Normal
.Stride
;
3213 case GL_NORMAL_ARRAY_COUNT_EXT
:
3216 case GL_COLOR_ARRAY
:
3217 *params
= (GLfloat
) ctx
->Array
.Color
.Enabled
;
3219 case GL_COLOR_ARRAY_SIZE
:
3220 *params
= (GLfloat
) ctx
->Array
.Color
.Size
;
3222 case GL_COLOR_ARRAY_TYPE
:
3223 *params
= ENUM_TO_FLOAT(ctx
->Array
.Color
.Type
);
3225 case GL_COLOR_ARRAY_STRIDE
:
3226 *params
= (GLfloat
) ctx
->Array
.Color
.Stride
;
3228 case GL_COLOR_ARRAY_COUNT_EXT
:
3231 case GL_INDEX_ARRAY
:
3232 *params
= (GLfloat
) ctx
->Array
.Index
.Enabled
;
3234 case GL_INDEX_ARRAY_TYPE
:
3235 *params
= ENUM_TO_FLOAT(ctx
->Array
.Index
.Type
);
3237 case GL_INDEX_ARRAY_STRIDE
:
3238 *params
= (GLfloat
) ctx
->Array
.Index
.Stride
;
3240 case GL_INDEX_ARRAY_COUNT_EXT
:
3243 case GL_TEXTURE_COORD_ARRAY
:
3244 *params
= (GLfloat
) ctx
->Array
.TexCoord
[texUnit
].Enabled
;
3246 case GL_TEXTURE_COORD_ARRAY_SIZE
:
3247 *params
= (GLfloat
) ctx
->Array
.TexCoord
[texUnit
].Size
;
3249 case GL_TEXTURE_COORD_ARRAY_TYPE
:
3250 *params
= ENUM_TO_FLOAT(ctx
->Array
.TexCoord
[texUnit
].Type
);
3252 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
3253 *params
= (GLfloat
) ctx
->Array
.TexCoord
[texUnit
].Stride
;
3255 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
3258 case GL_EDGE_FLAG_ARRAY
:
3259 *params
= (GLfloat
) ctx
->Array
.EdgeFlag
.Enabled
;
3261 case GL_EDGE_FLAG_ARRAY_STRIDE
:
3262 *params
= (GLfloat
) ctx
->Array
.EdgeFlag
.Stride
;
3264 case GL_EDGE_FLAG_ARRAY_COUNT_EXT
:
3268 /* GL_ARB_multitexture */
3269 case GL_MAX_TEXTURE_UNITS_ARB
:
3270 *params
= (GLfloat
) ctx
->Const
.MaxTextureUnits
;
3272 case GL_ACTIVE_TEXTURE_ARB
:
3273 *params
= (GLfloat
) (GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
);
3275 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
3276 *params
= (GLfloat
) (GL_TEXTURE0_ARB
+ ctx
->Array
.ActiveTexture
);
3279 /* GL_ARB_texture_cube_map */
3280 case GL_TEXTURE_CUBE_MAP_ARB
:
3281 if (ctx
->Extensions
.HaveTextureCubeMap
)
3282 *params
= (GLfloat
) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
);
3284 gl_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3286 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
3287 if (ctx
->Extensions
.HaveTextureCubeMap
)
3288 *params
= (GLfloat
) textureUnit
->CurrentCubeMap
->Name
;
3290 gl_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3292 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
3293 if (ctx
->Extensions
.HaveTextureCubeMap
)
3294 *params
= (GLfloat
) ctx
->Const
.MaxCubeTextureSize
;
3296 gl_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3299 /* GL_ARB_texture_compression */
3300 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
3301 if (ctx
->Extensions
.HaveTextureCompression
) {
3302 *params
= (GLfloat
) ctx
->Hint
.TextureCompression
;
3305 gl_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3307 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
3308 if (ctx
->Extensions
.HaveTextureCompression
) {
3309 *params
= (GLfloat
) ctx
->Const
.NumCompressedTextureFormats
;
3312 gl_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3314 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
3315 if (ctx
->Extensions
.HaveTextureCompression
) {
3317 for (i
= 0; i
< ctx
->Const
.NumCompressedTextureFormats
; i
++)
3318 params
[i
] = (GLfloat
) ctx
->Const
.CompressedTextureFormats
[i
];
3321 gl_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3324 /* GL_PGI_misc_hints */
3325 case GL_STRICT_DEPTHFUNC_HINT_PGI
:
3326 *params
= ENUM_TO_FLOAT(GL_NICEST
);
3328 case GL_STRICT_LIGHTING_HINT_PGI
:
3329 *params
= ENUM_TO_FLOAT(ctx
->Hint
.StrictLighting
);
3331 case GL_STRICT_SCISSOR_HINT_PGI
:
3332 case GL_FULL_STIPPLE_HINT_PGI
:
3333 *params
= ENUM_TO_FLOAT(GL_TRUE
);
3335 case GL_CONSERVE_MEMORY_HINT_PGI
:
3336 *params
= ENUM_TO_FLOAT(GL_FALSE
);
3338 case GL_ALWAYS_FAST_HINT_PGI
:
3339 *params
= (GLfloat
) (ctx
->Hint
.AllowDrawWin
== GL_TRUE
&&
3340 ctx
->Hint
.AllowDrawFrg
== GL_FALSE
&&
3341 ctx
->Hint
.AllowDrawMem
== GL_FALSE
);
3343 case GL_ALWAYS_SOFT_HINT_PGI
:
3344 *params
= (GLfloat
) (ctx
->Hint
.AllowDrawWin
== GL_TRUE
&&
3345 ctx
->Hint
.AllowDrawFrg
== GL_TRUE
&&
3346 ctx
->Hint
.AllowDrawMem
== GL_TRUE
);
3348 case GL_ALLOW_DRAW_OBJ_HINT_PGI
:
3349 *params
= (GLfloat
) GL_TRUE
;
3351 case GL_ALLOW_DRAW_WIN_HINT_PGI
:
3352 *params
= (GLfloat
) ctx
->Hint
.AllowDrawWin
;
3354 case GL_ALLOW_DRAW_FRG_HINT_PGI
:
3355 *params
= (GLfloat
) ctx
->Hint
.AllowDrawFrg
;
3357 case GL_ALLOW_DRAW_MEM_HINT_PGI
:
3358 *params
= (GLfloat
) ctx
->Hint
.AllowDrawMem
;
3360 case GL_CLIP_NEAR_HINT_PGI
:
3361 case GL_CLIP_FAR_HINT_PGI
:
3362 *params
= ENUM_TO_FLOAT(GL_TRUE
);
3364 case GL_WIDE_LINE_HINT_PGI
:
3365 *params
= ENUM_TO_FLOAT(GL_DONT_CARE
);
3367 case GL_BACK_NORMALS_HINT_PGI
:
3368 *params
= ENUM_TO_FLOAT(GL_TRUE
);
3370 case GL_NATIVE_GRAPHICS_HANDLE_PGI
:
3374 /* GL_EXT_compiled_vertex_array */
3375 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
3376 *params
= (GLfloat
) ctx
->Array
.LockFirst
;
3378 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
3379 *params
= (GLfloat
) ctx
->Array
.LockCount
;
3382 /* GL_ARB_transpose_matrix */
3383 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
3384 gl_matrix_transposef(params
, ctx
->ColorMatrix
.m
);
3386 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
3387 gl_matrix_transposef(params
, ctx
->ModelView
.m
);
3389 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
3390 gl_matrix_transposef(params
, ctx
->ProjectionMatrix
.m
);
3392 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
3393 gl_matrix_transposef(params
, ctx
->TextureMatrix
[texTransformUnit
].m
);
3396 /* GL_HP_occlusion_test */
3397 case GL_OCCLUSION_TEST_HP
:
3398 if (ctx
->Extensions
.HaveHpOcclusionTest
) {
3399 *params
= (GLfloat
) ctx
->Depth
.OcclusionTest
;
3402 gl_error( ctx
, GL_INVALID_ENUM
, "glGetFloatv" );
3405 case GL_OCCLUSION_TEST_RESULT_HP
:
3406 if (ctx
->Extensions
.HaveHpOcclusionTest
) {
3407 if (ctx
->Depth
.OcclusionTest
)
3408 *params
= (GLfloat
) ctx
->OcclusionResult
;
3410 *params
= (GLfloat
) ctx
->OcclusionResultSaved
;
3411 /* reset flag now */
3412 ctx
->OcclusionResult
= GL_FALSE
;
3413 ctx
->OcclusionResultSaved
= GL_FALSE
;
3416 gl_error( ctx
, GL_INVALID_ENUM
, "glGetFloatv" );
3420 /* GL_SGIS_pixel_texture */
3421 case GL_PIXEL_TEXTURE_SGIS
:
3422 *params
= (GLfloat
) ctx
->Pixel
.PixelTextureEnabled
;
3425 /* GL_SGIX_pixel_texture */
3426 case GL_PIXEL_TEX_GEN_SGIX
:
3427 *params
= (GLfloat
) ctx
->Pixel
.PixelTextureEnabled
;
3429 case GL_PIXEL_TEX_GEN_MODE_SGIX
:
3430 *params
= (GLfloat
) pixel_texgen_mode(ctx
);
3433 /* GL_SGI_color_matrix (also in 1.2 imaging) */
3434 case GL_COLOR_MATRIX_SGI
:
3435 for (i
=0;i
<16;i
++) {
3436 params
[i
] = ctx
->ColorMatrix
.m
[i
];
3439 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
3440 *params
= (GLfloat
) (ctx
->ColorStackDepth
+ 1);
3442 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
3443 *params
= (GLfloat
) MAX_COLOR_STACK_DEPTH
;
3445 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
3446 *params
= ctx
->Pixel
.PostColorMatrixScale
[0];
3448 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
3449 *params
= ctx
->Pixel
.PostColorMatrixScale
[1];
3451 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
3452 *params
= ctx
->Pixel
.PostColorMatrixScale
[2];
3454 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
3455 *params
= ctx
->Pixel
.PostColorMatrixScale
[3];
3457 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
3458 *params
= ctx
->Pixel
.PostColorMatrixBias
[0];
3460 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
3461 *params
= ctx
->Pixel
.PostColorMatrixBias
[1];
3463 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
3464 *params
= ctx
->Pixel
.PostColorMatrixBias
[2];
3466 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
3467 *params
= ctx
->Pixel
.PostColorMatrixBias
[3];
3470 /* GL_EXT_convolution (also in 1.2 imaging) */
3471 case GL_MAX_CONVOLUTION_WIDTH
:
3472 *params
= (GLfloat
) ctx
->Const
.MaxConvolutionWidth
;
3474 case GL_MAX_CONVOLUTION_HEIGHT
:
3475 *params
= (GLfloat
) ctx
->Const
.MaxConvolutionHeight
;
3477 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
3478 *params
= ctx
->Pixel
.PostConvolutionScale
[0];
3480 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
3481 *params
= ctx
->Pixel
.PostConvolutionScale
[1];
3483 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
3484 *params
= ctx
->Pixel
.PostConvolutionScale
[2];
3486 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
3487 *params
= ctx
->Pixel
.PostConvolutionScale
[3];
3489 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
3490 *params
= ctx
->Pixel
.PostConvolutionBias
[0];
3492 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
3493 *params
= ctx
->Pixel
.PostConvolutionBias
[1];
3495 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
3496 *params
= ctx
->Pixel
.PostConvolutionBias
[2];
3498 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
3499 *params
= ctx
->Pixel
.PostConvolutionBias
[2];
3502 /* GL_SGI_color_table (also in 1.2 imaging */
3503 case GL_COLOR_TABLE_SGI
:
3504 *params
= (GLfloat
) ctx
->Pixel
.ColorTableEnabled
;
3506 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
3507 *params
= (GLfloat
) ctx
->Pixel
.PostConvolutionColorTableEnabled
;
3509 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
3510 *params
= (GLfloat
) ctx
->Pixel
.PostColorMatrixColorTableEnabled
;
3514 gl_error( ctx
, GL_INVALID_ENUM
, "glGetFloatv" );
3522 _mesa_GetIntegerv( GLenum pname
, GLint
*params
)
3524 GET_CURRENT_CONTEXT(ctx
);
3526 GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
3527 GLuint texTransformUnit
= ctx
->Texture
.CurrentTransformUnit
;
3528 const struct gl_texture_unit
*textureUnit
= &ctx
->Texture
.Unit
[texUnit
];
3530 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
, "glGetIntegerv");
3535 if (MESA_VERBOSE
& VERBOSE_API
)
3536 fprintf(stderr
, "glGetIntegerv %s\n", gl_lookup_enum_by_nr(pname
));
3538 if (ctx
->Driver
.GetIntegerv
3539 && (*ctx
->Driver
.GetIntegerv
)(ctx
, pname
, params
))
3543 case GL_ACCUM_RED_BITS
:
3544 *params
= (GLint
) ctx
->Visual
->AccumRedBits
;
3546 case GL_ACCUM_GREEN_BITS
:
3547 *params
= (GLint
) ctx
->Visual
->AccumGreenBits
;
3549 case GL_ACCUM_BLUE_BITS
:
3550 *params
= (GLint
) ctx
->Visual
->AccumBlueBits
;
3552 case GL_ACCUM_ALPHA_BITS
:
3553 *params
= (GLint
) ctx
->Visual
->AccumAlphaBits
;
3555 case GL_ACCUM_CLEAR_VALUE
:
3556 params
[0] = FLOAT_TO_INT( ctx
->Accum
.ClearColor
[0] );
3557 params
[1] = FLOAT_TO_INT( ctx
->Accum
.ClearColor
[1] );
3558 params
[2] = FLOAT_TO_INT( ctx
->Accum
.ClearColor
[2] );
3559 params
[3] = FLOAT_TO_INT( ctx
->Accum
.ClearColor
[3] );
3562 *params
= (GLint
) ctx
->Pixel
.AlphaBias
;
3565 *params
= ctx
->Visual
->AlphaBits
;
3567 case GL_ALPHA_SCALE
:
3568 *params
= (GLint
) ctx
->Pixel
.AlphaScale
;
3571 *params
= (GLint
) ctx
->Color
.AlphaEnabled
;
3573 case GL_ALPHA_TEST_REF
:
3574 *params
= FLOAT_TO_INT( (GLfloat
) ctx
->Color
.AlphaRef
/ 255.0 );
3576 case GL_ALPHA_TEST_FUNC
:
3577 *params
= (GLint
) ctx
->Color
.AlphaFunc
;
3579 case GL_ATTRIB_STACK_DEPTH
:
3580 *params
= (GLint
) (ctx
->AttribStackDepth
);
3582 case GL_AUTO_NORMAL
:
3583 *params
= (GLint
) ctx
->Eval
.AutoNormal
;
3585 case GL_AUX_BUFFERS
:
3586 *params
= (GLint
) ctx
->Const
.NumAuxBuffers
;
3589 *params
= (GLint
) ctx
->Color
.BlendEnabled
;
3592 *params
= (GLint
) ctx
->Color
.BlendDstRGB
;
3595 *params
= (GLint
) ctx
->Color
.BlendSrcRGB
;
3597 case GL_BLEND_SRC_RGB_EXT
:
3598 *params
= (GLint
) ctx
->Color
.BlendSrcRGB
;
3600 case GL_BLEND_DST_RGB_EXT
:
3601 *params
= (GLint
) ctx
->Color
.BlendDstRGB
;
3603 case GL_BLEND_SRC_ALPHA_EXT
:
3604 *params
= (GLint
) ctx
->Color
.BlendSrcA
;
3606 case GL_BLEND_DST_ALPHA_EXT
:
3607 *params
= (GLint
) ctx
->Color
.BlendDstA
;
3609 case GL_BLEND_EQUATION_EXT
:
3610 *params
= (GLint
) ctx
->Color
.BlendEquation
;
3612 case GL_BLEND_COLOR_EXT
:
3613 params
[0] = FLOAT_TO_INT( ctx
->Color
.BlendColor
[0] );
3614 params
[1] = FLOAT_TO_INT( ctx
->Color
.BlendColor
[1] );
3615 params
[2] = FLOAT_TO_INT( ctx
->Color
.BlendColor
[2] );
3616 params
[3] = FLOAT_TO_INT( ctx
->Color
.BlendColor
[3] );
3619 *params
= (GLint
) ctx
->Pixel
.BlueBias
;
3622 *params
= (GLint
) ctx
->Visual
->BlueBits
;
3625 *params
= (GLint
) ctx
->Pixel
.BlueScale
;
3627 case GL_CLIENT_ATTRIB_STACK_DEPTH
:
3628 *params
= (GLint
) (ctx
->ClientAttribStackDepth
);
3630 case GL_CLIP_PLANE0
:
3631 case GL_CLIP_PLANE1
:
3632 case GL_CLIP_PLANE2
:
3633 case GL_CLIP_PLANE3
:
3634 case GL_CLIP_PLANE4
:
3635 case GL_CLIP_PLANE5
:
3636 i
= (GLint
) (pname
- GL_CLIP_PLANE0
);
3637 *params
= (GLint
) ctx
->Transform
.ClipEnabled
[i
];
3639 case GL_COLOR_CLEAR_VALUE
:
3640 params
[0] = FLOAT_TO_INT( ctx
->Color
.ClearColor
[0] );
3641 params
[1] = FLOAT_TO_INT( ctx
->Color
.ClearColor
[1] );
3642 params
[2] = FLOAT_TO_INT( ctx
->Color
.ClearColor
[2] );
3643 params
[3] = FLOAT_TO_INT( ctx
->Color
.ClearColor
[3] );
3645 case GL_COLOR_MATERIAL
:
3646 *params
= (GLint
) ctx
->Light
.ColorMaterialEnabled
;
3648 case GL_COLOR_MATERIAL_FACE
:
3649 *params
= (GLint
) ctx
->Light
.ColorMaterialFace
;
3651 case GL_COLOR_MATERIAL_PARAMETER
:
3652 *params
= (GLint
) ctx
->Light
.ColorMaterialMode
;
3654 case GL_COLOR_WRITEMASK
:
3655 params
[0] = ctx
->Color
.ColorMask
[RCOMP
] ? 1 : 0;
3656 params
[1] = ctx
->Color
.ColorMask
[GCOMP
] ? 1 : 0;
3657 params
[2] = ctx
->Color
.ColorMask
[BCOMP
] ? 1 : 0;
3658 params
[3] = ctx
->Color
.ColorMask
[ACOMP
] ? 1 : 0;
3661 *params
= (GLint
) ctx
->Polygon
.CullFlag
;
3663 case GL_CULL_FACE_MODE
:
3664 *params
= (GLint
) ctx
->Polygon
.CullFaceMode
;
3666 case GL_CURRENT_COLOR
:
3667 params
[0] = FLOAT_TO_INT( UBYTE_COLOR_TO_FLOAT_COLOR( ctx
->Current
.ByteColor
[0] ) );
3668 params
[1] = FLOAT_TO_INT( UBYTE_COLOR_TO_FLOAT_COLOR( ctx
->Current
.ByteColor
[1] ) );
3669 params
[2] = FLOAT_TO_INT( UBYTE_COLOR_TO_FLOAT_COLOR( ctx
->Current
.ByteColor
[2] ) );
3670 params
[3] = FLOAT_TO_INT( UBYTE_COLOR_TO_FLOAT_COLOR( ctx
->Current
.ByteColor
[3] ) );
3672 case GL_CURRENT_INDEX
:
3673 *params
= (GLint
) ctx
->Current
.Index
;
3675 case GL_CURRENT_NORMAL
:
3676 params
[0] = FLOAT_TO_INT( ctx
->Current
.Normal
[0] );
3677 params
[1] = FLOAT_TO_INT( ctx
->Current
.Normal
[1] );
3678 params
[2] = FLOAT_TO_INT( ctx
->Current
.Normal
[2] );
3680 case GL_CURRENT_RASTER_COLOR
:
3681 params
[0] = FLOAT_TO_INT( ctx
->Current
.RasterColor
[0] );
3682 params
[1] = FLOAT_TO_INT( ctx
->Current
.RasterColor
[1] );
3683 params
[2] = FLOAT_TO_INT( ctx
->Current
.RasterColor
[2] );
3684 params
[3] = FLOAT_TO_INT( ctx
->Current
.RasterColor
[3] );
3686 case GL_CURRENT_RASTER_DISTANCE
:
3687 params
[0] = (GLint
) ctx
->Current
.RasterDistance
;
3689 case GL_CURRENT_RASTER_INDEX
:
3690 *params
= (GLint
) ctx
->Current
.RasterIndex
;
3692 case GL_CURRENT_RASTER_POSITION
:
3693 params
[0] = (GLint
) ctx
->Current
.RasterPos
[0];
3694 params
[1] = (GLint
) ctx
->Current
.RasterPos
[1];
3695 params
[2] = (GLint
) ctx
->Current
.RasterPos
[2];
3696 params
[3] = (GLint
) ctx
->Current
.RasterPos
[3];
3698 case GL_CURRENT_RASTER_TEXTURE_COORDS
:
3699 params
[0] = (GLint
) ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][0];
3700 params
[1] = (GLint
) ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][1];
3701 params
[2] = (GLint
) ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][2];
3702 params
[3] = (GLint
) ctx
->Current
.RasterMultiTexCoord
[texTransformUnit
][3];
3704 case GL_CURRENT_RASTER_POSITION_VALID
:
3705 *params
= (GLint
) ctx
->Current
.RasterPosValid
;
3707 case GL_CURRENT_TEXTURE_COORDS
:
3708 params
[0] = (GLint
) ctx
->Current
.Texcoord
[texTransformUnit
][0];
3709 params
[1] = (GLint
) ctx
->Current
.Texcoord
[texTransformUnit
][1];
3710 params
[2] = (GLint
) ctx
->Current
.Texcoord
[texTransformUnit
][2];
3711 params
[3] = (GLint
) ctx
->Current
.Texcoord
[texTransformUnit
][3];
3714 *params
= (GLint
) ctx
->Pixel
.DepthBias
;
3717 *params
= ctx
->Visual
->DepthBits
;
3719 case GL_DEPTH_CLEAR_VALUE
:
3720 *params
= (GLint
) ctx
->Depth
.Clear
;
3723 *params
= (GLint
) ctx
->Depth
.Func
;
3725 case GL_DEPTH_RANGE
:
3726 params
[0] = (GLint
) ctx
->Viewport
.Near
;
3727 params
[1] = (GLint
) ctx
->Viewport
.Far
;
3729 case GL_DEPTH_SCALE
:
3730 *params
= (GLint
) ctx
->Pixel
.DepthScale
;
3733 *params
= (GLint
) ctx
->Depth
.Test
;
3735 case GL_DEPTH_WRITEMASK
:
3736 *params
= (GLint
) ctx
->Depth
.Mask
;
3739 *params
= (GLint
) ctx
->Color
.DitherFlag
;
3741 case GL_DOUBLEBUFFER
:
3742 *params
= (GLint
) ctx
->Visual
->DBflag
;
3744 case GL_DRAW_BUFFER
:
3745 *params
= (GLint
) ctx
->Color
.DrawBuffer
;
3748 *params
= (GLint
) ctx
->Current
.EdgeFlag
;
3750 case GL_FEEDBACK_BUFFER_SIZE
:
3751 *params
= ctx
->Feedback
.BufferSize
;
3753 case GL_FEEDBACK_BUFFER_TYPE
:
3754 *params
= ctx
->Feedback
.Type
;
3757 *params
= (GLint
) ctx
->Fog
.Enabled
;
3760 params
[0] = FLOAT_TO_INT( ctx
->Fog
.Color
[0] );
3761 params
[1] = FLOAT_TO_INT( ctx
->Fog
.Color
[1] );
3762 params
[2] = FLOAT_TO_INT( ctx
->Fog
.Color
[2] );
3763 params
[3] = FLOAT_TO_INT( ctx
->Fog
.Color
[3] );
3765 case GL_FOG_DENSITY
:
3766 *params
= (GLint
) ctx
->Fog
.Density
;
3769 *params
= (GLint
) ctx
->Fog
.End
;
3772 *params
= (GLint
) ctx
->Hint
.Fog
;
3775 *params
= (GLint
) ctx
->Fog
.Index
;
3778 *params
= (GLint
) ctx
->Fog
.Mode
;
3781 *params
= (GLint
) ctx
->Fog
.Start
;
3784 *params
= (GLint
) ctx
->Polygon
.FrontFace
;
3787 *params
= (GLint
) ctx
->Pixel
.GreenBias
;
3790 *params
= (GLint
) ctx
->Visual
->GreenBits
;
3792 case GL_GREEN_SCALE
:
3793 *params
= (GLint
) ctx
->Pixel
.GreenScale
;
3796 if (ctx
->Extensions
.HaveHistogram
) {
3797 *params
= (GLint
) ctx
->Pixel
.HistogramEnabled
;
3800 gl_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3805 *params
= (GLint
) ctx
->Visual
->IndexBits
;
3807 case GL_INDEX_CLEAR_VALUE
:
3808 *params
= (GLint
) ctx
->Color
.ClearIndex
;
3811 *params
= ctx
->Visual
->RGBAflag
? 0 : 1;
3813 case GL_INDEX_OFFSET
:
3814 *params
= ctx
->Pixel
.IndexOffset
;
3816 case GL_INDEX_SHIFT
:
3817 *params
= ctx
->Pixel
.IndexShift
;
3819 case GL_INDEX_WRITEMASK
:
3820 *params
= (GLint
) ctx
->Color
.IndexMask
;
3830 *params
= (GLint
) ctx
->Light
.Light
[pname
-GL_LIGHT0
].Enabled
;
3833 *params
= (GLint
) ctx
->Light
.Enabled
;
3835 case GL_LIGHT_MODEL_AMBIENT
:
3836 params
[0] = FLOAT_TO_INT( ctx
->Light
.Model
.Ambient
[0] );
3837 params
[1] = FLOAT_TO_INT( ctx
->Light
.Model
.Ambient
[1] );
3838 params
[2] = FLOAT_TO_INT( ctx
->Light
.Model
.Ambient
[2] );
3839 params
[3] = FLOAT_TO_INT( ctx
->Light
.Model
.Ambient
[3] );
3841 case GL_LIGHT_MODEL_COLOR_CONTROL
:
3842 params
[0] = (GLint
) ctx
->Light
.Model
.ColorControl
;
3844 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
3845 *params
= (GLint
) ctx
->Light
.Model
.LocalViewer
;
3847 case GL_LIGHT_MODEL_TWO_SIDE
:
3848 *params
= (GLint
) ctx
->Light
.Model
.TwoSide
;
3850 case GL_LINE_SMOOTH
:
3851 *params
= (GLint
) ctx
->Line
.SmoothFlag
;
3853 case GL_LINE_SMOOTH_HINT
:
3854 *params
= (GLint
) ctx
->Hint
.LineSmooth
;
3856 case GL_LINE_STIPPLE
:
3857 *params
= (GLint
) ctx
->Line
.StippleFlag
;
3859 case GL_LINE_STIPPLE_PATTERN
:
3860 *params
= (GLint
) ctx
->Line
.StipplePattern
;
3862 case GL_LINE_STIPPLE_REPEAT
:
3863 *params
= (GLint
) ctx
->Line
.StippleFactor
;
3866 *params
= (GLint
) ctx
->Line
.Width
;
3868 case GL_LINE_WIDTH_GRANULARITY
:
3869 *params
= (GLint
) ctx
->Const
.LineWidthGranularity
;
3871 case GL_LINE_WIDTH_RANGE
:
3872 params
[0] = (GLint
) ctx
->Const
.MinLineWidthAA
;
3873 params
[1] = (GLint
) ctx
->Const
.MaxLineWidthAA
;
3875 case GL_ALIASED_LINE_WIDTH_RANGE
:
3876 params
[0] = (GLint
) ctx
->Const
.MinLineWidth
;
3877 params
[1] = (GLint
) ctx
->Const
.MaxLineWidth
;
3880 *params
= (GLint
) ctx
->List
.ListBase
;
3883 *params
= (GLint
) ctx
->CurrentListNum
;
3886 *params
= ctx
->ExecuteFlag
? (GLint
) GL_COMPILE_AND_EXECUTE
3887 : (GLint
) GL_COMPILE
;
3889 case GL_INDEX_LOGIC_OP
:
3890 *params
= (GLint
) ctx
->Color
.IndexLogicOpEnabled
;
3892 case GL_COLOR_LOGIC_OP
:
3893 *params
= (GLint
) ctx
->Color
.ColorLogicOpEnabled
;
3895 case GL_LOGIC_OP_MODE
:
3896 *params
= (GLint
) ctx
->Color
.LogicOp
;
3898 case GL_MAP1_COLOR_4
:
3899 *params
= (GLint
) ctx
->Eval
.Map1Color4
;
3901 case GL_MAP1_GRID_DOMAIN
:
3902 params
[0] = (GLint
) ctx
->Eval
.MapGrid1u1
;
3903 params
[1] = (GLint
) ctx
->Eval
.MapGrid1u2
;
3905 case GL_MAP1_GRID_SEGMENTS
:
3906 *params
= (GLint
) ctx
->Eval
.MapGrid1un
;
3909 *params
= (GLint
) ctx
->Eval
.Map1Index
;
3911 case GL_MAP1_NORMAL
:
3912 *params
= (GLint
) ctx
->Eval
.Map1Normal
;
3914 case GL_MAP1_TEXTURE_COORD_1
:
3915 *params
= (GLint
) ctx
->Eval
.Map1TextureCoord1
;
3917 case GL_MAP1_TEXTURE_COORD_2
:
3918 *params
= (GLint
) ctx
->Eval
.Map1TextureCoord2
;
3920 case GL_MAP1_TEXTURE_COORD_3
:
3921 *params
= (GLint
) ctx
->Eval
.Map1TextureCoord3
;
3923 case GL_MAP1_TEXTURE_COORD_4
:
3924 *params
= (GLint
) ctx
->Eval
.Map1TextureCoord4
;
3926 case GL_MAP1_VERTEX_3
:
3927 *params
= (GLint
) ctx
->Eval
.Map1Vertex3
;
3929 case GL_MAP1_VERTEX_4
:
3930 *params
= (GLint
) ctx
->Eval
.Map1Vertex4
;
3932 case GL_MAP2_COLOR_4
:
3933 *params
= (GLint
) ctx
->Eval
.Map2Color4
;
3935 case GL_MAP2_GRID_DOMAIN
:
3936 params
[0] = (GLint
) ctx
->Eval
.MapGrid2u1
;
3937 params
[1] = (GLint
) ctx
->Eval
.MapGrid2u2
;
3938 params
[2] = (GLint
) ctx
->Eval
.MapGrid2v1
;
3939 params
[3] = (GLint
) ctx
->Eval
.MapGrid2v2
;
3941 case GL_MAP2_GRID_SEGMENTS
:
3942 params
[0] = (GLint
) ctx
->Eval
.MapGrid2un
;
3943 params
[1] = (GLint
) ctx
->Eval
.MapGrid2vn
;
3946 *params
= (GLint
) ctx
->Eval
.Map2Index
;
3948 case GL_MAP2_NORMAL
:
3949 *params
= (GLint
) ctx
->Eval
.Map2Normal
;
3951 case GL_MAP2_TEXTURE_COORD_1
:
3952 *params
= (GLint
) ctx
->Eval
.Map2TextureCoord1
;
3954 case GL_MAP2_TEXTURE_COORD_2
:
3955 *params
= (GLint
) ctx
->Eval
.Map2TextureCoord2
;
3957 case GL_MAP2_TEXTURE_COORD_3
:
3958 *params
= (GLint
) ctx
->Eval
.Map2TextureCoord3
;
3960 case GL_MAP2_TEXTURE_COORD_4
:
3961 *params
= (GLint
) ctx
->Eval
.Map2TextureCoord4
;
3963 case GL_MAP2_VERTEX_3
:
3964 *params
= (GLint
) ctx
->Eval
.Map2Vertex3
;
3966 case GL_MAP2_VERTEX_4
:
3967 *params
= (GLint
) ctx
->Eval
.Map2Vertex4
;
3970 *params
= (GLint
) ctx
->Pixel
.MapColorFlag
;
3972 case GL_MAP_STENCIL
:
3973 *params
= (GLint
) ctx
->Pixel
.MapStencilFlag
;
3975 case GL_MATRIX_MODE
:
3976 *params
= (GLint
) ctx
->Transform
.MatrixMode
;
3978 case GL_MAX_ATTRIB_STACK_DEPTH
:
3979 *params
= (GLint
) MAX_ATTRIB_STACK_DEPTH
;
3981 case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
:
3982 *params
= (GLint
) MAX_CLIENT_ATTRIB_STACK_DEPTH
;
3984 case GL_MAX_CLIP_PLANES
:
3985 *params
= (GLint
) MAX_CLIP_PLANES
;
3987 case GL_MAX_ELEMENTS_VERTICES
: /* GL_VERSION_1_2 */
3990 case GL_MAX_ELEMENTS_INDICES
: /* GL_VERSION_1_2 */
3993 case GL_MAX_EVAL_ORDER
:
3994 *params
= (GLint
) MAX_EVAL_ORDER
;
3997 *params
= (GLint
) MAX_LIGHTS
;
3999 case GL_MAX_LIST_NESTING
:
4000 *params
= (GLint
) MAX_LIST_NESTING
;
4002 case GL_MAX_MODELVIEW_STACK_DEPTH
:
4003 *params
= (GLint
) MAX_MODELVIEW_STACK_DEPTH
;
4005 case GL_MAX_NAME_STACK_DEPTH
:
4006 *params
= (GLint
) MAX_NAME_STACK_DEPTH
;
4008 case GL_MAX_PIXEL_MAP_TABLE
:
4009 *params
= (GLint
) MAX_PIXEL_MAP_TABLE
;
4011 case GL_MAX_PROJECTION_STACK_DEPTH
:
4012 *params
= (GLint
) MAX_PROJECTION_STACK_DEPTH
;
4014 case GL_MAX_TEXTURE_SIZE
:
4015 case GL_MAX_3D_TEXTURE_SIZE
:
4016 *params
= ctx
->Const
.MaxTextureSize
;
4018 case GL_MAX_TEXTURE_STACK_DEPTH
:
4019 *params
= (GLint
) MAX_TEXTURE_STACK_DEPTH
;
4021 case GL_MAX_VIEWPORT_DIMS
:
4022 params
[0] = (GLint
) MAX_WIDTH
;
4023 params
[1] = (GLint
) MAX_HEIGHT
;
4026 *params
= (GLint
) ctx
->Pixel
.MinMaxEnabled
;
4028 case GL_MODELVIEW_MATRIX
:
4029 for (i
=0;i
<16;i
++) {
4030 params
[i
] = (GLint
) ctx
->ModelView
.m
[i
];
4033 case GL_MODELVIEW_STACK_DEPTH
:
4034 *params
= (GLint
) (ctx
->ModelViewStackDepth
+ 1);
4036 case GL_NAME_STACK_DEPTH
:
4037 *params
= (GLint
) ctx
->Select
.NameStackDepth
;
4040 *params
= (GLint
) ctx
->Transform
.Normalize
;
4042 case GL_PACK_ALIGNMENT
:
4043 *params
= ctx
->Pack
.Alignment
;
4045 case GL_PACK_LSB_FIRST
:
4046 *params
= (GLint
) ctx
->Pack
.LsbFirst
;
4048 case GL_PACK_ROW_LENGTH
:
4049 *params
= ctx
->Pack
.RowLength
;
4051 case GL_PACK_SKIP_PIXELS
:
4052 *params
= ctx
->Pack
.SkipPixels
;
4054 case GL_PACK_SKIP_ROWS
:
4055 *params
= ctx
->Pack
.SkipRows
;
4057 case GL_PACK_SWAP_BYTES
:
4058 *params
= (GLint
) ctx
->Pack
.SwapBytes
;
4060 case GL_PACK_SKIP_IMAGES_EXT
:
4061 *params
= ctx
->Pack
.SkipImages
;
4063 case GL_PACK_IMAGE_HEIGHT_EXT
:
4064 *params
= ctx
->Pack
.ImageHeight
;
4066 case GL_PERSPECTIVE_CORRECTION_HINT
:
4067 *params
= (GLint
) ctx
->Hint
.PerspectiveCorrection
;
4069 case GL_PIXEL_MAP_A_TO_A_SIZE
:
4070 *params
= ctx
->Pixel
.MapAtoAsize
;
4072 case GL_PIXEL_MAP_B_TO_B_SIZE
:
4073 *params
= ctx
->Pixel
.MapBtoBsize
;
4075 case GL_PIXEL_MAP_G_TO_G_SIZE
:
4076 *params
= ctx
->Pixel
.MapGtoGsize
;
4078 case GL_PIXEL_MAP_I_TO_A_SIZE
:
4079 *params
= ctx
->Pixel
.MapItoAsize
;
4081 case GL_PIXEL_MAP_I_TO_B_SIZE
:
4082 *params
= ctx
->Pixel
.MapItoBsize
;
4084 case GL_PIXEL_MAP_I_TO_G_SIZE
:
4085 *params
= ctx
->Pixel
.MapItoGsize
;
4087 case GL_PIXEL_MAP_I_TO_I_SIZE
:
4088 *params
= ctx
->Pixel
.MapItoIsize
;
4090 case GL_PIXEL_MAP_I_TO_R_SIZE
:
4091 *params
= ctx
->Pixel
.MapItoRsize
;
4093 case GL_PIXEL_MAP_R_TO_R_SIZE
:
4094 *params
= ctx
->Pixel
.MapRtoRsize
;
4096 case GL_PIXEL_MAP_S_TO_S_SIZE
:
4097 *params
= ctx
->Pixel
.MapStoSsize
;
4100 *params
= (GLint
) ctx
->Point
.UserSize
;
4102 case GL_POINT_SIZE_GRANULARITY
:
4103 *params
= (GLint
) ctx
->Const
.PointSizeGranularity
;
4105 case GL_POINT_SIZE_RANGE
:
4106 params
[0] = (GLint
) ctx
->Const
.MinPointSizeAA
;
4107 params
[1] = (GLint
) ctx
->Const
.MaxPointSizeAA
;
4109 case GL_ALIASED_POINT_SIZE_RANGE
:
4110 params
[0] = (GLint
) ctx
->Const
.MinPointSize
;
4111 params
[1] = (GLint
) ctx
->Const
.MaxPointSize
;
4113 case GL_POINT_SMOOTH
:
4114 *params
= (GLint
) ctx
->Point
.SmoothFlag
;
4116 case GL_POINT_SMOOTH_HINT
:
4117 *params
= (GLint
) ctx
->Hint
.PointSmooth
;
4119 case GL_POINT_SIZE_MIN_EXT
:
4120 *params
= (GLint
) (ctx
->Point
.MinSize
);
4122 case GL_POINT_SIZE_MAX_EXT
:
4123 *params
= (GLint
) (ctx
->Point
.MaxSize
);
4125 case GL_POINT_FADE_THRESHOLD_SIZE_EXT
:
4126 *params
= (GLint
) (ctx
->Point
.Threshold
);
4128 case GL_DISTANCE_ATTENUATION_EXT
:
4129 params
[0] = (GLint
) (ctx
->Point
.Params
[0]);
4130 params
[1] = (GLint
) (ctx
->Point
.Params
[1]);
4131 params
[2] = (GLint
) (ctx
->Point
.Params
[2]);
4133 case GL_POLYGON_MODE
:
4134 params
[0] = (GLint
) ctx
->Polygon
.FrontMode
;
4135 params
[1] = (GLint
) ctx
->Polygon
.BackMode
;
4137 case GL_POLYGON_OFFSET_BIAS_EXT
: /* GL_EXT_polygon_offset */
4138 *params
= (GLint
) ctx
->Polygon
.OffsetUnits
;
4140 case GL_POLYGON_OFFSET_FACTOR
:
4141 *params
= (GLint
) ctx
->Polygon
.OffsetFactor
;
4143 case GL_POLYGON_OFFSET_UNITS
:
4144 *params
= (GLint
) ctx
->Polygon
.OffsetUnits
;
4146 case GL_POLYGON_SMOOTH
:
4147 *params
= (GLint
) ctx
->Polygon
.SmoothFlag
;
4149 case GL_POLYGON_SMOOTH_HINT
:
4150 *params
= (GLint
) ctx
->Hint
.PolygonSmooth
;
4152 case GL_POLYGON_STIPPLE
:
4153 *params
= (GLint
) ctx
->Polygon
.StippleFlag
;
4155 case GL_PROJECTION_MATRIX
:
4156 for (i
=0;i
<16;i
++) {
4157 params
[i
] = (GLint
) ctx
->ProjectionMatrix
.m
[i
];
4160 case GL_PROJECTION_STACK_DEPTH
:
4161 *params
= (GLint
) (ctx
->ProjectionStackDepth
+ 1);
4163 case GL_READ_BUFFER
:
4164 *params
= (GLint
) ctx
->Pixel
.ReadBuffer
;
4167 *params
= (GLint
) ctx
->Pixel
.RedBias
;
4170 *params
= (GLint
) ctx
->Visual
->RedBits
;
4173 *params
= (GLint
) ctx
->Pixel
.RedScale
;
4175 case GL_RENDER_MODE
:
4176 *params
= (GLint
) ctx
->RenderMode
;
4179 *params
= (GLint
) ctx
->Visual
->RGBAflag
;
4181 case GL_SCISSOR_BOX
:
4182 params
[0] = (GLint
) ctx
->Scissor
.X
;
4183 params
[1] = (GLint
) ctx
->Scissor
.Y
;
4184 params
[2] = (GLint
) ctx
->Scissor
.Width
;
4185 params
[3] = (GLint
) ctx
->Scissor
.Height
;
4187 case GL_SCISSOR_TEST
:
4188 *params
= (GLint
) ctx
->Scissor
.Enabled
;
4190 case GL_SELECTION_BUFFER_SIZE
:
4191 *params
= (GLint
) ctx
->Select
.BufferSize
;
4193 case GL_SHADE_MODEL
:
4194 *params
= (GLint
) ctx
->Light
.ShadeModel
;
4196 case GL_SHARED_TEXTURE_PALETTE_EXT
:
4197 *params
= (GLint
) ctx
->Texture
.SharedPalette
;
4199 case GL_STENCIL_BITS
:
4200 *params
= ctx
->Visual
->StencilBits
;
4202 case GL_STENCIL_CLEAR_VALUE
:
4203 *params
= (GLint
) ctx
->Stencil
.Clear
;
4205 case GL_STENCIL_FAIL
:
4206 *params
= (GLint
) ctx
->Stencil
.FailFunc
;
4208 case GL_STENCIL_FUNC
:
4209 *params
= (GLint
) ctx
->Stencil
.Function
;
4211 case GL_STENCIL_PASS_DEPTH_FAIL
:
4212 *params
= (GLint
) ctx
->Stencil
.ZFailFunc
;
4214 case GL_STENCIL_PASS_DEPTH_PASS
:
4215 *params
= (GLint
) ctx
->Stencil
.ZPassFunc
;
4217 case GL_STENCIL_REF
:
4218 *params
= (GLint
) ctx
->Stencil
.Ref
;
4220 case GL_STENCIL_TEST
:
4221 *params
= (GLint
) ctx
->Stencil
.Enabled
;
4223 case GL_STENCIL_VALUE_MASK
:
4224 *params
= (GLint
) ctx
->Stencil
.ValueMask
;
4226 case GL_STENCIL_WRITEMASK
:
4227 *params
= (GLint
) ctx
->Stencil
.WriteMask
;
4230 *params
= (GLint
) ctx
->Visual
->StereoFlag
;
4232 case GL_SUBPIXEL_BITS
:
4233 *params
= ctx
->Const
.SubPixelBits
;
4236 *params
= _mesa_IsEnabled(GL_TEXTURE_1D
) ? 1 : 0;
4239 *params
= _mesa_IsEnabled(GL_TEXTURE_2D
) ? 1 : 0;
4242 *params
= _mesa_IsEnabled(GL_TEXTURE_3D
) ? 1 : 0;
4244 case GL_TEXTURE_BINDING_1D
:
4245 *params
= textureUnit
->CurrentD
[1]->Name
;
4247 case GL_TEXTURE_BINDING_2D
:
4248 *params
= textureUnit
->CurrentD
[2]->Name
;
4250 case GL_TEXTURE_BINDING_3D
:
4251 *params
= textureUnit
->CurrentD
[3]->Name
;
4253 case GL_TEXTURE_ENV_COLOR
:
4254 params
[0] = FLOAT_TO_INT( textureUnit
->EnvColor
[0] );
4255 params
[1] = FLOAT_TO_INT( textureUnit
->EnvColor
[1] );
4256 params
[2] = FLOAT_TO_INT( textureUnit
->EnvColor
[2] );
4257 params
[3] = FLOAT_TO_INT( textureUnit
->EnvColor
[3] );
4259 case GL_TEXTURE_ENV_MODE
:
4260 *params
= (GLint
) textureUnit
->EnvMode
;
4262 case GL_TEXTURE_GEN_S
:
4263 *params
= (textureUnit
->TexGenEnabled
& S_BIT
) ? 1 : 0;
4265 case GL_TEXTURE_GEN_T
:
4266 *params
= (textureUnit
->TexGenEnabled
& T_BIT
) ? 1 : 0;
4268 case GL_TEXTURE_GEN_R
:
4269 *params
= (textureUnit
->TexGenEnabled
& R_BIT
) ? 1 : 0;
4271 case GL_TEXTURE_GEN_Q
:
4272 *params
= (textureUnit
->TexGenEnabled
& Q_BIT
) ? 1 : 0;
4274 case GL_TEXTURE_MATRIX
:
4275 for (i
=0;i
<16;i
++) {
4276 params
[i
] = (GLint
) ctx
->TextureMatrix
[texTransformUnit
].m
[i
];
4279 case GL_TEXTURE_STACK_DEPTH
:
4280 *params
= (GLint
) (ctx
->TextureStackDepth
[texTransformUnit
] + 1);
4282 case GL_UNPACK_ALIGNMENT
:
4283 *params
= ctx
->Unpack
.Alignment
;
4285 case GL_UNPACK_LSB_FIRST
:
4286 *params
= (GLint
) ctx
->Unpack
.LsbFirst
;
4288 case GL_UNPACK_ROW_LENGTH
:
4289 *params
= ctx
->Unpack
.RowLength
;
4291 case GL_UNPACK_SKIP_PIXELS
:
4292 *params
= ctx
->Unpack
.SkipPixels
;
4294 case GL_UNPACK_SKIP_ROWS
:
4295 *params
= ctx
->Unpack
.SkipRows
;
4297 case GL_UNPACK_SWAP_BYTES
:
4298 *params
= (GLint
) ctx
->Unpack
.SwapBytes
;
4300 case GL_UNPACK_SKIP_IMAGES_EXT
:
4301 *params
= ctx
->Unpack
.SkipImages
;
4303 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
4304 *params
= ctx
->Unpack
.ImageHeight
;
4307 params
[0] = (GLint
) ctx
->Viewport
.X
;
4308 params
[1] = (GLint
) ctx
->Viewport
.Y
;
4309 params
[2] = (GLint
) ctx
->Viewport
.Width
;
4310 params
[3] = (GLint
) ctx
->Viewport
.Height
;
4313 *params
= (GLint
) ctx
->Pixel
.ZoomX
;
4316 *params
= (GLint
) ctx
->Pixel
.ZoomY
;
4318 case GL_VERTEX_ARRAY
:
4319 *params
= (GLint
) ctx
->Array
.Vertex
.Enabled
;
4321 case GL_VERTEX_ARRAY_SIZE
:
4322 *params
= ctx
->Array
.Vertex
.Size
;
4324 case GL_VERTEX_ARRAY_TYPE
:
4325 *params
= ctx
->Array
.Vertex
.Type
;
4327 case GL_VERTEX_ARRAY_STRIDE
:
4328 *params
= ctx
->Array
.Vertex
.Stride
;
4330 case GL_VERTEX_ARRAY_COUNT_EXT
:
4333 case GL_NORMAL_ARRAY
:
4334 *params
= (GLint
) ctx
->Array
.Normal
.Enabled
;
4336 case GL_NORMAL_ARRAY_TYPE
:
4337 *params
= ctx
->Array
.Normal
.Type
;
4339 case GL_NORMAL_ARRAY_STRIDE
:
4340 *params
= ctx
->Array
.Normal
.Stride
;
4342 case GL_NORMAL_ARRAY_COUNT_EXT
:
4345 case GL_COLOR_ARRAY
:
4346 *params
= (GLint
) ctx
->Array
.Color
.Enabled
;
4348 case GL_COLOR_ARRAY_SIZE
:
4349 *params
= ctx
->Array
.Color
.Size
;
4351 case GL_COLOR_ARRAY_TYPE
:
4352 *params
= ctx
->Array
.Color
.Type
;
4354 case GL_COLOR_ARRAY_STRIDE
:
4355 *params
= ctx
->Array
.Color
.Stride
;
4357 case GL_COLOR_ARRAY_COUNT_EXT
:
4360 case GL_INDEX_ARRAY
:
4361 *params
= (GLint
) ctx
->Array
.Index
.Enabled
;
4363 case GL_INDEX_ARRAY_TYPE
:
4364 *params
= ctx
->Array
.Index
.Type
;
4366 case GL_INDEX_ARRAY_STRIDE
:
4367 *params
= ctx
->Array
.Index
.Stride
;
4369 case GL_INDEX_ARRAY_COUNT_EXT
:
4372 case GL_TEXTURE_COORD_ARRAY
:
4373 *params
= (GLint
) ctx
->Array
.TexCoord
[texUnit
].Enabled
;
4375 case GL_TEXTURE_COORD_ARRAY_SIZE
:
4376 *params
= ctx
->Array
.TexCoord
[texUnit
].Size
;
4378 case GL_TEXTURE_COORD_ARRAY_TYPE
:
4379 *params
= ctx
->Array
.TexCoord
[texUnit
].Type
;
4381 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
4382 *params
= ctx
->Array
.TexCoord
[texUnit
].Stride
;
4384 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
4387 case GL_EDGE_FLAG_ARRAY
:
4388 *params
= (GLint
) ctx
->Array
.EdgeFlag
.Enabled
;
4390 case GL_EDGE_FLAG_ARRAY_STRIDE
:
4391 *params
= ctx
->Array
.EdgeFlag
.Stride
;
4393 case GL_EDGE_FLAG_ARRAY_COUNT_EXT
:
4397 /* GL_ARB_multitexture */
4398 case GL_MAX_TEXTURE_UNITS_ARB
:
4399 *params
= ctx
->Const
.MaxTextureUnits
;
4401 case GL_ACTIVE_TEXTURE_ARB
:
4402 *params
= GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
;
4404 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
4405 *params
= GL_TEXTURE0_ARB
+ ctx
->Array
.ActiveTexture
;
4408 /* GL_ARB_texture_cube_map */
4409 case GL_TEXTURE_CUBE_MAP_ARB
:
4410 if (ctx
->Extensions
.HaveTextureCubeMap
)
4411 *params
= (GLint
) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
);
4413 gl_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
4415 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
4416 if (ctx
->Extensions
.HaveTextureCubeMap
)
4417 *params
= textureUnit
->CurrentCubeMap
->Name
;
4419 gl_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
4421 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
4422 if (ctx
->Extensions
.HaveTextureCubeMap
)
4423 *params
= ctx
->Const
.MaxCubeTextureSize
;
4425 gl_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
4428 /* GL_ARB_texture_compression */
4429 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
4430 if (ctx
->Extensions
.HaveTextureCompression
) {
4431 *params
= (GLint
) ctx
->Hint
.TextureCompression
;
4434 gl_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
4436 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
4437 if (ctx
->Extensions
.HaveTextureCompression
) {
4438 *params
= (GLint
) ctx
->Const
.NumCompressedTextureFormats
;
4441 gl_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
4443 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
4444 if (ctx
->Extensions
.HaveTextureCompression
) {
4446 for (i
= 0; i
< ctx
->Const
.NumCompressedTextureFormats
; i
++)
4447 params
[i
] = (GLint
) ctx
->Const
.CompressedTextureFormats
[i
];
4450 gl_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
4453 /* GL_PGI_misc_hints */
4454 case GL_STRICT_DEPTHFUNC_HINT_PGI
:
4455 *params
= (GL_NICEST
);
4457 case GL_STRICT_LIGHTING_HINT_PGI
:
4458 *params
= (ctx
->Hint
.StrictLighting
);
4460 case GL_STRICT_SCISSOR_HINT_PGI
:
4461 case GL_FULL_STIPPLE_HINT_PGI
:
4464 case GL_CONSERVE_MEMORY_HINT_PGI
:
4467 case GL_ALWAYS_FAST_HINT_PGI
:
4468 *params
= (ctx
->Hint
.AllowDrawWin
== GL_TRUE
&&
4469 ctx
->Hint
.AllowDrawFrg
== GL_FALSE
&&
4470 ctx
->Hint
.AllowDrawMem
== GL_FALSE
);
4472 case GL_ALWAYS_SOFT_HINT_PGI
:
4473 *params
= (ctx
->Hint
.AllowDrawWin
== GL_TRUE
&&
4474 ctx
->Hint
.AllowDrawFrg
== GL_TRUE
&&
4475 ctx
->Hint
.AllowDrawMem
== GL_TRUE
);
4477 case GL_ALLOW_DRAW_OBJ_HINT_PGI
:
4480 case GL_ALLOW_DRAW_WIN_HINT_PGI
:
4481 *params
= ctx
->Hint
.AllowDrawWin
;
4483 case GL_ALLOW_DRAW_FRG_HINT_PGI
:
4484 *params
= ctx
->Hint
.AllowDrawFrg
;
4486 case GL_ALLOW_DRAW_MEM_HINT_PGI
:
4487 *params
= ctx
->Hint
.AllowDrawMem
;
4489 case GL_CLIP_NEAR_HINT_PGI
:
4490 case GL_CLIP_FAR_HINT_PGI
:
4493 case GL_WIDE_LINE_HINT_PGI
:
4494 *params
= GL_DONT_CARE
;
4496 case GL_BACK_NORMALS_HINT_PGI
:
4499 case GL_NATIVE_GRAPHICS_HANDLE_PGI
:
4503 /* GL_EXT_compiled_vertex_array */
4504 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
4505 *params
= ctx
->Array
.LockFirst
;
4507 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
4508 *params
= ctx
->Array
.LockCount
;
4511 /* GL_ARB_transpose_matrix */
4512 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
4516 gl_matrix_transposef(tm
, ctx
->ColorMatrix
.m
);
4517 for (i
=0;i
<16;i
++) {
4518 params
[i
] = (GLint
) tm
[i
];
4522 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
4526 gl_matrix_transposef(tm
, ctx
->ModelView
.m
);
4527 for (i
=0;i
<16;i
++) {
4528 params
[i
] = (GLint
) tm
[i
];
4532 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
4536 gl_matrix_transposef(tm
, ctx
->ProjectionMatrix
.m
);
4537 for (i
=0;i
<16;i
++) {
4538 params
[i
] = (GLint
) tm
[i
];
4542 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
4546 gl_matrix_transposef(tm
, ctx
->TextureMatrix
[texTransformUnit
].m
);
4547 for (i
=0;i
<16;i
++) {
4548 params
[i
] = (GLint
) tm
[i
];
4553 /* GL_HP_occlusion_test */
4554 case GL_OCCLUSION_TEST_HP
:
4555 if (ctx
->Extensions
.HaveHpOcclusionTest
) {
4556 *params
= (GLint
) ctx
->Depth
.OcclusionTest
;
4559 gl_error( ctx
, GL_INVALID_ENUM
, "glGetIntegerv" );
4562 case GL_OCCLUSION_TEST_RESULT_HP
:
4563 if (ctx
->Extensions
.HaveHpOcclusionTest
) {
4564 if (ctx
->Depth
.OcclusionTest
)
4565 *params
= (GLint
) ctx
->OcclusionResult
;
4567 *params
= (GLint
) ctx
->OcclusionResultSaved
;
4568 /* reset flag now */
4569 ctx
->OcclusionResult
= GL_FALSE
;
4570 ctx
->OcclusionResultSaved
= GL_FALSE
;
4573 gl_error( ctx
, GL_INVALID_ENUM
, "glGetIntegerv" );
4577 /* GL_SGIS_pixel_texture */
4578 case GL_PIXEL_TEXTURE_SGIS
:
4579 *params
= (GLint
) ctx
->Pixel
.PixelTextureEnabled
;
4582 /* GL_SGIX_pixel_texture */
4583 case GL_PIXEL_TEX_GEN_SGIX
:
4584 *params
= (GLint
) ctx
->Pixel
.PixelTextureEnabled
;
4586 case GL_PIXEL_TEX_GEN_MODE_SGIX
:
4587 *params
= (GLint
) pixel_texgen_mode(ctx
);
4590 /* GL_SGI_color_matrix (also in 1.2 imaging) */
4591 case GL_COLOR_MATRIX_SGI
:
4592 for (i
=0;i
<16;i
++) {
4593 params
[i
] = (GLint
) ctx
->ColorMatrix
.m
[i
];
4596 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
4597 *params
= ctx
->ColorStackDepth
+ 1;
4599 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
4600 *params
= MAX_COLOR_STACK_DEPTH
;
4602 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
4603 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixScale
[0];
4605 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
4606 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixScale
[1];
4608 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
4609 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixScale
[2];
4611 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
4612 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixScale
[3];
4614 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
4615 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixBias
[0];
4617 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
4618 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixBias
[1];
4620 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
4621 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixBias
[2];
4623 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
4624 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixBias
[3];
4627 /* GL_EXT_convolution (also in 1.2 imaging) */
4628 case GL_MAX_CONVOLUTION_WIDTH
:
4629 *params
= ctx
->Const
.MaxConvolutionWidth
;
4631 case GL_MAX_CONVOLUTION_HEIGHT
:
4632 *params
= ctx
->Const
.MaxConvolutionHeight
;
4634 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
4635 *params
= (GLint
) ctx
->Pixel
.PostConvolutionScale
[0];
4637 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
4638 *params
= (GLint
) ctx
->Pixel
.PostConvolutionScale
[1];
4640 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
4641 *params
= (GLint
) ctx
->Pixel
.PostConvolutionScale
[2];
4643 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
4644 *params
= (GLint
) ctx
->Pixel
.PostConvolutionScale
[3];
4646 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
4647 *params
= (GLint
) ctx
->Pixel
.PostConvolutionBias
[0];
4649 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
4650 *params
= (GLint
) ctx
->Pixel
.PostConvolutionBias
[1];
4652 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
4653 *params
= (GLint
) ctx
->Pixel
.PostConvolutionBias
[2];
4655 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
4656 *params
= (GLint
) ctx
->Pixel
.PostConvolutionBias
[2];
4659 /* GL_SGI_color_table (also in 1.2 imaging */
4660 case GL_COLOR_TABLE_SGI
:
4661 *params
= (GLint
) ctx
->Pixel
.ColorTableEnabled
;
4663 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
4664 *params
= (GLint
) ctx
->Pixel
.PostConvolutionColorTableEnabled
;
4666 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
4667 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixColorTableEnabled
;
4671 gl_error( ctx
, GL_INVALID_ENUM
, "glGetIntegerv" );
4678 _mesa_GetPointerv( GLenum pname
, GLvoid
**params
)
4680 GET_CURRENT_CONTEXT(ctx
);
4681 GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
4683 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
, "glGetPointerv");
4688 if (MESA_VERBOSE
& VERBOSE_API
)
4689 fprintf(stderr
, "glGetPointerv %s\n", gl_lookup_enum_by_nr(pname
));
4691 if (ctx
->Driver
.GetPointerv
4692 && (*ctx
->Driver
.GetPointerv
)(ctx
, pname
, params
))
4696 case GL_VERTEX_ARRAY_POINTER
:
4697 *params
= ctx
->Array
.Vertex
.Ptr
;
4699 case GL_NORMAL_ARRAY_POINTER
:
4700 *params
= ctx
->Array
.Normal
.Ptr
;
4702 case GL_COLOR_ARRAY_POINTER
:
4703 *params
= ctx
->Array
.Color
.Ptr
;
4705 case GL_INDEX_ARRAY_POINTER
:
4706 *params
= ctx
->Array
.Index
.Ptr
;
4708 case GL_TEXTURE_COORD_ARRAY_POINTER
:
4709 *params
= ctx
->Array
.TexCoord
[texUnit
].Ptr
;
4711 case GL_EDGE_FLAG_ARRAY_POINTER
:
4712 *params
= ctx
->Array
.EdgeFlag
.Ptr
;
4714 case GL_FEEDBACK_BUFFER_POINTER
:
4715 *params
= ctx
->Feedback
.Buffer
;
4717 case GL_SELECTION_BUFFER_POINTER
:
4718 *params
= ctx
->Select
.Buffer
;
4721 gl_error( ctx
, GL_INVALID_ENUM
, "glGetPointerv" );
4729 _mesa_GetString( GLenum name
)
4731 GET_CURRENT_CONTEXT(ctx
);
4732 static const char *vendor
= "Brian Paul";
4733 static const char *renderer
= "Mesa";
4734 static const char *version
= "1.2 Mesa 3.5 beta";
4736 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx
, "glGetString", 0);
4738 /* this is a required driver function */
4739 assert(ctx
->Driver
.GetString
);
4741 const GLubyte
*str
= (*ctx
->Driver
.GetString
)(ctx
, name
);
4747 return (const GLubyte
*) vendor
;
4749 return (const GLubyte
*) renderer
;
4751 return (const GLubyte
*) version
;
4753 return (const GLubyte
*) gl_extensions_get_string( ctx
);
4755 gl_error( ctx
, GL_INVALID_ENUM
, "glGetString" );
4756 return (const GLubyte
*) 0;
4763 * Execute a glGetError command
4766 _mesa_GetError( void )
4768 GET_CURRENT_CONTEXT(ctx
);
4770 GLenum e
= ctx
->ErrorValue
;
4772 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL( ctx
, "glGetError", (GLenum
) 0);
4774 if (MESA_VERBOSE
& VERBOSE_API
)
4775 fprintf(stderr
, "glGetError <-- %s\n", gl_lookup_enum_by_nr(e
));
4777 ctx
->ErrorValue
= (GLenum
) GL_NO_ERROR
;