1 /* $Id: get.c,v 1.62 2001/06/12 22:08:41 brianp Exp $ */
4 * Mesa 3-D graphics library
7 * Copyright (C) 1999-2001 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.
36 #include "extensions.h"
42 #include "math/m_matrix.h"
47 #define FLOAT_TO_BOOL(X) ( (X)==0.0F ? GL_FALSE : GL_TRUE )
48 #define INT_TO_BOOL(I) ( (I)==0 ? GL_FALSE : GL_TRUE )
49 #define ENUM_TO_BOOL(E) ( (E)==0 ? GL_FALSE : GL_TRUE )
52 /* Needed for an Amiga compiler */
53 #define ENUM_TO_FLOAT(X) ((GLfloat)(GLint)(X))
54 #define ENUM_TO_DOUBLE(X) ((GLdouble)(GLint)(X))
56 /* all other compilers */
57 #define ENUM_TO_FLOAT(X) ((GLfloat)(X))
58 #define ENUM_TO_DOUBLE(X) ((GLdouble)(X))
64 pixel_texgen_mode(const GLcontext
*ctx
)
66 if (ctx
->Pixel
.FragmentRgbSource
== GL_CURRENT_RASTER_POSITION
) {
67 if (ctx
->Pixel
.FragmentAlphaSource
== GL_CURRENT_RASTER_POSITION
) {
75 if (ctx
->Pixel
.FragmentAlphaSource
== GL_CURRENT_RASTER_POSITION
) {
86 _mesa_GetBooleanv( GLenum pname
, GLboolean
*params
)
88 GET_CURRENT_CONTEXT(ctx
);
90 GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
91 const struct gl_texture_unit
*textureUnit
= &ctx
->Texture
.Unit
[texUnit
];
92 ASSERT_OUTSIDE_BEGIN_END(ctx
);
97 /* We need this in order to get correct results for
98 * GL_OCCLUSION_TEST_RESULT_HP. There might be other important cases.
100 FLUSH_VERTICES(ctx
, 0);
102 if (MESA_VERBOSE
& VERBOSE_API
)
103 fprintf(stderr
, "glGetBooleanv %s\n", _mesa_lookup_enum_by_nr(pname
));
105 if (ctx
->Driver
.GetBooleanv
106 && (*ctx
->Driver
.GetBooleanv
)(ctx
, pname
, params
))
110 case GL_ACCUM_RED_BITS
:
111 *params
= INT_TO_BOOL(ctx
->Visual
.accumRedBits
);
113 case GL_ACCUM_GREEN_BITS
:
114 *params
= INT_TO_BOOL(ctx
->Visual
.accumGreenBits
);
116 case GL_ACCUM_BLUE_BITS
:
117 *params
= INT_TO_BOOL(ctx
->Visual
.accumBlueBits
);
119 case GL_ACCUM_ALPHA_BITS
:
120 *params
= INT_TO_BOOL(ctx
->Visual
.accumAlphaBits
);
122 case GL_ACCUM_CLEAR_VALUE
:
123 params
[0] = FLOAT_TO_BOOL(ctx
->Accum
.ClearColor
[0]);
124 params
[1] = FLOAT_TO_BOOL(ctx
->Accum
.ClearColor
[1]);
125 params
[2] = FLOAT_TO_BOOL(ctx
->Accum
.ClearColor
[2]);
126 params
[3] = FLOAT_TO_BOOL(ctx
->Accum
.ClearColor
[3]);
129 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.AlphaBias
);
132 *params
= INT_TO_BOOL(ctx
->Visual
.alphaBits
);
135 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.AlphaScale
);
138 *params
= ctx
->Color
.AlphaEnabled
;
140 case GL_ALPHA_TEST_FUNC
:
141 *params
= ENUM_TO_BOOL(ctx
->Color
.AlphaFunc
);
143 case GL_ALPHA_TEST_REF
:
144 *params
= FLOAT_TO_BOOL((GLfloat
) ctx
->Color
.AlphaRef
/ CHAN_MAXF
);
146 case GL_ATTRIB_STACK_DEPTH
:
147 *params
= INT_TO_BOOL(ctx
->AttribStackDepth
);
150 *params
= ctx
->Eval
.AutoNormal
;
153 *params
= (ctx
->Const
.NumAuxBuffers
) ? GL_TRUE
: GL_FALSE
;
156 *params
= ctx
->Color
.BlendEnabled
;
159 *params
= ENUM_TO_BOOL(ctx
->Color
.BlendDstRGB
);
162 *params
= ENUM_TO_BOOL(ctx
->Color
.BlendSrcRGB
);
164 case GL_BLEND_SRC_RGB_EXT
:
165 *params
= ENUM_TO_BOOL(ctx
->Color
.BlendSrcRGB
);
167 case GL_BLEND_DST_RGB_EXT
:
168 *params
= ENUM_TO_BOOL(ctx
->Color
.BlendDstRGB
);
170 case GL_BLEND_SRC_ALPHA_EXT
:
171 *params
= ENUM_TO_BOOL(ctx
->Color
.BlendSrcA
);
173 case GL_BLEND_DST_ALPHA_EXT
:
174 *params
= ENUM_TO_BOOL(ctx
->Color
.BlendDstA
);
176 case GL_BLEND_EQUATION_EXT
:
177 *params
= ENUM_TO_BOOL( ctx
->Color
.BlendEquation
);
179 case GL_BLEND_COLOR_EXT
:
180 params
[0] = FLOAT_TO_BOOL( ctx
->Color
.BlendColor
[0] );
181 params
[1] = FLOAT_TO_BOOL( ctx
->Color
.BlendColor
[1] );
182 params
[2] = FLOAT_TO_BOOL( ctx
->Color
.BlendColor
[2] );
183 params
[3] = FLOAT_TO_BOOL( ctx
->Color
.BlendColor
[3] );
186 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.BlueBias
);
189 *params
= INT_TO_BOOL( ctx
->Visual
.blueBits
);
192 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.BlueScale
);
194 case GL_CLIENT_ATTRIB_STACK_DEPTH
:
195 *params
= INT_TO_BOOL(ctx
->ClientAttribStackDepth
);
203 *params
= ctx
->Transform
.ClipEnabled
[pname
-GL_CLIP_PLANE0
];
205 case GL_COLOR_CLEAR_VALUE
:
206 params
[0] = ctx
->Color
.ClearColor
[0] ? GL_TRUE
: GL_FALSE
;
207 params
[1] = ctx
->Color
.ClearColor
[1] ? GL_TRUE
: GL_FALSE
;
208 params
[2] = ctx
->Color
.ClearColor
[2] ? GL_TRUE
: GL_FALSE
;
209 params
[3] = ctx
->Color
.ClearColor
[3] ? GL_TRUE
: GL_FALSE
;
211 case GL_COLOR_MATERIAL
:
212 *params
= ctx
->Light
.ColorMaterialEnabled
;
214 case GL_COLOR_MATERIAL_FACE
:
215 *params
= ENUM_TO_BOOL(ctx
->Light
.ColorMaterialFace
);
217 case GL_COLOR_MATERIAL_PARAMETER
:
218 *params
= ENUM_TO_BOOL(ctx
->Light
.ColorMaterialMode
);
220 case GL_COLOR_WRITEMASK
:
221 params
[0] = ctx
->Color
.ColorMask
[RCOMP
] ? GL_TRUE
: GL_FALSE
;
222 params
[1] = ctx
->Color
.ColorMask
[GCOMP
] ? GL_TRUE
: GL_FALSE
;
223 params
[2] = ctx
->Color
.ColorMask
[BCOMP
] ? GL_TRUE
: GL_FALSE
;
224 params
[3] = ctx
->Color
.ColorMask
[ACOMP
] ? GL_TRUE
: GL_FALSE
;
227 *params
= ctx
->Polygon
.CullFlag
;
229 case GL_CULL_FACE_MODE
:
230 *params
= ENUM_TO_BOOL(ctx
->Polygon
.CullFaceMode
);
232 case GL_CURRENT_COLOR
:
233 FLUSH_CURRENT(ctx
, 0);
234 params
[0] = FLOAT_TO_BOOL(ctx
->Current
.Color
[0]);
235 params
[1] = FLOAT_TO_BOOL(ctx
->Current
.Color
[1]);
236 params
[2] = FLOAT_TO_BOOL(ctx
->Current
.Color
[2]);
237 params
[3] = FLOAT_TO_BOOL(ctx
->Current
.Color
[3]);
239 case GL_CURRENT_INDEX
:
240 FLUSH_CURRENT(ctx
, 0);
241 *params
= INT_TO_BOOL(ctx
->Current
.Index
);
243 case GL_CURRENT_NORMAL
:
244 FLUSH_CURRENT(ctx
, 0);
245 params
[0] = FLOAT_TO_BOOL(ctx
->Current
.Normal
[0]);
246 params
[1] = FLOAT_TO_BOOL(ctx
->Current
.Normal
[1]);
247 params
[2] = FLOAT_TO_BOOL(ctx
->Current
.Normal
[2]);
249 case GL_CURRENT_RASTER_COLOR
:
250 params
[0] = FLOAT_TO_BOOL(ctx
->Current
.RasterColor
[0]);
251 params
[1] = FLOAT_TO_BOOL(ctx
->Current
.RasterColor
[1]);
252 params
[2] = FLOAT_TO_BOOL(ctx
->Current
.RasterColor
[2]);
253 params
[3] = FLOAT_TO_BOOL(ctx
->Current
.RasterColor
[3]);
255 case GL_CURRENT_RASTER_DISTANCE
:
256 *params
= FLOAT_TO_BOOL(ctx
->Current
.RasterDistance
);
258 case GL_CURRENT_RASTER_INDEX
:
259 *params
= FLOAT_TO_BOOL(ctx
->Current
.RasterIndex
);
261 case GL_CURRENT_RASTER_POSITION
:
262 params
[0] = FLOAT_TO_BOOL(ctx
->Current
.RasterPos
[0]);
263 params
[1] = FLOAT_TO_BOOL(ctx
->Current
.RasterPos
[1]);
264 params
[2] = FLOAT_TO_BOOL(ctx
->Current
.RasterPos
[2]);
265 params
[3] = FLOAT_TO_BOOL(ctx
->Current
.RasterPos
[3]);
267 case GL_CURRENT_RASTER_TEXTURE_COORDS
:
268 params
[0] = FLOAT_TO_BOOL(ctx
->Current
.RasterMultiTexCoord
[texUnit
][0]);
269 params
[1] = FLOAT_TO_BOOL(ctx
->Current
.RasterMultiTexCoord
[texUnit
][1]);
270 params
[2] = FLOAT_TO_BOOL(ctx
->Current
.RasterMultiTexCoord
[texUnit
][2]);
271 params
[3] = FLOAT_TO_BOOL(ctx
->Current
.RasterMultiTexCoord
[texUnit
][3]);
273 case GL_CURRENT_RASTER_POSITION_VALID
:
274 *params
= ctx
->Current
.RasterPosValid
;
276 case GL_CURRENT_TEXTURE_COORDS
:
277 FLUSH_CURRENT(ctx
, 0);
278 params
[0] = FLOAT_TO_BOOL(ctx
->Current
.Texcoord
[texUnit
][0]);
279 params
[1] = FLOAT_TO_BOOL(ctx
->Current
.Texcoord
[texUnit
][1]);
280 params
[2] = FLOAT_TO_BOOL(ctx
->Current
.Texcoord
[texUnit
][2]);
281 params
[3] = FLOAT_TO_BOOL(ctx
->Current
.Texcoord
[texUnit
][3]);
284 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.DepthBias
);
287 *params
= INT_TO_BOOL(ctx
->Visual
.depthBits
);
289 case GL_DEPTH_CLEAR_VALUE
:
290 *params
= FLOAT_TO_BOOL(ctx
->Depth
.Clear
);
293 *params
= ENUM_TO_BOOL(ctx
->Depth
.Func
);
296 params
[0] = FLOAT_TO_BOOL(ctx
->Viewport
.Near
);
297 params
[1] = FLOAT_TO_BOOL(ctx
->Viewport
.Far
);
300 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.DepthScale
);
303 *params
= ctx
->Depth
.Test
;
305 case GL_DEPTH_WRITEMASK
:
306 *params
= ctx
->Depth
.Mask
;
309 *params
= ctx
->Color
.DitherFlag
;
311 case GL_DOUBLEBUFFER
:
312 *params
= ctx
->Visual
.doubleBufferMode
;
315 *params
= ENUM_TO_BOOL(ctx
->Color
.DrawBuffer
);
318 FLUSH_CURRENT(ctx
, 0);
319 *params
= ctx
->Current
.EdgeFlag
;
321 case GL_FEEDBACK_BUFFER_SIZE
:
322 *params
= INT_TO_BOOL(ctx
->Feedback
.BufferSize
);
324 case GL_FEEDBACK_BUFFER_TYPE
:
325 *params
= INT_TO_BOOL(ctx
->Feedback
.Type
);
328 *params
= ctx
->Fog
.Enabled
;
331 params
[0] = FLOAT_TO_BOOL(ctx
->Fog
.Color
[0]);
332 params
[1] = FLOAT_TO_BOOL(ctx
->Fog
.Color
[1]);
333 params
[2] = FLOAT_TO_BOOL(ctx
->Fog
.Color
[2]);
334 params
[3] = FLOAT_TO_BOOL(ctx
->Fog
.Color
[3]);
337 *params
= FLOAT_TO_BOOL(ctx
->Fog
.Density
);
340 *params
= FLOAT_TO_BOOL(ctx
->Fog
.End
);
343 *params
= ENUM_TO_BOOL(ctx
->Hint
.Fog
);
346 *params
= FLOAT_TO_BOOL(ctx
->Fog
.Index
);
349 *params
= ENUM_TO_BOOL(ctx
->Fog
.Mode
);
352 *params
= FLOAT_TO_BOOL(ctx
->Fog
.End
);
355 *params
= ENUM_TO_BOOL(ctx
->Polygon
.FrontFace
);
358 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.GreenBias
);
361 *params
= INT_TO_BOOL( ctx
->Visual
.greenBits
);
364 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.GreenScale
);
367 if (ctx
->Extensions
.EXT_histogram
) {
368 *params
= ctx
->Pixel
.HistogramEnabled
;
371 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
376 *params
= INT_TO_BOOL( ctx
->Visual
.indexBits
);
378 case GL_INDEX_CLEAR_VALUE
:
379 *params
= INT_TO_BOOL(ctx
->Color
.ClearIndex
);
382 *params
= ctx
->Visual
.rgbMode
? GL_FALSE
: GL_TRUE
;
384 case GL_INDEX_OFFSET
:
385 *params
= INT_TO_BOOL(ctx
->Pixel
.IndexOffset
);
388 *params
= INT_TO_BOOL(ctx
->Pixel
.IndexShift
);
390 case GL_INDEX_WRITEMASK
:
391 *params
= INT_TO_BOOL(ctx
->Color
.IndexMask
);
401 *params
= ctx
->Light
.Light
[pname
-GL_LIGHT0
].Enabled
;
404 *params
= ctx
->Light
.Enabled
;
406 case GL_LIGHT_MODEL_AMBIENT
:
407 params
[0] = FLOAT_TO_BOOL(ctx
->Light
.Model
.Ambient
[0]);
408 params
[1] = FLOAT_TO_BOOL(ctx
->Light
.Model
.Ambient
[1]);
409 params
[2] = FLOAT_TO_BOOL(ctx
->Light
.Model
.Ambient
[2]);
410 params
[3] = FLOAT_TO_BOOL(ctx
->Light
.Model
.Ambient
[3]);
412 case GL_LIGHT_MODEL_COLOR_CONTROL
:
413 params
[0] = ENUM_TO_BOOL(ctx
->Light
.Model
.ColorControl
);
415 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
416 *params
= ctx
->Light
.Model
.LocalViewer
;
418 case GL_LIGHT_MODEL_TWO_SIDE
:
419 *params
= ctx
->Light
.Model
.TwoSide
;
422 *params
= ctx
->Line
.SmoothFlag
;
424 case GL_LINE_SMOOTH_HINT
:
425 *params
= ENUM_TO_BOOL(ctx
->Hint
.LineSmooth
);
427 case GL_LINE_STIPPLE
:
428 *params
= ctx
->Line
.StippleFlag
;
430 case GL_LINE_STIPPLE_PATTERN
:
431 *params
= INT_TO_BOOL(ctx
->Line
.StipplePattern
);
433 case GL_LINE_STIPPLE_REPEAT
:
434 *params
= INT_TO_BOOL(ctx
->Line
.StippleFactor
);
437 *params
= FLOAT_TO_BOOL(ctx
->Line
.Width
);
439 case GL_LINE_WIDTH_GRANULARITY
:
440 *params
= FLOAT_TO_BOOL(ctx
->Const
.LineWidthGranularity
);
442 case GL_LINE_WIDTH_RANGE
:
443 params
[0] = FLOAT_TO_BOOL(ctx
->Const
.MinLineWidthAA
);
444 params
[1] = FLOAT_TO_BOOL(ctx
->Const
.MaxLineWidthAA
);
446 case GL_ALIASED_LINE_WIDTH_RANGE
:
447 params
[0] = FLOAT_TO_BOOL(ctx
->Const
.MinLineWidth
);
448 params
[1] = FLOAT_TO_BOOL(ctx
->Const
.MaxLineWidth
);
451 *params
= INT_TO_BOOL(ctx
->List
.ListBase
);
454 *params
= INT_TO_BOOL( ctx
->CurrentListNum
);
457 *params
= ENUM_TO_BOOL( ctx
->ExecuteFlag
458 ? GL_COMPILE_AND_EXECUTE
: GL_COMPILE
);
460 case GL_INDEX_LOGIC_OP
:
461 *params
= ctx
->Color
.IndexLogicOpEnabled
;
463 case GL_COLOR_LOGIC_OP
:
464 *params
= ctx
->Color
.ColorLogicOpEnabled
;
466 case GL_LOGIC_OP_MODE
:
467 *params
= ENUM_TO_BOOL(ctx
->Color
.LogicOp
);
469 case GL_MAP1_COLOR_4
:
470 *params
= ctx
->Eval
.Map1Color4
;
472 case GL_MAP1_GRID_DOMAIN
:
473 params
[0] = FLOAT_TO_BOOL(ctx
->Eval
.MapGrid1u1
);
474 params
[1] = FLOAT_TO_BOOL(ctx
->Eval
.MapGrid1u2
);
476 case GL_MAP1_GRID_SEGMENTS
:
477 *params
= INT_TO_BOOL(ctx
->Eval
.MapGrid1un
);
480 *params
= ctx
->Eval
.Map1Index
;
483 *params
= ctx
->Eval
.Map1Normal
;
485 case GL_MAP1_TEXTURE_COORD_1
:
486 *params
= ctx
->Eval
.Map1TextureCoord1
;
488 case GL_MAP1_TEXTURE_COORD_2
:
489 *params
= ctx
->Eval
.Map1TextureCoord2
;
491 case GL_MAP1_TEXTURE_COORD_3
:
492 *params
= ctx
->Eval
.Map1TextureCoord3
;
494 case GL_MAP1_TEXTURE_COORD_4
:
495 *params
= ctx
->Eval
.Map1TextureCoord4
;
497 case GL_MAP1_VERTEX_3
:
498 *params
= ctx
->Eval
.Map1Vertex3
;
500 case GL_MAP1_VERTEX_4
:
501 *params
= ctx
->Eval
.Map1Vertex4
;
503 case GL_MAP2_COLOR_4
:
504 *params
= ctx
->Eval
.Map2Color4
;
506 case GL_MAP2_GRID_DOMAIN
:
507 params
[0] = FLOAT_TO_BOOL(ctx
->Eval
.MapGrid2u1
);
508 params
[1] = FLOAT_TO_BOOL(ctx
->Eval
.MapGrid2u2
);
509 params
[2] = FLOAT_TO_BOOL(ctx
->Eval
.MapGrid2v1
);
510 params
[3] = FLOAT_TO_BOOL(ctx
->Eval
.MapGrid2v2
);
512 case GL_MAP2_GRID_SEGMENTS
:
513 params
[0] = INT_TO_BOOL(ctx
->Eval
.MapGrid2un
);
514 params
[1] = INT_TO_BOOL(ctx
->Eval
.MapGrid2vn
);
517 *params
= ctx
->Eval
.Map2Index
;
520 *params
= ctx
->Eval
.Map2Normal
;
522 case GL_MAP2_TEXTURE_COORD_1
:
523 *params
= ctx
->Eval
.Map2TextureCoord1
;
525 case GL_MAP2_TEXTURE_COORD_2
:
526 *params
= ctx
->Eval
.Map2TextureCoord2
;
528 case GL_MAP2_TEXTURE_COORD_3
:
529 *params
= ctx
->Eval
.Map2TextureCoord3
;
531 case GL_MAP2_TEXTURE_COORD_4
:
532 *params
= ctx
->Eval
.Map2TextureCoord4
;
534 case GL_MAP2_VERTEX_3
:
535 *params
= ctx
->Eval
.Map2Vertex3
;
537 case GL_MAP2_VERTEX_4
:
538 *params
= ctx
->Eval
.Map2Vertex4
;
541 *params
= ctx
->Pixel
.MapColorFlag
;
544 *params
= ctx
->Pixel
.MapStencilFlag
;
547 *params
= ENUM_TO_BOOL( ctx
->Transform
.MatrixMode
);
549 case GL_MAX_ATTRIB_STACK_DEPTH
:
550 *params
= INT_TO_BOOL(MAX_ATTRIB_STACK_DEPTH
);
552 case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
:
553 *params
= INT_TO_BOOL( MAX_CLIENT_ATTRIB_STACK_DEPTH
);
555 case GL_MAX_CLIP_PLANES
:
556 *params
= INT_TO_BOOL(ctx
->Const
.MaxClipPlanes
);
558 case GL_MAX_ELEMENTS_VERTICES
: /* GL_VERSION_1_2 */
559 *params
= INT_TO_BOOL(ctx
->Const
.MaxArrayLockSize
);
561 case GL_MAX_ELEMENTS_INDICES
: /* GL_VERSION_1_2 */
562 *params
= INT_TO_BOOL(ctx
->Const
.MaxArrayLockSize
);
564 case GL_MAX_EVAL_ORDER
:
565 *params
= INT_TO_BOOL(MAX_EVAL_ORDER
);
568 *params
= INT_TO_BOOL(ctx
->Const
.MaxLights
);
570 case GL_MAX_LIST_NESTING
:
571 *params
= INT_TO_BOOL(MAX_LIST_NESTING
);
573 case GL_MAX_MODELVIEW_STACK_DEPTH
:
574 *params
= INT_TO_BOOL(MAX_MODELVIEW_STACK_DEPTH
);
576 case GL_MAX_NAME_STACK_DEPTH
:
577 *params
= INT_TO_BOOL(MAX_NAME_STACK_DEPTH
);
579 case GL_MAX_PIXEL_MAP_TABLE
:
580 *params
= INT_TO_BOOL(MAX_PIXEL_MAP_TABLE
);
582 case GL_MAX_PROJECTION_STACK_DEPTH
:
583 *params
= INT_TO_BOOL(MAX_PROJECTION_STACK_DEPTH
);
585 case GL_MAX_TEXTURE_SIZE
:
586 case GL_MAX_3D_TEXTURE_SIZE
:
587 *params
= INT_TO_BOOL(ctx
->Const
.MaxTextureSize
);
589 case GL_MAX_TEXTURE_STACK_DEPTH
:
590 *params
= INT_TO_BOOL(MAX_TEXTURE_STACK_DEPTH
);
592 case GL_MAX_VIEWPORT_DIMS
:
593 params
[0] = INT_TO_BOOL(MAX_WIDTH
);
594 params
[1] = INT_TO_BOOL(MAX_HEIGHT
);
597 *params
= ctx
->Pixel
.MinMaxEnabled
;
599 case GL_MODELVIEW_MATRIX
:
601 params
[i
] = FLOAT_TO_BOOL(ctx
->ModelView
.m
[i
]);
604 case GL_MODELVIEW_STACK_DEPTH
:
605 *params
= INT_TO_BOOL(ctx
->ModelViewStackDepth
+ 1);
607 case GL_NAME_STACK_DEPTH
:
608 *params
= INT_TO_BOOL(ctx
->Select
.NameStackDepth
);
611 *params
= ctx
->Transform
.Normalize
;
613 case GL_PACK_ALIGNMENT
:
614 *params
= INT_TO_BOOL(ctx
->Pack
.Alignment
);
616 case GL_PACK_LSB_FIRST
:
617 *params
= ctx
->Pack
.LsbFirst
;
619 case GL_PACK_ROW_LENGTH
:
620 *params
= INT_TO_BOOL(ctx
->Pack
.RowLength
);
622 case GL_PACK_SKIP_PIXELS
:
623 *params
= INT_TO_BOOL(ctx
->Pack
.SkipPixels
);
625 case GL_PACK_SKIP_ROWS
:
626 *params
= INT_TO_BOOL(ctx
->Pack
.SkipRows
);
628 case GL_PACK_SWAP_BYTES
:
629 *params
= ctx
->Pack
.SwapBytes
;
631 case GL_PACK_SKIP_IMAGES_EXT
:
632 *params
= ctx
->Pack
.SkipImages
;
634 case GL_PACK_IMAGE_HEIGHT_EXT
:
635 *params
= ctx
->Pack
.ImageHeight
;
637 case GL_PERSPECTIVE_CORRECTION_HINT
:
638 *params
= ENUM_TO_BOOL(ctx
->Hint
.PerspectiveCorrection
);
640 case GL_PIXEL_MAP_A_TO_A_SIZE
:
641 *params
= INT_TO_BOOL(ctx
->Pixel
.MapAtoAsize
);
643 case GL_PIXEL_MAP_B_TO_B_SIZE
:
644 *params
= INT_TO_BOOL(ctx
->Pixel
.MapBtoBsize
);
646 case GL_PIXEL_MAP_G_TO_G_SIZE
:
647 *params
= INT_TO_BOOL(ctx
->Pixel
.MapGtoGsize
);
649 case GL_PIXEL_MAP_I_TO_A_SIZE
:
650 *params
= INT_TO_BOOL(ctx
->Pixel
.MapItoAsize
);
652 case GL_PIXEL_MAP_I_TO_B_SIZE
:
653 *params
= INT_TO_BOOL(ctx
->Pixel
.MapItoBsize
);
655 case GL_PIXEL_MAP_I_TO_G_SIZE
:
656 *params
= INT_TO_BOOL(ctx
->Pixel
.MapItoGsize
);
658 case GL_PIXEL_MAP_I_TO_I_SIZE
:
659 *params
= INT_TO_BOOL(ctx
->Pixel
.MapItoIsize
);
661 case GL_PIXEL_MAP_I_TO_R_SIZE
:
662 *params
= INT_TO_BOOL(ctx
->Pixel
.MapItoRsize
);
664 case GL_PIXEL_MAP_R_TO_R_SIZE
:
665 *params
= INT_TO_BOOL(ctx
->Pixel
.MapRtoRsize
);
667 case GL_PIXEL_MAP_S_TO_S_SIZE
:
668 *params
= INT_TO_BOOL(ctx
->Pixel
.MapStoSsize
);
671 *params
= FLOAT_TO_BOOL(ctx
->Point
.Size
);
673 case GL_POINT_SIZE_GRANULARITY
:
674 *params
= FLOAT_TO_BOOL(ctx
->Const
.PointSizeGranularity
);
676 case GL_POINT_SIZE_RANGE
:
677 params
[0] = FLOAT_TO_BOOL(ctx
->Const
.MinPointSizeAA
);
678 params
[1] = FLOAT_TO_BOOL(ctx
->Const
.MaxPointSizeAA
);
680 case GL_ALIASED_POINT_SIZE_RANGE
:
681 params
[0] = FLOAT_TO_BOOL(ctx
->Const
.MinPointSize
);
682 params
[1] = FLOAT_TO_BOOL(ctx
->Const
.MaxPointSize
);
684 case GL_POINT_SMOOTH
:
685 *params
= ctx
->Point
.SmoothFlag
;
687 case GL_POINT_SMOOTH_HINT
:
688 *params
= ENUM_TO_BOOL(ctx
->Hint
.PointSmooth
);
690 case GL_POINT_SIZE_MIN_EXT
:
691 *params
= FLOAT_TO_BOOL(ctx
->Point
.MinSize
);
693 case GL_POINT_SIZE_MAX_EXT
:
694 *params
= FLOAT_TO_BOOL(ctx
->Point
.MaxSize
);
696 case GL_POINT_FADE_THRESHOLD_SIZE_EXT
:
697 *params
= FLOAT_TO_BOOL(ctx
->Point
.Threshold
);
699 case GL_DISTANCE_ATTENUATION_EXT
:
700 params
[0] = FLOAT_TO_BOOL(ctx
->Point
.Params
[0]);
701 params
[1] = FLOAT_TO_BOOL(ctx
->Point
.Params
[1]);
702 params
[2] = FLOAT_TO_BOOL(ctx
->Point
.Params
[2]);
704 case GL_POLYGON_MODE
:
705 params
[0] = ENUM_TO_BOOL(ctx
->Polygon
.FrontMode
);
706 params
[1] = ENUM_TO_BOOL(ctx
->Polygon
.BackMode
);
708 case GL_POLYGON_OFFSET_BIAS_EXT
: /* GL_EXT_polygon_offset */
709 *params
= FLOAT_TO_BOOL( ctx
->Polygon
.OffsetUnits
);
711 case GL_POLYGON_OFFSET_FACTOR
:
712 *params
= FLOAT_TO_BOOL( ctx
->Polygon
.OffsetFactor
);
714 case GL_POLYGON_OFFSET_UNITS
:
715 *params
= FLOAT_TO_BOOL( ctx
->Polygon
.OffsetUnits
);
717 case GL_POLYGON_SMOOTH
:
718 *params
= ctx
->Polygon
.SmoothFlag
;
720 case GL_POLYGON_SMOOTH_HINT
:
721 *params
= ENUM_TO_BOOL(ctx
->Hint
.PolygonSmooth
);
723 case GL_POLYGON_STIPPLE
:
724 *params
= ctx
->Polygon
.StippleFlag
;
726 case GL_PROJECTION_MATRIX
:
728 params
[i
] = FLOAT_TO_BOOL(ctx
->ProjectionMatrix
.m
[i
]);
731 case GL_PROJECTION_STACK_DEPTH
:
732 *params
= INT_TO_BOOL(ctx
->ProjectionStackDepth
+ 1);
735 *params
= ENUM_TO_BOOL(ctx
->Pixel
.ReadBuffer
);
738 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.RedBias
);
741 *params
= INT_TO_BOOL( ctx
->Visual
.redBits
);
744 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.RedScale
);
747 *params
= ENUM_TO_BOOL(ctx
->RenderMode
);
749 case GL_RESCALE_NORMAL
:
750 *params
= ctx
->Transform
.RescaleNormals
;
753 *params
= ctx
->Visual
.rgbMode
;
756 params
[0] = INT_TO_BOOL(ctx
->Scissor
.X
);
757 params
[1] = INT_TO_BOOL(ctx
->Scissor
.Y
);
758 params
[2] = INT_TO_BOOL(ctx
->Scissor
.Width
);
759 params
[3] = INT_TO_BOOL(ctx
->Scissor
.Height
);
761 case GL_SCISSOR_TEST
:
762 *params
= ctx
->Scissor
.Enabled
;
764 case GL_SELECTION_BUFFER_SIZE
:
765 *params
= INT_TO_BOOL(ctx
->Select
.BufferSize
);
768 *params
= ENUM_TO_BOOL(ctx
->Light
.ShadeModel
);
770 case GL_SHARED_TEXTURE_PALETTE_EXT
:
771 *params
= ctx
->Texture
.SharedPalette
;
773 case GL_STENCIL_BITS
:
774 *params
= INT_TO_BOOL(ctx
->Visual
.stencilBits
);
776 case GL_STENCIL_CLEAR_VALUE
:
777 *params
= INT_TO_BOOL(ctx
->Stencil
.Clear
);
779 case GL_STENCIL_FAIL
:
780 *params
= ENUM_TO_BOOL(ctx
->Stencil
.FailFunc
);
782 case GL_STENCIL_FUNC
:
783 *params
= ENUM_TO_BOOL(ctx
->Stencil
.Function
);
785 case GL_STENCIL_PASS_DEPTH_FAIL
:
786 *params
= ENUM_TO_BOOL(ctx
->Stencil
.ZFailFunc
);
788 case GL_STENCIL_PASS_DEPTH_PASS
:
789 *params
= ENUM_TO_BOOL(ctx
->Stencil
.ZPassFunc
);
792 *params
= INT_TO_BOOL(ctx
->Stencil
.Ref
);
794 case GL_STENCIL_TEST
:
795 *params
= ctx
->Stencil
.Enabled
;
797 case GL_STENCIL_VALUE_MASK
:
798 *params
= INT_TO_BOOL(ctx
->Stencil
.ValueMask
);
800 case GL_STENCIL_WRITEMASK
:
801 *params
= INT_TO_BOOL(ctx
->Stencil
.WriteMask
);
804 *params
= ctx
->Visual
.stereoMode
;
806 case GL_SUBPIXEL_BITS
:
807 *params
= INT_TO_BOOL(ctx
->Const
.SubPixelBits
);
810 *params
= _mesa_IsEnabled(GL_TEXTURE_1D
);
813 *params
= _mesa_IsEnabled(GL_TEXTURE_2D
);
816 *params
= _mesa_IsEnabled(GL_TEXTURE_3D
);
818 case GL_TEXTURE_BINDING_1D
:
819 *params
= INT_TO_BOOL(textureUnit
->Current1D
->Name
);
821 case GL_TEXTURE_BINDING_2D
:
822 *params
= INT_TO_BOOL(textureUnit
->Current2D
->Name
);
824 case GL_TEXTURE_BINDING_3D
:
825 *params
= INT_TO_BOOL(textureUnit
->Current3D
->Name
);
827 case GL_TEXTURE_ENV_COLOR
:
829 params
[0] = FLOAT_TO_BOOL(textureUnit
->EnvColor
[0]);
830 params
[1] = FLOAT_TO_BOOL(textureUnit
->EnvColor
[1]);
831 params
[2] = FLOAT_TO_BOOL(textureUnit
->EnvColor
[2]);
832 params
[3] = FLOAT_TO_BOOL(textureUnit
->EnvColor
[3]);
835 case GL_TEXTURE_ENV_MODE
:
836 *params
= ENUM_TO_BOOL(textureUnit
->EnvMode
);
838 case GL_TEXTURE_GEN_S
:
839 *params
= (textureUnit
->TexGenEnabled
& S_BIT
) ? GL_TRUE
: GL_FALSE
;
841 case GL_TEXTURE_GEN_T
:
842 *params
= (textureUnit
->TexGenEnabled
& T_BIT
) ? GL_TRUE
: GL_FALSE
;
844 case GL_TEXTURE_GEN_R
:
845 *params
= (textureUnit
->TexGenEnabled
& R_BIT
) ? GL_TRUE
: GL_FALSE
;
847 case GL_TEXTURE_GEN_Q
:
848 *params
= (textureUnit
->TexGenEnabled
& Q_BIT
) ? GL_TRUE
: GL_FALSE
;
850 case GL_TEXTURE_MATRIX
:
853 FLOAT_TO_BOOL(ctx
->TextureMatrix
[texUnit
].m
[i
]);
856 case GL_TEXTURE_STACK_DEPTH
:
857 *params
= INT_TO_BOOL(ctx
->TextureStackDepth
[texUnit
] + 1);
859 case GL_UNPACK_ALIGNMENT
:
860 *params
= INT_TO_BOOL(ctx
->Unpack
.Alignment
);
862 case GL_UNPACK_LSB_FIRST
:
863 *params
= ctx
->Unpack
.LsbFirst
;
865 case GL_UNPACK_ROW_LENGTH
:
866 *params
= INT_TO_BOOL(ctx
->Unpack
.RowLength
);
868 case GL_UNPACK_SKIP_PIXELS
:
869 *params
= INT_TO_BOOL(ctx
->Unpack
.SkipPixels
);
871 case GL_UNPACK_SKIP_ROWS
:
872 *params
= INT_TO_BOOL(ctx
->Unpack
.SkipRows
);
874 case GL_UNPACK_SWAP_BYTES
:
875 *params
= ctx
->Unpack
.SwapBytes
;
877 case GL_UNPACK_SKIP_IMAGES_EXT
:
878 *params
= ctx
->Unpack
.SkipImages
;
880 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
881 *params
= ctx
->Unpack
.ImageHeight
;
884 params
[0] = INT_TO_BOOL(ctx
->Viewport
.X
);
885 params
[1] = INT_TO_BOOL(ctx
->Viewport
.Y
);
886 params
[2] = INT_TO_BOOL(ctx
->Viewport
.Width
);
887 params
[3] = INT_TO_BOOL(ctx
->Viewport
.Height
);
890 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.ZoomX
);
893 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.ZoomY
);
895 case GL_VERTEX_ARRAY
:
896 *params
= ctx
->Array
.Vertex
.Enabled
;
898 case GL_VERTEX_ARRAY_SIZE
:
899 *params
= INT_TO_BOOL(ctx
->Array
.Vertex
.Size
);
901 case GL_VERTEX_ARRAY_TYPE
:
902 *params
= ENUM_TO_BOOL(ctx
->Array
.Vertex
.Type
);
904 case GL_VERTEX_ARRAY_STRIDE
:
905 *params
= INT_TO_BOOL(ctx
->Array
.Vertex
.Stride
);
907 case GL_VERTEX_ARRAY_COUNT_EXT
:
908 *params
= INT_TO_BOOL(0);
910 case GL_NORMAL_ARRAY
:
911 *params
= ctx
->Array
.Normal
.Enabled
;
913 case GL_NORMAL_ARRAY_TYPE
:
914 *params
= ENUM_TO_BOOL(ctx
->Array
.Normal
.Type
);
916 case GL_NORMAL_ARRAY_STRIDE
:
917 *params
= INT_TO_BOOL(ctx
->Array
.Normal
.Stride
);
919 case GL_NORMAL_ARRAY_COUNT_EXT
:
920 *params
= INT_TO_BOOL(0);
923 *params
= ctx
->Array
.Color
.Enabled
;
925 case GL_COLOR_ARRAY_SIZE
:
926 *params
= INT_TO_BOOL(ctx
->Array
.Color
.Size
);
928 case GL_COLOR_ARRAY_TYPE
:
929 *params
= ENUM_TO_BOOL(ctx
->Array
.Color
.Type
);
931 case GL_COLOR_ARRAY_STRIDE
:
932 *params
= INT_TO_BOOL(ctx
->Array
.Color
.Stride
);
934 case GL_COLOR_ARRAY_COUNT_EXT
:
935 *params
= INT_TO_BOOL(0);
938 *params
= ctx
->Array
.Index
.Enabled
;
940 case GL_INDEX_ARRAY_TYPE
:
941 *params
= ENUM_TO_BOOL(ctx
->Array
.Index
.Type
);
943 case GL_INDEX_ARRAY_STRIDE
:
944 *params
= INT_TO_BOOL(ctx
->Array
.Index
.Stride
);
946 case GL_INDEX_ARRAY_COUNT_EXT
:
947 *params
= INT_TO_BOOL(0);
949 case GL_TEXTURE_COORD_ARRAY
:
950 *params
= ctx
->Array
.TexCoord
[texUnit
].Enabled
;
952 case GL_TEXTURE_COORD_ARRAY_SIZE
:
953 *params
= INT_TO_BOOL(ctx
->Array
.TexCoord
[texUnit
].Size
);
955 case GL_TEXTURE_COORD_ARRAY_TYPE
:
956 *params
= ENUM_TO_BOOL(ctx
->Array
.TexCoord
[texUnit
].Type
);
958 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
959 *params
= INT_TO_BOOL(ctx
->Array
.TexCoord
[texUnit
].Stride
);
961 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
962 *params
= INT_TO_BOOL(0);
964 case GL_EDGE_FLAG_ARRAY
:
965 *params
= ctx
->Array
.EdgeFlag
.Enabled
;
967 case GL_EDGE_FLAG_ARRAY_STRIDE
:
968 *params
= INT_TO_BOOL(ctx
->Array
.EdgeFlag
.Stride
);
971 /* GL_ARB_multitexture */
972 case GL_MAX_TEXTURE_UNITS_ARB
:
973 *params
= ctx
->Const
.MaxTextureUnits
;
975 case GL_ACTIVE_TEXTURE_ARB
:
976 *params
= INT_TO_BOOL(GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
);
978 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
979 *params
= INT_TO_BOOL(GL_TEXTURE0_ARB
+ ctx
->Array
.ActiveTexture
);
982 /* GL_ARB_texture_cube_map */
983 case GL_TEXTURE_CUBE_MAP_ARB
:
984 if (ctx
->Extensions
.ARB_texture_cube_map
)
985 *params
= _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
);
987 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
989 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
990 if (ctx
->Extensions
.ARB_texture_cube_map
)
991 *params
= INT_TO_BOOL(textureUnit
->CurrentCubeMap
->Name
);
993 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
995 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
996 if (ctx
->Extensions
.ARB_texture_cube_map
)
997 *params
= INT_TO_BOOL(ctx
->Const
.MaxCubeTextureSize
);
999 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
1002 /* GL_ARB_texture_compression */
1003 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
1004 if (ctx
->Extensions
.ARB_texture_compression
) {
1005 *params
= INT_TO_BOOL(ctx
->Hint
.TextureCompression
);
1008 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
1010 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
1011 if (ctx
->Extensions
.ARB_texture_compression
) {
1012 *params
= INT_TO_BOOL(ctx
->Const
.NumCompressedTextureFormats
);
1015 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
1017 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
1018 if (ctx
->Extensions
.ARB_texture_compression
) {
1020 for (i
= 0; i
< ctx
->Const
.NumCompressedTextureFormats
; i
++)
1021 params
[i
] = INT_TO_BOOL(ctx
->Const
.CompressedTextureFormats
[i
]);
1024 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
1027 /* GL_EXT_compiled_vertex_array */
1028 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
1029 *params
= ctx
->Array
.LockFirst
? GL_TRUE
: GL_FALSE
;
1031 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
1032 *params
= ctx
->Array
.LockCount
? GL_TRUE
: GL_FALSE
;
1035 /* GL_ARB_transpose_matrix */
1036 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
1040 _math_transposef(tm
, ctx
->ColorMatrix
.m
);
1041 for (i
=0;i
<16;i
++) {
1042 params
[i
] = FLOAT_TO_BOOL(tm
[i
]);
1046 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
1050 _math_transposef(tm
, ctx
->ModelView
.m
);
1051 for (i
=0;i
<16;i
++) {
1052 params
[i
] = FLOAT_TO_BOOL(tm
[i
]);
1056 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
1060 _math_transposef(tm
, ctx
->ProjectionMatrix
.m
);
1061 for (i
=0;i
<16;i
++) {
1062 params
[i
] = FLOAT_TO_BOOL(tm
[i
]);
1066 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
1070 _math_transposef(tm
, ctx
->TextureMatrix
[texUnit
].m
);
1071 for (i
=0;i
<16;i
++) {
1072 params
[i
] = FLOAT_TO_BOOL(tm
[i
]);
1077 /* GL_HP_occlusion_test */
1078 case GL_OCCLUSION_TEST_HP
:
1079 if (ctx
->Extensions
.HP_occlusion_test
) {
1080 *params
= ctx
->Depth
.OcclusionTest
;
1083 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetBooleanv" );
1086 case GL_OCCLUSION_TEST_RESULT_HP
:
1087 if (ctx
->Extensions
.HP_occlusion_test
) {
1088 if (ctx
->Depth
.OcclusionTest
)
1089 *params
= ctx
->OcclusionResult
;
1091 *params
= ctx
->OcclusionResultSaved
;
1092 /* reset flag now */
1093 ctx
->OcclusionResult
= GL_FALSE
;
1094 ctx
->OcclusionResultSaved
= GL_FALSE
;
1097 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetBooleanv" );
1101 /* GL_SGIS_pixel_texture */
1102 case GL_PIXEL_TEXTURE_SGIS
:
1103 *params
= ctx
->Pixel
.PixelTextureEnabled
;
1106 /* GL_SGIX_pixel_texture */
1107 case GL_PIXEL_TEX_GEN_SGIX
:
1108 *params
= ctx
->Pixel
.PixelTextureEnabled
;
1110 case GL_PIXEL_TEX_GEN_MODE_SGIX
:
1111 *params
= (GLboolean
) pixel_texgen_mode(ctx
);
1114 /* GL_SGI_color_matrix (also in 1.2 imaging) */
1115 case GL_COLOR_MATRIX_SGI
:
1116 for (i
=0;i
<16;i
++) {
1117 params
[i
] = FLOAT_TO_BOOL(ctx
->ColorMatrix
.m
[i
]);
1120 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
1121 *params
= INT_TO_BOOL(ctx
->ColorStackDepth
+ 1);
1123 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
1124 *params
= FLOAT_TO_BOOL(MAX_COLOR_STACK_DEPTH
);
1126 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
1127 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixScale
[0]);
1129 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
1130 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixScale
[1]);
1132 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
1133 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixScale
[2]);
1135 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
1136 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixScale
[3]);
1138 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
1139 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixBias
[0]);
1141 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
1142 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixBias
[1]);
1144 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
1145 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixBias
[2]);
1147 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
1148 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostColorMatrixBias
[3]);
1151 /* GL_EXT_convolution (also in 1.2 imaging) */
1152 case GL_CONVOLUTION_1D_EXT
:
1153 if (ctx
->Extensions
.EXT_convolution
|| ctx
->Extensions
.ARB_imaging
) {
1154 *params
= ctx
->Pixel
.Convolution1DEnabled
;
1157 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
1161 case GL_CONVOLUTION_2D
:
1162 if (ctx
->Extensions
.EXT_convolution
|| ctx
->Extensions
.ARB_imaging
) {
1163 *params
= ctx
->Pixel
.Convolution2DEnabled
;
1166 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
1170 case GL_SEPARABLE_2D
:
1171 if (ctx
->Extensions
.EXT_convolution
|| ctx
->Extensions
.ARB_imaging
) {
1172 *params
= ctx
->Pixel
.Separable2DEnabled
;
1175 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
1179 case GL_MAX_CONVOLUTION_WIDTH
:
1180 *params
= INT_TO_BOOL(ctx
->Const
.MaxConvolutionWidth
);
1182 case GL_MAX_CONVOLUTION_HEIGHT
:
1183 *params
= INT_TO_BOOL(ctx
->Const
.MaxConvolutionHeight
);
1185 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
1186 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionScale
[0]);
1188 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
1189 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionScale
[1]);
1191 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
1192 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionScale
[2]);
1194 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
1195 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionScale
[3]);
1197 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
1198 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionBias
[0]);
1200 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
1201 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionBias
[1]);
1203 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
1204 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionBias
[2]);
1206 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
1207 *params
= FLOAT_TO_BOOL(ctx
->Pixel
.PostConvolutionBias
[2]);
1210 /* GL_SGI_color_table (also in 1.2 imaging */
1211 case GL_COLOR_TABLE_SGI
:
1212 *params
= ctx
->Pixel
.ColorTableEnabled
;
1214 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
1215 *params
= ctx
->Pixel
.PostConvolutionColorTableEnabled
;
1217 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
1218 *params
= ctx
->Pixel
.PostColorMatrixColorTableEnabled
;
1221 /* GL_EXT_secondary_color */
1222 case GL_COLOR_SUM_EXT
:
1223 *params
= ctx
->Fog
.ColorSumEnabled
;
1225 case GL_CURRENT_SECONDARY_COLOR_EXT
:
1226 FLUSH_CURRENT(ctx
, 0);
1227 params
[0] = INT_TO_BOOL(ctx
->Current
.SecondaryColor
[0]);
1228 params
[1] = INT_TO_BOOL(ctx
->Current
.SecondaryColor
[1]);
1229 params
[2] = INT_TO_BOOL(ctx
->Current
.SecondaryColor
[2]);
1231 case GL_SECONDARY_COLOR_ARRAY_EXT
:
1232 *params
= ctx
->Array
.SecondaryColor
.Enabled
;
1234 case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT
:
1235 *params
= ENUM_TO_BOOL(ctx
->Array
.SecondaryColor
.Type
);
1237 case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT
:
1238 *params
= INT_TO_BOOL(ctx
->Array
.SecondaryColor
.Stride
);
1240 case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT
:
1241 *params
= INT_TO_BOOL(ctx
->Array
.SecondaryColor
.Stride
);
1244 /* GL_EXT_fog_coord */
1245 case GL_CURRENT_FOG_COORDINATE_EXT
:
1246 FLUSH_CURRENT(ctx
, 0);
1247 *params
= FLOAT_TO_BOOL(ctx
->Current
.FogCoord
);
1249 case GL_FOG_COORDINATE_ARRAY_EXT
:
1250 *params
= ctx
->Array
.FogCoord
.Enabled
;
1252 case GL_FOG_COORDINATE_ARRAY_TYPE_EXT
:
1253 *params
= ENUM_TO_BOOL(ctx
->Array
.FogCoord
.Type
);
1255 case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
:
1256 *params
= INT_TO_BOOL(ctx
->Array
.FogCoord
.Stride
);
1259 /* GL_EXT_texture_filter_anisotropic */
1260 case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
:
1261 if (ctx
->Extensions
.EXT_texture_filter_anisotropic
) {
1262 *params
= FLOAT_TO_BOOL(ctx
->Const
.MaxTextureMaxAnisotropy
);
1265 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetBooleanv" );
1270 /* GL_ARB_multisample */
1271 case GL_MULTISAMPLE_ARB
:
1272 if (ctx
->Extensions
.ARB_multisample
) {
1273 *params
= ctx
->Multisample
.Enabled
;
1276 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
1279 case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB
:
1280 if (ctx
->Extensions
.ARB_multisample
) {
1281 *params
= ctx
->Multisample
.SampleAlphaToCoverage
;
1284 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
1287 case GL_SAMPLE_ALPHA_TO_ONE_ARB
:
1288 if (ctx
->Extensions
.ARB_multisample
) {
1289 *params
= ctx
->Multisample
.SampleAlphaToOne
;
1292 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
1295 case GL_SAMPLE_COVERAGE_ARB
:
1296 if (ctx
->Extensions
.ARB_multisample
) {
1297 *params
= ctx
->Multisample
.SampleCoverage
;
1300 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
1303 case GL_SAMPLE_COVERAGE_VALUE_ARB
:
1304 if (ctx
->Extensions
.ARB_multisample
) {
1305 *params
= FLOAT_TO_BOOL(ctx
->Multisample
.SampleCoverageValue
);
1308 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
1311 case GL_SAMPLE_COVERAGE_INVERT_ARB
:
1312 if (ctx
->Extensions
.ARB_multisample
) {
1313 *params
= ctx
->Multisample
.SampleCoverageInvert
;
1316 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
1319 case GL_SAMPLE_BUFFERS_ARB
:
1320 if (ctx
->Extensions
.ARB_multisample
) {
1321 *params
= 0; /* XXX fix someday */
1324 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
1327 case GL_SAMPLES_ARB
:
1328 if (ctx
->Extensions
.ARB_multisample
) {
1329 *params
= 0; /* XXX fix someday */
1332 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
1336 /* GL_MESA_sprite_point */
1337 case GL_SPRITE_POINT_MESA
:
1338 if (ctx
->Extensions
.MESA_sprite_point
) {
1339 *params
= ctx
->Point
.SpriteMode
;
1342 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetBooleanv" );
1347 /* GL_SGIS_generate_mipmap */
1348 case GL_GENERATE_MIPMAP_HINT_SGIS
:
1349 if (ctx
->Extensions
.SGIS_generate_mipmap
) {
1350 *params
= ENUM_TO_BOOL(ctx
->Hint
.GenerateMipmap
);
1353 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetBooleanv");
1359 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetBooleanv" );
1365 _mesa_GetDoublev( GLenum pname
, GLdouble
*params
)
1367 GET_CURRENT_CONTEXT(ctx
);
1369 GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
1370 const struct gl_texture_unit
*textureUnit
= &ctx
->Texture
.Unit
[texUnit
];
1371 ASSERT_OUTSIDE_BEGIN_END(ctx
);
1376 /* We need this in order to get correct results for
1377 * GL_OCCLUSION_TEST_RESULT_HP. There might be other important cases.
1379 FLUSH_VERTICES(ctx
, 0);
1381 if (MESA_VERBOSE
& VERBOSE_API
)
1382 fprintf(stderr
, "glGetDoublev %s\n", _mesa_lookup_enum_by_nr(pname
));
1384 if (ctx
->Driver
.GetDoublev
&& (*ctx
->Driver
.GetDoublev
)(ctx
, pname
, params
))
1388 case GL_ACCUM_RED_BITS
:
1389 *params
= (GLdouble
) ctx
->Visual
.accumRedBits
;
1391 case GL_ACCUM_GREEN_BITS
:
1392 *params
= (GLdouble
) ctx
->Visual
.accumGreenBits
;
1394 case GL_ACCUM_BLUE_BITS
:
1395 *params
= (GLdouble
) ctx
->Visual
.accumBlueBits
;
1397 case GL_ACCUM_ALPHA_BITS
:
1398 *params
= (GLdouble
) ctx
->Visual
.accumAlphaBits
;
1400 case GL_ACCUM_CLEAR_VALUE
:
1401 params
[0] = (GLdouble
) ctx
->Accum
.ClearColor
[0];
1402 params
[1] = (GLdouble
) ctx
->Accum
.ClearColor
[1];
1403 params
[2] = (GLdouble
) ctx
->Accum
.ClearColor
[2];
1404 params
[3] = (GLdouble
) ctx
->Accum
.ClearColor
[3];
1407 *params
= (GLdouble
) ctx
->Pixel
.AlphaBias
;
1410 *params
= (GLdouble
) ctx
->Visual
.alphaBits
;
1412 case GL_ALPHA_SCALE
:
1413 *params
= (GLdouble
) ctx
->Pixel
.AlphaScale
;
1416 *params
= (GLdouble
) ctx
->Color
.AlphaEnabled
;
1418 case GL_ALPHA_TEST_FUNC
:
1419 *params
= ENUM_TO_DOUBLE(ctx
->Color
.AlphaFunc
);
1421 case GL_ALPHA_TEST_REF
:
1422 *params
= (GLdouble
) ctx
->Color
.AlphaRef
/ CHAN_MAXF
;
1424 case GL_ATTRIB_STACK_DEPTH
:
1425 *params
= (GLdouble
) (ctx
->AttribStackDepth
);
1427 case GL_AUTO_NORMAL
:
1428 *params
= (GLdouble
) ctx
->Eval
.AutoNormal
;
1430 case GL_AUX_BUFFERS
:
1431 *params
= (GLdouble
) ctx
->Const
.NumAuxBuffers
;
1434 *params
= (GLdouble
) ctx
->Color
.BlendEnabled
;
1437 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendDstRGB
);
1440 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendSrcRGB
);
1442 case GL_BLEND_SRC_RGB_EXT
:
1443 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendSrcRGB
);
1445 case GL_BLEND_DST_RGB_EXT
:
1446 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendDstRGB
);
1448 case GL_BLEND_SRC_ALPHA_EXT
:
1449 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendSrcA
);
1451 case GL_BLEND_DST_ALPHA_EXT
:
1452 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendDstA
);
1454 case GL_BLEND_EQUATION_EXT
:
1455 *params
= ENUM_TO_DOUBLE(ctx
->Color
.BlendEquation
);
1457 case GL_BLEND_COLOR_EXT
:
1458 params
[0] = (GLdouble
) ctx
->Color
.BlendColor
[0];
1459 params
[1] = (GLdouble
) ctx
->Color
.BlendColor
[1];
1460 params
[2] = (GLdouble
) ctx
->Color
.BlendColor
[2];
1461 params
[3] = (GLdouble
) ctx
->Color
.BlendColor
[3];
1464 *params
= (GLdouble
) ctx
->Pixel
.BlueBias
;
1467 *params
= (GLdouble
) ctx
->Visual
.blueBits
;
1470 *params
= (GLdouble
) ctx
->Pixel
.BlueScale
;
1472 case GL_CLIENT_ATTRIB_STACK_DEPTH
:
1473 *params
= (GLdouble
) (ctx
->ClientAttribStackDepth
);
1475 case GL_CLIP_PLANE0
:
1476 case GL_CLIP_PLANE1
:
1477 case GL_CLIP_PLANE2
:
1478 case GL_CLIP_PLANE3
:
1479 case GL_CLIP_PLANE4
:
1480 case GL_CLIP_PLANE5
:
1481 *params
= (GLdouble
) ctx
->Transform
.ClipEnabled
[pname
-GL_CLIP_PLANE0
];
1483 case GL_COLOR_CLEAR_VALUE
:
1484 params
[0] = (GLdouble
) CHAN_TO_FLOAT(ctx
->Color
.ClearColor
[0]);
1485 params
[1] = (GLdouble
) CHAN_TO_FLOAT(ctx
->Color
.ClearColor
[1]);
1486 params
[2] = (GLdouble
) CHAN_TO_FLOAT(ctx
->Color
.ClearColor
[2]);
1487 params
[3] = (GLdouble
) CHAN_TO_FLOAT(ctx
->Color
.ClearColor
[3]);
1489 case GL_COLOR_MATERIAL
:
1490 *params
= (GLdouble
) ctx
->Light
.ColorMaterialEnabled
;
1492 case GL_COLOR_MATERIAL_FACE
:
1493 *params
= ENUM_TO_DOUBLE(ctx
->Light
.ColorMaterialFace
);
1495 case GL_COLOR_MATERIAL_PARAMETER
:
1496 *params
= ENUM_TO_DOUBLE(ctx
->Light
.ColorMaterialMode
);
1498 case GL_COLOR_WRITEMASK
:
1499 params
[0] = ctx
->Color
.ColorMask
[RCOMP
] ? 1.0 : 0.0;
1500 params
[1] = ctx
->Color
.ColorMask
[GCOMP
] ? 1.0 : 0.0;
1501 params
[2] = ctx
->Color
.ColorMask
[BCOMP
] ? 1.0 : 0.0;
1502 params
[3] = ctx
->Color
.ColorMask
[ACOMP
] ? 1.0 : 0.0;
1505 *params
= (GLdouble
) ctx
->Polygon
.CullFlag
;
1507 case GL_CULL_FACE_MODE
:
1508 *params
= ENUM_TO_DOUBLE(ctx
->Polygon
.CullFaceMode
);
1510 case GL_CURRENT_COLOR
:
1511 FLUSH_CURRENT(ctx
, 0);
1512 params
[0] = (ctx
->Current
.Color
[0]);
1513 params
[1] = (ctx
->Current
.Color
[1]);
1514 params
[2] = (ctx
->Current
.Color
[2]);
1515 params
[3] = (ctx
->Current
.Color
[3]);
1517 case GL_CURRENT_INDEX
:
1518 FLUSH_CURRENT(ctx
, 0);
1519 *params
= (GLdouble
) ctx
->Current
.Index
;
1521 case GL_CURRENT_NORMAL
:
1522 FLUSH_CURRENT(ctx
, 0);
1523 params
[0] = (GLdouble
) ctx
->Current
.Normal
[0];
1524 params
[1] = (GLdouble
) ctx
->Current
.Normal
[1];
1525 params
[2] = (GLdouble
) ctx
->Current
.Normal
[2];
1527 case GL_CURRENT_RASTER_COLOR
:
1528 params
[0] = (GLdouble
) ctx
->Current
.RasterColor
[0];
1529 params
[1] = (GLdouble
) ctx
->Current
.RasterColor
[1];
1530 params
[2] = (GLdouble
) ctx
->Current
.RasterColor
[2];
1531 params
[3] = (GLdouble
) ctx
->Current
.RasterColor
[3];
1533 case GL_CURRENT_RASTER_DISTANCE
:
1534 params
[0] = (GLdouble
) ctx
->Current
.RasterDistance
;
1536 case GL_CURRENT_RASTER_INDEX
:
1537 *params
= (GLdouble
) ctx
->Current
.RasterIndex
;
1539 case GL_CURRENT_RASTER_POSITION
:
1540 params
[0] = (GLdouble
) ctx
->Current
.RasterPos
[0];
1541 params
[1] = (GLdouble
) ctx
->Current
.RasterPos
[1];
1542 params
[2] = (GLdouble
) ctx
->Current
.RasterPos
[2];
1543 params
[3] = (GLdouble
) ctx
->Current
.RasterPos
[3];
1545 case GL_CURRENT_RASTER_TEXTURE_COORDS
:
1546 params
[0] = (GLdouble
) ctx
->Current
.RasterMultiTexCoord
[texUnit
][0];
1547 params
[1] = (GLdouble
) ctx
->Current
.RasterMultiTexCoord
[texUnit
][1];
1548 params
[2] = (GLdouble
) ctx
->Current
.RasterMultiTexCoord
[texUnit
][2];
1549 params
[3] = (GLdouble
) ctx
->Current
.RasterMultiTexCoord
[texUnit
][3];
1551 case GL_CURRENT_RASTER_POSITION_VALID
:
1552 *params
= (GLdouble
) ctx
->Current
.RasterPosValid
;
1554 case GL_CURRENT_TEXTURE_COORDS
:
1555 FLUSH_CURRENT(ctx
, 0);
1556 params
[0] = (GLdouble
) ctx
->Current
.Texcoord
[texUnit
][0];
1557 params
[1] = (GLdouble
) ctx
->Current
.Texcoord
[texUnit
][1];
1558 params
[2] = (GLdouble
) ctx
->Current
.Texcoord
[texUnit
][2];
1559 params
[3] = (GLdouble
) ctx
->Current
.Texcoord
[texUnit
][3];
1562 *params
= (GLdouble
) ctx
->Pixel
.DepthBias
;
1565 *params
= (GLdouble
) ctx
->Visual
.depthBits
;
1567 case GL_DEPTH_CLEAR_VALUE
:
1568 *params
= (GLdouble
) ctx
->Depth
.Clear
;
1571 *params
= ENUM_TO_DOUBLE(ctx
->Depth
.Func
);
1573 case GL_DEPTH_RANGE
:
1574 params
[0] = (GLdouble
) ctx
->Viewport
.Near
;
1575 params
[1] = (GLdouble
) ctx
->Viewport
.Far
;
1577 case GL_DEPTH_SCALE
:
1578 *params
= (GLdouble
) ctx
->Pixel
.DepthScale
;
1581 *params
= (GLdouble
) ctx
->Depth
.Test
;
1583 case GL_DEPTH_WRITEMASK
:
1584 *params
= (GLdouble
) ctx
->Depth
.Mask
;
1587 *params
= (GLdouble
) ctx
->Color
.DitherFlag
;
1589 case GL_DOUBLEBUFFER
:
1590 *params
= (GLdouble
) ctx
->Visual
.doubleBufferMode
;
1592 case GL_DRAW_BUFFER
:
1593 *params
= ENUM_TO_DOUBLE(ctx
->Color
.DrawBuffer
);
1596 FLUSH_CURRENT(ctx
, 0);
1597 *params
= (GLdouble
) ctx
->Current
.EdgeFlag
;
1599 case GL_FEEDBACK_BUFFER_SIZE
:
1600 *params
= (GLdouble
) ctx
->Feedback
.BufferSize
;
1602 case GL_FEEDBACK_BUFFER_TYPE
:
1603 *params
= ENUM_TO_DOUBLE(ctx
->Feedback
.Type
);
1606 *params
= (GLdouble
) ctx
->Fog
.Enabled
;
1609 params
[0] = (GLdouble
) ctx
->Fog
.Color
[0];
1610 params
[1] = (GLdouble
) ctx
->Fog
.Color
[1];
1611 params
[2] = (GLdouble
) ctx
->Fog
.Color
[2];
1612 params
[3] = (GLdouble
) ctx
->Fog
.Color
[3];
1614 case GL_FOG_DENSITY
:
1615 *params
= (GLdouble
) ctx
->Fog
.Density
;
1618 *params
= (GLdouble
) ctx
->Fog
.End
;
1621 *params
= ENUM_TO_DOUBLE(ctx
->Hint
.Fog
);
1624 *params
= (GLdouble
) ctx
->Fog
.Index
;
1627 *params
= ENUM_TO_DOUBLE(ctx
->Fog
.Mode
);
1630 *params
= (GLdouble
) ctx
->Fog
.Start
;
1633 *params
= ENUM_TO_DOUBLE(ctx
->Polygon
.FrontFace
);
1636 *params
= (GLdouble
) ctx
->Pixel
.GreenBias
;
1639 *params
= (GLdouble
) ctx
->Visual
.greenBits
;
1641 case GL_GREEN_SCALE
:
1642 *params
= (GLdouble
) ctx
->Pixel
.GreenScale
;
1645 if (ctx
->Extensions
.EXT_histogram
|| ctx
->Extensions
.ARB_imaging
) {
1646 *params
= (GLdouble
) ctx
->Pixel
.HistogramEnabled
;
1649 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
1654 *params
= (GLdouble
) ctx
->Visual
.indexBits
;
1656 case GL_INDEX_CLEAR_VALUE
:
1657 *params
= (GLdouble
) ctx
->Color
.ClearIndex
;
1660 *params
= ctx
->Visual
.rgbMode
? 0.0 : 1.0;
1662 case GL_INDEX_OFFSET
:
1663 *params
= (GLdouble
) ctx
->Pixel
.IndexOffset
;
1665 case GL_INDEX_SHIFT
:
1666 *params
= (GLdouble
) ctx
->Pixel
.IndexShift
;
1668 case GL_INDEX_WRITEMASK
:
1669 *params
= (GLdouble
) ctx
->Color
.IndexMask
;
1679 *params
= (GLdouble
) ctx
->Light
.Light
[pname
-GL_LIGHT0
].Enabled
;
1682 *params
= (GLdouble
) ctx
->Light
.Enabled
;
1684 case GL_LIGHT_MODEL_AMBIENT
:
1685 params
[0] = (GLdouble
) ctx
->Light
.Model
.Ambient
[0];
1686 params
[1] = (GLdouble
) ctx
->Light
.Model
.Ambient
[1];
1687 params
[2] = (GLdouble
) ctx
->Light
.Model
.Ambient
[2];
1688 params
[3] = (GLdouble
) ctx
->Light
.Model
.Ambient
[3];
1690 case GL_LIGHT_MODEL_COLOR_CONTROL
:
1691 params
[0] = (GLdouble
) ctx
->Light
.Model
.ColorControl
;
1693 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
1694 *params
= (GLdouble
) ctx
->Light
.Model
.LocalViewer
;
1696 case GL_LIGHT_MODEL_TWO_SIDE
:
1697 *params
= (GLdouble
) ctx
->Light
.Model
.TwoSide
;
1699 case GL_LINE_SMOOTH
:
1700 *params
= (GLdouble
) ctx
->Line
.SmoothFlag
;
1702 case GL_LINE_SMOOTH_HINT
:
1703 *params
= ENUM_TO_DOUBLE(ctx
->Hint
.LineSmooth
);
1705 case GL_LINE_STIPPLE
:
1706 *params
= (GLdouble
) ctx
->Line
.StippleFlag
;
1708 case GL_LINE_STIPPLE_PATTERN
:
1709 *params
= (GLdouble
) ctx
->Line
.StipplePattern
;
1711 case GL_LINE_STIPPLE_REPEAT
:
1712 *params
= (GLdouble
) ctx
->Line
.StippleFactor
;
1715 *params
= (GLdouble
) ctx
->Line
.Width
;
1717 case GL_LINE_WIDTH_GRANULARITY
:
1718 *params
= (GLdouble
) ctx
->Const
.LineWidthGranularity
;
1720 case GL_LINE_WIDTH_RANGE
:
1721 params
[0] = (GLdouble
) ctx
->Const
.MinLineWidthAA
;
1722 params
[1] = (GLdouble
) ctx
->Const
.MaxLineWidthAA
;
1724 case GL_ALIASED_LINE_WIDTH_RANGE
:
1725 params
[0] = (GLdouble
) ctx
->Const
.MinLineWidth
;
1726 params
[1] = (GLdouble
) ctx
->Const
.MaxLineWidth
;
1729 *params
= (GLdouble
) ctx
->List
.ListBase
;
1732 *params
= (GLdouble
) ctx
->CurrentListNum
;
1735 *params
= ctx
->ExecuteFlag
? ENUM_TO_DOUBLE(GL_COMPILE_AND_EXECUTE
)
1736 : ENUM_TO_DOUBLE(GL_COMPILE
);
1738 case GL_INDEX_LOGIC_OP
:
1739 *params
= (GLdouble
) ctx
->Color
.IndexLogicOpEnabled
;
1741 case GL_COLOR_LOGIC_OP
:
1742 *params
= (GLdouble
) ctx
->Color
.ColorLogicOpEnabled
;
1744 case GL_LOGIC_OP_MODE
:
1745 *params
= ENUM_TO_DOUBLE(ctx
->Color
.LogicOp
);
1747 case GL_MAP1_COLOR_4
:
1748 *params
= (GLdouble
) ctx
->Eval
.Map1Color4
;
1750 case GL_MAP1_GRID_DOMAIN
:
1751 params
[0] = (GLdouble
) ctx
->Eval
.MapGrid1u1
;
1752 params
[1] = (GLdouble
) ctx
->Eval
.MapGrid1u2
;
1754 case GL_MAP1_GRID_SEGMENTS
:
1755 *params
= (GLdouble
) ctx
->Eval
.MapGrid1un
;
1758 *params
= (GLdouble
) ctx
->Eval
.Map1Index
;
1760 case GL_MAP1_NORMAL
:
1761 *params
= (GLdouble
) ctx
->Eval
.Map1Normal
;
1763 case GL_MAP1_TEXTURE_COORD_1
:
1764 *params
= (GLdouble
) ctx
->Eval
.Map1TextureCoord1
;
1766 case GL_MAP1_TEXTURE_COORD_2
:
1767 *params
= (GLdouble
) ctx
->Eval
.Map1TextureCoord2
;
1769 case GL_MAP1_TEXTURE_COORD_3
:
1770 *params
= (GLdouble
) ctx
->Eval
.Map1TextureCoord3
;
1772 case GL_MAP1_TEXTURE_COORD_4
:
1773 *params
= (GLdouble
) ctx
->Eval
.Map1TextureCoord4
;
1775 case GL_MAP1_VERTEX_3
:
1776 *params
= (GLdouble
) ctx
->Eval
.Map1Vertex3
;
1778 case GL_MAP1_VERTEX_4
:
1779 *params
= (GLdouble
) ctx
->Eval
.Map1Vertex4
;
1781 case GL_MAP2_COLOR_4
:
1782 *params
= (GLdouble
) ctx
->Eval
.Map2Color4
;
1784 case GL_MAP2_GRID_DOMAIN
:
1785 params
[0] = (GLdouble
) ctx
->Eval
.MapGrid2u1
;
1786 params
[1] = (GLdouble
) ctx
->Eval
.MapGrid2u2
;
1787 params
[2] = (GLdouble
) ctx
->Eval
.MapGrid2v1
;
1788 params
[3] = (GLdouble
) ctx
->Eval
.MapGrid2v2
;
1790 case GL_MAP2_GRID_SEGMENTS
:
1791 params
[0] = (GLdouble
) ctx
->Eval
.MapGrid2un
;
1792 params
[1] = (GLdouble
) ctx
->Eval
.MapGrid2vn
;
1795 *params
= (GLdouble
) ctx
->Eval
.Map2Index
;
1797 case GL_MAP2_NORMAL
:
1798 *params
= (GLdouble
) ctx
->Eval
.Map2Normal
;
1800 case GL_MAP2_TEXTURE_COORD_1
:
1801 *params
= (GLdouble
) ctx
->Eval
.Map2TextureCoord1
;
1803 case GL_MAP2_TEXTURE_COORD_2
:
1804 *params
= (GLdouble
) ctx
->Eval
.Map2TextureCoord2
;
1806 case GL_MAP2_TEXTURE_COORD_3
:
1807 *params
= (GLdouble
) ctx
->Eval
.Map2TextureCoord3
;
1809 case GL_MAP2_TEXTURE_COORD_4
:
1810 *params
= (GLdouble
) ctx
->Eval
.Map2TextureCoord4
;
1812 case GL_MAP2_VERTEX_3
:
1813 *params
= (GLdouble
) ctx
->Eval
.Map2Vertex3
;
1815 case GL_MAP2_VERTEX_4
:
1816 *params
= (GLdouble
) ctx
->Eval
.Map2Vertex4
;
1819 *params
= (GLdouble
) ctx
->Pixel
.MapColorFlag
;
1821 case GL_MAP_STENCIL
:
1822 *params
= (GLdouble
) ctx
->Pixel
.MapStencilFlag
;
1824 case GL_MATRIX_MODE
:
1825 *params
= ENUM_TO_DOUBLE(ctx
->Transform
.MatrixMode
);
1827 case GL_MAX_ATTRIB_STACK_DEPTH
:
1828 *params
= (GLdouble
) MAX_ATTRIB_STACK_DEPTH
;
1830 case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
:
1831 *params
= (GLdouble
) MAX_CLIENT_ATTRIB_STACK_DEPTH
;
1833 case GL_MAX_CLIP_PLANES
:
1834 *params
= (GLdouble
) ctx
->Const
.MaxClipPlanes
;
1836 case GL_MAX_ELEMENTS_VERTICES
: /* GL_VERSION_1_2 */
1837 *params
= (GLdouble
) ctx
->Const
.MaxArrayLockSize
;
1839 case GL_MAX_ELEMENTS_INDICES
: /* GL_VERSION_1_2 */
1840 *params
= (GLdouble
) ctx
->Const
.MaxArrayLockSize
;
1842 case GL_MAX_EVAL_ORDER
:
1843 *params
= (GLdouble
) MAX_EVAL_ORDER
;
1846 *params
= (GLdouble
) ctx
->Const
.MaxLights
;
1848 case GL_MAX_LIST_NESTING
:
1849 *params
= (GLdouble
) MAX_LIST_NESTING
;
1851 case GL_MAX_MODELVIEW_STACK_DEPTH
:
1852 *params
= (GLdouble
) MAX_MODELVIEW_STACK_DEPTH
;
1854 case GL_MAX_NAME_STACK_DEPTH
:
1855 *params
= (GLdouble
) MAX_NAME_STACK_DEPTH
;
1857 case GL_MAX_PIXEL_MAP_TABLE
:
1858 *params
= (GLdouble
) MAX_PIXEL_MAP_TABLE
;
1860 case GL_MAX_PROJECTION_STACK_DEPTH
:
1861 *params
= (GLdouble
) MAX_PROJECTION_STACK_DEPTH
;
1863 case GL_MAX_TEXTURE_SIZE
:
1864 case GL_MAX_3D_TEXTURE_SIZE
:
1865 *params
= (GLdouble
) ctx
->Const
.MaxTextureSize
;
1867 case GL_MAX_TEXTURE_STACK_DEPTH
:
1868 *params
= (GLdouble
) MAX_TEXTURE_STACK_DEPTH
;
1870 case GL_MAX_VIEWPORT_DIMS
:
1871 params
[0] = (GLdouble
) MAX_WIDTH
;
1872 params
[1] = (GLdouble
) MAX_HEIGHT
;
1875 *params
= (GLdouble
) ctx
->Pixel
.MinMaxEnabled
;
1877 case GL_MODELVIEW_MATRIX
:
1878 for (i
=0;i
<16;i
++) {
1879 params
[i
] = (GLdouble
) ctx
->ModelView
.m
[i
];
1882 case GL_MODELVIEW_STACK_DEPTH
:
1883 *params
= (GLdouble
) (ctx
->ModelViewStackDepth
+ 1);
1885 case GL_NAME_STACK_DEPTH
:
1886 *params
= (GLdouble
) ctx
->Select
.NameStackDepth
;
1889 *params
= (GLdouble
) ctx
->Transform
.Normalize
;
1891 case GL_PACK_ALIGNMENT
:
1892 *params
= (GLdouble
) ctx
->Pack
.Alignment
;
1894 case GL_PACK_LSB_FIRST
:
1895 *params
= (GLdouble
) ctx
->Pack
.LsbFirst
;
1897 case GL_PACK_ROW_LENGTH
:
1898 *params
= (GLdouble
) ctx
->Pack
.RowLength
;
1900 case GL_PACK_SKIP_PIXELS
:
1901 *params
= (GLdouble
) ctx
->Pack
.SkipPixels
;
1903 case GL_PACK_SKIP_ROWS
:
1904 *params
= (GLdouble
) ctx
->Pack
.SkipRows
;
1906 case GL_PACK_SWAP_BYTES
:
1907 *params
= (GLdouble
) ctx
->Pack
.SwapBytes
;
1909 case GL_PACK_SKIP_IMAGES_EXT
:
1910 *params
= (GLdouble
) ctx
->Pack
.SkipImages
;
1912 case GL_PACK_IMAGE_HEIGHT_EXT
:
1913 *params
= (GLdouble
) ctx
->Pack
.ImageHeight
;
1915 case GL_PERSPECTIVE_CORRECTION_HINT
:
1916 *params
= ENUM_TO_DOUBLE(ctx
->Hint
.PerspectiveCorrection
);
1918 case GL_PIXEL_MAP_A_TO_A_SIZE
:
1919 *params
= (GLdouble
) ctx
->Pixel
.MapAtoAsize
;
1921 case GL_PIXEL_MAP_B_TO_B_SIZE
:
1922 *params
= (GLdouble
) ctx
->Pixel
.MapBtoBsize
;
1924 case GL_PIXEL_MAP_G_TO_G_SIZE
:
1925 *params
= (GLdouble
) ctx
->Pixel
.MapGtoGsize
;
1927 case GL_PIXEL_MAP_I_TO_A_SIZE
:
1928 *params
= (GLdouble
) ctx
->Pixel
.MapItoAsize
;
1930 case GL_PIXEL_MAP_I_TO_B_SIZE
:
1931 *params
= (GLdouble
) ctx
->Pixel
.MapItoBsize
;
1933 case GL_PIXEL_MAP_I_TO_G_SIZE
:
1934 *params
= (GLdouble
) ctx
->Pixel
.MapItoGsize
;
1936 case GL_PIXEL_MAP_I_TO_I_SIZE
:
1937 *params
= (GLdouble
) ctx
->Pixel
.MapItoIsize
;
1939 case GL_PIXEL_MAP_I_TO_R_SIZE
:
1940 *params
= (GLdouble
) ctx
->Pixel
.MapItoRsize
;
1942 case GL_PIXEL_MAP_R_TO_R_SIZE
:
1943 *params
= (GLdouble
) ctx
->Pixel
.MapRtoRsize
;
1945 case GL_PIXEL_MAP_S_TO_S_SIZE
:
1946 *params
= (GLdouble
) ctx
->Pixel
.MapStoSsize
;
1949 *params
= (GLdouble
) ctx
->Point
.Size
;
1951 case GL_POINT_SIZE_GRANULARITY
:
1952 *params
= (GLdouble
) ctx
->Const
.PointSizeGranularity
;
1954 case GL_POINT_SIZE_RANGE
:
1955 params
[0] = (GLdouble
) ctx
->Const
.MinPointSizeAA
;
1956 params
[1] = (GLdouble
) ctx
->Const
.MaxPointSizeAA
;
1958 case GL_ALIASED_POINT_SIZE_RANGE
:
1959 params
[0] = (GLdouble
) ctx
->Const
.MinPointSize
;
1960 params
[1] = (GLdouble
) ctx
->Const
.MaxPointSize
;
1962 case GL_POINT_SMOOTH
:
1963 *params
= (GLdouble
) ctx
->Point
.SmoothFlag
;
1965 case GL_POINT_SMOOTH_HINT
:
1966 *params
= ENUM_TO_DOUBLE(ctx
->Hint
.PointSmooth
);
1968 case GL_POINT_SIZE_MIN_EXT
:
1969 *params
= (GLdouble
) (ctx
->Point
.MinSize
);
1971 case GL_POINT_SIZE_MAX_EXT
:
1972 *params
= (GLdouble
) (ctx
->Point
.MaxSize
);
1974 case GL_POINT_FADE_THRESHOLD_SIZE_EXT
:
1975 *params
= (GLdouble
) (ctx
->Point
.Threshold
);
1977 case GL_DISTANCE_ATTENUATION_EXT
:
1978 params
[0] = (GLdouble
) (ctx
->Point
.Params
[0]);
1979 params
[1] = (GLdouble
) (ctx
->Point
.Params
[1]);
1980 params
[2] = (GLdouble
) (ctx
->Point
.Params
[2]);
1982 case GL_POLYGON_MODE
:
1983 params
[0] = ENUM_TO_DOUBLE(ctx
->Polygon
.FrontMode
);
1984 params
[1] = ENUM_TO_DOUBLE(ctx
->Polygon
.BackMode
);
1986 case GL_POLYGON_OFFSET_BIAS_EXT
: /* GL_EXT_polygon_offset */
1987 *params
= (GLdouble
) ctx
->Polygon
.OffsetUnits
;
1989 case GL_POLYGON_OFFSET_FACTOR
:
1990 *params
= (GLdouble
) ctx
->Polygon
.OffsetFactor
;
1992 case GL_POLYGON_OFFSET_UNITS
:
1993 *params
= (GLdouble
) ctx
->Polygon
.OffsetUnits
;
1995 case GL_POLYGON_SMOOTH
:
1996 *params
= (GLdouble
) ctx
->Polygon
.SmoothFlag
;
1998 case GL_POLYGON_SMOOTH_HINT
:
1999 *params
= ENUM_TO_DOUBLE(ctx
->Hint
.PolygonSmooth
);
2001 case GL_POLYGON_STIPPLE
:
2002 *params
= (GLdouble
) ctx
->Polygon
.StippleFlag
;
2004 case GL_PROJECTION_MATRIX
:
2005 for (i
=0;i
<16;i
++) {
2006 params
[i
] = (GLdouble
) ctx
->ProjectionMatrix
.m
[i
];
2009 case GL_PROJECTION_STACK_DEPTH
:
2010 *params
= (GLdouble
) (ctx
->ProjectionStackDepth
+ 1);
2012 case GL_READ_BUFFER
:
2013 *params
= ENUM_TO_DOUBLE(ctx
->Pixel
.ReadBuffer
);
2016 *params
= (GLdouble
) ctx
->Pixel
.RedBias
;
2019 *params
= (GLdouble
) ctx
->Visual
.redBits
;
2022 *params
= (GLdouble
) ctx
->Pixel
.RedScale
;
2024 case GL_RENDER_MODE
:
2025 *params
= ENUM_TO_DOUBLE(ctx
->RenderMode
);
2027 case GL_RESCALE_NORMAL
:
2028 *params
= (GLdouble
) ctx
->Transform
.RescaleNormals
;
2031 *params
= (GLdouble
) ctx
->Visual
.rgbMode
;
2033 case GL_SCISSOR_BOX
:
2034 params
[0] = (GLdouble
) ctx
->Scissor
.X
;
2035 params
[1] = (GLdouble
) ctx
->Scissor
.Y
;
2036 params
[2] = (GLdouble
) ctx
->Scissor
.Width
;
2037 params
[3] = (GLdouble
) ctx
->Scissor
.Height
;
2039 case GL_SCISSOR_TEST
:
2040 *params
= (GLdouble
) ctx
->Scissor
.Enabled
;
2042 case GL_SELECTION_BUFFER_SIZE
:
2043 *params
= (GLdouble
) ctx
->Select
.BufferSize
;
2045 case GL_SHADE_MODEL
:
2046 *params
= ENUM_TO_DOUBLE(ctx
->Light
.ShadeModel
);
2048 case GL_SHARED_TEXTURE_PALETTE_EXT
:
2049 *params
= (GLdouble
) ctx
->Texture
.SharedPalette
;
2051 case GL_STENCIL_BITS
:
2052 *params
= (GLdouble
) ctx
->Visual
.stencilBits
;
2054 case GL_STENCIL_CLEAR_VALUE
:
2055 *params
= (GLdouble
) ctx
->Stencil
.Clear
;
2057 case GL_STENCIL_FAIL
:
2058 *params
= ENUM_TO_DOUBLE(ctx
->Stencil
.FailFunc
);
2060 case GL_STENCIL_FUNC
:
2061 *params
= ENUM_TO_DOUBLE(ctx
->Stencil
.Function
);
2063 case GL_STENCIL_PASS_DEPTH_FAIL
:
2064 *params
= ENUM_TO_DOUBLE(ctx
->Stencil
.ZFailFunc
);
2066 case GL_STENCIL_PASS_DEPTH_PASS
:
2067 *params
= ENUM_TO_DOUBLE(ctx
->Stencil
.ZPassFunc
);
2069 case GL_STENCIL_REF
:
2070 *params
= (GLdouble
) ctx
->Stencil
.Ref
;
2072 case GL_STENCIL_TEST
:
2073 *params
= (GLdouble
) ctx
->Stencil
.Enabled
;
2075 case GL_STENCIL_VALUE_MASK
:
2076 *params
= (GLdouble
) ctx
->Stencil
.ValueMask
;
2078 case GL_STENCIL_WRITEMASK
:
2079 *params
= (GLdouble
) ctx
->Stencil
.WriteMask
;
2082 *params
= (GLdouble
) ctx
->Visual
.stereoMode
;
2084 case GL_SUBPIXEL_BITS
:
2085 *params
= (GLdouble
) ctx
->Const
.SubPixelBits
;
2088 *params
= _mesa_IsEnabled(GL_TEXTURE_1D
) ? 1.0 : 0.0;
2091 *params
= _mesa_IsEnabled(GL_TEXTURE_2D
) ? 1.0 : 0.0;
2094 *params
= _mesa_IsEnabled(GL_TEXTURE_3D
) ? 1.0 : 0.0;
2096 case GL_TEXTURE_BINDING_1D
:
2097 *params
= (GLdouble
) textureUnit
->Current1D
->Name
;
2099 case GL_TEXTURE_BINDING_2D
:
2100 *params
= (GLdouble
) textureUnit
->Current2D
->Name
;
2102 case GL_TEXTURE_BINDING_3D
:
2103 *params
= (GLdouble
) textureUnit
->Current3D
->Name
;
2105 case GL_TEXTURE_ENV_COLOR
:
2106 params
[0] = (GLdouble
) textureUnit
->EnvColor
[0];
2107 params
[1] = (GLdouble
) textureUnit
->EnvColor
[1];
2108 params
[2] = (GLdouble
) textureUnit
->EnvColor
[2];
2109 params
[3] = (GLdouble
) textureUnit
->EnvColor
[3];
2111 case GL_TEXTURE_ENV_MODE
:
2112 *params
= ENUM_TO_DOUBLE(textureUnit
->EnvMode
);
2114 case GL_TEXTURE_GEN_S
:
2115 *params
= (textureUnit
->TexGenEnabled
& S_BIT
) ? 1.0 : 0.0;
2117 case GL_TEXTURE_GEN_T
:
2118 *params
= (textureUnit
->TexGenEnabled
& T_BIT
) ? 1.0 : 0.0;
2120 case GL_TEXTURE_GEN_R
:
2121 *params
= (textureUnit
->TexGenEnabled
& R_BIT
) ? 1.0 : 0.0;
2123 case GL_TEXTURE_GEN_Q
:
2124 *params
= (textureUnit
->TexGenEnabled
& Q_BIT
) ? 1.0 : 0.0;
2126 case GL_TEXTURE_MATRIX
:
2127 for (i
=0;i
<16;i
++) {
2128 params
[i
] = (GLdouble
) ctx
->TextureMatrix
[texUnit
].m
[i
];
2131 case GL_TEXTURE_STACK_DEPTH
:
2132 *params
= (GLdouble
) (ctx
->TextureStackDepth
[texUnit
] + 1);
2134 case GL_UNPACK_ALIGNMENT
:
2135 *params
= (GLdouble
) ctx
->Unpack
.Alignment
;
2137 case GL_UNPACK_LSB_FIRST
:
2138 *params
= (GLdouble
) ctx
->Unpack
.LsbFirst
;
2140 case GL_UNPACK_ROW_LENGTH
:
2141 *params
= (GLdouble
) ctx
->Unpack
.RowLength
;
2143 case GL_UNPACK_SKIP_PIXELS
:
2144 *params
= (GLdouble
) ctx
->Unpack
.SkipPixels
;
2146 case GL_UNPACK_SKIP_ROWS
:
2147 *params
= (GLdouble
) ctx
->Unpack
.SkipRows
;
2149 case GL_UNPACK_SWAP_BYTES
:
2150 *params
= (GLdouble
) ctx
->Unpack
.SwapBytes
;
2152 case GL_UNPACK_SKIP_IMAGES_EXT
:
2153 *params
= (GLdouble
) ctx
->Unpack
.SkipImages
;
2155 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
2156 *params
= (GLdouble
) ctx
->Unpack
.ImageHeight
;
2159 params
[0] = (GLdouble
) ctx
->Viewport
.X
;
2160 params
[1] = (GLdouble
) ctx
->Viewport
.Y
;
2161 params
[2] = (GLdouble
) ctx
->Viewport
.Width
;
2162 params
[3] = (GLdouble
) ctx
->Viewport
.Height
;
2165 *params
= (GLdouble
) ctx
->Pixel
.ZoomX
;
2168 *params
= (GLdouble
) ctx
->Pixel
.ZoomY
;
2170 case GL_VERTEX_ARRAY
:
2171 *params
= (GLdouble
) ctx
->Array
.Vertex
.Enabled
;
2173 case GL_VERTEX_ARRAY_SIZE
:
2174 *params
= (GLdouble
) ctx
->Array
.Vertex
.Size
;
2176 case GL_VERTEX_ARRAY_TYPE
:
2177 *params
= ENUM_TO_DOUBLE(ctx
->Array
.Vertex
.Type
);
2179 case GL_VERTEX_ARRAY_STRIDE
:
2180 *params
= (GLdouble
) ctx
->Array
.Vertex
.Stride
;
2182 case GL_VERTEX_ARRAY_COUNT_EXT
:
2185 case GL_NORMAL_ARRAY
:
2186 *params
= (GLdouble
) ctx
->Array
.Normal
.Enabled
;
2188 case GL_NORMAL_ARRAY_TYPE
:
2189 *params
= ENUM_TO_DOUBLE(ctx
->Array
.Normal
.Type
);
2191 case GL_NORMAL_ARRAY_STRIDE
:
2192 *params
= (GLdouble
) ctx
->Array
.Normal
.Stride
;
2194 case GL_NORMAL_ARRAY_COUNT_EXT
:
2197 case GL_COLOR_ARRAY
:
2198 *params
= (GLdouble
) ctx
->Array
.Color
.Enabled
;
2200 case GL_COLOR_ARRAY_SIZE
:
2201 *params
= (GLdouble
) ctx
->Array
.Color
.Size
;
2203 case GL_COLOR_ARRAY_TYPE
:
2204 *params
= ENUM_TO_DOUBLE(ctx
->Array
.Color
.Type
);
2206 case GL_COLOR_ARRAY_STRIDE
:
2207 *params
= (GLdouble
) ctx
->Array
.Color
.Stride
;
2209 case GL_COLOR_ARRAY_COUNT_EXT
:
2212 case GL_INDEX_ARRAY
:
2213 *params
= (GLdouble
) ctx
->Array
.Index
.Enabled
;
2215 case GL_INDEX_ARRAY_TYPE
:
2216 *params
= ENUM_TO_DOUBLE(ctx
->Array
.Index
.Type
);
2218 case GL_INDEX_ARRAY_STRIDE
:
2219 *params
= (GLdouble
) ctx
->Array
.Index
.Stride
;
2221 case GL_INDEX_ARRAY_COUNT_EXT
:
2224 case GL_TEXTURE_COORD_ARRAY
:
2225 *params
= (GLdouble
) ctx
->Array
.TexCoord
[texUnit
].Enabled
;
2227 case GL_TEXTURE_COORD_ARRAY_SIZE
:
2228 *params
= (GLdouble
) ctx
->Array
.TexCoord
[texUnit
].Size
;
2230 case GL_TEXTURE_COORD_ARRAY_TYPE
:
2231 *params
= ENUM_TO_DOUBLE(ctx
->Array
.TexCoord
[texUnit
].Type
);
2233 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
2234 *params
= (GLdouble
) ctx
->Array
.TexCoord
[texUnit
].Stride
;
2236 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
2239 case GL_EDGE_FLAG_ARRAY
:
2240 *params
= (GLdouble
) ctx
->Array
.EdgeFlag
.Enabled
;
2242 case GL_EDGE_FLAG_ARRAY_STRIDE
:
2243 *params
= (GLdouble
) ctx
->Array
.EdgeFlag
.Stride
;
2245 case GL_EDGE_FLAG_ARRAY_COUNT_EXT
:
2249 /* GL_ARB_multitexture */
2250 case GL_MAX_TEXTURE_UNITS_ARB
:
2251 *params
= (GLdouble
) ctx
->Const
.MaxTextureUnits
;
2253 case GL_ACTIVE_TEXTURE_ARB
:
2254 *params
= (GLdouble
) (GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
);
2256 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
2257 *params
= (GLdouble
) (GL_TEXTURE0_ARB
+ ctx
->Array
.ActiveTexture
);
2260 /* GL_ARB_texture_cube_map */
2261 case GL_TEXTURE_CUBE_MAP_ARB
:
2262 if (ctx
->Extensions
.ARB_texture_cube_map
)
2263 *params
= (GLdouble
) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
);
2265 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2267 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
2268 if (ctx
->Extensions
.ARB_texture_cube_map
)
2269 *params
= (GLdouble
) textureUnit
->CurrentCubeMap
->Name
;
2271 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2273 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
2274 if (ctx
->Extensions
.ARB_texture_cube_map
)
2275 *params
= (GLdouble
) ctx
->Const
.MaxCubeTextureSize
;
2277 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2280 /* GL_ARB_texture_compression */
2281 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
2282 if (ctx
->Extensions
.ARB_texture_compression
) {
2283 *params
= (GLdouble
) ctx
->Hint
.TextureCompression
;
2286 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2288 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
2289 if (ctx
->Extensions
.ARB_texture_compression
) {
2290 *params
= (GLdouble
) ctx
->Const
.NumCompressedTextureFormats
;
2293 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2295 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
2296 if (ctx
->Extensions
.ARB_texture_compression
) {
2298 for (i
= 0; i
< ctx
->Const
.NumCompressedTextureFormats
; i
++)
2299 params
[i
] = (GLdouble
) ctx
->Const
.CompressedTextureFormats
[i
];
2302 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2305 /* GL_EXT_compiled_vertex_array */
2306 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
2307 *params
= (GLdouble
) ctx
->Array
.LockFirst
;
2309 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
2310 *params
= (GLdouble
) ctx
->Array
.LockCount
;
2313 /* GL_ARB_transpose_matrix */
2314 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
2318 _math_transposef(tm
, ctx
->ColorMatrix
.m
);
2319 for (i
=0;i
<16;i
++) {
2320 params
[i
] = (GLdouble
) tm
[i
];
2324 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
2328 _math_transposef(tm
, ctx
->ModelView
.m
);
2329 for (i
=0;i
<16;i
++) {
2330 params
[i
] = (GLdouble
) tm
[i
];
2334 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
2338 _math_transposef(tm
, ctx
->ProjectionMatrix
.m
);
2339 for (i
=0;i
<16;i
++) {
2340 params
[i
] = (GLdouble
) tm
[i
];
2344 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
2348 _math_transposef(tm
, ctx
->TextureMatrix
[texUnit
].m
);
2349 for (i
=0;i
<16;i
++) {
2350 params
[i
] = (GLdouble
) tm
[i
];
2355 /* GL_HP_occlusion_test */
2356 case GL_OCCLUSION_TEST_HP
:
2357 if (ctx
->Extensions
.HP_occlusion_test
) {
2358 *params
= (GLdouble
) ctx
->Depth
.OcclusionTest
;
2361 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetDoublev" );
2364 case GL_OCCLUSION_TEST_RESULT_HP
:
2365 if (ctx
->Extensions
.HP_occlusion_test
) {
2366 if (ctx
->Depth
.OcclusionTest
)
2367 *params
= (GLdouble
) ctx
->OcclusionResult
;
2369 *params
= (GLdouble
) ctx
->OcclusionResultSaved
;
2370 /* reset flag now */
2371 ctx
->OcclusionResult
= GL_FALSE
;
2372 ctx
->OcclusionResultSaved
= GL_FALSE
;
2375 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetDoublev" );
2379 /* GL_SGIS_pixel_texture */
2380 case GL_PIXEL_TEXTURE_SGIS
:
2381 *params
= (GLdouble
) ctx
->Pixel
.PixelTextureEnabled
;
2384 /* GL_SGIX_pixel_texture */
2385 case GL_PIXEL_TEX_GEN_SGIX
:
2386 *params
= (GLdouble
) ctx
->Pixel
.PixelTextureEnabled
;
2388 case GL_PIXEL_TEX_GEN_MODE_SGIX
:
2389 *params
= (GLdouble
) pixel_texgen_mode(ctx
);
2392 /* GL_SGI_color_matrix (also in 1.2 imaging) */
2393 case GL_COLOR_MATRIX_SGI
:
2394 for (i
=0;i
<16;i
++) {
2395 params
[i
] = (GLdouble
) ctx
->ColorMatrix
.m
[i
];
2398 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
2399 *params
= (GLdouble
) (ctx
->ColorStackDepth
+ 1);
2401 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
2402 *params
= (GLdouble
) MAX_COLOR_STACK_DEPTH
;
2404 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
2405 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixScale
[0];
2407 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
2408 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixScale
[1];
2410 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
2411 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixScale
[2];
2413 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
2414 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixScale
[3];
2416 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
2417 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixBias
[0];
2419 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
2420 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixBias
[1];
2422 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
2423 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixBias
[2];
2425 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
2426 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixBias
[3];
2429 /* GL_EXT_convolution (also in 1.2 imaging) */
2430 case GL_CONVOLUTION_1D_EXT
:
2431 if (ctx
->Extensions
.EXT_convolution
|| ctx
->Extensions
.ARB_imaging
) {
2432 *params
= (GLdouble
) ctx
->Pixel
.Convolution1DEnabled
;
2435 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2439 case GL_CONVOLUTION_2D
:
2440 if (ctx
->Extensions
.EXT_convolution
|| ctx
->Extensions
.ARB_imaging
) {
2441 *params
= (GLdouble
) ctx
->Pixel
.Convolution2DEnabled
;
2444 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2448 case GL_SEPARABLE_2D
:
2449 if (ctx
->Extensions
.EXT_convolution
|| ctx
->Extensions
.ARB_imaging
) {
2450 *params
= (GLdouble
) ctx
->Pixel
.Separable2DEnabled
;
2453 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2457 case GL_MAX_CONVOLUTION_WIDTH
:
2458 *params
= (GLdouble
) ctx
->Const
.MaxConvolutionWidth
;
2460 case GL_MAX_CONVOLUTION_HEIGHT
:
2461 *params
= (GLdouble
) ctx
->Const
.MaxConvolutionHeight
;
2463 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
2464 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionScale
[0];
2466 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
2467 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionScale
[1];
2469 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
2470 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionScale
[2];
2472 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
2473 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionScale
[3];
2475 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
2476 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionBias
[0];
2478 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
2479 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionBias
[1];
2481 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
2482 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionBias
[2];
2484 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
2485 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionBias
[2];
2488 /* GL_SGI_color_table (also in 1.2 imaging */
2489 case GL_COLOR_TABLE_SGI
:
2490 *params
= (GLdouble
) ctx
->Pixel
.ColorTableEnabled
;
2492 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
2493 *params
= (GLdouble
) ctx
->Pixel
.PostConvolutionColorTableEnabled
;
2495 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
2496 *params
= (GLdouble
) ctx
->Pixel
.PostColorMatrixColorTableEnabled
;
2499 /* GL_EXT_secondary_color */
2500 case GL_COLOR_SUM_EXT
:
2501 *params
= (GLdouble
) ctx
->Fog
.ColorSumEnabled
;
2503 case GL_CURRENT_SECONDARY_COLOR_EXT
:
2504 FLUSH_CURRENT(ctx
, 0);
2505 params
[0] = (ctx
->Current
.SecondaryColor
[0]);
2506 params
[1] = (ctx
->Current
.SecondaryColor
[1]);
2507 params
[2] = (ctx
->Current
.SecondaryColor
[2]);
2509 case GL_SECONDARY_COLOR_ARRAY_EXT
:
2510 *params
= (GLdouble
) ctx
->Array
.SecondaryColor
.Enabled
;
2512 case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT
:
2513 *params
= (GLdouble
) ctx
->Array
.SecondaryColor
.Type
;
2515 case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT
:
2516 *params
= (GLdouble
) ctx
->Array
.SecondaryColor
.Stride
;
2518 case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT
:
2519 *params
= (GLdouble
) ctx
->Array
.SecondaryColor
.Stride
;
2522 /* GL_EXT_fog_coord */
2523 case GL_CURRENT_FOG_COORDINATE_EXT
:
2524 FLUSH_CURRENT(ctx
, 0);
2525 *params
= (GLdouble
) ctx
->Current
.FogCoord
;
2527 case GL_FOG_COORDINATE_ARRAY_EXT
:
2528 *params
= (GLdouble
) ctx
->Array
.FogCoord
.Enabled
;
2530 case GL_FOG_COORDINATE_ARRAY_TYPE_EXT
:
2531 *params
= (GLdouble
) ctx
->Array
.FogCoord
.Type
;
2533 case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
:
2534 *params
= (GLdouble
) ctx
->Array
.FogCoord
.Stride
;
2537 /* GL_EXT_texture_filter_anisotropic */
2538 case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
:
2539 if (ctx
->Extensions
.EXT_texture_filter_anisotropic
) {
2540 *params
= (GLdouble
) ctx
->Const
.MaxTextureMaxAnisotropy
;
2543 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetDoublev" );
2548 /* GL_ARB_multisample */
2549 case GL_MULTISAMPLE_ARB
:
2550 if (ctx
->Extensions
.ARB_multisample
) {
2551 *params
= (GLdouble
) ctx
->Multisample
.Enabled
;
2554 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2557 case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB
:
2558 if (ctx
->Extensions
.ARB_multisample
) {
2559 *params
= (GLdouble
) ctx
->Multisample
.SampleAlphaToCoverage
;
2562 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2565 case GL_SAMPLE_ALPHA_TO_ONE_ARB
:
2566 if (ctx
->Extensions
.ARB_multisample
) {
2567 *params
= (GLdouble
) ctx
->Multisample
.SampleAlphaToOne
;
2570 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2573 case GL_SAMPLE_COVERAGE_ARB
:
2574 if (ctx
->Extensions
.ARB_multisample
) {
2575 *params
= (GLdouble
) ctx
->Multisample
.SampleCoverage
;
2578 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2581 case GL_SAMPLE_COVERAGE_VALUE_ARB
:
2582 if (ctx
->Extensions
.ARB_multisample
) {
2583 *params
= ctx
->Multisample
.SampleCoverageValue
;
2586 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2589 case GL_SAMPLE_COVERAGE_INVERT_ARB
:
2590 if (ctx
->Extensions
.ARB_multisample
) {
2591 *params
= (GLdouble
) ctx
->Multisample
.SampleCoverageInvert
;
2594 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2597 case GL_SAMPLE_BUFFERS_ARB
:
2598 if (ctx
->Extensions
.ARB_multisample
) {
2599 *params
= 0.0; /* XXX fix someday */
2602 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2605 case GL_SAMPLES_ARB
:
2606 if (ctx
->Extensions
.ARB_multisample
) {
2607 *params
= 0.0; /* XXX fix someday */
2610 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2614 /* GL_MESA_sprite_point */
2615 case GL_SPRITE_POINT_MESA
:
2616 if (ctx
->Extensions
.MESA_sprite_point
) {
2617 *params
= (GLdouble
) ctx
->Point
.SpriteMode
;
2620 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetDoublev" );
2625 /* GL_SGIS_generate_mipmap */
2626 case GL_GENERATE_MIPMAP_HINT_SGIS
:
2627 if (ctx
->Extensions
.SGIS_generate_mipmap
) {
2628 *params
= (GLdouble
) ctx
->Hint
.GenerateMipmap
;
2631 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetDoublev");
2637 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetDoublev" );
2643 _mesa_GetFloatv( GLenum pname
, GLfloat
*params
)
2645 GET_CURRENT_CONTEXT(ctx
);
2647 GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
2648 const struct gl_texture_unit
*textureUnit
= &ctx
->Texture
.Unit
[texUnit
];
2649 ASSERT_OUTSIDE_BEGIN_END(ctx
);
2654 /* We need this in order to get correct results for
2655 * GL_OCCLUSION_TEST_RESULT_HP. There might be other important cases.
2657 FLUSH_VERTICES(ctx
, 0);
2659 if (MESA_VERBOSE
& VERBOSE_API
)
2660 fprintf(stderr
, "glGetFloatv %s\n", _mesa_lookup_enum_by_nr(pname
));
2662 if (ctx
->Driver
.GetFloatv
&& (*ctx
->Driver
.GetFloatv
)(ctx
, pname
, params
))
2666 case GL_ACCUM_RED_BITS
:
2667 *params
= (GLfloat
) ctx
->Visual
.accumRedBits
;
2669 case GL_ACCUM_GREEN_BITS
:
2670 *params
= (GLfloat
) ctx
->Visual
.accumGreenBits
;
2672 case GL_ACCUM_BLUE_BITS
:
2673 *params
= (GLfloat
) ctx
->Visual
.accumBlueBits
;
2675 case GL_ACCUM_ALPHA_BITS
:
2676 *params
= (GLfloat
) ctx
->Visual
.accumAlphaBits
;
2678 case GL_ACCUM_CLEAR_VALUE
:
2679 params
[0] = ctx
->Accum
.ClearColor
[0];
2680 params
[1] = ctx
->Accum
.ClearColor
[1];
2681 params
[2] = ctx
->Accum
.ClearColor
[2];
2682 params
[3] = ctx
->Accum
.ClearColor
[3];
2685 *params
= ctx
->Pixel
.AlphaBias
;
2688 *params
= (GLfloat
) ctx
->Visual
.alphaBits
;
2690 case GL_ALPHA_SCALE
:
2691 *params
= ctx
->Pixel
.AlphaScale
;
2694 *params
= (GLfloat
) ctx
->Color
.AlphaEnabled
;
2696 case GL_ALPHA_TEST_FUNC
:
2697 *params
= ENUM_TO_FLOAT(ctx
->Color
.AlphaFunc
);
2699 case GL_ALPHA_TEST_REF
:
2700 *params
= (GLfloat
) ctx
->Color
.AlphaRef
/ CHAN_MAXF
;
2702 case GL_ATTRIB_STACK_DEPTH
:
2703 *params
= (GLfloat
) (ctx
->AttribStackDepth
);
2705 case GL_AUTO_NORMAL
:
2706 *params
= (GLfloat
) ctx
->Eval
.AutoNormal
;
2708 case GL_AUX_BUFFERS
:
2709 *params
= (GLfloat
) ctx
->Const
.NumAuxBuffers
;
2712 *params
= (GLfloat
) ctx
->Color
.BlendEnabled
;
2715 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendDstRGB
);
2718 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendSrcRGB
);
2720 case GL_BLEND_SRC_RGB_EXT
:
2721 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendSrcRGB
);
2723 case GL_BLEND_DST_RGB_EXT
:
2724 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendDstRGB
);
2726 case GL_BLEND_SRC_ALPHA_EXT
:
2727 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendSrcA
);
2729 case GL_BLEND_DST_ALPHA_EXT
:
2730 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendDstA
);
2732 case GL_BLEND_EQUATION_EXT
:
2733 *params
= ENUM_TO_FLOAT(ctx
->Color
.BlendEquation
);
2735 case GL_BLEND_COLOR_EXT
:
2736 params
[0] = ctx
->Color
.BlendColor
[0];
2737 params
[1] = ctx
->Color
.BlendColor
[1];
2738 params
[2] = ctx
->Color
.BlendColor
[2];
2739 params
[3] = ctx
->Color
.BlendColor
[3];
2742 *params
= ctx
->Pixel
.BlueBias
;
2745 *params
= (GLfloat
) ctx
->Visual
.blueBits
;
2748 *params
= ctx
->Pixel
.BlueScale
;
2750 case GL_CLIENT_ATTRIB_STACK_DEPTH
:
2751 *params
= (GLfloat
) (ctx
->ClientAttribStackDepth
);
2753 case GL_CLIP_PLANE0
:
2754 case GL_CLIP_PLANE1
:
2755 case GL_CLIP_PLANE2
:
2756 case GL_CLIP_PLANE3
:
2757 case GL_CLIP_PLANE4
:
2758 case GL_CLIP_PLANE5
:
2759 *params
= (GLfloat
) ctx
->Transform
.ClipEnabled
[pname
-GL_CLIP_PLANE0
];
2761 case GL_COLOR_CLEAR_VALUE
:
2762 params
[0] = CHAN_TO_FLOAT(ctx
->Color
.ClearColor
[0]);
2763 params
[1] = CHAN_TO_FLOAT(ctx
->Color
.ClearColor
[1]);
2764 params
[2] = CHAN_TO_FLOAT(ctx
->Color
.ClearColor
[2]);
2765 params
[3] = CHAN_TO_FLOAT(ctx
->Color
.ClearColor
[3]);
2767 case GL_COLOR_MATERIAL
:
2768 *params
= (GLfloat
) ctx
->Light
.ColorMaterialEnabled
;
2770 case GL_COLOR_MATERIAL_FACE
:
2771 *params
= ENUM_TO_FLOAT(ctx
->Light
.ColorMaterialFace
);
2773 case GL_COLOR_MATERIAL_PARAMETER
:
2774 *params
= ENUM_TO_FLOAT(ctx
->Light
.ColorMaterialMode
);
2776 case GL_COLOR_WRITEMASK
:
2777 params
[0] = ctx
->Color
.ColorMask
[RCOMP
] ? 1.0F
: 0.0F
;
2778 params
[1] = ctx
->Color
.ColorMask
[GCOMP
] ? 1.0F
: 0.0F
;
2779 params
[2] = ctx
->Color
.ColorMask
[BCOMP
] ? 1.0F
: 0.0F
;
2780 params
[3] = ctx
->Color
.ColorMask
[ACOMP
] ? 1.0F
: 0.0F
;
2783 *params
= (GLfloat
) ctx
->Polygon
.CullFlag
;
2785 case GL_CULL_FACE_MODE
:
2786 *params
= ENUM_TO_FLOAT(ctx
->Polygon
.CullFaceMode
);
2788 case GL_CURRENT_COLOR
:
2789 FLUSH_CURRENT(ctx
, 0);
2790 params
[0] = (ctx
->Current
.Color
[0]);
2791 params
[1] = (ctx
->Current
.Color
[1]);
2792 params
[2] = (ctx
->Current
.Color
[2]);
2793 params
[3] = (ctx
->Current
.Color
[3]);
2795 case GL_CURRENT_INDEX
:
2796 FLUSH_CURRENT(ctx
, 0);
2797 *params
= (GLfloat
) ctx
->Current
.Index
;
2799 case GL_CURRENT_NORMAL
:
2800 FLUSH_CURRENT(ctx
, 0);
2801 params
[0] = ctx
->Current
.Normal
[0];
2802 params
[1] = ctx
->Current
.Normal
[1];
2803 params
[2] = ctx
->Current
.Normal
[2];
2805 case GL_CURRENT_RASTER_COLOR
:
2806 params
[0] = ctx
->Current
.RasterColor
[0];
2807 params
[1] = ctx
->Current
.RasterColor
[1];
2808 params
[2] = ctx
->Current
.RasterColor
[2];
2809 params
[3] = ctx
->Current
.RasterColor
[3];
2811 case GL_CURRENT_RASTER_DISTANCE
:
2812 params
[0] = ctx
->Current
.RasterDistance
;
2814 case GL_CURRENT_RASTER_INDEX
:
2815 *params
= (GLfloat
) ctx
->Current
.RasterIndex
;
2817 case GL_CURRENT_RASTER_POSITION
:
2818 params
[0] = ctx
->Current
.RasterPos
[0];
2819 params
[1] = ctx
->Current
.RasterPos
[1];
2820 params
[2] = ctx
->Current
.RasterPos
[2];
2821 params
[3] = ctx
->Current
.RasterPos
[3];
2823 case GL_CURRENT_RASTER_TEXTURE_COORDS
:
2824 params
[0] = ctx
->Current
.RasterMultiTexCoord
[texUnit
][0];
2825 params
[1] = ctx
->Current
.RasterMultiTexCoord
[texUnit
][1];
2826 params
[2] = ctx
->Current
.RasterMultiTexCoord
[texUnit
][2];
2827 params
[3] = ctx
->Current
.RasterMultiTexCoord
[texUnit
][3];
2829 case GL_CURRENT_RASTER_POSITION_VALID
:
2830 *params
= (GLfloat
) ctx
->Current
.RasterPosValid
;
2832 case GL_CURRENT_TEXTURE_COORDS
:
2833 FLUSH_CURRENT(ctx
, 0);
2834 params
[0] = (GLfloat
) ctx
->Current
.Texcoord
[texUnit
][0];
2835 params
[1] = (GLfloat
) ctx
->Current
.Texcoord
[texUnit
][1];
2836 params
[2] = (GLfloat
) ctx
->Current
.Texcoord
[texUnit
][2];
2837 params
[3] = (GLfloat
) ctx
->Current
.Texcoord
[texUnit
][3];
2840 *params
= (GLfloat
) ctx
->Pixel
.DepthBias
;
2843 *params
= (GLfloat
) ctx
->Visual
.depthBits
;
2845 case GL_DEPTH_CLEAR_VALUE
:
2846 *params
= (GLfloat
) ctx
->Depth
.Clear
;
2849 *params
= ENUM_TO_FLOAT(ctx
->Depth
.Func
);
2851 case GL_DEPTH_RANGE
:
2852 params
[0] = (GLfloat
) ctx
->Viewport
.Near
;
2853 params
[1] = (GLfloat
) ctx
->Viewport
.Far
;
2855 case GL_DEPTH_SCALE
:
2856 *params
= (GLfloat
) ctx
->Pixel
.DepthScale
;
2859 *params
= (GLfloat
) ctx
->Depth
.Test
;
2861 case GL_DEPTH_WRITEMASK
:
2862 *params
= (GLfloat
) ctx
->Depth
.Mask
;
2865 *params
= (GLfloat
) ctx
->Color
.DitherFlag
;
2867 case GL_DOUBLEBUFFER
:
2868 *params
= (GLfloat
) ctx
->Visual
.doubleBufferMode
;
2870 case GL_DRAW_BUFFER
:
2871 *params
= ENUM_TO_FLOAT(ctx
->Color
.DrawBuffer
);
2874 FLUSH_CURRENT(ctx
, 0);
2875 *params
= (GLfloat
) ctx
->Current
.EdgeFlag
;
2877 case GL_FEEDBACK_BUFFER_SIZE
:
2878 *params
= (GLfloat
) ctx
->Feedback
.BufferSize
;
2880 case GL_FEEDBACK_BUFFER_TYPE
:
2881 *params
= ENUM_TO_FLOAT(ctx
->Feedback
.Type
);
2884 *params
= (GLfloat
) ctx
->Fog
.Enabled
;
2887 params
[0] = ctx
->Fog
.Color
[0];
2888 params
[1] = ctx
->Fog
.Color
[1];
2889 params
[2] = ctx
->Fog
.Color
[2];
2890 params
[3] = ctx
->Fog
.Color
[3];
2892 case GL_FOG_DENSITY
:
2893 *params
= ctx
->Fog
.Density
;
2896 *params
= ctx
->Fog
.End
;
2899 *params
= ENUM_TO_FLOAT(ctx
->Hint
.Fog
);
2902 *params
= ctx
->Fog
.Index
;
2905 *params
= ENUM_TO_FLOAT(ctx
->Fog
.Mode
);
2908 *params
= ctx
->Fog
.Start
;
2911 *params
= ENUM_TO_FLOAT(ctx
->Polygon
.FrontFace
);
2914 *params
= (GLfloat
) ctx
->Pixel
.GreenBias
;
2917 *params
= (GLfloat
) ctx
->Visual
.greenBits
;
2919 case GL_GREEN_SCALE
:
2920 *params
= (GLfloat
) ctx
->Pixel
.GreenScale
;
2923 if (ctx
->Extensions
.EXT_histogram
|| ctx
->Extensions
.ARB_imaging
) {
2924 *params
= (GLfloat
) ctx
->Pixel
.HistogramEnabled
;
2927 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
2932 *params
= (GLfloat
) ctx
->Visual
.indexBits
;
2934 case GL_INDEX_CLEAR_VALUE
:
2935 *params
= (GLfloat
) ctx
->Color
.ClearIndex
;
2938 *params
= ctx
->Visual
.rgbMode
? 0.0F
: 1.0F
;
2940 case GL_INDEX_OFFSET
:
2941 *params
= (GLfloat
) ctx
->Pixel
.IndexOffset
;
2943 case GL_INDEX_SHIFT
:
2944 *params
= (GLfloat
) ctx
->Pixel
.IndexShift
;
2946 case GL_INDEX_WRITEMASK
:
2947 *params
= (GLfloat
) ctx
->Color
.IndexMask
;
2957 *params
= (GLfloat
) ctx
->Light
.Light
[pname
-GL_LIGHT0
].Enabled
;
2960 *params
= (GLfloat
) ctx
->Light
.Enabled
;
2962 case GL_LIGHT_MODEL_AMBIENT
:
2963 params
[0] = ctx
->Light
.Model
.Ambient
[0];
2964 params
[1] = ctx
->Light
.Model
.Ambient
[1];
2965 params
[2] = ctx
->Light
.Model
.Ambient
[2];
2966 params
[3] = ctx
->Light
.Model
.Ambient
[3];
2968 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2969 params
[0] = ENUM_TO_FLOAT(ctx
->Light
.Model
.ColorControl
);
2971 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2972 *params
= (GLfloat
) ctx
->Light
.Model
.LocalViewer
;
2974 case GL_LIGHT_MODEL_TWO_SIDE
:
2975 *params
= (GLfloat
) ctx
->Light
.Model
.TwoSide
;
2977 case GL_LINE_SMOOTH
:
2978 *params
= (GLfloat
) ctx
->Line
.SmoothFlag
;
2980 case GL_LINE_SMOOTH_HINT
:
2981 *params
= ENUM_TO_FLOAT(ctx
->Hint
.LineSmooth
);
2983 case GL_LINE_STIPPLE
:
2984 *params
= (GLfloat
) ctx
->Line
.StippleFlag
;
2986 case GL_LINE_STIPPLE_PATTERN
:
2987 *params
= (GLfloat
) ctx
->Line
.StipplePattern
;
2989 case GL_LINE_STIPPLE_REPEAT
:
2990 *params
= (GLfloat
) ctx
->Line
.StippleFactor
;
2993 *params
= (GLfloat
) ctx
->Line
.Width
;
2995 case GL_LINE_WIDTH_GRANULARITY
:
2996 *params
= (GLfloat
) ctx
->Const
.LineWidthGranularity
;
2998 case GL_LINE_WIDTH_RANGE
:
2999 params
[0] = (GLfloat
) ctx
->Const
.MinLineWidthAA
;
3000 params
[1] = (GLfloat
) ctx
->Const
.MaxLineWidthAA
;
3002 case GL_ALIASED_LINE_WIDTH_RANGE
:
3003 params
[0] = (GLfloat
) ctx
->Const
.MinLineWidth
;
3004 params
[1] = (GLfloat
) ctx
->Const
.MaxLineWidth
;
3007 *params
= (GLfloat
) ctx
->List
.ListBase
;
3010 *params
= (GLfloat
) ctx
->CurrentListNum
;
3013 *params
= ctx
->ExecuteFlag
? ENUM_TO_FLOAT(GL_COMPILE_AND_EXECUTE
)
3014 : ENUM_TO_FLOAT(GL_COMPILE
);
3016 case GL_INDEX_LOGIC_OP
:
3017 *params
= (GLfloat
) ctx
->Color
.IndexLogicOpEnabled
;
3019 case GL_COLOR_LOGIC_OP
:
3020 *params
= (GLfloat
) ctx
->Color
.ColorLogicOpEnabled
;
3022 case GL_LOGIC_OP_MODE
:
3023 *params
= ENUM_TO_FLOAT(ctx
->Color
.LogicOp
);
3025 case GL_MAP1_COLOR_4
:
3026 *params
= (GLfloat
) ctx
->Eval
.Map1Color4
;
3028 case GL_MAP1_GRID_DOMAIN
:
3029 params
[0] = ctx
->Eval
.MapGrid1u1
;
3030 params
[1] = ctx
->Eval
.MapGrid1u2
;
3032 case GL_MAP1_GRID_SEGMENTS
:
3033 *params
= (GLfloat
) ctx
->Eval
.MapGrid1un
;
3036 *params
= (GLfloat
) ctx
->Eval
.Map1Index
;
3038 case GL_MAP1_NORMAL
:
3039 *params
= (GLfloat
) ctx
->Eval
.Map1Normal
;
3041 case GL_MAP1_TEXTURE_COORD_1
:
3042 *params
= (GLfloat
) ctx
->Eval
.Map1TextureCoord1
;
3044 case GL_MAP1_TEXTURE_COORD_2
:
3045 *params
= (GLfloat
) ctx
->Eval
.Map1TextureCoord2
;
3047 case GL_MAP1_TEXTURE_COORD_3
:
3048 *params
= (GLfloat
) ctx
->Eval
.Map1TextureCoord3
;
3050 case GL_MAP1_TEXTURE_COORD_4
:
3051 *params
= (GLfloat
) ctx
->Eval
.Map1TextureCoord4
;
3053 case GL_MAP1_VERTEX_3
:
3054 *params
= (GLfloat
) ctx
->Eval
.Map1Vertex3
;
3056 case GL_MAP1_VERTEX_4
:
3057 *params
= (GLfloat
) ctx
->Eval
.Map1Vertex4
;
3059 case GL_MAP2_COLOR_4
:
3060 *params
= (GLfloat
) ctx
->Eval
.Map2Color4
;
3062 case GL_MAP2_GRID_DOMAIN
:
3063 params
[0] = ctx
->Eval
.MapGrid2u1
;
3064 params
[1] = ctx
->Eval
.MapGrid2u2
;
3065 params
[2] = ctx
->Eval
.MapGrid2v1
;
3066 params
[3] = ctx
->Eval
.MapGrid2v2
;
3068 case GL_MAP2_GRID_SEGMENTS
:
3069 params
[0] = (GLfloat
) ctx
->Eval
.MapGrid2un
;
3070 params
[1] = (GLfloat
) ctx
->Eval
.MapGrid2vn
;
3073 *params
= (GLfloat
) ctx
->Eval
.Map2Index
;
3075 case GL_MAP2_NORMAL
:
3076 *params
= (GLfloat
) ctx
->Eval
.Map2Normal
;
3078 case GL_MAP2_TEXTURE_COORD_1
:
3079 *params
= ctx
->Eval
.Map2TextureCoord1
;
3081 case GL_MAP2_TEXTURE_COORD_2
:
3082 *params
= ctx
->Eval
.Map2TextureCoord2
;
3084 case GL_MAP2_TEXTURE_COORD_3
:
3085 *params
= ctx
->Eval
.Map2TextureCoord3
;
3087 case GL_MAP2_TEXTURE_COORD_4
:
3088 *params
= ctx
->Eval
.Map2TextureCoord4
;
3090 case GL_MAP2_VERTEX_3
:
3091 *params
= (GLfloat
) ctx
->Eval
.Map2Vertex3
;
3093 case GL_MAP2_VERTEX_4
:
3094 *params
= (GLfloat
) ctx
->Eval
.Map2Vertex4
;
3097 *params
= (GLfloat
) ctx
->Pixel
.MapColorFlag
;
3099 case GL_MAP_STENCIL
:
3100 *params
= (GLfloat
) ctx
->Pixel
.MapStencilFlag
;
3102 case GL_MATRIX_MODE
:
3103 *params
= ENUM_TO_FLOAT(ctx
->Transform
.MatrixMode
);
3105 case GL_MAX_ATTRIB_STACK_DEPTH
:
3106 *params
= (GLfloat
) MAX_ATTRIB_STACK_DEPTH
;
3108 case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
:
3109 *params
= (GLfloat
) MAX_CLIENT_ATTRIB_STACK_DEPTH
;
3111 case GL_MAX_CLIP_PLANES
:
3112 *params
= (GLfloat
) ctx
->Const
.MaxClipPlanes
;
3114 case GL_MAX_ELEMENTS_VERTICES
: /* GL_VERSION_1_2 */
3115 *params
= (GLfloat
) ctx
->Const
.MaxArrayLockSize
;
3117 case GL_MAX_ELEMENTS_INDICES
: /* GL_VERSION_1_2 */
3118 *params
= (GLfloat
) ctx
->Const
.MaxArrayLockSize
;
3120 case GL_MAX_EVAL_ORDER
:
3121 *params
= (GLfloat
) MAX_EVAL_ORDER
;
3124 *params
= (GLfloat
) ctx
->Const
.MaxLights
;
3126 case GL_MAX_LIST_NESTING
:
3127 *params
= (GLfloat
) MAX_LIST_NESTING
;
3129 case GL_MAX_MODELVIEW_STACK_DEPTH
:
3130 *params
= (GLfloat
) MAX_MODELVIEW_STACK_DEPTH
;
3132 case GL_MAX_NAME_STACK_DEPTH
:
3133 *params
= (GLfloat
) MAX_NAME_STACK_DEPTH
;
3135 case GL_MAX_PIXEL_MAP_TABLE
:
3136 *params
= (GLfloat
) MAX_PIXEL_MAP_TABLE
;
3138 case GL_MAX_PROJECTION_STACK_DEPTH
:
3139 *params
= (GLfloat
) MAX_PROJECTION_STACK_DEPTH
;
3141 case GL_MAX_TEXTURE_SIZE
:
3142 case GL_MAX_3D_TEXTURE_SIZE
:
3143 *params
= (GLfloat
) ctx
->Const
.MaxTextureSize
;
3145 case GL_MAX_TEXTURE_STACK_DEPTH
:
3146 *params
= (GLfloat
) MAX_TEXTURE_STACK_DEPTH
;
3148 case GL_MAX_VIEWPORT_DIMS
:
3149 params
[0] = (GLfloat
) MAX_WIDTH
;
3150 params
[1] = (GLfloat
) MAX_HEIGHT
;
3153 *params
= (GLfloat
) ctx
->Pixel
.MinMaxEnabled
;
3155 case GL_MODELVIEW_MATRIX
:
3156 for (i
=0;i
<16;i
++) {
3157 params
[i
] = ctx
->ModelView
.m
[i
];
3160 case GL_MODELVIEW_STACK_DEPTH
:
3161 *params
= (GLfloat
) (ctx
->ModelViewStackDepth
+ 1);
3163 case GL_NAME_STACK_DEPTH
:
3164 *params
= (GLfloat
) ctx
->Select
.NameStackDepth
;
3167 *params
= (GLfloat
) ctx
->Transform
.Normalize
;
3169 case GL_PACK_ALIGNMENT
:
3170 *params
= (GLfloat
) ctx
->Pack
.Alignment
;
3172 case GL_PACK_LSB_FIRST
:
3173 *params
= (GLfloat
) ctx
->Pack
.LsbFirst
;
3175 case GL_PACK_ROW_LENGTH
:
3176 *params
= (GLfloat
) ctx
->Pack
.RowLength
;
3178 case GL_PACK_SKIP_PIXELS
:
3179 *params
= (GLfloat
) ctx
->Pack
.SkipPixels
;
3181 case GL_PACK_SKIP_ROWS
:
3182 *params
= (GLfloat
) ctx
->Pack
.SkipRows
;
3184 case GL_PACK_SWAP_BYTES
:
3185 *params
= (GLfloat
) ctx
->Pack
.SwapBytes
;
3187 case GL_PACK_SKIP_IMAGES_EXT
:
3188 *params
= (GLfloat
) ctx
->Pack
.SkipImages
;
3190 case GL_PACK_IMAGE_HEIGHT_EXT
:
3191 *params
= (GLfloat
) ctx
->Pack
.ImageHeight
;
3193 case GL_PERSPECTIVE_CORRECTION_HINT
:
3194 *params
= ENUM_TO_FLOAT(ctx
->Hint
.PerspectiveCorrection
);
3196 case GL_PIXEL_MAP_A_TO_A_SIZE
:
3197 *params
= (GLfloat
) ctx
->Pixel
.MapAtoAsize
;
3199 case GL_PIXEL_MAP_B_TO_B_SIZE
:
3200 *params
= (GLfloat
) ctx
->Pixel
.MapBtoBsize
;
3202 case GL_PIXEL_MAP_G_TO_G_SIZE
:
3203 *params
= (GLfloat
) ctx
->Pixel
.MapGtoGsize
;
3205 case GL_PIXEL_MAP_I_TO_A_SIZE
:
3206 *params
= (GLfloat
) ctx
->Pixel
.MapItoAsize
;
3208 case GL_PIXEL_MAP_I_TO_B_SIZE
:
3209 *params
= (GLfloat
) ctx
->Pixel
.MapItoBsize
;
3211 case GL_PIXEL_MAP_I_TO_G_SIZE
:
3212 *params
= (GLfloat
) ctx
->Pixel
.MapItoGsize
;
3214 case GL_PIXEL_MAP_I_TO_I_SIZE
:
3215 *params
= (GLfloat
) ctx
->Pixel
.MapItoIsize
;
3217 case GL_PIXEL_MAP_I_TO_R_SIZE
:
3218 *params
= (GLfloat
) ctx
->Pixel
.MapItoRsize
;
3220 case GL_PIXEL_MAP_R_TO_R_SIZE
:
3221 *params
= (GLfloat
) ctx
->Pixel
.MapRtoRsize
;
3223 case GL_PIXEL_MAP_S_TO_S_SIZE
:
3224 *params
= (GLfloat
) ctx
->Pixel
.MapStoSsize
;
3227 *params
= (GLfloat
) ctx
->Point
.Size
;
3229 case GL_POINT_SIZE_GRANULARITY
:
3230 *params
= (GLfloat
) ctx
->Const
.PointSizeGranularity
;
3232 case GL_POINT_SIZE_RANGE
:
3233 params
[0] = (GLfloat
) ctx
->Const
.MinPointSizeAA
;
3234 params
[1] = (GLfloat
) ctx
->Const
.MaxPointSizeAA
;
3236 case GL_ALIASED_POINT_SIZE_RANGE
:
3237 params
[0] = (GLfloat
) ctx
->Const
.MinPointSize
;
3238 params
[1] = (GLfloat
) ctx
->Const
.MaxPointSize
;
3240 case GL_POINT_SMOOTH
:
3241 *params
= (GLfloat
) ctx
->Point
.SmoothFlag
;
3243 case GL_POINT_SMOOTH_HINT
:
3244 *params
= ENUM_TO_FLOAT(ctx
->Hint
.PointSmooth
);
3246 case GL_POINT_SIZE_MIN_EXT
:
3247 *params
= (GLfloat
) (ctx
->Point
.MinSize
);
3249 case GL_POINT_SIZE_MAX_EXT
:
3250 *params
= (GLfloat
) (ctx
->Point
.MaxSize
);
3252 case GL_POINT_FADE_THRESHOLD_SIZE_EXT
:
3253 *params
= (GLfloat
) (ctx
->Point
.Threshold
);
3255 case GL_DISTANCE_ATTENUATION_EXT
:
3256 params
[0] = (GLfloat
) (ctx
->Point
.Params
[0]);
3257 params
[1] = (GLfloat
) (ctx
->Point
.Params
[1]);
3258 params
[2] = (GLfloat
) (ctx
->Point
.Params
[2]);
3260 case GL_POLYGON_MODE
:
3261 params
[0] = ENUM_TO_FLOAT(ctx
->Polygon
.FrontMode
);
3262 params
[1] = ENUM_TO_FLOAT(ctx
->Polygon
.BackMode
);
3264 #ifdef GL_EXT_polygon_offset
3265 case GL_POLYGON_OFFSET_BIAS_EXT
:
3266 *params
= ctx
->Polygon
.OffsetUnits
;
3269 case GL_POLYGON_OFFSET_FACTOR
:
3270 *params
= ctx
->Polygon
.OffsetFactor
;
3272 case GL_POLYGON_OFFSET_UNITS
:
3273 *params
= ctx
->Polygon
.OffsetUnits
;
3275 case GL_POLYGON_SMOOTH
:
3276 *params
= (GLfloat
) ctx
->Polygon
.SmoothFlag
;
3278 case GL_POLYGON_SMOOTH_HINT
:
3279 *params
= ENUM_TO_FLOAT(ctx
->Hint
.PolygonSmooth
);
3281 case GL_POLYGON_STIPPLE
:
3282 *params
= (GLfloat
) ctx
->Polygon
.StippleFlag
;
3284 case GL_PROJECTION_MATRIX
:
3285 for (i
=0;i
<16;i
++) {
3286 params
[i
] = ctx
->ProjectionMatrix
.m
[i
];
3289 case GL_PROJECTION_STACK_DEPTH
:
3290 *params
= (GLfloat
) (ctx
->ProjectionStackDepth
+ 1);
3292 case GL_READ_BUFFER
:
3293 *params
= ENUM_TO_FLOAT(ctx
->Pixel
.ReadBuffer
);
3296 *params
= ctx
->Pixel
.RedBias
;
3299 *params
= (GLfloat
) ctx
->Visual
.redBits
;
3302 *params
= ctx
->Pixel
.RedScale
;
3304 case GL_RENDER_MODE
:
3305 *params
= ENUM_TO_FLOAT(ctx
->RenderMode
);
3307 case GL_RESCALE_NORMAL
:
3308 *params
= (GLfloat
) ctx
->Transform
.RescaleNormals
;
3311 *params
= (GLfloat
) ctx
->Visual
.rgbMode
;
3313 case GL_SCISSOR_BOX
:
3314 params
[0] = (GLfloat
) ctx
->Scissor
.X
;
3315 params
[1] = (GLfloat
) ctx
->Scissor
.Y
;
3316 params
[2] = (GLfloat
) ctx
->Scissor
.Width
;
3317 params
[3] = (GLfloat
) ctx
->Scissor
.Height
;
3319 case GL_SCISSOR_TEST
:
3320 *params
= (GLfloat
) ctx
->Scissor
.Enabled
;
3322 case GL_SELECTION_BUFFER_SIZE
:
3323 *params
= (GLfloat
) ctx
->Select
.BufferSize
;
3325 case GL_SHADE_MODEL
:
3326 *params
= ENUM_TO_FLOAT(ctx
->Light
.ShadeModel
);
3328 case GL_SHARED_TEXTURE_PALETTE_EXT
:
3329 *params
= (GLfloat
) ctx
->Texture
.SharedPalette
;
3331 case GL_STENCIL_BITS
:
3332 *params
= (GLfloat
) ctx
->Visual
.stencilBits
;
3334 case GL_STENCIL_CLEAR_VALUE
:
3335 *params
= (GLfloat
) ctx
->Stencil
.Clear
;
3337 case GL_STENCIL_FAIL
:
3338 *params
= ENUM_TO_FLOAT(ctx
->Stencil
.FailFunc
);
3340 case GL_STENCIL_FUNC
:
3341 *params
= ENUM_TO_FLOAT(ctx
->Stencil
.Function
);
3343 case GL_STENCIL_PASS_DEPTH_FAIL
:
3344 *params
= ENUM_TO_FLOAT(ctx
->Stencil
.ZFailFunc
);
3346 case GL_STENCIL_PASS_DEPTH_PASS
:
3347 *params
= ENUM_TO_FLOAT(ctx
->Stencil
.ZPassFunc
);
3349 case GL_STENCIL_REF
:
3350 *params
= (GLfloat
) ctx
->Stencil
.Ref
;
3352 case GL_STENCIL_TEST
:
3353 *params
= (GLfloat
) ctx
->Stencil
.Enabled
;
3355 case GL_STENCIL_VALUE_MASK
:
3356 *params
= (GLfloat
) ctx
->Stencil
.ValueMask
;
3358 case GL_STENCIL_WRITEMASK
:
3359 *params
= (GLfloat
) ctx
->Stencil
.WriteMask
;
3362 *params
= (GLfloat
) ctx
->Visual
.stereoMode
;
3364 case GL_SUBPIXEL_BITS
:
3365 *params
= (GLfloat
) ctx
->Const
.SubPixelBits
;
3368 *params
= _mesa_IsEnabled(GL_TEXTURE_1D
) ? 1.0 : 0.0;
3371 *params
= _mesa_IsEnabled(GL_TEXTURE_2D
) ? 1.0 : 0.0;
3374 *params
= _mesa_IsEnabled(GL_TEXTURE_3D
) ? 1.0 : 0.0;
3376 case GL_TEXTURE_BINDING_1D
:
3377 *params
= (GLfloat
) textureUnit
->Current1D
->Name
;
3379 case GL_TEXTURE_BINDING_2D
:
3380 *params
= (GLfloat
) textureUnit
->Current2D
->Name
;
3382 case GL_TEXTURE_BINDING_3D
:
3383 *params
= (GLfloat
) textureUnit
->Current2D
->Name
;
3385 case GL_TEXTURE_ENV_COLOR
:
3386 params
[0] = textureUnit
->EnvColor
[0];
3387 params
[1] = textureUnit
->EnvColor
[1];
3388 params
[2] = textureUnit
->EnvColor
[2];
3389 params
[3] = textureUnit
->EnvColor
[3];
3391 case GL_TEXTURE_ENV_MODE
:
3392 *params
= ENUM_TO_FLOAT(textureUnit
->EnvMode
);
3394 case GL_TEXTURE_GEN_S
:
3395 *params
= (textureUnit
->TexGenEnabled
& S_BIT
) ? 1.0 : 0.0;
3397 case GL_TEXTURE_GEN_T
:
3398 *params
= (textureUnit
->TexGenEnabled
& T_BIT
) ? 1.0 : 0.0;
3400 case GL_TEXTURE_GEN_R
:
3401 *params
= (textureUnit
->TexGenEnabled
& R_BIT
) ? 1.0 : 0.0;
3403 case GL_TEXTURE_GEN_Q
:
3404 *params
= (textureUnit
->TexGenEnabled
& Q_BIT
) ? 1.0 : 0.0;
3406 case GL_TEXTURE_MATRIX
:
3407 for (i
=0;i
<16;i
++) {
3408 params
[i
] = ctx
->TextureMatrix
[texUnit
].m
[i
];
3411 case GL_TEXTURE_STACK_DEPTH
:
3412 *params
= (GLfloat
) (ctx
->TextureStackDepth
[texUnit
] + 1);
3414 case GL_UNPACK_ALIGNMENT
:
3415 *params
= (GLfloat
) ctx
->Unpack
.Alignment
;
3417 case GL_UNPACK_LSB_FIRST
:
3418 *params
= (GLfloat
) ctx
->Unpack
.LsbFirst
;
3420 case GL_UNPACK_ROW_LENGTH
:
3421 *params
= (GLfloat
) ctx
->Unpack
.RowLength
;
3423 case GL_UNPACK_SKIP_PIXELS
:
3424 *params
= (GLfloat
) ctx
->Unpack
.SkipPixels
;
3426 case GL_UNPACK_SKIP_ROWS
:
3427 *params
= (GLfloat
) ctx
->Unpack
.SkipRows
;
3429 case GL_UNPACK_SWAP_BYTES
:
3430 *params
= (GLfloat
) ctx
->Unpack
.SwapBytes
;
3432 case GL_UNPACK_SKIP_IMAGES_EXT
:
3433 *params
= (GLfloat
) ctx
->Unpack
.SkipImages
;
3435 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
3436 *params
= (GLfloat
) ctx
->Unpack
.ImageHeight
;
3439 params
[0] = (GLfloat
) ctx
->Viewport
.X
;
3440 params
[1] = (GLfloat
) ctx
->Viewport
.Y
;
3441 params
[2] = (GLfloat
) ctx
->Viewport
.Width
;
3442 params
[3] = (GLfloat
) ctx
->Viewport
.Height
;
3445 *params
= (GLfloat
) ctx
->Pixel
.ZoomX
;
3448 *params
= (GLfloat
) ctx
->Pixel
.ZoomY
;
3450 case GL_VERTEX_ARRAY
:
3451 *params
= (GLfloat
) ctx
->Array
.Vertex
.Enabled
;
3453 case GL_VERTEX_ARRAY_SIZE
:
3454 *params
= (GLfloat
) ctx
->Array
.Vertex
.Size
;
3456 case GL_VERTEX_ARRAY_TYPE
:
3457 *params
= ENUM_TO_FLOAT(ctx
->Array
.Vertex
.Type
);
3459 case GL_VERTEX_ARRAY_STRIDE
:
3460 *params
= (GLfloat
) ctx
->Array
.Vertex
.Stride
;
3462 case GL_VERTEX_ARRAY_COUNT_EXT
:
3465 case GL_NORMAL_ARRAY
:
3466 *params
= (GLfloat
) ctx
->Array
.Normal
.Enabled
;
3468 case GL_NORMAL_ARRAY_TYPE
:
3469 *params
= ENUM_TO_FLOAT(ctx
->Array
.Normal
.Type
);
3471 case GL_NORMAL_ARRAY_STRIDE
:
3472 *params
= (GLfloat
) ctx
->Array
.Normal
.Stride
;
3474 case GL_NORMAL_ARRAY_COUNT_EXT
:
3477 case GL_COLOR_ARRAY
:
3478 *params
= (GLfloat
) ctx
->Array
.Color
.Enabled
;
3480 case GL_COLOR_ARRAY_SIZE
:
3481 *params
= (GLfloat
) ctx
->Array
.Color
.Size
;
3483 case GL_COLOR_ARRAY_TYPE
:
3484 *params
= ENUM_TO_FLOAT(ctx
->Array
.Color
.Type
);
3486 case GL_COLOR_ARRAY_STRIDE
:
3487 *params
= (GLfloat
) ctx
->Array
.Color
.Stride
;
3489 case GL_COLOR_ARRAY_COUNT_EXT
:
3492 case GL_INDEX_ARRAY
:
3493 *params
= (GLfloat
) ctx
->Array
.Index
.Enabled
;
3495 case GL_INDEX_ARRAY_TYPE
:
3496 *params
= ENUM_TO_FLOAT(ctx
->Array
.Index
.Type
);
3498 case GL_INDEX_ARRAY_STRIDE
:
3499 *params
= (GLfloat
) ctx
->Array
.Index
.Stride
;
3501 case GL_INDEX_ARRAY_COUNT_EXT
:
3504 case GL_TEXTURE_COORD_ARRAY
:
3505 *params
= (GLfloat
) ctx
->Array
.TexCoord
[texUnit
].Enabled
;
3507 case GL_TEXTURE_COORD_ARRAY_SIZE
:
3508 *params
= (GLfloat
) ctx
->Array
.TexCoord
[texUnit
].Size
;
3510 case GL_TEXTURE_COORD_ARRAY_TYPE
:
3511 *params
= ENUM_TO_FLOAT(ctx
->Array
.TexCoord
[texUnit
].Type
);
3513 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
3514 *params
= (GLfloat
) ctx
->Array
.TexCoord
[texUnit
].Stride
;
3516 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
3519 case GL_EDGE_FLAG_ARRAY
:
3520 *params
= (GLfloat
) ctx
->Array
.EdgeFlag
.Enabled
;
3522 case GL_EDGE_FLAG_ARRAY_STRIDE
:
3523 *params
= (GLfloat
) ctx
->Array
.EdgeFlag
.Stride
;
3525 case GL_EDGE_FLAG_ARRAY_COUNT_EXT
:
3529 /* GL_ARB_multitexture */
3530 case GL_MAX_TEXTURE_UNITS_ARB
:
3531 *params
= (GLfloat
) ctx
->Const
.MaxTextureUnits
;
3533 case GL_ACTIVE_TEXTURE_ARB
:
3534 *params
= (GLfloat
) (GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
);
3536 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
3537 *params
= (GLfloat
) (GL_TEXTURE0_ARB
+ ctx
->Array
.ActiveTexture
);
3540 /* GL_ARB_texture_cube_map */
3541 case GL_TEXTURE_CUBE_MAP_ARB
:
3542 if (ctx
->Extensions
.ARB_texture_cube_map
)
3543 *params
= (GLfloat
) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
);
3545 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3547 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
3548 if (ctx
->Extensions
.ARB_texture_cube_map
)
3549 *params
= (GLfloat
) textureUnit
->CurrentCubeMap
->Name
;
3551 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3553 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
3554 if (ctx
->Extensions
.ARB_texture_cube_map
)
3555 *params
= (GLfloat
) ctx
->Const
.MaxCubeTextureSize
;
3557 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3560 /* GL_ARB_texture_compression */
3561 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
3562 if (ctx
->Extensions
.ARB_texture_compression
) {
3563 *params
= (GLfloat
) ctx
->Hint
.TextureCompression
;
3566 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3568 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
3569 if (ctx
->Extensions
.ARB_texture_compression
) {
3570 *params
= (GLfloat
) ctx
->Const
.NumCompressedTextureFormats
;
3573 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3575 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
3576 if (ctx
->Extensions
.ARB_texture_compression
) {
3578 for (i
= 0; i
< ctx
->Const
.NumCompressedTextureFormats
; i
++)
3579 params
[i
] = (GLfloat
) ctx
->Const
.CompressedTextureFormats
[i
];
3582 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3585 /* GL_EXT_compiled_vertex_array */
3586 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
3587 *params
= (GLfloat
) ctx
->Array
.LockFirst
;
3589 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
3590 *params
= (GLfloat
) ctx
->Array
.LockCount
;
3593 /* GL_ARB_transpose_matrix */
3594 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
3595 _math_transposef(params
, ctx
->ColorMatrix
.m
);
3597 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
3598 _math_transposef(params
, ctx
->ModelView
.m
);
3600 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
3601 _math_transposef(params
, ctx
->ProjectionMatrix
.m
);
3603 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
3604 _math_transposef(params
, ctx
->TextureMatrix
[texUnit
].m
);
3607 /* GL_HP_occlusion_test */
3608 case GL_OCCLUSION_TEST_HP
:
3609 if (ctx
->Extensions
.HP_occlusion_test
) {
3610 *params
= (GLfloat
) ctx
->Depth
.OcclusionTest
;
3613 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetFloatv" );
3616 case GL_OCCLUSION_TEST_RESULT_HP
:
3617 if (ctx
->Extensions
.HP_occlusion_test
) {
3618 if (ctx
->Depth
.OcclusionTest
)
3619 *params
= (GLfloat
) ctx
->OcclusionResult
;
3621 *params
= (GLfloat
) ctx
->OcclusionResultSaved
;
3622 /* reset flag now */
3623 ctx
->OcclusionResult
= GL_FALSE
;
3624 ctx
->OcclusionResultSaved
= GL_FALSE
;
3627 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetFloatv" );
3631 /* GL_SGIS_pixel_texture */
3632 case GL_PIXEL_TEXTURE_SGIS
:
3633 *params
= (GLfloat
) ctx
->Pixel
.PixelTextureEnabled
;
3636 /* GL_SGIX_pixel_texture */
3637 case GL_PIXEL_TEX_GEN_SGIX
:
3638 *params
= (GLfloat
) ctx
->Pixel
.PixelTextureEnabled
;
3640 case GL_PIXEL_TEX_GEN_MODE_SGIX
:
3641 *params
= (GLfloat
) pixel_texgen_mode(ctx
);
3644 /* GL_SGI_color_matrix (also in 1.2 imaging) */
3645 case GL_COLOR_MATRIX_SGI
:
3646 for (i
=0;i
<16;i
++) {
3647 params
[i
] = ctx
->ColorMatrix
.m
[i
];
3650 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
3651 *params
= (GLfloat
) (ctx
->ColorStackDepth
+ 1);
3653 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
3654 *params
= (GLfloat
) MAX_COLOR_STACK_DEPTH
;
3656 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
3657 *params
= ctx
->Pixel
.PostColorMatrixScale
[0];
3659 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
3660 *params
= ctx
->Pixel
.PostColorMatrixScale
[1];
3662 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
3663 *params
= ctx
->Pixel
.PostColorMatrixScale
[2];
3665 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
3666 *params
= ctx
->Pixel
.PostColorMatrixScale
[3];
3668 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
3669 *params
= ctx
->Pixel
.PostColorMatrixBias
[0];
3671 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
3672 *params
= ctx
->Pixel
.PostColorMatrixBias
[1];
3674 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
3675 *params
= ctx
->Pixel
.PostColorMatrixBias
[2];
3677 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
3678 *params
= ctx
->Pixel
.PostColorMatrixBias
[3];
3681 /* GL_EXT_convolution (also in 1.2 imaging) */
3682 case GL_CONVOLUTION_1D_EXT
:
3683 if (ctx
->Extensions
.EXT_convolution
|| ctx
->Extensions
.ARB_imaging
) {
3684 *params
= (GLfloat
) ctx
->Pixel
.Convolution1DEnabled
;
3687 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3691 case GL_CONVOLUTION_2D
:
3692 if (ctx
->Extensions
.EXT_convolution
|| ctx
->Extensions
.ARB_imaging
) {
3693 *params
= (GLfloat
) ctx
->Pixel
.Convolution2DEnabled
;
3696 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3700 case GL_SEPARABLE_2D
:
3701 if (ctx
->Extensions
.EXT_convolution
|| ctx
->Extensions
.ARB_imaging
) {
3702 *params
= (GLfloat
) ctx
->Pixel
.Separable2DEnabled
;
3705 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3709 case GL_MAX_CONVOLUTION_WIDTH
:
3710 *params
= (GLfloat
) ctx
->Const
.MaxConvolutionWidth
;
3712 case GL_MAX_CONVOLUTION_HEIGHT
:
3713 *params
= (GLfloat
) ctx
->Const
.MaxConvolutionHeight
;
3715 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
3716 *params
= ctx
->Pixel
.PostConvolutionScale
[0];
3718 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
3719 *params
= ctx
->Pixel
.PostConvolutionScale
[1];
3721 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
3722 *params
= ctx
->Pixel
.PostConvolutionScale
[2];
3724 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
3725 *params
= ctx
->Pixel
.PostConvolutionScale
[3];
3727 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
3728 *params
= ctx
->Pixel
.PostConvolutionBias
[0];
3730 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
3731 *params
= ctx
->Pixel
.PostConvolutionBias
[1];
3733 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
3734 *params
= ctx
->Pixel
.PostConvolutionBias
[2];
3736 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
3737 *params
= ctx
->Pixel
.PostConvolutionBias
[2];
3740 /* GL_SGI_color_table (also in 1.2 imaging */
3741 case GL_COLOR_TABLE_SGI
:
3742 *params
= (GLfloat
) ctx
->Pixel
.ColorTableEnabled
;
3744 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
3745 *params
= (GLfloat
) ctx
->Pixel
.PostConvolutionColorTableEnabled
;
3747 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
3748 *params
= (GLfloat
) ctx
->Pixel
.PostColorMatrixColorTableEnabled
;
3751 /* GL_EXT_secondary_color */
3752 case GL_COLOR_SUM_EXT
:
3753 *params
= (GLfloat
) ctx
->Fog
.ColorSumEnabled
;
3755 case GL_CURRENT_SECONDARY_COLOR_EXT
:
3756 FLUSH_CURRENT(ctx
, 0);
3757 params
[0] = (ctx
->Current
.SecondaryColor
[0]);
3758 params
[1] = (ctx
->Current
.SecondaryColor
[1]);
3759 params
[2] = (ctx
->Current
.SecondaryColor
[2]);
3761 case GL_SECONDARY_COLOR_ARRAY_EXT
:
3762 *params
= (GLfloat
) ctx
->Array
.SecondaryColor
.Enabled
;
3764 case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT
:
3765 *params
= (GLfloat
) ctx
->Array
.SecondaryColor
.Type
;
3767 case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT
:
3768 *params
= (GLfloat
) ctx
->Array
.SecondaryColor
.Stride
;
3770 case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT
:
3771 *params
= (GLfloat
) ctx
->Array
.SecondaryColor
.Stride
;
3774 /* GL_EXT_fog_coord */
3775 case GL_CURRENT_FOG_COORDINATE_EXT
:
3776 FLUSH_CURRENT(ctx
, 0);
3777 *params
= (GLfloat
) ctx
->Current
.FogCoord
;
3779 case GL_FOG_COORDINATE_ARRAY_EXT
:
3780 *params
= (GLfloat
) ctx
->Array
.FogCoord
.Enabled
;
3782 case GL_FOG_COORDINATE_ARRAY_TYPE_EXT
:
3783 *params
= (GLfloat
) ctx
->Array
.FogCoord
.Type
;
3785 case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
:
3786 *params
= (GLfloat
) ctx
->Array
.FogCoord
.Stride
;
3789 /* GL_EXT_texture_filter_anisotropic */
3790 case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
:
3791 if (ctx
->Extensions
.EXT_texture_filter_anisotropic
) {
3792 *params
= ctx
->Const
.MaxTextureMaxAnisotropy
;
3795 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetFloatv" );
3800 /* GL_ARB_multisample */
3801 case GL_MULTISAMPLE_ARB
:
3802 if (ctx
->Extensions
.ARB_multisample
) {
3803 *params
= (GLfloat
) ctx
->Multisample
.Enabled
;
3806 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3809 case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB
:
3810 if (ctx
->Extensions
.ARB_multisample
) {
3811 *params
= (GLfloat
) ctx
->Multisample
.SampleAlphaToCoverage
;
3814 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3817 case GL_SAMPLE_ALPHA_TO_ONE_ARB
:
3818 if (ctx
->Extensions
.ARB_multisample
) {
3819 *params
= (GLfloat
) ctx
->Multisample
.SampleAlphaToOne
;
3822 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3825 case GL_SAMPLE_COVERAGE_ARB
:
3826 if (ctx
->Extensions
.ARB_multisample
) {
3827 *params
= (GLfloat
) ctx
->Multisample
.SampleCoverage
;
3830 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3833 case GL_SAMPLE_COVERAGE_VALUE_ARB
:
3834 if (ctx
->Extensions
.ARB_multisample
) {
3835 *params
= ctx
->Multisample
.SampleCoverageValue
;
3838 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3841 case GL_SAMPLE_COVERAGE_INVERT_ARB
:
3842 if (ctx
->Extensions
.ARB_multisample
) {
3843 *params
= (GLfloat
) ctx
->Multisample
.SampleCoverageInvert
;
3846 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3849 case GL_SAMPLE_BUFFERS_ARB
:
3850 if (ctx
->Extensions
.ARB_multisample
) {
3851 *params
= 0.0; /* XXX fix someday */
3854 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3857 case GL_SAMPLES_ARB
:
3858 if (ctx
->Extensions
.ARB_multisample
) {
3859 *params
= 0.0; /* XXX fix someday */
3862 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3866 /* GL_MESA_sprite_point */
3867 case GL_SPRITE_POINT_MESA
:
3868 if (ctx
->Extensions
.MESA_sprite_point
) {
3869 *params
= (GLfloat
) ctx
->Point
.SpriteMode
;
3872 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetFloatv" );
3877 /* GL_SGIS_generate_mipmap */
3878 case GL_GENERATE_MIPMAP_HINT_SGIS
:
3879 if (ctx
->Extensions
.SGIS_generate_mipmap
) {
3880 *params
= (GLfloat
) ctx
->Hint
.GenerateMipmap
;
3883 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
3889 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetFloatv" );
3895 _mesa_GetIntegerv( GLenum pname
, GLint
*params
)
3897 GET_CURRENT_CONTEXT(ctx
);
3899 GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
3900 const struct gl_texture_unit
*textureUnit
= &ctx
->Texture
.Unit
[texUnit
];
3901 ASSERT_OUTSIDE_BEGIN_END(ctx
);
3906 /* We need this in order to get correct results for
3907 * GL_OCCLUSION_TEST_RESULT_HP. There might be other important cases.
3909 FLUSH_VERTICES(ctx
, 0);
3911 if (MESA_VERBOSE
& VERBOSE_API
)
3912 fprintf(stderr
, "glGetIntegerv %s\n", _mesa_lookup_enum_by_nr(pname
));
3914 if (ctx
->Driver
.GetIntegerv
3915 && (*ctx
->Driver
.GetIntegerv
)(ctx
, pname
, params
))
3919 case GL_ACCUM_RED_BITS
:
3920 *params
= (GLint
) ctx
->Visual
.accumRedBits
;
3922 case GL_ACCUM_GREEN_BITS
:
3923 *params
= (GLint
) ctx
->Visual
.accumGreenBits
;
3925 case GL_ACCUM_BLUE_BITS
:
3926 *params
= (GLint
) ctx
->Visual
.accumBlueBits
;
3928 case GL_ACCUM_ALPHA_BITS
:
3929 *params
= (GLint
) ctx
->Visual
.accumAlphaBits
;
3931 case GL_ACCUM_CLEAR_VALUE
:
3932 params
[0] = FLOAT_TO_INT( ctx
->Accum
.ClearColor
[0] );
3933 params
[1] = FLOAT_TO_INT( ctx
->Accum
.ClearColor
[1] );
3934 params
[2] = FLOAT_TO_INT( ctx
->Accum
.ClearColor
[2] );
3935 params
[3] = FLOAT_TO_INT( ctx
->Accum
.ClearColor
[3] );
3938 *params
= (GLint
) ctx
->Pixel
.AlphaBias
;
3941 *params
= ctx
->Visual
.alphaBits
;
3943 case GL_ALPHA_SCALE
:
3944 *params
= (GLint
) ctx
->Pixel
.AlphaScale
;
3947 *params
= (GLint
) ctx
->Color
.AlphaEnabled
;
3949 case GL_ALPHA_TEST_REF
:
3950 *params
= FLOAT_TO_INT( (GLfloat
) ctx
->Color
.AlphaRef
/ CHAN_MAXF
);
3952 case GL_ALPHA_TEST_FUNC
:
3953 *params
= (GLint
) ctx
->Color
.AlphaFunc
;
3955 case GL_ATTRIB_STACK_DEPTH
:
3956 *params
= (GLint
) (ctx
->AttribStackDepth
);
3958 case GL_AUTO_NORMAL
:
3959 *params
= (GLint
) ctx
->Eval
.AutoNormal
;
3961 case GL_AUX_BUFFERS
:
3962 *params
= (GLint
) ctx
->Const
.NumAuxBuffers
;
3965 *params
= (GLint
) ctx
->Color
.BlendEnabled
;
3968 *params
= (GLint
) ctx
->Color
.BlendDstRGB
;
3971 *params
= (GLint
) ctx
->Color
.BlendSrcRGB
;
3973 case GL_BLEND_SRC_RGB_EXT
:
3974 *params
= (GLint
) ctx
->Color
.BlendSrcRGB
;
3976 case GL_BLEND_DST_RGB_EXT
:
3977 *params
= (GLint
) ctx
->Color
.BlendDstRGB
;
3979 case GL_BLEND_SRC_ALPHA_EXT
:
3980 *params
= (GLint
) ctx
->Color
.BlendSrcA
;
3982 case GL_BLEND_DST_ALPHA_EXT
:
3983 *params
= (GLint
) ctx
->Color
.BlendDstA
;
3985 case GL_BLEND_EQUATION_EXT
:
3986 *params
= (GLint
) ctx
->Color
.BlendEquation
;
3988 case GL_BLEND_COLOR_EXT
:
3989 params
[0] = FLOAT_TO_INT( ctx
->Color
.BlendColor
[0] );
3990 params
[1] = FLOAT_TO_INT( ctx
->Color
.BlendColor
[1] );
3991 params
[2] = FLOAT_TO_INT( ctx
->Color
.BlendColor
[2] );
3992 params
[3] = FLOAT_TO_INT( ctx
->Color
.BlendColor
[3] );
3995 *params
= (GLint
) ctx
->Pixel
.BlueBias
;
3998 *params
= (GLint
) ctx
->Visual
.blueBits
;
4001 *params
= (GLint
) ctx
->Pixel
.BlueScale
;
4003 case GL_CLIENT_ATTRIB_STACK_DEPTH
:
4004 *params
= (GLint
) (ctx
->ClientAttribStackDepth
);
4006 case GL_CLIP_PLANE0
:
4007 case GL_CLIP_PLANE1
:
4008 case GL_CLIP_PLANE2
:
4009 case GL_CLIP_PLANE3
:
4010 case GL_CLIP_PLANE4
:
4011 case GL_CLIP_PLANE5
:
4012 i
= (GLint
) (pname
- GL_CLIP_PLANE0
);
4013 *params
= (GLint
) ctx
->Transform
.ClipEnabled
[i
];
4015 case GL_COLOR_CLEAR_VALUE
:
4016 params
[0] = FLOAT_TO_INT( (ctx
->Color
.ClearColor
[0]) );
4017 params
[1] = FLOAT_TO_INT( (ctx
->Color
.ClearColor
[1]) );
4018 params
[2] = FLOAT_TO_INT( (ctx
->Color
.ClearColor
[2]) );
4019 params
[3] = FLOAT_TO_INT( (ctx
->Color
.ClearColor
[3]) );
4021 case GL_COLOR_MATERIAL
:
4022 *params
= (GLint
) ctx
->Light
.ColorMaterialEnabled
;
4024 case GL_COLOR_MATERIAL_FACE
:
4025 *params
= (GLint
) ctx
->Light
.ColorMaterialFace
;
4027 case GL_COLOR_MATERIAL_PARAMETER
:
4028 *params
= (GLint
) ctx
->Light
.ColorMaterialMode
;
4030 case GL_COLOR_WRITEMASK
:
4031 params
[0] = ctx
->Color
.ColorMask
[RCOMP
] ? 1 : 0;
4032 params
[1] = ctx
->Color
.ColorMask
[GCOMP
] ? 1 : 0;
4033 params
[2] = ctx
->Color
.ColorMask
[BCOMP
] ? 1 : 0;
4034 params
[3] = ctx
->Color
.ColorMask
[ACOMP
] ? 1 : 0;
4037 *params
= (GLint
) ctx
->Polygon
.CullFlag
;
4039 case GL_CULL_FACE_MODE
:
4040 *params
= (GLint
) ctx
->Polygon
.CullFaceMode
;
4042 case GL_CURRENT_COLOR
:
4043 FLUSH_CURRENT(ctx
, 0);
4044 params
[0] = FLOAT_TO_INT( ( ctx
->Current
.Color
[0] ) );
4045 params
[1] = FLOAT_TO_INT( ( ctx
->Current
.Color
[1] ) );
4046 params
[2] = FLOAT_TO_INT( ( ctx
->Current
.Color
[2] ) );
4047 params
[3] = FLOAT_TO_INT( ( ctx
->Current
.Color
[3] ) );
4049 case GL_CURRENT_INDEX
:
4050 FLUSH_CURRENT(ctx
, 0);
4051 *params
= (GLint
) ctx
->Current
.Index
;
4053 case GL_CURRENT_NORMAL
:
4054 FLUSH_CURRENT(ctx
, 0);
4055 params
[0] = FLOAT_TO_INT( ctx
->Current
.Normal
[0] );
4056 params
[1] = FLOAT_TO_INT( ctx
->Current
.Normal
[1] );
4057 params
[2] = FLOAT_TO_INT( ctx
->Current
.Normal
[2] );
4059 case GL_CURRENT_RASTER_COLOR
:
4060 params
[0] = FLOAT_TO_INT( ctx
->Current
.RasterColor
[0] );
4061 params
[1] = FLOAT_TO_INT( ctx
->Current
.RasterColor
[1] );
4062 params
[2] = FLOAT_TO_INT( ctx
->Current
.RasterColor
[2] );
4063 params
[3] = FLOAT_TO_INT( ctx
->Current
.RasterColor
[3] );
4065 case GL_CURRENT_RASTER_DISTANCE
:
4066 params
[0] = (GLint
) ctx
->Current
.RasterDistance
;
4068 case GL_CURRENT_RASTER_INDEX
:
4069 *params
= (GLint
) ctx
->Current
.RasterIndex
;
4071 case GL_CURRENT_RASTER_POSITION
:
4072 params
[0] = (GLint
) ctx
->Current
.RasterPos
[0];
4073 params
[1] = (GLint
) ctx
->Current
.RasterPos
[1];
4074 params
[2] = (GLint
) ctx
->Current
.RasterPos
[2];
4075 params
[3] = (GLint
) ctx
->Current
.RasterPos
[3];
4077 case GL_CURRENT_RASTER_TEXTURE_COORDS
:
4078 params
[0] = (GLint
) ctx
->Current
.RasterMultiTexCoord
[texUnit
][0];
4079 params
[1] = (GLint
) ctx
->Current
.RasterMultiTexCoord
[texUnit
][1];
4080 params
[2] = (GLint
) ctx
->Current
.RasterMultiTexCoord
[texUnit
][2];
4081 params
[3] = (GLint
) ctx
->Current
.RasterMultiTexCoord
[texUnit
][3];
4083 case GL_CURRENT_RASTER_POSITION_VALID
:
4084 *params
= (GLint
) ctx
->Current
.RasterPosValid
;
4086 case GL_CURRENT_TEXTURE_COORDS
:
4087 FLUSH_CURRENT(ctx
, 0);
4088 params
[0] = (GLint
) ctx
->Current
.Texcoord
[texUnit
][0];
4089 params
[1] = (GLint
) ctx
->Current
.Texcoord
[texUnit
][1];
4090 params
[2] = (GLint
) ctx
->Current
.Texcoord
[texUnit
][2];
4091 params
[3] = (GLint
) ctx
->Current
.Texcoord
[texUnit
][3];
4094 *params
= (GLint
) ctx
->Pixel
.DepthBias
;
4097 *params
= ctx
->Visual
.depthBits
;
4099 case GL_DEPTH_CLEAR_VALUE
:
4100 *params
= (GLint
) ctx
->Depth
.Clear
;
4103 *params
= (GLint
) ctx
->Depth
.Func
;
4105 case GL_DEPTH_RANGE
:
4106 params
[0] = (GLint
) ctx
->Viewport
.Near
;
4107 params
[1] = (GLint
) ctx
->Viewport
.Far
;
4109 case GL_DEPTH_SCALE
:
4110 *params
= (GLint
) ctx
->Pixel
.DepthScale
;
4113 *params
= (GLint
) ctx
->Depth
.Test
;
4115 case GL_DEPTH_WRITEMASK
:
4116 *params
= (GLint
) ctx
->Depth
.Mask
;
4119 *params
= (GLint
) ctx
->Color
.DitherFlag
;
4121 case GL_DOUBLEBUFFER
:
4122 *params
= (GLint
) ctx
->Visual
.doubleBufferMode
;
4124 case GL_DRAW_BUFFER
:
4125 *params
= (GLint
) ctx
->Color
.DrawBuffer
;
4128 FLUSH_CURRENT(ctx
, 0);
4129 *params
= (GLint
) ctx
->Current
.EdgeFlag
;
4131 case GL_FEEDBACK_BUFFER_SIZE
:
4132 *params
= ctx
->Feedback
.BufferSize
;
4134 case GL_FEEDBACK_BUFFER_TYPE
:
4135 *params
= ctx
->Feedback
.Type
;
4138 *params
= (GLint
) ctx
->Fog
.Enabled
;
4141 params
[0] = FLOAT_TO_INT( ctx
->Fog
.Color
[0] );
4142 params
[1] = FLOAT_TO_INT( ctx
->Fog
.Color
[1] );
4143 params
[2] = FLOAT_TO_INT( ctx
->Fog
.Color
[2] );
4144 params
[3] = FLOAT_TO_INT( ctx
->Fog
.Color
[3] );
4146 case GL_FOG_DENSITY
:
4147 *params
= (GLint
) ctx
->Fog
.Density
;
4150 *params
= (GLint
) ctx
->Fog
.End
;
4153 *params
= (GLint
) ctx
->Hint
.Fog
;
4156 *params
= (GLint
) ctx
->Fog
.Index
;
4159 *params
= (GLint
) ctx
->Fog
.Mode
;
4162 *params
= (GLint
) ctx
->Fog
.Start
;
4165 *params
= (GLint
) ctx
->Polygon
.FrontFace
;
4168 *params
= (GLint
) ctx
->Pixel
.GreenBias
;
4171 *params
= (GLint
) ctx
->Visual
.greenBits
;
4173 case GL_GREEN_SCALE
:
4174 *params
= (GLint
) ctx
->Pixel
.GreenScale
;
4177 if (ctx
->Extensions
.EXT_histogram
|| ctx
->Extensions
.ARB_imaging
) {
4178 *params
= (GLint
) ctx
->Pixel
.HistogramEnabled
;
4181 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetFloatv");
4186 *params
= (GLint
) ctx
->Visual
.indexBits
;
4188 case GL_INDEX_CLEAR_VALUE
:
4189 *params
= (GLint
) ctx
->Color
.ClearIndex
;
4192 *params
= ctx
->Visual
.rgbMode
? 0 : 1;
4194 case GL_INDEX_OFFSET
:
4195 *params
= ctx
->Pixel
.IndexOffset
;
4197 case GL_INDEX_SHIFT
:
4198 *params
= ctx
->Pixel
.IndexShift
;
4200 case GL_INDEX_WRITEMASK
:
4201 *params
= (GLint
) ctx
->Color
.IndexMask
;
4211 *params
= (GLint
) ctx
->Light
.Light
[pname
-GL_LIGHT0
].Enabled
;
4214 *params
= (GLint
) ctx
->Light
.Enabled
;
4216 case GL_LIGHT_MODEL_AMBIENT
:
4217 params
[0] = FLOAT_TO_INT( ctx
->Light
.Model
.Ambient
[0] );
4218 params
[1] = FLOAT_TO_INT( ctx
->Light
.Model
.Ambient
[1] );
4219 params
[2] = FLOAT_TO_INT( ctx
->Light
.Model
.Ambient
[2] );
4220 params
[3] = FLOAT_TO_INT( ctx
->Light
.Model
.Ambient
[3] );
4222 case GL_LIGHT_MODEL_COLOR_CONTROL
:
4223 params
[0] = (GLint
) ctx
->Light
.Model
.ColorControl
;
4225 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
4226 *params
= (GLint
) ctx
->Light
.Model
.LocalViewer
;
4228 case GL_LIGHT_MODEL_TWO_SIDE
:
4229 *params
= (GLint
) ctx
->Light
.Model
.TwoSide
;
4231 case GL_LINE_SMOOTH
:
4232 *params
= (GLint
) ctx
->Line
.SmoothFlag
;
4234 case GL_LINE_SMOOTH_HINT
:
4235 *params
= (GLint
) ctx
->Hint
.LineSmooth
;
4237 case GL_LINE_STIPPLE
:
4238 *params
= (GLint
) ctx
->Line
.StippleFlag
;
4240 case GL_LINE_STIPPLE_PATTERN
:
4241 *params
= (GLint
) ctx
->Line
.StipplePattern
;
4243 case GL_LINE_STIPPLE_REPEAT
:
4244 *params
= (GLint
) ctx
->Line
.StippleFactor
;
4247 *params
= (GLint
) ctx
->Line
.Width
;
4249 case GL_LINE_WIDTH_GRANULARITY
:
4250 *params
= (GLint
) ctx
->Const
.LineWidthGranularity
;
4252 case GL_LINE_WIDTH_RANGE
:
4253 params
[0] = (GLint
) ctx
->Const
.MinLineWidthAA
;
4254 params
[1] = (GLint
) ctx
->Const
.MaxLineWidthAA
;
4256 case GL_ALIASED_LINE_WIDTH_RANGE
:
4257 params
[0] = (GLint
) ctx
->Const
.MinLineWidth
;
4258 params
[1] = (GLint
) ctx
->Const
.MaxLineWidth
;
4261 *params
= (GLint
) ctx
->List
.ListBase
;
4264 *params
= (GLint
) ctx
->CurrentListNum
;
4267 *params
= ctx
->ExecuteFlag
? (GLint
) GL_COMPILE_AND_EXECUTE
4268 : (GLint
) GL_COMPILE
;
4270 case GL_INDEX_LOGIC_OP
:
4271 *params
= (GLint
) ctx
->Color
.IndexLogicOpEnabled
;
4273 case GL_COLOR_LOGIC_OP
:
4274 *params
= (GLint
) ctx
->Color
.ColorLogicOpEnabled
;
4276 case GL_LOGIC_OP_MODE
:
4277 *params
= (GLint
) ctx
->Color
.LogicOp
;
4279 case GL_MAP1_COLOR_4
:
4280 *params
= (GLint
) ctx
->Eval
.Map1Color4
;
4282 case GL_MAP1_GRID_DOMAIN
:
4283 params
[0] = (GLint
) ctx
->Eval
.MapGrid1u1
;
4284 params
[1] = (GLint
) ctx
->Eval
.MapGrid1u2
;
4286 case GL_MAP1_GRID_SEGMENTS
:
4287 *params
= (GLint
) ctx
->Eval
.MapGrid1un
;
4290 *params
= (GLint
) ctx
->Eval
.Map1Index
;
4292 case GL_MAP1_NORMAL
:
4293 *params
= (GLint
) ctx
->Eval
.Map1Normal
;
4295 case GL_MAP1_TEXTURE_COORD_1
:
4296 *params
= (GLint
) ctx
->Eval
.Map1TextureCoord1
;
4298 case GL_MAP1_TEXTURE_COORD_2
:
4299 *params
= (GLint
) ctx
->Eval
.Map1TextureCoord2
;
4301 case GL_MAP1_TEXTURE_COORD_3
:
4302 *params
= (GLint
) ctx
->Eval
.Map1TextureCoord3
;
4304 case GL_MAP1_TEXTURE_COORD_4
:
4305 *params
= (GLint
) ctx
->Eval
.Map1TextureCoord4
;
4307 case GL_MAP1_VERTEX_3
:
4308 *params
= (GLint
) ctx
->Eval
.Map1Vertex3
;
4310 case GL_MAP1_VERTEX_4
:
4311 *params
= (GLint
) ctx
->Eval
.Map1Vertex4
;
4313 case GL_MAP2_COLOR_4
:
4314 *params
= (GLint
) ctx
->Eval
.Map2Color4
;
4316 case GL_MAP2_GRID_DOMAIN
:
4317 params
[0] = (GLint
) ctx
->Eval
.MapGrid2u1
;
4318 params
[1] = (GLint
) ctx
->Eval
.MapGrid2u2
;
4319 params
[2] = (GLint
) ctx
->Eval
.MapGrid2v1
;
4320 params
[3] = (GLint
) ctx
->Eval
.MapGrid2v2
;
4322 case GL_MAP2_GRID_SEGMENTS
:
4323 params
[0] = (GLint
) ctx
->Eval
.MapGrid2un
;
4324 params
[1] = (GLint
) ctx
->Eval
.MapGrid2vn
;
4327 *params
= (GLint
) ctx
->Eval
.Map2Index
;
4329 case GL_MAP2_NORMAL
:
4330 *params
= (GLint
) ctx
->Eval
.Map2Normal
;
4332 case GL_MAP2_TEXTURE_COORD_1
:
4333 *params
= (GLint
) ctx
->Eval
.Map2TextureCoord1
;
4335 case GL_MAP2_TEXTURE_COORD_2
:
4336 *params
= (GLint
) ctx
->Eval
.Map2TextureCoord2
;
4338 case GL_MAP2_TEXTURE_COORD_3
:
4339 *params
= (GLint
) ctx
->Eval
.Map2TextureCoord3
;
4341 case GL_MAP2_TEXTURE_COORD_4
:
4342 *params
= (GLint
) ctx
->Eval
.Map2TextureCoord4
;
4344 case GL_MAP2_VERTEX_3
:
4345 *params
= (GLint
) ctx
->Eval
.Map2Vertex3
;
4347 case GL_MAP2_VERTEX_4
:
4348 *params
= (GLint
) ctx
->Eval
.Map2Vertex4
;
4351 *params
= (GLint
) ctx
->Pixel
.MapColorFlag
;
4353 case GL_MAP_STENCIL
:
4354 *params
= (GLint
) ctx
->Pixel
.MapStencilFlag
;
4356 case GL_MATRIX_MODE
:
4357 *params
= (GLint
) ctx
->Transform
.MatrixMode
;
4359 case GL_MAX_ATTRIB_STACK_DEPTH
:
4360 *params
= (GLint
) MAX_ATTRIB_STACK_DEPTH
;
4362 case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH
:
4363 *params
= (GLint
) MAX_CLIENT_ATTRIB_STACK_DEPTH
;
4365 case GL_MAX_CLIP_PLANES
:
4366 *params
= (GLint
) ctx
->Const
.MaxClipPlanes
;
4368 case GL_MAX_ELEMENTS_VERTICES
: /* GL_VERSION_1_2 */
4369 *params
= (GLint
) ctx
->Const
.MaxArrayLockSize
;
4371 case GL_MAX_ELEMENTS_INDICES
: /* GL_VERSION_1_2 */
4372 *params
= (GLint
) ctx
->Const
.MaxArrayLockSize
;
4374 case GL_MAX_EVAL_ORDER
:
4375 *params
= (GLint
) MAX_EVAL_ORDER
;
4378 *params
= (GLint
) ctx
->Const
.MaxLights
;
4380 case GL_MAX_LIST_NESTING
:
4381 *params
= (GLint
) MAX_LIST_NESTING
;
4383 case GL_MAX_MODELVIEW_STACK_DEPTH
:
4384 *params
= (GLint
) MAX_MODELVIEW_STACK_DEPTH
;
4386 case GL_MAX_NAME_STACK_DEPTH
:
4387 *params
= (GLint
) MAX_NAME_STACK_DEPTH
;
4389 case GL_MAX_PIXEL_MAP_TABLE
:
4390 *params
= (GLint
) MAX_PIXEL_MAP_TABLE
;
4392 case GL_MAX_PROJECTION_STACK_DEPTH
:
4393 *params
= (GLint
) MAX_PROJECTION_STACK_DEPTH
;
4395 case GL_MAX_TEXTURE_SIZE
:
4396 case GL_MAX_3D_TEXTURE_SIZE
:
4397 *params
= ctx
->Const
.MaxTextureSize
;
4399 case GL_MAX_TEXTURE_STACK_DEPTH
:
4400 *params
= (GLint
) MAX_TEXTURE_STACK_DEPTH
;
4402 case GL_MAX_VIEWPORT_DIMS
:
4403 params
[0] = (GLint
) MAX_WIDTH
;
4404 params
[1] = (GLint
) MAX_HEIGHT
;
4407 *params
= (GLint
) ctx
->Pixel
.MinMaxEnabled
;
4409 case GL_MODELVIEW_MATRIX
:
4410 for (i
=0;i
<16;i
++) {
4411 params
[i
] = (GLint
) ctx
->ModelView
.m
[i
];
4414 case GL_MODELVIEW_STACK_DEPTH
:
4415 *params
= (GLint
) (ctx
->ModelViewStackDepth
+ 1);
4417 case GL_NAME_STACK_DEPTH
:
4418 *params
= (GLint
) ctx
->Select
.NameStackDepth
;
4421 *params
= (GLint
) ctx
->Transform
.Normalize
;
4423 case GL_PACK_ALIGNMENT
:
4424 *params
= ctx
->Pack
.Alignment
;
4426 case GL_PACK_LSB_FIRST
:
4427 *params
= (GLint
) ctx
->Pack
.LsbFirst
;
4429 case GL_PACK_ROW_LENGTH
:
4430 *params
= ctx
->Pack
.RowLength
;
4432 case GL_PACK_SKIP_PIXELS
:
4433 *params
= ctx
->Pack
.SkipPixels
;
4435 case GL_PACK_SKIP_ROWS
:
4436 *params
= ctx
->Pack
.SkipRows
;
4438 case GL_PACK_SWAP_BYTES
:
4439 *params
= (GLint
) ctx
->Pack
.SwapBytes
;
4441 case GL_PACK_SKIP_IMAGES_EXT
:
4442 *params
= ctx
->Pack
.SkipImages
;
4444 case GL_PACK_IMAGE_HEIGHT_EXT
:
4445 *params
= ctx
->Pack
.ImageHeight
;
4447 case GL_PERSPECTIVE_CORRECTION_HINT
:
4448 *params
= (GLint
) ctx
->Hint
.PerspectiveCorrection
;
4450 case GL_PIXEL_MAP_A_TO_A_SIZE
:
4451 *params
= ctx
->Pixel
.MapAtoAsize
;
4453 case GL_PIXEL_MAP_B_TO_B_SIZE
:
4454 *params
= ctx
->Pixel
.MapBtoBsize
;
4456 case GL_PIXEL_MAP_G_TO_G_SIZE
:
4457 *params
= ctx
->Pixel
.MapGtoGsize
;
4459 case GL_PIXEL_MAP_I_TO_A_SIZE
:
4460 *params
= ctx
->Pixel
.MapItoAsize
;
4462 case GL_PIXEL_MAP_I_TO_B_SIZE
:
4463 *params
= ctx
->Pixel
.MapItoBsize
;
4465 case GL_PIXEL_MAP_I_TO_G_SIZE
:
4466 *params
= ctx
->Pixel
.MapItoGsize
;
4468 case GL_PIXEL_MAP_I_TO_I_SIZE
:
4469 *params
= ctx
->Pixel
.MapItoIsize
;
4471 case GL_PIXEL_MAP_I_TO_R_SIZE
:
4472 *params
= ctx
->Pixel
.MapItoRsize
;
4474 case GL_PIXEL_MAP_R_TO_R_SIZE
:
4475 *params
= ctx
->Pixel
.MapRtoRsize
;
4477 case GL_PIXEL_MAP_S_TO_S_SIZE
:
4478 *params
= ctx
->Pixel
.MapStoSsize
;
4481 *params
= (GLint
) ctx
->Point
.Size
;
4483 case GL_POINT_SIZE_GRANULARITY
:
4484 *params
= (GLint
) ctx
->Const
.PointSizeGranularity
;
4486 case GL_POINT_SIZE_RANGE
:
4487 params
[0] = (GLint
) ctx
->Const
.MinPointSizeAA
;
4488 params
[1] = (GLint
) ctx
->Const
.MaxPointSizeAA
;
4490 case GL_ALIASED_POINT_SIZE_RANGE
:
4491 params
[0] = (GLint
) ctx
->Const
.MinPointSize
;
4492 params
[1] = (GLint
) ctx
->Const
.MaxPointSize
;
4494 case GL_POINT_SMOOTH
:
4495 *params
= (GLint
) ctx
->Point
.SmoothFlag
;
4497 case GL_POINT_SMOOTH_HINT
:
4498 *params
= (GLint
) ctx
->Hint
.PointSmooth
;
4500 case GL_POINT_SIZE_MIN_EXT
:
4501 *params
= (GLint
) (ctx
->Point
.MinSize
);
4503 case GL_POINT_SIZE_MAX_EXT
:
4504 *params
= (GLint
) (ctx
->Point
.MaxSize
);
4506 case GL_POINT_FADE_THRESHOLD_SIZE_EXT
:
4507 *params
= (GLint
) (ctx
->Point
.Threshold
);
4509 case GL_DISTANCE_ATTENUATION_EXT
:
4510 params
[0] = (GLint
) (ctx
->Point
.Params
[0]);
4511 params
[1] = (GLint
) (ctx
->Point
.Params
[1]);
4512 params
[2] = (GLint
) (ctx
->Point
.Params
[2]);
4514 case GL_POLYGON_MODE
:
4515 params
[0] = (GLint
) ctx
->Polygon
.FrontMode
;
4516 params
[1] = (GLint
) ctx
->Polygon
.BackMode
;
4518 case GL_POLYGON_OFFSET_BIAS_EXT
: /* GL_EXT_polygon_offset */
4519 *params
= (GLint
) ctx
->Polygon
.OffsetUnits
;
4521 case GL_POLYGON_OFFSET_FACTOR
:
4522 *params
= (GLint
) ctx
->Polygon
.OffsetFactor
;
4524 case GL_POLYGON_OFFSET_UNITS
:
4525 *params
= (GLint
) ctx
->Polygon
.OffsetUnits
;
4527 case GL_POLYGON_SMOOTH
:
4528 *params
= (GLint
) ctx
->Polygon
.SmoothFlag
;
4530 case GL_POLYGON_SMOOTH_HINT
:
4531 *params
= (GLint
) ctx
->Hint
.PolygonSmooth
;
4533 case GL_POLYGON_STIPPLE
:
4534 *params
= (GLint
) ctx
->Polygon
.StippleFlag
;
4536 case GL_PROJECTION_MATRIX
:
4537 for (i
=0;i
<16;i
++) {
4538 params
[i
] = (GLint
) ctx
->ProjectionMatrix
.m
[i
];
4541 case GL_PROJECTION_STACK_DEPTH
:
4542 *params
= (GLint
) (ctx
->ProjectionStackDepth
+ 1);
4544 case GL_READ_BUFFER
:
4545 *params
= (GLint
) ctx
->Pixel
.ReadBuffer
;
4548 *params
= (GLint
) ctx
->Pixel
.RedBias
;
4551 *params
= (GLint
) ctx
->Visual
.redBits
;
4554 *params
= (GLint
) ctx
->Pixel
.RedScale
;
4556 case GL_RENDER_MODE
:
4557 *params
= (GLint
) ctx
->RenderMode
;
4559 case GL_RESCALE_NORMAL
:
4560 *params
= (GLint
) ctx
->Transform
.RescaleNormals
;
4563 *params
= (GLint
) ctx
->Visual
.rgbMode
;
4565 case GL_SCISSOR_BOX
:
4566 params
[0] = (GLint
) ctx
->Scissor
.X
;
4567 params
[1] = (GLint
) ctx
->Scissor
.Y
;
4568 params
[2] = (GLint
) ctx
->Scissor
.Width
;
4569 params
[3] = (GLint
) ctx
->Scissor
.Height
;
4571 case GL_SCISSOR_TEST
:
4572 *params
= (GLint
) ctx
->Scissor
.Enabled
;
4574 case GL_SELECTION_BUFFER_SIZE
:
4575 *params
= (GLint
) ctx
->Select
.BufferSize
;
4577 case GL_SHADE_MODEL
:
4578 *params
= (GLint
) ctx
->Light
.ShadeModel
;
4580 case GL_SHARED_TEXTURE_PALETTE_EXT
:
4581 *params
= (GLint
) ctx
->Texture
.SharedPalette
;
4583 case GL_STENCIL_BITS
:
4584 *params
= ctx
->Visual
.stencilBits
;
4586 case GL_STENCIL_CLEAR_VALUE
:
4587 *params
= (GLint
) ctx
->Stencil
.Clear
;
4589 case GL_STENCIL_FAIL
:
4590 *params
= (GLint
) ctx
->Stencil
.FailFunc
;
4592 case GL_STENCIL_FUNC
:
4593 *params
= (GLint
) ctx
->Stencil
.Function
;
4595 case GL_STENCIL_PASS_DEPTH_FAIL
:
4596 *params
= (GLint
) ctx
->Stencil
.ZFailFunc
;
4598 case GL_STENCIL_PASS_DEPTH_PASS
:
4599 *params
= (GLint
) ctx
->Stencil
.ZPassFunc
;
4601 case GL_STENCIL_REF
:
4602 *params
= (GLint
) ctx
->Stencil
.Ref
;
4604 case GL_STENCIL_TEST
:
4605 *params
= (GLint
) ctx
->Stencil
.Enabled
;
4607 case GL_STENCIL_VALUE_MASK
:
4608 *params
= (GLint
) ctx
->Stencil
.ValueMask
;
4610 case GL_STENCIL_WRITEMASK
:
4611 *params
= (GLint
) ctx
->Stencil
.WriteMask
;
4614 *params
= (GLint
) ctx
->Visual
.stereoMode
;
4616 case GL_SUBPIXEL_BITS
:
4617 *params
= ctx
->Const
.SubPixelBits
;
4620 *params
= _mesa_IsEnabled(GL_TEXTURE_1D
) ? 1 : 0;
4623 *params
= _mesa_IsEnabled(GL_TEXTURE_2D
) ? 1 : 0;
4626 *params
= _mesa_IsEnabled(GL_TEXTURE_3D
) ? 1 : 0;
4628 case GL_TEXTURE_BINDING_1D
:
4629 *params
= textureUnit
->Current1D
->Name
;
4631 case GL_TEXTURE_BINDING_2D
:
4632 *params
= textureUnit
->Current2D
->Name
;
4634 case GL_TEXTURE_BINDING_3D
:
4635 *params
= textureUnit
->Current3D
->Name
;
4637 case GL_TEXTURE_ENV_COLOR
:
4638 params
[0] = FLOAT_TO_INT( textureUnit
->EnvColor
[0] );
4639 params
[1] = FLOAT_TO_INT( textureUnit
->EnvColor
[1] );
4640 params
[2] = FLOAT_TO_INT( textureUnit
->EnvColor
[2] );
4641 params
[3] = FLOAT_TO_INT( textureUnit
->EnvColor
[3] );
4643 case GL_TEXTURE_ENV_MODE
:
4644 *params
= (GLint
) textureUnit
->EnvMode
;
4646 case GL_TEXTURE_GEN_S
:
4647 *params
= (textureUnit
->TexGenEnabled
& S_BIT
) ? 1 : 0;
4649 case GL_TEXTURE_GEN_T
:
4650 *params
= (textureUnit
->TexGenEnabled
& T_BIT
) ? 1 : 0;
4652 case GL_TEXTURE_GEN_R
:
4653 *params
= (textureUnit
->TexGenEnabled
& R_BIT
) ? 1 : 0;
4655 case GL_TEXTURE_GEN_Q
:
4656 *params
= (textureUnit
->TexGenEnabled
& Q_BIT
) ? 1 : 0;
4658 case GL_TEXTURE_MATRIX
:
4659 for (i
=0;i
<16;i
++) {
4660 params
[i
] = (GLint
) ctx
->TextureMatrix
[texUnit
].m
[i
];
4663 case GL_TEXTURE_STACK_DEPTH
:
4664 *params
= (GLint
) (ctx
->TextureStackDepth
[texUnit
] + 1);
4666 case GL_UNPACK_ALIGNMENT
:
4667 *params
= ctx
->Unpack
.Alignment
;
4669 case GL_UNPACK_LSB_FIRST
:
4670 *params
= (GLint
) ctx
->Unpack
.LsbFirst
;
4672 case GL_UNPACK_ROW_LENGTH
:
4673 *params
= ctx
->Unpack
.RowLength
;
4675 case GL_UNPACK_SKIP_PIXELS
:
4676 *params
= ctx
->Unpack
.SkipPixels
;
4678 case GL_UNPACK_SKIP_ROWS
:
4679 *params
= ctx
->Unpack
.SkipRows
;
4681 case GL_UNPACK_SWAP_BYTES
:
4682 *params
= (GLint
) ctx
->Unpack
.SwapBytes
;
4684 case GL_UNPACK_SKIP_IMAGES_EXT
:
4685 *params
= ctx
->Unpack
.SkipImages
;
4687 case GL_UNPACK_IMAGE_HEIGHT_EXT
:
4688 *params
= ctx
->Unpack
.ImageHeight
;
4691 params
[0] = (GLint
) ctx
->Viewport
.X
;
4692 params
[1] = (GLint
) ctx
->Viewport
.Y
;
4693 params
[2] = (GLint
) ctx
->Viewport
.Width
;
4694 params
[3] = (GLint
) ctx
->Viewport
.Height
;
4697 *params
= (GLint
) ctx
->Pixel
.ZoomX
;
4700 *params
= (GLint
) ctx
->Pixel
.ZoomY
;
4702 case GL_VERTEX_ARRAY
:
4703 *params
= (GLint
) ctx
->Array
.Vertex
.Enabled
;
4705 case GL_VERTEX_ARRAY_SIZE
:
4706 *params
= ctx
->Array
.Vertex
.Size
;
4708 case GL_VERTEX_ARRAY_TYPE
:
4709 *params
= ctx
->Array
.Vertex
.Type
;
4711 case GL_VERTEX_ARRAY_STRIDE
:
4712 *params
= ctx
->Array
.Vertex
.Stride
;
4714 case GL_VERTEX_ARRAY_COUNT_EXT
:
4717 case GL_NORMAL_ARRAY
:
4718 *params
= (GLint
) ctx
->Array
.Normal
.Enabled
;
4720 case GL_NORMAL_ARRAY_TYPE
:
4721 *params
= ctx
->Array
.Normal
.Type
;
4723 case GL_NORMAL_ARRAY_STRIDE
:
4724 *params
= ctx
->Array
.Normal
.Stride
;
4726 case GL_NORMAL_ARRAY_COUNT_EXT
:
4729 case GL_COLOR_ARRAY
:
4730 *params
= (GLint
) ctx
->Array
.Color
.Enabled
;
4732 case GL_COLOR_ARRAY_SIZE
:
4733 *params
= ctx
->Array
.Color
.Size
;
4735 case GL_COLOR_ARRAY_TYPE
:
4736 *params
= ctx
->Array
.Color
.Type
;
4738 case GL_COLOR_ARRAY_STRIDE
:
4739 *params
= ctx
->Array
.Color
.Stride
;
4741 case GL_COLOR_ARRAY_COUNT_EXT
:
4744 case GL_INDEX_ARRAY
:
4745 *params
= (GLint
) ctx
->Array
.Index
.Enabled
;
4747 case GL_INDEX_ARRAY_TYPE
:
4748 *params
= ctx
->Array
.Index
.Type
;
4750 case GL_INDEX_ARRAY_STRIDE
:
4751 *params
= ctx
->Array
.Index
.Stride
;
4753 case GL_INDEX_ARRAY_COUNT_EXT
:
4756 case GL_TEXTURE_COORD_ARRAY
:
4757 *params
= (GLint
) ctx
->Array
.TexCoord
[texUnit
].Enabled
;
4759 case GL_TEXTURE_COORD_ARRAY_SIZE
:
4760 *params
= ctx
->Array
.TexCoord
[texUnit
].Size
;
4762 case GL_TEXTURE_COORD_ARRAY_TYPE
:
4763 *params
= ctx
->Array
.TexCoord
[texUnit
].Type
;
4765 case GL_TEXTURE_COORD_ARRAY_STRIDE
:
4766 *params
= ctx
->Array
.TexCoord
[texUnit
].Stride
;
4768 case GL_TEXTURE_COORD_ARRAY_COUNT_EXT
:
4771 case GL_EDGE_FLAG_ARRAY
:
4772 *params
= (GLint
) ctx
->Array
.EdgeFlag
.Enabled
;
4774 case GL_EDGE_FLAG_ARRAY_STRIDE
:
4775 *params
= ctx
->Array
.EdgeFlag
.Stride
;
4777 case GL_EDGE_FLAG_ARRAY_COUNT_EXT
:
4781 /* GL_ARB_multitexture */
4782 case GL_MAX_TEXTURE_UNITS_ARB
:
4783 *params
= ctx
->Const
.MaxTextureUnits
;
4785 case GL_ACTIVE_TEXTURE_ARB
:
4786 *params
= GL_TEXTURE0_ARB
+ ctx
->Texture
.CurrentUnit
;
4788 case GL_CLIENT_ACTIVE_TEXTURE_ARB
:
4789 *params
= GL_TEXTURE0_ARB
+ ctx
->Array
.ActiveTexture
;
4792 /* GL_ARB_texture_cube_map */
4793 case GL_TEXTURE_CUBE_MAP_ARB
:
4794 if (ctx
->Extensions
.ARB_texture_cube_map
)
4795 *params
= (GLint
) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB
);
4797 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
4799 case GL_TEXTURE_BINDING_CUBE_MAP_ARB
:
4800 if (ctx
->Extensions
.ARB_texture_cube_map
)
4801 *params
= textureUnit
->CurrentCubeMap
->Name
;
4803 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
4805 case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB
:
4806 if (ctx
->Extensions
.ARB_texture_cube_map
)
4807 *params
= ctx
->Const
.MaxCubeTextureSize
;
4809 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
4812 /* GL_ARB_texture_compression */
4813 case GL_TEXTURE_COMPRESSION_HINT_ARB
:
4814 if (ctx
->Extensions
.ARB_texture_compression
) {
4815 *params
= (GLint
) ctx
->Hint
.TextureCompression
;
4818 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
4820 case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB
:
4821 if (ctx
->Extensions
.ARB_texture_compression
) {
4822 *params
= (GLint
) ctx
->Const
.NumCompressedTextureFormats
;
4825 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
4827 case GL_COMPRESSED_TEXTURE_FORMATS_ARB
:
4828 if (ctx
->Extensions
.ARB_texture_compression
) {
4830 for (i
= 0; i
< ctx
->Const
.NumCompressedTextureFormats
; i
++)
4831 params
[i
] = (GLint
) ctx
->Const
.CompressedTextureFormats
[i
];
4834 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
4837 /* GL_EXT_compiled_vertex_array */
4838 case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
:
4839 *params
= ctx
->Array
.LockFirst
;
4841 case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
:
4842 *params
= ctx
->Array
.LockCount
;
4845 /* GL_ARB_transpose_matrix */
4846 case GL_TRANSPOSE_COLOR_MATRIX_ARB
:
4850 _math_transposef(tm
, ctx
->ColorMatrix
.m
);
4851 for (i
=0;i
<16;i
++) {
4852 params
[i
] = (GLint
) tm
[i
];
4856 case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB
:
4860 _math_transposef(tm
, ctx
->ModelView
.m
);
4861 for (i
=0;i
<16;i
++) {
4862 params
[i
] = (GLint
) tm
[i
];
4866 case GL_TRANSPOSE_PROJECTION_MATRIX_ARB
:
4870 _math_transposef(tm
, ctx
->ProjectionMatrix
.m
);
4871 for (i
=0;i
<16;i
++) {
4872 params
[i
] = (GLint
) tm
[i
];
4876 case GL_TRANSPOSE_TEXTURE_MATRIX_ARB
:
4880 _math_transposef(tm
, ctx
->TextureMatrix
[texUnit
].m
);
4881 for (i
=0;i
<16;i
++) {
4882 params
[i
] = (GLint
) tm
[i
];
4887 /* GL_HP_occlusion_test */
4888 case GL_OCCLUSION_TEST_HP
:
4889 if (ctx
->Extensions
.HP_occlusion_test
) {
4890 *params
= (GLint
) ctx
->Depth
.OcclusionTest
;
4893 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetIntegerv" );
4896 case GL_OCCLUSION_TEST_RESULT_HP
:
4897 if (ctx
->Extensions
.HP_occlusion_test
) {
4898 if (ctx
->Depth
.OcclusionTest
)
4899 *params
= (GLint
) ctx
->OcclusionResult
;
4901 *params
= (GLint
) ctx
->OcclusionResultSaved
;
4902 /* reset flag now */
4903 ctx
->OcclusionResult
= GL_FALSE
;
4904 ctx
->OcclusionResultSaved
= GL_FALSE
;
4907 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetIntegerv" );
4911 /* GL_SGIS_pixel_texture */
4912 case GL_PIXEL_TEXTURE_SGIS
:
4913 *params
= (GLint
) ctx
->Pixel
.PixelTextureEnabled
;
4916 /* GL_SGIX_pixel_texture */
4917 case GL_PIXEL_TEX_GEN_SGIX
:
4918 *params
= (GLint
) ctx
->Pixel
.PixelTextureEnabled
;
4920 case GL_PIXEL_TEX_GEN_MODE_SGIX
:
4921 *params
= (GLint
) pixel_texgen_mode(ctx
);
4924 /* GL_SGI_color_matrix (also in 1.2 imaging) */
4925 case GL_COLOR_MATRIX_SGI
:
4926 for (i
=0;i
<16;i
++) {
4927 params
[i
] = (GLint
) ctx
->ColorMatrix
.m
[i
];
4930 case GL_COLOR_MATRIX_STACK_DEPTH_SGI
:
4931 *params
= ctx
->ColorStackDepth
+ 1;
4933 case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI
:
4934 *params
= MAX_COLOR_STACK_DEPTH
;
4936 case GL_POST_COLOR_MATRIX_RED_SCALE_SGI
:
4937 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixScale
[0];
4939 case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI
:
4940 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixScale
[1];
4942 case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI
:
4943 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixScale
[2];
4945 case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI
:
4946 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixScale
[3];
4948 case GL_POST_COLOR_MATRIX_RED_BIAS_SGI
:
4949 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixBias
[0];
4951 case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI
:
4952 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixBias
[1];
4954 case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI
:
4955 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixBias
[2];
4957 case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI
:
4958 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixBias
[3];
4961 /* GL_EXT_convolution (also in 1.2 imaging) */
4962 case GL_CONVOLUTION_1D_EXT
:
4963 if (ctx
->Extensions
.EXT_convolution
|| ctx
->Extensions
.ARB_imaging
) {
4964 *params
= (GLint
) ctx
->Pixel
.Convolution1DEnabled
;
4967 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
4971 case GL_CONVOLUTION_2D
:
4972 if (ctx
->Extensions
.EXT_convolution
|| ctx
->Extensions
.ARB_imaging
) {
4973 *params
= (GLint
) ctx
->Pixel
.Convolution2DEnabled
;
4976 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
4980 case GL_SEPARABLE_2D
:
4981 if (ctx
->Extensions
.EXT_convolution
|| ctx
->Extensions
.ARB_imaging
) {
4982 *params
= (GLint
) ctx
->Pixel
.Separable2DEnabled
;
4985 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
4989 case GL_MAX_CONVOLUTION_WIDTH
:
4990 *params
= ctx
->Const
.MaxConvolutionWidth
;
4992 case GL_MAX_CONVOLUTION_HEIGHT
:
4993 *params
= ctx
->Const
.MaxConvolutionHeight
;
4995 case GL_POST_CONVOLUTION_RED_SCALE_EXT
:
4996 *params
= (GLint
) ctx
->Pixel
.PostConvolutionScale
[0];
4998 case GL_POST_CONVOLUTION_GREEN_SCALE_EXT
:
4999 *params
= (GLint
) ctx
->Pixel
.PostConvolutionScale
[1];
5001 case GL_POST_CONVOLUTION_BLUE_SCALE_EXT
:
5002 *params
= (GLint
) ctx
->Pixel
.PostConvolutionScale
[2];
5004 case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT
:
5005 *params
= (GLint
) ctx
->Pixel
.PostConvolutionScale
[3];
5007 case GL_POST_CONVOLUTION_RED_BIAS_EXT
:
5008 *params
= (GLint
) ctx
->Pixel
.PostConvolutionBias
[0];
5010 case GL_POST_CONVOLUTION_GREEN_BIAS_EXT
:
5011 *params
= (GLint
) ctx
->Pixel
.PostConvolutionBias
[1];
5013 case GL_POST_CONVOLUTION_BLUE_BIAS_EXT
:
5014 *params
= (GLint
) ctx
->Pixel
.PostConvolutionBias
[2];
5016 case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT
:
5017 *params
= (GLint
) ctx
->Pixel
.PostConvolutionBias
[2];
5020 /* GL_SGI_color_table (also in 1.2 imaging */
5021 case GL_COLOR_TABLE_SGI
:
5022 *params
= (GLint
) ctx
->Pixel
.ColorTableEnabled
;
5024 case GL_POST_CONVOLUTION_COLOR_TABLE_SGI
:
5025 *params
= (GLint
) ctx
->Pixel
.PostConvolutionColorTableEnabled
;
5027 case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
:
5028 *params
= (GLint
) ctx
->Pixel
.PostColorMatrixColorTableEnabled
;
5032 /* GL_EXT_secondary_color */
5033 case GL_COLOR_SUM_EXT
:
5034 *params
= (GLint
) ctx
->Fog
.ColorSumEnabled
;
5036 case GL_CURRENT_SECONDARY_COLOR_EXT
:
5037 FLUSH_CURRENT(ctx
, 0);
5038 params
[0] = FLOAT_TO_INT( (ctx
->Current
.SecondaryColor
[0]) );
5039 params
[1] = FLOAT_TO_INT( (ctx
->Current
.SecondaryColor
[1]) );
5040 params
[2] = FLOAT_TO_INT( (ctx
->Current
.SecondaryColor
[2]) );
5042 case GL_SECONDARY_COLOR_ARRAY_EXT
:
5043 *params
= (GLint
) ctx
->Array
.SecondaryColor
.Enabled
;
5045 case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT
:
5046 *params
= (GLint
) ctx
->Array
.SecondaryColor
.Type
;
5048 case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT
:
5049 *params
= (GLint
) ctx
->Array
.SecondaryColor
.Stride
;
5051 case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT
:
5052 *params
= (GLint
) ctx
->Array
.SecondaryColor
.Stride
;
5055 /* GL_EXT_fog_coord */
5056 case GL_CURRENT_FOG_COORDINATE_EXT
:
5057 if (ctx
->Extensions
.EXT_fog_coord
) {
5058 FLUSH_CURRENT(ctx
, 0);
5059 *params
= (GLint
) ctx
->Current
.FogCoord
;
5062 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetIntegerv" );
5065 case GL_FOG_COORDINATE_ARRAY_EXT
:
5066 if (ctx
->Extensions
.EXT_fog_coord
) {
5067 *params
= (GLint
) ctx
->Array
.FogCoord
.Enabled
;
5070 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetIntegerv" );
5073 case GL_FOG_COORDINATE_ARRAY_TYPE_EXT
:
5074 if (ctx
->Extensions
.EXT_fog_coord
) {
5075 *params
= (GLint
) ctx
->Array
.FogCoord
.Type
;
5078 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetIntegerv" );
5081 case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
:
5082 if (ctx
->Extensions
.EXT_fog_coord
) {
5083 *params
= (GLint
) ctx
->Array
.FogCoord
.Stride
;
5086 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetIntegerv" );
5090 /* GL_EXT_texture_filter_anisotropic */
5091 case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
:
5092 if (ctx
->Extensions
.EXT_texture_filter_anisotropic
) {
5093 *params
= (GLint
) ctx
->Const
.MaxTextureMaxAnisotropy
;
5096 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetIntegerv" );
5101 /* GL_ARB_multisample */
5102 case GL_MULTISAMPLE_ARB
:
5103 if (ctx
->Extensions
.ARB_multisample
) {
5104 *params
= (GLint
) ctx
->Multisample
.Enabled
;
5107 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
5110 case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB
:
5111 if (ctx
->Extensions
.ARB_multisample
) {
5112 *params
= (GLint
) ctx
->Multisample
.SampleAlphaToCoverage
;
5115 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
5118 case GL_SAMPLE_ALPHA_TO_ONE_ARB
:
5119 if (ctx
->Extensions
.ARB_multisample
) {
5120 *params
= (GLint
) ctx
->Multisample
.SampleAlphaToOne
;
5123 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
5126 case GL_SAMPLE_COVERAGE_ARB
:
5127 if (ctx
->Extensions
.ARB_multisample
) {
5128 *params
= (GLint
) ctx
->Multisample
.SampleCoverage
;
5131 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
5134 case GL_SAMPLE_COVERAGE_VALUE_ARB
:
5135 if (ctx
->Extensions
.ARB_multisample
) {
5136 *params
= (GLint
) ctx
->Multisample
.SampleCoverageValue
;
5139 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
5142 case GL_SAMPLE_COVERAGE_INVERT_ARB
:
5143 if (ctx
->Extensions
.ARB_multisample
) {
5144 *params
= (GLint
) ctx
->Multisample
.SampleCoverageInvert
;
5147 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
5150 case GL_SAMPLE_BUFFERS_ARB
:
5151 if (ctx
->Extensions
.ARB_multisample
) {
5152 *params
= 0; /* XXX fix someday */
5155 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
5158 case GL_SAMPLES_ARB
:
5159 if (ctx
->Extensions
.ARB_multisample
) {
5160 *params
= 0; /* XXX fix someday */
5163 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
5167 /* GL_MESA_sprite_point */
5168 case GL_SPRITE_POINT_MESA
:
5169 if (ctx
->Extensions
.MESA_sprite_point
) {
5170 *params
= (GLint
) ctx
->Point
.SpriteMode
;
5173 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetIntegerv" );
5178 /* GL_SGIS_generate_mipmap */
5179 case GL_GENERATE_MIPMAP_HINT_SGIS
:
5180 if (ctx
->Extensions
.SGIS_generate_mipmap
) {
5181 *params
= (GLint
) ctx
->Hint
.GenerateMipmap
;
5184 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetIntegerv");
5190 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetIntegerv" );
5197 _mesa_GetPointerv( GLenum pname
, GLvoid
**params
)
5199 GET_CURRENT_CONTEXT(ctx
);
5200 GLuint texUnit
= ctx
->Texture
.CurrentUnit
;
5201 ASSERT_OUTSIDE_BEGIN_END(ctx
);
5206 if (MESA_VERBOSE
& VERBOSE_API
)
5207 fprintf(stderr
, "glGetPointerv %s\n", _mesa_lookup_enum_by_nr(pname
));
5209 if (ctx
->Driver
.GetPointerv
5210 && (*ctx
->Driver
.GetPointerv
)(ctx
, pname
, params
))
5214 case GL_VERTEX_ARRAY_POINTER
:
5215 *params
= ctx
->Array
.Vertex
.Ptr
;
5217 case GL_NORMAL_ARRAY_POINTER
:
5218 *params
= ctx
->Array
.Normal
.Ptr
;
5220 case GL_COLOR_ARRAY_POINTER
:
5221 *params
= ctx
->Array
.Color
.Ptr
;
5223 case GL_SECONDARY_COLOR_ARRAY_POINTER_EXT
:
5224 *params
= ctx
->Array
.SecondaryColor
.Ptr
;
5226 case GL_FOG_COORDINATE_ARRAY_POINTER_EXT
:
5227 *params
= ctx
->Array
.FogCoord
.Ptr
;
5229 case GL_INDEX_ARRAY_POINTER
:
5230 *params
= ctx
->Array
.Index
.Ptr
;
5232 case GL_TEXTURE_COORD_ARRAY_POINTER
:
5233 *params
= ctx
->Array
.TexCoord
[texUnit
].Ptr
;
5235 case GL_EDGE_FLAG_ARRAY_POINTER
:
5236 *params
= ctx
->Array
.EdgeFlag
.Ptr
;
5238 case GL_FEEDBACK_BUFFER_POINTER
:
5239 *params
= ctx
->Feedback
.Buffer
;
5241 case GL_SELECTION_BUFFER_POINTER
:
5242 *params
= ctx
->Select
.Buffer
;
5245 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetPointerv" );
5253 _mesa_GetString( GLenum name
)
5255 GET_CURRENT_CONTEXT(ctx
);
5256 static const char *vendor
= "Brian Paul";
5257 static const char *renderer
= "Mesa";
5258 static const char *version
= "1.2 Mesa 3.5 beta";
5259 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
5261 /* this is a required driver function */
5262 assert(ctx
->Driver
.GetString
);
5264 const GLubyte
*str
= (*ctx
->Driver
.GetString
)(ctx
, name
);
5270 return (const GLubyte
*) vendor
;
5272 return (const GLubyte
*) renderer
;
5274 return (const GLubyte
*) version
;
5276 return (const GLubyte
*) _mesa_extensions_get_string(ctx
);
5278 _mesa_error( ctx
, GL_INVALID_ENUM
, "glGetString" );
5279 return (const GLubyte
*) 0;
5286 * Execute a glGetError command
5289 _mesa_GetError( void )
5291 GET_CURRENT_CONTEXT(ctx
);
5292 GLenum e
= ctx
->ErrorValue
;
5293 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
5295 if (MESA_VERBOSE
& VERBOSE_API
)
5296 fprintf(stderr
, "glGetError <-- %s\n", _mesa_lookup_enum_by_nr(e
));
5298 ctx
->ErrorValue
= (GLenum
) GL_NO_ERROR
;