Subversion Repositories shark

Rev

Rev 55 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
55 pj 1
/* $Id: get.c,v 1.1 2003-02-28 11:42:00 pj Exp $ */
2
 
3
/*
4
 * Mesa 3-D graphics library
5
 * Version:  5.0
6
 *
7
 * Copyright (C) 1999-2002  Brian Paul   All Rights Reserved.
8
 *
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:
15
 *
16
 * The above copyright notice and this permission notice shall be included
17
 * in all copies or substantial portions of the Software.
18
 *
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.
25
 */
26
 
27
 
28
#include "glheader.h"
29
#include "colormac.h"
30
#include "context.h"
31
#include "enable.h"
32
#include "enums.h"
33
#include "extensions.h"
34
#include "get.h"
35
#include "macros.h"
36
#include "mmath.h"
37
#include "mtypes.h"
38
#include "texcompress.h"
39
#include "math/m_matrix.h"
40
 
41
 
42
 
43
#define FLOAT_TO_BOOL(X)        ( (X)==0.0F ? GL_FALSE : GL_TRUE )
44
#define INT_TO_BOOL(I)          ( (I)==0 ? GL_FALSE : GL_TRUE )
45
#define ENUM_TO_BOOL(E)         ( (E)==0 ? GL_FALSE : GL_TRUE )
46
 
47
#ifdef SPECIALCAST
48
/* Needed for an Amiga compiler */
49
#define ENUM_TO_FLOAT(X) ((GLfloat)(GLint)(X))
50
#define ENUM_TO_DOUBLE(X) ((GLdouble)(GLint)(X))
51
#else
52
/* all other compilers */
53
#define ENUM_TO_FLOAT(X) ((GLfloat)(X))
54
#define ENUM_TO_DOUBLE(X) ((GLdouble)(X))
55
#endif
56
 
57
 
58
/* Check if named extension is enabled, if not generate error and return */
59
 
60
#define CHECK_EXTENSION_B(EXTNAME, PNAME)                       \
61
   if (!ctx->Extensions.EXTNAME) {                              \
62
      _mesa_error(ctx, GL_INVALID_VALUE,                        \
63
                  "glGetBooleanv(0x%x)", (int) PNAME);          \
64
      return;                                                   \
65
   }    
66
 
67
#define CHECK_EXTENSION_I(EXTNAME, PNAME)                       \
68
   if (!ctx->Extensions.EXTNAME) {                              \
69
      _mesa_error(ctx, GL_INVALID_VALUE,                        \
70
                  "glGetIntegerv(0x%x)", (int) PNAME);          \
71
      return;                                                   \
72
   }    
73
 
74
#define CHECK_EXTENSION_F(EXTNAME, PNAME)                       \
75
   if (!ctx->Extensions.EXTNAME) {                              \
76
      _mesa_error(ctx, GL_INVALID_VALUE,                        \
77
                  "glGetFloatv(0x%x)", (int) PNAME);            \
78
      return;                                                   \
79
   }    
80
 
81
#define CHECK_EXTENSION_D(EXTNAME, PNAME)                       \
82
   if (!ctx->Extensions.EXTNAME) {                              \
83
      _mesa_error(ctx, GL_INVALID_VALUE,                        \
84
                  "glGetDoublev(0x%x)", (int) PNAME);           \
85
      return;                                                   \
86
   }    
87
 
88
 
89
 
90
 
91
static GLenum
92
pixel_texgen_mode(const GLcontext *ctx)
93
{
94
   if (ctx->Pixel.FragmentRgbSource == GL_CURRENT_RASTER_POSITION) {
95
      if (ctx->Pixel.FragmentAlphaSource == GL_CURRENT_RASTER_POSITION) {
96
         return GL_RGBA;
97
      }
98
      else {
99
         return GL_RGB;
100
      }
101
   }
102
   else {
103
      if (ctx->Pixel.FragmentAlphaSource == GL_CURRENT_RASTER_POSITION) {
104
         return GL_ALPHA;
105
      }
106
      else {
107
         return GL_NONE;
108
      }
109
   }
110
}
111
 
112
 
113
void
114
_mesa_GetBooleanv( GLenum pname, GLboolean *params )
115
{
116
   GET_CURRENT_CONTEXT(ctx);
117
   GLuint i;
118
   GLuint texUnit = ctx->Texture.CurrentUnit;
119
   const struct gl_texture_unit *textureUnit = &ctx->Texture.Unit[texUnit];
120
   ASSERT_OUTSIDE_BEGIN_END(ctx);
121
 
122
   if (!params)
123
      return;
124
 
125
   /* We need this in order to get correct results for
126
    * GL_OCCLUSION_TEST_RESULT_HP.  There might be other important cases.
127
    */
128
   FLUSH_VERTICES(ctx, 0);
129
 
130
   if (MESA_VERBOSE & VERBOSE_API)
131
      _mesa_debug(ctx, "glGetBooleanv %s\n", _mesa_lookup_enum_by_nr(pname));
132
 
133
   if (ctx->Driver.GetBooleanv
134
       && (*ctx->Driver.GetBooleanv)(ctx, pname, params))
135
      return;
136
 
137
   switch (pname) {
138
      case GL_ACCUM_RED_BITS:
139
         *params = INT_TO_BOOL(ctx->Visual.accumRedBits);
140
         break;
141
      case GL_ACCUM_GREEN_BITS:
142
         *params = INT_TO_BOOL(ctx->Visual.accumGreenBits);
143
         break;
144
      case GL_ACCUM_BLUE_BITS:
145
         *params = INT_TO_BOOL(ctx->Visual.accumBlueBits);
146
         break;
147
      case GL_ACCUM_ALPHA_BITS:
148
         *params = INT_TO_BOOL(ctx->Visual.accumAlphaBits);
149
         break;
150
      case GL_ACCUM_CLEAR_VALUE:
151
         params[0] = FLOAT_TO_BOOL(ctx->Accum.ClearColor[0]);
152
         params[1] = FLOAT_TO_BOOL(ctx->Accum.ClearColor[1]);
153
         params[2] = FLOAT_TO_BOOL(ctx->Accum.ClearColor[2]);
154
         params[3] = FLOAT_TO_BOOL(ctx->Accum.ClearColor[3]);
155
         break;
156
      case GL_ALPHA_BIAS:
157
         *params = FLOAT_TO_BOOL(ctx->Pixel.AlphaBias);
158
         break;
159
      case GL_ALPHA_BITS:
160
         *params = INT_TO_BOOL(ctx->Visual.alphaBits);
161
         break;
162
      case GL_ALPHA_SCALE:
163
         *params = FLOAT_TO_BOOL(ctx->Pixel.AlphaScale);
164
         break;
165
      case GL_ALPHA_TEST:
166
         *params = ctx->Color.AlphaEnabled;
167
         break;
168
      case GL_ALPHA_TEST_FUNC:
169
         *params = ENUM_TO_BOOL(ctx->Color.AlphaFunc);
170
         break;
171
      case GL_ALPHA_TEST_REF:
172
         *params = ctx->Color.AlphaRef ? GL_TRUE : GL_FALSE;
173
         break;
174
      case GL_ATTRIB_STACK_DEPTH:
175
         *params = INT_TO_BOOL(ctx->AttribStackDepth);
176
         break;
177
      case GL_AUTO_NORMAL:
178
         *params = ctx->Eval.AutoNormal;
179
         break;
180
      case GL_AUX_BUFFERS:
181
         *params = (ctx->Const.NumAuxBuffers) ? GL_TRUE : GL_FALSE;
182
         break;
183
      case GL_BLEND:
184
         *params = ctx->Color.BlendEnabled;
185
         break;
186
      case GL_BLEND_DST:
187
         *params = ENUM_TO_BOOL(ctx->Color.BlendDstRGB);
188
         break;
189
      case GL_BLEND_SRC:
190
         *params = ENUM_TO_BOOL(ctx->Color.BlendSrcRGB);
191
         break;
192
      case GL_BLEND_SRC_RGB_EXT:
193
         *params = ENUM_TO_BOOL(ctx->Color.BlendSrcRGB);
194
         break;
195
      case GL_BLEND_DST_RGB_EXT:
196
         *params = ENUM_TO_BOOL(ctx->Color.BlendDstRGB);
197
         break;
198
      case GL_BLEND_SRC_ALPHA_EXT:
199
         *params = ENUM_TO_BOOL(ctx->Color.BlendSrcA);
200
         break;
201
      case GL_BLEND_DST_ALPHA_EXT:
202
         *params = ENUM_TO_BOOL(ctx->Color.BlendDstA);
203
         break;
204
      case GL_BLEND_EQUATION_EXT:
205
         *params = ENUM_TO_BOOL( ctx->Color.BlendEquation );
206
         break;
207
      case GL_BLEND_COLOR_EXT:
208
         params[0] = FLOAT_TO_BOOL( ctx->Color.BlendColor[0] );
209
         params[1] = FLOAT_TO_BOOL( ctx->Color.BlendColor[1] );
210
         params[2] = FLOAT_TO_BOOL( ctx->Color.BlendColor[2] );
211
         params[3] = FLOAT_TO_BOOL( ctx->Color.BlendColor[3] );
212
         break;
213
      case GL_BLUE_BIAS:
214
         *params = FLOAT_TO_BOOL(ctx->Pixel.BlueBias);
215
         break;
216
      case GL_BLUE_BITS:
217
         *params = INT_TO_BOOL( ctx->Visual.blueBits );
218
         break;
219
      case GL_BLUE_SCALE:
220
         *params = FLOAT_TO_BOOL(ctx->Pixel.BlueScale);
221
         break;
222
      case GL_CLIENT_ATTRIB_STACK_DEPTH:
223
         *params = INT_TO_BOOL(ctx->ClientAttribStackDepth);
224
         break;
225
      case GL_CLIP_PLANE0:
226
      case GL_CLIP_PLANE1:
227
      case GL_CLIP_PLANE2:
228
      case GL_CLIP_PLANE3:
229
      case GL_CLIP_PLANE4:
230
      case GL_CLIP_PLANE5:
231
         if (ctx->Transform.ClipPlanesEnabled & (1 << (pname - GL_CLIP_PLANE0)))
232
            *params = GL_TRUE;
233
         else
234
            *params = GL_FALSE;
235
         break;
236
      case GL_COLOR_CLEAR_VALUE:
237
         params[0] = ctx->Color.ClearColor[0] ? GL_TRUE : GL_FALSE;
238
         params[1] = ctx->Color.ClearColor[1] ? GL_TRUE : GL_FALSE;
239
         params[2] = ctx->Color.ClearColor[2] ? GL_TRUE : GL_FALSE;
240
         params[3] = ctx->Color.ClearColor[3] ? GL_TRUE : GL_FALSE;
241
         break;
242
      case GL_COLOR_MATERIAL:
243
         *params = ctx->Light.ColorMaterialEnabled;
244
         break;
245
      case GL_COLOR_MATERIAL_FACE:
246
         *params = ENUM_TO_BOOL(ctx->Light.ColorMaterialFace);
247
         break;
248
      case GL_COLOR_MATERIAL_PARAMETER:
249
         *params = ENUM_TO_BOOL(ctx->Light.ColorMaterialMode);
250
         break;
251
      case GL_COLOR_WRITEMASK:
252
         params[0] = ctx->Color.ColorMask[RCOMP] ? GL_TRUE : GL_FALSE;
253
         params[1] = ctx->Color.ColorMask[GCOMP] ? GL_TRUE : GL_FALSE;
254
         params[2] = ctx->Color.ColorMask[BCOMP] ? GL_TRUE : GL_FALSE;
255
         params[3] = ctx->Color.ColorMask[ACOMP] ? GL_TRUE : GL_FALSE;
256
         break;
257
      case GL_CULL_FACE:
258
         *params = ctx->Polygon.CullFlag;
259
         break;
260
      case GL_CULL_FACE_MODE:
261
         *params = ENUM_TO_BOOL(ctx->Polygon.CullFaceMode);
262
         break;
263
      case GL_CURRENT_COLOR:
264
         FLUSH_CURRENT(ctx, 0);
265
         params[0] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]);
266
         params[1] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]);
267
         params[2] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]);
268
         params[3] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]);
269
         break;
270
      case GL_CURRENT_INDEX:
271
         FLUSH_CURRENT(ctx, 0);
272
         *params = INT_TO_BOOL(ctx->Current.Index);
273
         break;
274
      case GL_CURRENT_NORMAL:
275
         FLUSH_CURRENT(ctx, 0);
276
         params[0] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0]);
277
         params[1] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1]);
278
         params[2] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2]);
279
         break;
280
      case GL_CURRENT_RASTER_COLOR:
281
         params[0] = FLOAT_TO_BOOL(ctx->Current.RasterColor[0]);
282
         params[1] = FLOAT_TO_BOOL(ctx->Current.RasterColor[1]);
283
         params[2] = FLOAT_TO_BOOL(ctx->Current.RasterColor[2]);
284
         params[3] = FLOAT_TO_BOOL(ctx->Current.RasterColor[3]);
285
         break;
286
      case GL_CURRENT_RASTER_DISTANCE:
287
         *params = FLOAT_TO_BOOL(ctx->Current.RasterDistance);
288
         break;
289
      case GL_CURRENT_RASTER_INDEX:
290
         *params = FLOAT_TO_BOOL(ctx->Current.RasterIndex);
291
         break;
292
      case GL_CURRENT_RASTER_POSITION:
293
         params[0] = FLOAT_TO_BOOL(ctx->Current.RasterPos[0]);
294
         params[1] = FLOAT_TO_BOOL(ctx->Current.RasterPos[1]);
295
         params[2] = FLOAT_TO_BOOL(ctx->Current.RasterPos[2]);
296
         params[3] = FLOAT_TO_BOOL(ctx->Current.RasterPos[3]);
297
         break;
298
      case GL_CURRENT_RASTER_TEXTURE_COORDS:
299
         params[0] = FLOAT_TO_BOOL(ctx->Current.RasterTexCoords[texUnit][0]);
300
         params[1] = FLOAT_TO_BOOL(ctx->Current.RasterTexCoords[texUnit][1]);
301
         params[2] = FLOAT_TO_BOOL(ctx->Current.RasterTexCoords[texUnit][2]);
302
         params[3] = FLOAT_TO_BOOL(ctx->Current.RasterTexCoords[texUnit][3]);
303
         break;
304
      case GL_CURRENT_RASTER_POSITION_VALID:
305
         *params = ctx->Current.RasterPosValid;
306
         break;
307
      case GL_CURRENT_TEXTURE_COORDS:
308
         FLUSH_CURRENT(ctx, 0);
309
         params[0] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][0]);
310
         params[1] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][1]);
311
         params[2] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][2]);
312
         params[3] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3]);
313
         break;
314
      case GL_DEPTH_BIAS:
315
         *params = FLOAT_TO_BOOL(ctx->Pixel.DepthBias);
316
         break;
317
      case GL_DEPTH_BITS:
318
         *params = INT_TO_BOOL(ctx->Visual.depthBits);
319
         break;
320
      case GL_DEPTH_CLEAR_VALUE:
321
         *params = FLOAT_TO_BOOL(ctx->Depth.Clear);
322
         break;
323
      case GL_DEPTH_FUNC:
324
         *params = ENUM_TO_BOOL(ctx->Depth.Func);
325
         break;
326
      case GL_DEPTH_RANGE:
327
         params[0] = FLOAT_TO_BOOL(ctx->Viewport.Near);
328
         params[1] = FLOAT_TO_BOOL(ctx->Viewport.Far);
329
         break;
330
      case GL_DEPTH_SCALE:
331
         *params = FLOAT_TO_BOOL(ctx->Pixel.DepthScale);
332
         break;
333
      case GL_DEPTH_TEST:
334
         *params = ctx->Depth.Test;
335
         break;
336
      case GL_DEPTH_WRITEMASK:
337
         *params = ctx->Depth.Mask;
338
         break;
339
      case GL_DITHER:
340
         *params = ctx->Color.DitherFlag;
341
         break;
342
      case GL_DOUBLEBUFFER:
343
         *params = ctx->Visual.doubleBufferMode;
344
         break;
345
      case GL_DRAW_BUFFER:
346
         *params = ENUM_TO_BOOL(ctx->Color.DrawBuffer);
347
         break;
348
      case GL_EDGE_FLAG:
349
         FLUSH_CURRENT(ctx, 0);
350
         *params = ctx->Current.EdgeFlag;
351
         break;
352
      case GL_FEEDBACK_BUFFER_SIZE:
353
         *params = INT_TO_BOOL(ctx->Feedback.BufferSize);
354
         break;
355
      case GL_FEEDBACK_BUFFER_TYPE:
356
         *params = INT_TO_BOOL(ctx->Feedback.Type);
357
         break;
358
      case GL_FOG:
359
         *params = ctx->Fog.Enabled;
360
         break;
361
      case GL_FOG_COLOR:
362
         params[0] = FLOAT_TO_BOOL(ctx->Fog.Color[0]);
363
         params[1] = FLOAT_TO_BOOL(ctx->Fog.Color[1]);
364
         params[2] = FLOAT_TO_BOOL(ctx->Fog.Color[2]);
365
         params[3] = FLOAT_TO_BOOL(ctx->Fog.Color[3]);
366
         break;
367
      case GL_FOG_DENSITY:
368
         *params = FLOAT_TO_BOOL(ctx->Fog.Density);
369
         break;
370
      case GL_FOG_END:
371
         *params = FLOAT_TO_BOOL(ctx->Fog.End);
372
         break;
373
      case GL_FOG_HINT:
374
         *params = ENUM_TO_BOOL(ctx->Hint.Fog);
375
         break;
376
      case GL_FOG_INDEX:
377
         *params = FLOAT_TO_BOOL(ctx->Fog.Index);
378
         break;
379
      case GL_FOG_MODE:
380
         *params = ENUM_TO_BOOL(ctx->Fog.Mode);
381
         break;
382
      case GL_FOG_START:
383
         *params = FLOAT_TO_BOOL(ctx->Fog.End);
384
         break;
385
      case GL_FRONT_FACE:
386
         *params = ENUM_TO_BOOL(ctx->Polygon.FrontFace);
387
         break;
388
      case GL_GREEN_BIAS:
389
         *params = FLOAT_TO_BOOL(ctx->Pixel.GreenBias);
390
         break;
391
      case GL_GREEN_BITS:
392
         *params = INT_TO_BOOL( ctx->Visual.greenBits );
393
         break;
394
      case GL_GREEN_SCALE:
395
         *params = FLOAT_TO_BOOL(ctx->Pixel.GreenScale);
396
         break;
397
      case GL_INDEX_BITS:
398
         *params = INT_TO_BOOL( ctx->Visual.indexBits );
399
         break;
400
      case GL_INDEX_CLEAR_VALUE:
401
         *params = INT_TO_BOOL(ctx->Color.ClearIndex);
402
         break;
403
      case GL_INDEX_MODE:
404
         *params = ctx->Visual.rgbMode ? GL_FALSE : GL_TRUE;
405
         break;
406
      case GL_INDEX_OFFSET:
407
         *params = INT_TO_BOOL(ctx->Pixel.IndexOffset);
408
         break;
409
      case GL_INDEX_SHIFT:
410
         *params = INT_TO_BOOL(ctx->Pixel.IndexShift);
411
         break;
412
      case GL_INDEX_WRITEMASK:
413
         *params = INT_TO_BOOL(ctx->Color.IndexMask);
414
         break;
415
      case GL_LIGHT0:
416
      case GL_LIGHT1:
417
      case GL_LIGHT2:
418
      case GL_LIGHT3:
419
      case GL_LIGHT4:
420
      case GL_LIGHT5:
421
      case GL_LIGHT6:
422
      case GL_LIGHT7:
423
         *params = ctx->Light.Light[pname-GL_LIGHT0].Enabled;
424
         break;
425
      case GL_LIGHTING:
426
         *params = ctx->Light.Enabled;
427
         break;
428
      case GL_LIGHT_MODEL_AMBIENT:
429
         params[0] = FLOAT_TO_BOOL(ctx->Light.Model.Ambient[0]);
430
         params[1] = FLOAT_TO_BOOL(ctx->Light.Model.Ambient[1]);
431
         params[2] = FLOAT_TO_BOOL(ctx->Light.Model.Ambient[2]);
432
         params[3] = FLOAT_TO_BOOL(ctx->Light.Model.Ambient[3]);
433
         break;
434
      case GL_LIGHT_MODEL_COLOR_CONTROL:
435
         params[0] = ENUM_TO_BOOL(ctx->Light.Model.ColorControl);
436
         break;
437
      case GL_LIGHT_MODEL_LOCAL_VIEWER:
438
         *params = ctx->Light.Model.LocalViewer;
439
         break;
440
      case GL_LIGHT_MODEL_TWO_SIDE:
441
         *params = ctx->Light.Model.TwoSide;
442
         break;
443
      case GL_LINE_SMOOTH:
444
         *params = ctx->Line.SmoothFlag;
445
         break;
446
      case GL_LINE_SMOOTH_HINT:
447
         *params = ENUM_TO_BOOL(ctx->Hint.LineSmooth);
448
         break;
449
      case GL_LINE_STIPPLE:
450
         *params = ctx->Line.StippleFlag;
451
         break;
452
      case GL_LINE_STIPPLE_PATTERN:
453
         *params = INT_TO_BOOL(ctx->Line.StipplePattern);
454
         break;
455
      case GL_LINE_STIPPLE_REPEAT:
456
         *params = INT_TO_BOOL(ctx->Line.StippleFactor);
457
         break;
458
      case GL_LINE_WIDTH:
459
         *params = FLOAT_TO_BOOL(ctx->Line.Width);
460
         break;
461
      case GL_LINE_WIDTH_GRANULARITY:
462
         *params = FLOAT_TO_BOOL(ctx->Const.LineWidthGranularity);
463
         break;
464
      case GL_LINE_WIDTH_RANGE:
465
         params[0] = FLOAT_TO_BOOL(ctx->Const.MinLineWidthAA);
466
         params[1] = FLOAT_TO_BOOL(ctx->Const.MaxLineWidthAA);
467
         break;
468
      case GL_ALIASED_LINE_WIDTH_RANGE:
469
         params[0] = FLOAT_TO_BOOL(ctx->Const.MinLineWidth);
470
         params[1] = FLOAT_TO_BOOL(ctx->Const.MaxLineWidth);
471
         break;
472
      case GL_LIST_BASE:
473
         *params = INT_TO_BOOL(ctx->List.ListBase);
474
         break;
475
      case GL_LIST_INDEX:
476
         *params = INT_TO_BOOL( ctx->CurrentListNum );
477
         break;
478
      case GL_LIST_MODE:
479
         *params = ENUM_TO_BOOL( ctx->ExecuteFlag
480
                                  ? GL_COMPILE_AND_EXECUTE : GL_COMPILE );
481
         break;
482
      case GL_INDEX_LOGIC_OP:
483
         *params = ctx->Color.IndexLogicOpEnabled;
484
         break;
485
      case GL_COLOR_LOGIC_OP:
486
         *params = ctx->Color.ColorLogicOpEnabled;
487
         break;
488
      case GL_LOGIC_OP_MODE:
489
         *params = ENUM_TO_BOOL(ctx->Color.LogicOp);
490
         break;
491
      case GL_MAP1_COLOR_4:
492
         *params = ctx->Eval.Map1Color4;
493
         break;
494
      case GL_MAP1_GRID_DOMAIN:
495
         params[0] = FLOAT_TO_BOOL(ctx->Eval.MapGrid1u1);
496
         params[1] = FLOAT_TO_BOOL(ctx->Eval.MapGrid1u2);
497
         break;
498
      case GL_MAP1_GRID_SEGMENTS:
499
         *params = INT_TO_BOOL(ctx->Eval.MapGrid1un);
500
         break;
501
      case GL_MAP1_INDEX:
502
         *params = ctx->Eval.Map1Index;
503
         break;
504
      case GL_MAP1_NORMAL:
505
         *params = ctx->Eval.Map1Normal;
506
         break;
507
      case GL_MAP1_TEXTURE_COORD_1:
508
         *params = ctx->Eval.Map1TextureCoord1;
509
         break;
510
      case GL_MAP1_TEXTURE_COORD_2:
511
         *params = ctx->Eval.Map1TextureCoord2;
512
         break;
513
      case GL_MAP1_TEXTURE_COORD_3:
514
         *params = ctx->Eval.Map1TextureCoord3;
515
         break;
516
      case GL_MAP1_TEXTURE_COORD_4:
517
         *params = ctx->Eval.Map1TextureCoord4;
518
         break;
519
      case GL_MAP1_VERTEX_3:
520
         *params = ctx->Eval.Map1Vertex3;
521
         break;
522
      case GL_MAP1_VERTEX_4:
523
         *params = ctx->Eval.Map1Vertex4;
524
         break;
525
      case GL_MAP2_COLOR_4:
526
         *params = ctx->Eval.Map2Color4;
527
         break;
528
      case GL_MAP2_GRID_DOMAIN:
529
         params[0] = FLOAT_TO_BOOL(ctx->Eval.MapGrid2u1);
530
         params[1] = FLOAT_TO_BOOL(ctx->Eval.MapGrid2u2);
531
         params[2] = FLOAT_TO_BOOL(ctx->Eval.MapGrid2v1);
532
         params[3] = FLOAT_TO_BOOL(ctx->Eval.MapGrid2v2);
533
         break;
534
      case GL_MAP2_GRID_SEGMENTS:
535
         params[0] = INT_TO_BOOL(ctx->Eval.MapGrid2un);
536
         params[1] = INT_TO_BOOL(ctx->Eval.MapGrid2vn);
537
         break;
538
      case GL_MAP2_INDEX:
539
         *params = ctx->Eval.Map2Index;
540
         break;
541
      case GL_MAP2_NORMAL:
542
         *params = ctx->Eval.Map2Normal;
543
         break;
544
      case GL_MAP2_TEXTURE_COORD_1:
545
         *params = ctx->Eval.Map2TextureCoord1;
546
         break;
547
      case GL_MAP2_TEXTURE_COORD_2:
548
         *params = ctx->Eval.Map2TextureCoord2;
549
         break;
550
      case GL_MAP2_TEXTURE_COORD_3:
551
         *params = ctx->Eval.Map2TextureCoord3;
552
         break;
553
      case GL_MAP2_TEXTURE_COORD_4:
554
         *params = ctx->Eval.Map2TextureCoord4;
555
         break;
556
      case GL_MAP2_VERTEX_3:
557
         *params = ctx->Eval.Map2Vertex3;
558
         break;
559
      case GL_MAP2_VERTEX_4:
560
         *params = ctx->Eval.Map2Vertex4;
561
         break;
562
      case GL_MAP_COLOR:
563
         *params = ctx->Pixel.MapColorFlag;
564
         break;
565
      case GL_MAP_STENCIL:
566
         *params = ctx->Pixel.MapStencilFlag;
567
         break;
568
      case GL_MATRIX_MODE:
569
         *params = ENUM_TO_BOOL( ctx->Transform.MatrixMode );
570
         break;
571
      case GL_MAX_ATTRIB_STACK_DEPTH:
572
         *params = INT_TO_BOOL(MAX_ATTRIB_STACK_DEPTH);
573
         break;
574
      case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH:
575
         *params = INT_TO_BOOL( MAX_CLIENT_ATTRIB_STACK_DEPTH);
576
         break;
577
      case GL_MAX_CLIP_PLANES:
578
         *params = INT_TO_BOOL(ctx->Const.MaxClipPlanes);
579
         break;
580
      case GL_MAX_ELEMENTS_VERTICES:  /* GL_VERSION_1_2 */
581
         *params = INT_TO_BOOL(ctx->Const.MaxArrayLockSize);
582
         break;
583
      case GL_MAX_ELEMENTS_INDICES:   /* GL_VERSION_1_2 */
584
         *params = INT_TO_BOOL(ctx->Const.MaxArrayLockSize);
585
         break;
586
      case GL_MAX_EVAL_ORDER:
587
         *params = INT_TO_BOOL(MAX_EVAL_ORDER);
588
         break;
589
      case GL_MAX_LIGHTS:
590
         *params = INT_TO_BOOL(ctx->Const.MaxLights);
591
         break;
592
      case GL_MAX_LIST_NESTING:
593
         *params = INT_TO_BOOL(MAX_LIST_NESTING);
594
         break;
595
      case GL_MAX_MODELVIEW_STACK_DEPTH:
596
         *params = INT_TO_BOOL(MAX_MODELVIEW_STACK_DEPTH);
597
         break;
598
      case GL_MAX_NAME_STACK_DEPTH:
599
         *params = INT_TO_BOOL(MAX_NAME_STACK_DEPTH);
600
         break;
601
      case GL_MAX_PIXEL_MAP_TABLE:
602
         *params = INT_TO_BOOL(MAX_PIXEL_MAP_TABLE);
603
         break;
604
      case GL_MAX_PROJECTION_STACK_DEPTH:
605
         *params = INT_TO_BOOL(MAX_PROJECTION_STACK_DEPTH);
606
         break;
607
      case GL_MAX_TEXTURE_SIZE:
608
         *params = INT_TO_BOOL(1 << (ctx->Const.MaxTextureLevels - 1));
609
         break;
610
      case GL_MAX_3D_TEXTURE_SIZE:
611
         *params = INT_TO_BOOL(1 << (ctx->Const.Max3DTextureLevels - 1));
612
         break;
613
      case GL_MAX_TEXTURE_STACK_DEPTH:
614
         *params = INT_TO_BOOL(MAX_TEXTURE_STACK_DEPTH);
615
         break;
616
      case GL_MAX_VIEWPORT_DIMS:
617
         params[0] = INT_TO_BOOL(MAX_WIDTH);
618
         params[1] = INT_TO_BOOL(MAX_HEIGHT);
619
         break;
620
      case GL_MODELVIEW_MATRIX:
621
         for (i=0;i<16;i++) {
622
            params[i] = FLOAT_TO_BOOL(ctx->ModelviewMatrixStack.Top->m[i]);
623
         }
624
         break;
625
      case GL_MODELVIEW_STACK_DEPTH:
626
         *params = INT_TO_BOOL(ctx->ModelviewMatrixStack.Depth + 1);
627
         break;
628
      case GL_NAME_STACK_DEPTH:
629
         *params = INT_TO_BOOL(ctx->Select.NameStackDepth);
630
         break;
631
      case GL_NORMALIZE:
632
         *params = ctx->Transform.Normalize;
633
         break;
634
      case GL_PACK_ALIGNMENT:
635
         *params = INT_TO_BOOL(ctx->Pack.Alignment);
636
         break;
637
      case GL_PACK_LSB_FIRST:
638
         *params = ctx->Pack.LsbFirst;
639
         break;
640
      case GL_PACK_ROW_LENGTH:
641
         *params = INT_TO_BOOL(ctx->Pack.RowLength);
642
         break;
643
      case GL_PACK_SKIP_PIXELS:
644
         *params = INT_TO_BOOL(ctx->Pack.SkipPixels);
645
         break;
646
      case GL_PACK_SKIP_ROWS:
647
         *params = INT_TO_BOOL(ctx->Pack.SkipRows);
648
         break;
649
      case GL_PACK_SWAP_BYTES:
650
         *params = ctx->Pack.SwapBytes;
651
         break;
652
      case GL_PACK_SKIP_IMAGES_EXT:
653
         *params = ctx->Pack.SkipImages;
654
         break;
655
      case GL_PACK_IMAGE_HEIGHT_EXT:
656
         *params = ctx->Pack.ImageHeight;
657
         break;
658
      case GL_PACK_INVERT_MESA:
659
         *params = ctx->Pack.Invert;
660
         break;
661
      case GL_PERSPECTIVE_CORRECTION_HINT:
662
         *params = ENUM_TO_BOOL(ctx->Hint.PerspectiveCorrection);
663
         break;
664
      case GL_PIXEL_MAP_A_TO_A_SIZE:
665
         *params = INT_TO_BOOL(ctx->Pixel.MapAtoAsize);
666
         break;
667
      case GL_PIXEL_MAP_B_TO_B_SIZE:
668
         *params = INT_TO_BOOL(ctx->Pixel.MapBtoBsize);
669
         break;
670
      case GL_PIXEL_MAP_G_TO_G_SIZE:
671
         *params = INT_TO_BOOL(ctx->Pixel.MapGtoGsize);
672
         break;
673
      case GL_PIXEL_MAP_I_TO_A_SIZE:
674
         *params = INT_TO_BOOL(ctx->Pixel.MapItoAsize);
675
         break;
676
      case GL_PIXEL_MAP_I_TO_B_SIZE:
677
         *params = INT_TO_BOOL(ctx->Pixel.MapItoBsize);
678
         break;
679
      case GL_PIXEL_MAP_I_TO_G_SIZE:
680
         *params = INT_TO_BOOL(ctx->Pixel.MapItoGsize);
681
         break;
682
      case GL_PIXEL_MAP_I_TO_I_SIZE:
683
         *params = INT_TO_BOOL(ctx->Pixel.MapItoIsize);
684
         break;
685
      case GL_PIXEL_MAP_I_TO_R_SIZE:
686
         *params = INT_TO_BOOL(ctx->Pixel.MapItoRsize);
687
         break;
688
      case GL_PIXEL_MAP_R_TO_R_SIZE:
689
         *params = INT_TO_BOOL(ctx->Pixel.MapRtoRsize);
690
         break;
691
      case GL_PIXEL_MAP_S_TO_S_SIZE:
692
         *params = INT_TO_BOOL(ctx->Pixel.MapStoSsize);
693
         break;
694
      case GL_POINT_SIZE:
695
         *params = FLOAT_TO_BOOL(ctx->Point.Size);
696
         break;
697
      case GL_POINT_SIZE_GRANULARITY:
698
         *params = FLOAT_TO_BOOL(ctx->Const.PointSizeGranularity );
699
         break;
700
      case GL_POINT_SIZE_RANGE:
701
         params[0] = FLOAT_TO_BOOL(ctx->Const.MinPointSizeAA);
702
         params[1] = FLOAT_TO_BOOL(ctx->Const.MaxPointSizeAA);
703
         break;
704
      case GL_ALIASED_POINT_SIZE_RANGE:
705
         params[0] = FLOAT_TO_BOOL(ctx->Const.MinPointSize);
706
         params[1] = FLOAT_TO_BOOL(ctx->Const.MaxPointSize);
707
         break;
708
      case GL_POINT_SMOOTH:
709
         *params = ctx->Point.SmoothFlag;
710
         break;
711
      case GL_POINT_SMOOTH_HINT:
712
         *params = ENUM_TO_BOOL(ctx->Hint.PointSmooth);
713
         break;
714
      case GL_POINT_SIZE_MIN_EXT:
715
         *params = FLOAT_TO_BOOL(ctx->Point.MinSize);
716
         break;
717
      case GL_POINT_SIZE_MAX_EXT:
718
         *params = FLOAT_TO_BOOL(ctx->Point.MaxSize);
719
         break;
720
      case GL_POINT_FADE_THRESHOLD_SIZE_EXT:
721
         *params = FLOAT_TO_BOOL(ctx->Point.Threshold);
722
         break;
723
      case GL_DISTANCE_ATTENUATION_EXT:
724
         params[0] = FLOAT_TO_BOOL(ctx->Point.Params[0]);
725
         params[1] = FLOAT_TO_BOOL(ctx->Point.Params[1]);
726
         params[2] = FLOAT_TO_BOOL(ctx->Point.Params[2]);
727
         break;
728
      case GL_POLYGON_MODE:
729
         params[0] = ENUM_TO_BOOL(ctx->Polygon.FrontMode);
730
         params[1] = ENUM_TO_BOOL(ctx->Polygon.BackMode);
731
         break;
732
      case GL_POLYGON_OFFSET_BIAS_EXT:  /* GL_EXT_polygon_offset */
733
         *params = FLOAT_TO_BOOL( ctx->Polygon.OffsetUnits );
734
         break;
735
      case GL_POLYGON_OFFSET_FACTOR:
736
         *params = FLOAT_TO_BOOL( ctx->Polygon.OffsetFactor );
737
         break;
738
      case GL_POLYGON_OFFSET_UNITS:
739
         *params = FLOAT_TO_BOOL( ctx->Polygon.OffsetUnits );
740
         break;
741
      case GL_POLYGON_SMOOTH:
742
         *params = ctx->Polygon.SmoothFlag;
743
         break;
744
      case GL_POLYGON_SMOOTH_HINT:
745
         *params = ENUM_TO_BOOL(ctx->Hint.PolygonSmooth);
746
         break;
747
      case GL_POLYGON_STIPPLE:
748
         *params = ctx->Polygon.StippleFlag;
749
         break;
750
      case GL_PROJECTION_MATRIX:
751
         for (i=0;i<16;i++) {
752
            params[i] = FLOAT_TO_BOOL(ctx->ProjectionMatrixStack.Top->m[i]);
753
         }
754
         break;
755
      case GL_PROJECTION_STACK_DEPTH:
756
         *params = INT_TO_BOOL(ctx->ProjectionMatrixStack.Depth + 1);
757
         break;
758
      case GL_READ_BUFFER:
759
         *params = ENUM_TO_BOOL(ctx->Pixel.ReadBuffer);
760
         break;
761
      case GL_RED_BIAS:
762
         *params = FLOAT_TO_BOOL(ctx->Pixel.RedBias);
763
         break;
764
      case GL_RED_BITS:
765
         *params = INT_TO_BOOL( ctx->Visual.redBits );
766
         break;
767
      case GL_RED_SCALE:
768
         *params = FLOAT_TO_BOOL(ctx->Pixel.RedScale);
769
         break;
770
      case GL_RENDER_MODE:
771
         *params = ENUM_TO_BOOL(ctx->RenderMode);
772
         break;
773
      case GL_RESCALE_NORMAL:
774
         *params = ctx->Transform.RescaleNormals;
775
         break;
776
      case GL_RGBA_MODE:
777
         *params = ctx->Visual.rgbMode;
778
         break;
779
      case GL_SCISSOR_BOX:
780
         params[0] = INT_TO_BOOL(ctx->Scissor.X);
781
         params[1] = INT_TO_BOOL(ctx->Scissor.Y);
782
         params[2] = INT_TO_BOOL(ctx->Scissor.Width);
783
         params[3] = INT_TO_BOOL(ctx->Scissor.Height);
784
         break;
785
      case GL_SCISSOR_TEST:
786
         *params = ctx->Scissor.Enabled;
787
         break;
788
      case GL_SELECTION_BUFFER_SIZE:
789
         *params = INT_TO_BOOL(ctx->Select.BufferSize);
790
         break;
791
      case GL_SHADE_MODEL:
792
         *params = ENUM_TO_BOOL(ctx->Light.ShadeModel);
793
         break;
794
      case GL_SHARED_TEXTURE_PALETTE_EXT:
795
         *params = ctx->Texture.SharedPalette;
796
         break;
797
      case GL_STENCIL_BITS:
798
         *params = INT_TO_BOOL(ctx->Visual.stencilBits);
799
         break;
800
      case GL_STENCIL_CLEAR_VALUE:
801
         *params = INT_TO_BOOL(ctx->Stencil.Clear);
802
         break;
803
      case GL_STENCIL_FAIL:
804
         *params = ENUM_TO_BOOL(ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]);
805
         break;
806
      case GL_STENCIL_FUNC:
807
         *params = ENUM_TO_BOOL(ctx->Stencil.Function[ctx->Stencil.ActiveFace]);
808
         break;
809
      case GL_STENCIL_PASS_DEPTH_FAIL:
810
         *params = ENUM_TO_BOOL(ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]);
811
         break;
812
      case GL_STENCIL_PASS_DEPTH_PASS:
813
         *params = ENUM_TO_BOOL(ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]);
814
         break;
815
      case GL_STENCIL_REF:
816
         *params = INT_TO_BOOL(ctx->Stencil.Ref[ctx->Stencil.ActiveFace]);
817
         break;
818
      case GL_STENCIL_TEST:
819
         *params = ctx->Stencil.Enabled;
820
         break;
821
      case GL_STENCIL_VALUE_MASK:
822
         *params = INT_TO_BOOL(ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace]);
823
         break;
824
      case GL_STENCIL_WRITEMASK:
825
         *params = INT_TO_BOOL(ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]);
826
         break;
827
      case GL_STEREO:
828
         *params = ctx->Visual.stereoMode;
829
         break;
830
      case GL_SUBPIXEL_BITS:
831
         *params = INT_TO_BOOL(ctx->Const.SubPixelBits);
832
         break;
833
      case GL_TEXTURE_1D:
834
         *params = _mesa_IsEnabled(GL_TEXTURE_1D);
835
         break;
836
      case GL_TEXTURE_2D:
837
         *params = _mesa_IsEnabled(GL_TEXTURE_2D);
838
         break;
839
      case GL_TEXTURE_3D:
840
         *params = _mesa_IsEnabled(GL_TEXTURE_3D);
841
         break;
842
      case GL_TEXTURE_BINDING_1D:
843
         *params = INT_TO_BOOL(textureUnit->Current1D->Name);
844
          break;
845
      case GL_TEXTURE_BINDING_2D:
846
         *params = INT_TO_BOOL(textureUnit->Current2D->Name);
847
          break;
848
      case GL_TEXTURE_BINDING_3D:
849
         *params = INT_TO_BOOL(textureUnit->Current3D->Name);
850
         break;
851
      case GL_TEXTURE_ENV_COLOR:
852
         {
853
            params[0] = FLOAT_TO_BOOL(textureUnit->EnvColor[0]);
854
            params[1] = FLOAT_TO_BOOL(textureUnit->EnvColor[1]);
855
            params[2] = FLOAT_TO_BOOL(textureUnit->EnvColor[2]);
856
            params[3] = FLOAT_TO_BOOL(textureUnit->EnvColor[3]);
857
         }
858
         break;
859
      case GL_TEXTURE_ENV_MODE:
860
         *params = ENUM_TO_BOOL(textureUnit->EnvMode);
861
         break;
862
      case GL_TEXTURE_GEN_S:
863
         *params = (textureUnit->TexGenEnabled & S_BIT) ? GL_TRUE : GL_FALSE;
864
         break;
865
      case GL_TEXTURE_GEN_T:
866
         *params = (textureUnit->TexGenEnabled & T_BIT) ? GL_TRUE : GL_FALSE;
867
         break;
868
      case GL_TEXTURE_GEN_R:
869
         *params = (textureUnit->TexGenEnabled & R_BIT) ? GL_TRUE : GL_FALSE;
870
         break;
871
      case GL_TEXTURE_GEN_Q:
872
         *params = (textureUnit->TexGenEnabled & Q_BIT) ? GL_TRUE : GL_FALSE;
873
         break;
874
      case GL_TEXTURE_MATRIX:
875
         for (i=0;i<16;i++) {
876
            params[i] =
877
               FLOAT_TO_BOOL(ctx->TextureMatrixStack[texUnit].Top->m[i]);
878
         }
879
         break;
880
      case GL_TEXTURE_STACK_DEPTH:
881
         *params = INT_TO_BOOL(ctx->TextureMatrixStack[texUnit].Depth + 1);
882
         break;
883
      case GL_UNPACK_ALIGNMENT:
884
         *params = INT_TO_BOOL(ctx->Unpack.Alignment);
885
         break;
886
      case GL_UNPACK_LSB_FIRST:
887
         *params = ctx->Unpack.LsbFirst;
888
         break;
889
      case GL_UNPACK_ROW_LENGTH:
890
         *params = INT_TO_BOOL(ctx->Unpack.RowLength);
891
         break;
892
      case GL_UNPACK_SKIP_PIXELS:
893
         *params = INT_TO_BOOL(ctx->Unpack.SkipPixels);
894
         break;
895
      case GL_UNPACK_SKIP_ROWS:
896
         *params = INT_TO_BOOL(ctx->Unpack.SkipRows);
897
         break;
898
      case GL_UNPACK_SWAP_BYTES:
899
         *params = ctx->Unpack.SwapBytes;
900
         break;
901
      case GL_UNPACK_SKIP_IMAGES_EXT:
902
         *params = ctx->Unpack.SkipImages;
903
         break;
904
      case GL_UNPACK_IMAGE_HEIGHT_EXT:
905
         *params = ctx->Unpack.ImageHeight;
906
         break;
907
      case GL_UNPACK_CLIENT_STORAGE_APPLE:
908
         *params = ctx->Unpack.ClientStorage;
909
         break;
910
      case GL_VIEWPORT:
911
         params[0] = INT_TO_BOOL(ctx->Viewport.X);
912
         params[1] = INT_TO_BOOL(ctx->Viewport.Y);
913
         params[2] = INT_TO_BOOL(ctx->Viewport.Width);
914
         params[3] = INT_TO_BOOL(ctx->Viewport.Height);
915
         break;
916
      case GL_ZOOM_X:
917
         *params = FLOAT_TO_BOOL(ctx->Pixel.ZoomX);
918
         break;
919
      case GL_ZOOM_Y:
920
         *params = FLOAT_TO_BOOL(ctx->Pixel.ZoomY);
921
         break;
922
      case GL_VERTEX_ARRAY:
923
         *params = ctx->Array.Vertex.Enabled;
924
         break;
925
      case GL_VERTEX_ARRAY_SIZE:
926
         *params = INT_TO_BOOL(ctx->Array.Vertex.Size);
927
         break;
928
      case GL_VERTEX_ARRAY_TYPE:
929
         *params = ENUM_TO_BOOL(ctx->Array.Vertex.Type);
930
         break;
931
      case GL_VERTEX_ARRAY_STRIDE:
932
         *params = INT_TO_BOOL(ctx->Array.Vertex.Stride);
933
         break;
934
      case GL_VERTEX_ARRAY_COUNT_EXT:
935
         *params = INT_TO_BOOL(0);
936
         break;
937
      case GL_NORMAL_ARRAY:
938
         *params = ctx->Array.Normal.Enabled;
939
         break;
940
      case GL_NORMAL_ARRAY_TYPE:
941
         *params = ENUM_TO_BOOL(ctx->Array.Normal.Type);
942
         break;
943
      case GL_NORMAL_ARRAY_STRIDE:
944
         *params = INT_TO_BOOL(ctx->Array.Normal.Stride);
945
         break;
946
      case GL_NORMAL_ARRAY_COUNT_EXT:
947
         *params = INT_TO_BOOL(0);
948
         break;
949
      case GL_COLOR_ARRAY:
950
         *params = ctx->Array.Color.Enabled;
951
         break;
952
      case GL_COLOR_ARRAY_SIZE:
953
         *params = INT_TO_BOOL(ctx->Array.Color.Size);
954
         break;
955
      case GL_COLOR_ARRAY_TYPE:
956
         *params = ENUM_TO_BOOL(ctx->Array.Color.Type);
957
         break;
958
      case GL_COLOR_ARRAY_STRIDE:
959
         *params = INT_TO_BOOL(ctx->Array.Color.Stride);
960
         break;
961
      case GL_COLOR_ARRAY_COUNT_EXT:
962
         *params = INT_TO_BOOL(0);
963
         break;
964
      case GL_INDEX_ARRAY:
965
         *params = ctx->Array.Index.Enabled;
966
         break;
967
      case GL_INDEX_ARRAY_TYPE:
968
         *params = ENUM_TO_BOOL(ctx->Array.Index.Type);
969
         break;
970
      case GL_INDEX_ARRAY_STRIDE:
971
         *params = INT_TO_BOOL(ctx->Array.Index.Stride);
972
         break;
973
      case GL_INDEX_ARRAY_COUNT_EXT:
974
         *params = INT_TO_BOOL(0);
975
         break;
976
      case GL_TEXTURE_COORD_ARRAY:
977
         *params = ctx->Array.TexCoord[texUnit].Enabled;
978
         break;
979
      case GL_TEXTURE_COORD_ARRAY_SIZE:
980
         *params = INT_TO_BOOL(ctx->Array.TexCoord[texUnit].Size);
981
         break;
982
      case GL_TEXTURE_COORD_ARRAY_TYPE:
983
         *params = ENUM_TO_BOOL(ctx->Array.TexCoord[texUnit].Type);
984
         break;
985
      case GL_TEXTURE_COORD_ARRAY_STRIDE:
986
         *params = INT_TO_BOOL(ctx->Array.TexCoord[texUnit].Stride);
987
         break;
988
      case GL_TEXTURE_COORD_ARRAY_COUNT_EXT:
989
         *params = INT_TO_BOOL(0);
990
         break;
991
      case GL_EDGE_FLAG_ARRAY:
992
         *params = ctx->Array.EdgeFlag.Enabled;
993
         break;
994
      case GL_EDGE_FLAG_ARRAY_STRIDE:
995
         *params = INT_TO_BOOL(ctx->Array.EdgeFlag.Stride);
996
         break;
997
      case GL_EDGE_FLAG_ARRAY_COUNT_EXT:
998
         *params = INT_TO_BOOL(0);
999
         break;
1000
 
1001
      /* GL_ARB_multitexture */
1002
      case GL_MAX_TEXTURE_UNITS_ARB:
1003
         CHECK_EXTENSION_B(ARB_multitexture, pname);
1004
         *params = INT_TO_BOOL(ctx->Const.MaxTextureUnits);
1005
         break;
1006
      case GL_ACTIVE_TEXTURE_ARB:
1007
         CHECK_EXTENSION_B(ARB_multitexture, pname);
1008
         *params = INT_TO_BOOL(GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit);
1009
         break;
1010
      case GL_CLIENT_ACTIVE_TEXTURE_ARB:
1011
         CHECK_EXTENSION_B(ARB_multitexture, pname);
1012
         *params = INT_TO_BOOL(GL_TEXTURE0_ARB + ctx->Array.ActiveTexture);
1013
         break;
1014
 
1015
      /* GL_ARB_texture_cube_map */
1016
      case GL_TEXTURE_CUBE_MAP_ARB:
1017
         CHECK_EXTENSION_B(ARB_texture_cube_map, pname);
1018
         *params = _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
1019
         break;
1020
      case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
1021
         CHECK_EXTENSION_B(ARB_texture_cube_map, pname);
1022
         *params = INT_TO_BOOL(textureUnit->CurrentCubeMap->Name);
1023
         break;
1024
      case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
1025
         CHECK_EXTENSION_B(ARB_texture_cube_map, pname);
1026
         *params = INT_TO_BOOL(1 << (ctx->Const.MaxCubeTextureLevels - 1));
1027
         break;
1028
 
1029
      /* GL_ARB_texture_compression */
1030
      case GL_TEXTURE_COMPRESSION_HINT_ARB:
1031
         CHECK_EXTENSION_B(ARB_texture_compression, pname);
1032
         *params = INT_TO_BOOL(ctx->Hint.TextureCompression);
1033
         break;
1034
      case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
1035
         CHECK_EXTENSION_B(ARB_texture_compression, pname);
1036
         *params = INT_TO_BOOL(_mesa_get_compressed_formats(ctx, NULL));
1037
         break;
1038
      case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
1039
         CHECK_EXTENSION_B(ARB_texture_compression, pname);
1040
         {
1041
            GLint formats[100];
1042
            GLuint i, n;
1043
            n = _mesa_get_compressed_formats(ctx, formats);
1044
            for (i = 0; i < n; i++)
1045
               params[i] = INT_TO_BOOL(formats[i]);
1046
         }
1047
         break;
1048
 
1049
      /* GL_EXT_compiled_vertex_array */
1050
      case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT:
1051
         *params = ctx->Array.LockFirst ? GL_TRUE : GL_FALSE;
1052
         break;
1053
      case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT:
1054
         *params = ctx->Array.LockCount ? GL_TRUE : GL_FALSE;
1055
         break;
1056
 
1057
      /* GL_ARB_transpose_matrix */
1058
      case GL_TRANSPOSE_COLOR_MATRIX_ARB:
1059
         {
1060
            GLfloat tm[16];
1061
            GLuint i;
1062
            _math_transposef(tm, ctx->ColorMatrixStack.Top->m);
1063
            for (i=0;i<16;i++) {
1064
               params[i] = FLOAT_TO_BOOL(tm[i]);
1065
            }
1066
         }
1067
         break;
1068
      case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB:
1069
         {
1070
            GLfloat tm[16];
1071
            GLuint i;
1072
            _math_transposef(tm, ctx->ModelviewMatrixStack.Top->m);
1073
            for (i=0;i<16;i++) {
1074
               params[i] = FLOAT_TO_BOOL(tm[i]);
1075
            }
1076
         }
1077
         break;
1078
      case GL_TRANSPOSE_PROJECTION_MATRIX_ARB:
1079
         {
1080
            GLfloat tm[16];
1081
            GLuint i;
1082
            _math_transposef(tm, ctx->ProjectionMatrixStack.Top->m);
1083
            for (i=0;i<16;i++) {
1084
               params[i] = FLOAT_TO_BOOL(tm[i]);
1085
            }
1086
         }
1087
         break;
1088
      case GL_TRANSPOSE_TEXTURE_MATRIX_ARB:
1089
         {
1090
            GLfloat tm[16];
1091
            GLuint i;
1092
            _math_transposef(tm, ctx->TextureMatrixStack[texUnit].Top->m);
1093
            for (i=0;i<16;i++) {
1094
               params[i] = FLOAT_TO_BOOL(tm[i]);
1095
            }
1096
         }
1097
         break;
1098
 
1099
      /* GL_HP_occlusion_test */
1100
      case GL_OCCLUSION_TEST_HP:
1101
         CHECK_EXTENSION_B(HP_occlusion_test, pname);
1102
         *params = ctx->Depth.OcclusionTest;
1103
         return;
1104
      case GL_OCCLUSION_TEST_RESULT_HP:
1105
         CHECK_EXTENSION_B(HP_occlusion_test, pname);
1106
         if (ctx->Depth.OcclusionTest)
1107
            *params = ctx->OcclusionResult;
1108
         else
1109
            *params = ctx->OcclusionResultSaved;
1110
         /* reset flag now */
1111
         ctx->OcclusionResult = GL_FALSE;
1112
         ctx->OcclusionResultSaved = GL_FALSE;
1113
         return;
1114
 
1115
      /* GL_SGIS_pixel_texture */
1116
      case GL_PIXEL_TEXTURE_SGIS:
1117
         *params = ctx->Pixel.PixelTextureEnabled;
1118
         break;
1119
 
1120
      /* GL_SGIX_pixel_texture */
1121
      case GL_PIXEL_TEX_GEN_SGIX:
1122
         *params = ctx->Pixel.PixelTextureEnabled;
1123
         break;
1124
      case GL_PIXEL_TEX_GEN_MODE_SGIX:
1125
         *params = (GLboolean) pixel_texgen_mode(ctx);
1126
         break;
1127
 
1128
      /* GL_SGI_color_matrix (also in 1.2 imaging) */
1129
      case GL_COLOR_MATRIX_SGI:
1130
         for (i=0;i<16;i++) {
1131
            params[i] = FLOAT_TO_BOOL(ctx->ColorMatrixStack.Top->m[i]);
1132
         }
1133
         break;
1134
      case GL_COLOR_MATRIX_STACK_DEPTH_SGI:
1135
         *params = INT_TO_BOOL(ctx->ColorMatrixStack.Depth + 1);
1136
         break;
1137
      case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI:
1138
         *params = FLOAT_TO_BOOL(MAX_COLOR_STACK_DEPTH);
1139
         break;
1140
      case GL_POST_COLOR_MATRIX_RED_SCALE_SGI:
1141
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixScale[0]);
1142
         break;
1143
      case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI:
1144
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixScale[1]);
1145
         break;
1146
      case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI:
1147
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixScale[2]);
1148
         break;
1149
      case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI:
1150
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixScale[3]);
1151
         break;
1152
      case GL_POST_COLOR_MATRIX_RED_BIAS_SGI:
1153
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixBias[0]);
1154
         break;
1155
      case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI:
1156
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixBias[1]);
1157
         break;
1158
      case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI:
1159
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixBias[2]);
1160
         break;
1161
      case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI:
1162
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixBias[3]);
1163
         break;
1164
 
1165
      /* GL_EXT_convolution (also in 1.2 imaging) */
1166
      case GL_CONVOLUTION_1D_EXT:
1167
         CHECK_EXTENSION_B(EXT_convolution, pname);
1168
         *params = ctx->Pixel.Convolution1DEnabled;
1169
         break;
1170
      case GL_CONVOLUTION_2D:
1171
         CHECK_EXTENSION_B(EXT_convolution, pname);
1172
         *params = ctx->Pixel.Convolution2DEnabled;
1173
         break;
1174
      case GL_SEPARABLE_2D:
1175
         CHECK_EXTENSION_B(EXT_convolution, pname);
1176
         *params = ctx->Pixel.Separable2DEnabled;
1177
         break;
1178
      case GL_POST_CONVOLUTION_RED_SCALE_EXT:
1179
         CHECK_EXTENSION_B(EXT_convolution, pname);
1180
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionScale[0]);
1181
         break;
1182
      case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:
1183
         CHECK_EXTENSION_B(EXT_convolution, pname);
1184
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionScale[1]);
1185
         break;
1186
      case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:
1187
         CHECK_EXTENSION_B(EXT_convolution, pname);
1188
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionScale[2]);
1189
         break;
1190
      case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:
1191
         CHECK_EXTENSION_B(EXT_convolution, pname);
1192
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionScale[3]);
1193
         break;
1194
      case GL_POST_CONVOLUTION_RED_BIAS_EXT:
1195
         CHECK_EXTENSION_B(EXT_convolution, pname);
1196
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionBias[0]);
1197
         break;
1198
      case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:
1199
         CHECK_EXTENSION_B(EXT_convolution, pname);
1200
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionBias[1]);
1201
         break;
1202
      case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:
1203
         CHECK_EXTENSION_B(EXT_convolution, pname);
1204
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionBias[2]);
1205
         break;
1206
      case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:
1207
         CHECK_EXTENSION_B(EXT_convolution, pname);
1208
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionBias[2]);
1209
         break;
1210
 
1211
      /* GL_EXT_histogram (also in 1.2 imaging) */
1212
      case GL_HISTOGRAM:
1213
         CHECK_EXTENSION_B(EXT_histogram, pname);
1214
         *params = ctx->Pixel.HistogramEnabled;
1215
         break;
1216
      case GL_MINMAX:
1217
         CHECK_EXTENSION_B(EXT_histogram, pname);
1218
         *params = ctx->Pixel.MinMaxEnabled;
1219
         break;
1220
 
1221
      /* GL_SGI_color_table (also in 1.2 imaging */
1222
      case GL_COLOR_TABLE_SGI:
1223
         *params = ctx->Pixel.ColorTableEnabled;
1224
         break;
1225
      case GL_POST_CONVOLUTION_COLOR_TABLE_SGI:
1226
         *params = ctx->Pixel.PostConvolutionColorTableEnabled;
1227
         break;
1228
      case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
1229
         *params = ctx->Pixel.PostColorMatrixColorTableEnabled;
1230
         break;
1231
 
1232
      /* GL_EXT_secondary_color */
1233
      case GL_COLOR_SUM_EXT:
1234
         CHECK_EXTENSION_B(EXT_secondary_color, pname);
1235
         *params = ctx->Fog.ColorSumEnabled;
1236
         break;
1237
      case GL_CURRENT_SECONDARY_COLOR_EXT:
1238
         CHECK_EXTENSION_B(EXT_secondary_color, pname);
1239
         FLUSH_CURRENT(ctx, 0);
1240
         params[0] = INT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0]);
1241
         params[1] = INT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1]);
1242
         params[2] = INT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2]);
1243
         break;
1244
      case GL_SECONDARY_COLOR_ARRAY_EXT:
1245
         CHECK_EXTENSION_B(EXT_secondary_color, pname);
1246
         *params = ctx->Array.SecondaryColor.Enabled;
1247
         break;
1248
      case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT:
1249
         CHECK_EXTENSION_B(EXT_secondary_color, pname);
1250
         *params = ENUM_TO_BOOL(ctx->Array.SecondaryColor.Type);
1251
         break;
1252
      case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT:
1253
         CHECK_EXTENSION_B(EXT_secondary_color, pname);
1254
         *params = INT_TO_BOOL(ctx->Array.SecondaryColor.Stride);
1255
         break;
1256
      case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT:
1257
         CHECK_EXTENSION_B(EXT_secondary_color, pname);
1258
         *params = INT_TO_BOOL(ctx->Array.SecondaryColor.Stride);
1259
         break;
1260
 
1261
      /* GL_EXT_fog_coord */
1262
      case GL_CURRENT_FOG_COORDINATE_EXT:
1263
         CHECK_EXTENSION_B(EXT_fog_coord, pname);
1264
         FLUSH_CURRENT(ctx, 0);
1265
         *params = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_FOG][0]);
1266
         break;
1267
      case GL_FOG_COORDINATE_ARRAY_EXT:
1268
         CHECK_EXTENSION_B(EXT_fog_coord, pname);
1269
         *params = ctx->Array.FogCoord.Enabled;
1270
         break;
1271
      case GL_FOG_COORDINATE_ARRAY_TYPE_EXT:
1272
         CHECK_EXTENSION_B(EXT_fog_coord, pname);
1273
         *params = ENUM_TO_BOOL(ctx->Array.FogCoord.Type);
1274
         break;
1275
      case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT:
1276
         CHECK_EXTENSION_B(EXT_fog_coord, pname);
1277
         *params = INT_TO_BOOL(ctx->Array.FogCoord.Stride);
1278
         break;
1279
 
1280
      /* GL_EXT_texture_lod_bias */
1281
      case GL_MAX_TEXTURE_LOD_BIAS_EXT:
1282
         *params = FLOAT_TO_BOOL(ctx->Const.MaxTextureLodBias);
1283
         break;
1284
 
1285
      /* GL_EXT_texture_filter_anisotropic */
1286
      case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
1287
         CHECK_EXTENSION_B(EXT_texture_filter_anisotropic, pname);
1288
         *params = FLOAT_TO_BOOL(ctx->Const.MaxTextureMaxAnisotropy);
1289
         break;
1290
 
1291
      /* GL_ARB_multisample */
1292
      case GL_MULTISAMPLE_ARB:
1293
         CHECK_EXTENSION_B(ARB_multisample, pname);
1294
         *params = ctx->Multisample.Enabled;
1295
         break;
1296
      case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
1297
         CHECK_EXTENSION_B(ARB_multisample, pname);
1298
         *params = ctx->Multisample.SampleAlphaToCoverage;
1299
         break;
1300
      case GL_SAMPLE_ALPHA_TO_ONE_ARB:
1301
         CHECK_EXTENSION_B(ARB_multisample, pname);
1302
         *params = ctx->Multisample.SampleAlphaToOne;
1303
         break;
1304
      case GL_SAMPLE_COVERAGE_ARB:
1305
         CHECK_EXTENSION_B(ARB_multisample, pname);
1306
         *params = ctx->Multisample.SampleCoverage;
1307
         break;
1308
      case GL_SAMPLE_COVERAGE_VALUE_ARB:
1309
         CHECK_EXTENSION_B(ARB_multisample, pname);
1310
         *params = FLOAT_TO_BOOL(ctx->Multisample.SampleCoverageValue);
1311
         break;
1312
      case GL_SAMPLE_COVERAGE_INVERT_ARB:
1313
         CHECK_EXTENSION_B(ARB_multisample, pname);
1314
         *params = ctx->Multisample.SampleCoverageInvert;
1315
         break;
1316
      case GL_SAMPLE_BUFFERS_ARB:
1317
         CHECK_EXTENSION_B(ARB_multisample, pname);
1318
         *params = 0; /* XXX fix someday */
1319
         break;
1320
      case GL_SAMPLES_ARB:
1321
         CHECK_EXTENSION_B(ARB_multisample, pname);
1322
         *params = 0; /* XXX fix someday */
1323
         break;
1324
 
1325
      /* GL_IBM_rasterpos_clip */
1326
      case GL_RASTER_POSITION_UNCLIPPED_IBM:
1327
         CHECK_EXTENSION_B(IBM_rasterpos_clip, pname);
1328
         *params = ctx->Transform.RasterPositionUnclipped;
1329
         break;
1330
 
1331
      /* GL_NV_point_sprite */
1332
      case GL_POINT_SPRITE_NV:
1333
         CHECK_EXTENSION_B(NV_point_sprite, pname);
1334
         *params = ctx->Point.PointSprite;
1335
         break;
1336
      case GL_POINT_SPRITE_R_MODE_NV:
1337
         CHECK_EXTENSION_B(NV_point_sprite, pname);
1338
         *params = ENUM_TO_BOOL(ctx->Point.SpriteRMode);
1339
         break;
1340
 
1341
      /* GL_SGIS_generate_mipmap */
1342
      case GL_GENERATE_MIPMAP_HINT_SGIS:
1343
         CHECK_EXTENSION_B(SGIS_generate_mipmap, pname);
1344
         *params = ENUM_TO_BOOL(ctx->Hint.GenerateMipmap);
1345
         break;
1346
 
1347
#if FEATURE_NV_vertex_program
1348
      case GL_VERTEX_PROGRAM_NV:
1349
         CHECK_EXTENSION_B(NV_vertex_program, pname);
1350
         *params = ctx->VertexProgram.Enabled;
1351
         break;
1352
      case GL_VERTEX_PROGRAM_POINT_SIZE_NV:
1353
         CHECK_EXTENSION_B(NV_vertex_program, pname);
1354
         *params = ctx->VertexProgram.PointSizeEnabled;
1355
         break;
1356
      case GL_VERTEX_PROGRAM_TWO_SIDE_NV:
1357
         CHECK_EXTENSION_B(NV_vertex_program, pname);
1358
         *params = ctx->VertexProgram.TwoSideEnabled;
1359
         break;
1360
      case GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV:
1361
         CHECK_EXTENSION_B(NV_vertex_program, pname);
1362
         *params = (MAX_PROGRAM_STACK_DEPTH > 0) ? GL_TRUE : GL_FALSE;
1363
         break;
1364
      case GL_MAX_TRACK_MATRICES_NV:
1365
         CHECK_EXTENSION_B(NV_vertex_program, pname);
1366
         *params = (MAX_PROGRAM_MATRICES > 0) ? GL_TRUE : GL_FALSE;
1367
         break;
1368
      case GL_CURRENT_MATRIX_STACK_DEPTH_NV:
1369
         CHECK_EXTENSION_B(NV_vertex_program, pname);
1370
         *params = (ctx->CurrentStack->Depth > 0) ? GL_TRUE : GL_FALSE;
1371
         break;
1372
      case GL_CURRENT_MATRIX_NV:
1373
         CHECK_EXTENSION_B(NV_vertex_program, pname);
1374
         *params = (ctx->Transform.MatrixMode != 0) ? GL_TRUE : GL_FALSE;
1375
         break;
1376
      case GL_VERTEX_PROGRAM_BINDING_NV:
1377
         CHECK_EXTENSION_B(NV_vertex_program, pname);
1378
         *params = (ctx->VertexProgram.CurrentID != 0) ? GL_TRUE : GL_FALSE;
1379
         break;
1380
      case GL_PROGRAM_ERROR_POSITION_NV:
1381
         CHECK_EXTENSION_B(NV_vertex_program, pname);
1382
         *params = (ctx->VertexProgram.ErrorPos != 0) ? GL_TRUE : GL_FALSE;
1383
         break;
1384
      case GL_VERTEX_ATTRIB_ARRAY0_NV:
1385
      case GL_VERTEX_ATTRIB_ARRAY1_NV:
1386
      case GL_VERTEX_ATTRIB_ARRAY2_NV:
1387
      case GL_VERTEX_ATTRIB_ARRAY3_NV:
1388
      case GL_VERTEX_ATTRIB_ARRAY4_NV:
1389
      case GL_VERTEX_ATTRIB_ARRAY5_NV:
1390
      case GL_VERTEX_ATTRIB_ARRAY6_NV:
1391
      case GL_VERTEX_ATTRIB_ARRAY7_NV:
1392
      case GL_VERTEX_ATTRIB_ARRAY8_NV:
1393
      case GL_VERTEX_ATTRIB_ARRAY9_NV:
1394
      case GL_VERTEX_ATTRIB_ARRAY10_NV:
1395
      case GL_VERTEX_ATTRIB_ARRAY11_NV:
1396
      case GL_VERTEX_ATTRIB_ARRAY12_NV:
1397
      case GL_VERTEX_ATTRIB_ARRAY13_NV:
1398
      case GL_VERTEX_ATTRIB_ARRAY14_NV:
1399
      case GL_VERTEX_ATTRIB_ARRAY15_NV:
1400
         CHECK_EXTENSION_B(NV_vertex_program, pname);
1401
         {
1402
            GLuint n = (GLuint) pname - GL_VERTEX_ATTRIB_ARRAY0_NV;
1403
            *params = ctx->Array.VertexAttrib[n].Enabled;
1404
         }
1405
         break;
1406
      case GL_MAP1_VERTEX_ATTRIB0_4_NV:
1407
      case GL_MAP1_VERTEX_ATTRIB1_4_NV:
1408
      case GL_MAP1_VERTEX_ATTRIB2_4_NV:
1409
      case GL_MAP1_VERTEX_ATTRIB3_4_NV:
1410
      case GL_MAP1_VERTEX_ATTRIB4_4_NV:
1411
      case GL_MAP1_VERTEX_ATTRIB5_4_NV:
1412
      case GL_MAP1_VERTEX_ATTRIB6_4_NV:
1413
      case GL_MAP1_VERTEX_ATTRIB7_4_NV:
1414
      case GL_MAP1_VERTEX_ATTRIB8_4_NV:
1415
      case GL_MAP1_VERTEX_ATTRIB9_4_NV:
1416
      case GL_MAP1_VERTEX_ATTRIB10_4_NV:
1417
      case GL_MAP1_VERTEX_ATTRIB11_4_NV:
1418
      case GL_MAP1_VERTEX_ATTRIB12_4_NV:
1419
      case GL_MAP1_VERTEX_ATTRIB13_4_NV:
1420
      case GL_MAP1_VERTEX_ATTRIB14_4_NV:
1421
      case GL_MAP1_VERTEX_ATTRIB15_4_NV:
1422
         CHECK_EXTENSION_B(NV_vertex_program, pname);
1423
         {
1424
            GLuint n = (GLuint) pname - GL_MAP1_VERTEX_ATTRIB0_4_NV;
1425
            *params = ctx->Eval.Map1Attrib[n];
1426
         }
1427
         break;
1428
      case GL_MAP2_VERTEX_ATTRIB0_4_NV:
1429
      case GL_MAP2_VERTEX_ATTRIB1_4_NV:
1430
      case GL_MAP2_VERTEX_ATTRIB2_4_NV:
1431
      case GL_MAP2_VERTEX_ATTRIB3_4_NV:
1432
      case GL_MAP2_VERTEX_ATTRIB4_4_NV:
1433
      case GL_MAP2_VERTEX_ATTRIB5_4_NV:
1434
      case GL_MAP2_VERTEX_ATTRIB6_4_NV:
1435
      case GL_MAP2_VERTEX_ATTRIB7_4_NV:
1436
      case GL_MAP2_VERTEX_ATTRIB8_4_NV:
1437
      case GL_MAP2_VERTEX_ATTRIB9_4_NV:
1438
      case GL_MAP2_VERTEX_ATTRIB10_4_NV:
1439
      case GL_MAP2_VERTEX_ATTRIB11_4_NV:
1440
      case GL_MAP2_VERTEX_ATTRIB12_4_NV:
1441
      case GL_MAP2_VERTEX_ATTRIB13_4_NV:
1442
      case GL_MAP2_VERTEX_ATTRIB14_4_NV:
1443
      case GL_MAP2_VERTEX_ATTRIB15_4_NV:
1444
         CHECK_EXTENSION_B(NV_vertex_program, pname);
1445
         {
1446
            GLuint n = (GLuint) pname - GL_MAP2_VERTEX_ATTRIB0_4_NV;
1447
            *params = ctx->Eval.Map2Attrib[n];
1448
         }
1449
         break;
1450
#endif /* FEATURE_NV_vertex_program */
1451
 
1452
      /* GL_NV_texture_rectangle */
1453
      case GL_TEXTURE_RECTANGLE_NV:
1454
         CHECK_EXTENSION_B(NV_texture_rectangle, pname);
1455
         *params = _mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV);
1456
         break;
1457
      case GL_TEXTURE_BINDING_RECTANGLE_NV:
1458
         CHECK_EXTENSION_B(NV_texture_rectangle, pname);
1459
         *params = INT_TO_BOOL(textureUnit->CurrentRect->Name);
1460
         break;
1461
      case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV:
1462
         CHECK_EXTENSION_B(NV_texture_rectangle, pname);
1463
         *params = INT_TO_BOOL(ctx->Const.MaxTextureRectSize);
1464
         break;
1465
 
1466
      /* GL_EXT_stencil_two_side */
1467
      case GL_STENCIL_TEST_TWO_SIDE_EXT:
1468
         CHECK_EXTENSION_B(EXT_stencil_two_side, pname);
1469
         *params = ctx->Stencil.TestTwoSide;
1470
         break;
1471
      case GL_ACTIVE_STENCIL_FACE_EXT:
1472
         CHECK_EXTENSION_B(EXT_stencil_two_side, pname);
1473
         *params = ENUM_TO_BOOL(ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT);
1474
         break;
1475
 
1476
      default:
1477
         _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv(pname=0x%x)", pname);
1478
   }
1479
}
1480
 
1481
 
1482
void
1483
_mesa_GetDoublev( GLenum pname, GLdouble *params )
1484
{
1485
   GET_CURRENT_CONTEXT(ctx);
1486
   GLuint i;
1487
   GLuint texUnit = ctx->Texture.CurrentUnit;
1488
   const struct gl_texture_unit *textureUnit = &ctx->Texture.Unit[texUnit];
1489
   ASSERT_OUTSIDE_BEGIN_END(ctx);
1490
 
1491
   if (!params)
1492
      return;
1493
 
1494
   /* We need this in order to get correct results for
1495
    * GL_OCCLUSION_TEST_RESULT_HP.  There might be other important cases.
1496
    */
1497
   FLUSH_VERTICES(ctx, 0);
1498
 
1499
   if (MESA_VERBOSE & VERBOSE_API)
1500
      _mesa_debug(ctx, "glGetDoublev %s\n", _mesa_lookup_enum_by_nr(pname));
1501
 
1502
   if (ctx->Driver.GetDoublev && (*ctx->Driver.GetDoublev)(ctx, pname, params))
1503
      return;
1504
 
1505
   switch (pname) {
1506
      case GL_ACCUM_RED_BITS:
1507
         *params = (GLdouble) ctx->Visual.accumRedBits;
1508
         break;
1509
      case GL_ACCUM_GREEN_BITS:
1510
         *params = (GLdouble) ctx->Visual.accumGreenBits;
1511
         break;
1512
      case GL_ACCUM_BLUE_BITS:
1513
         *params = (GLdouble) ctx->Visual.accumBlueBits;
1514
         break;
1515
      case GL_ACCUM_ALPHA_BITS:
1516
         *params = (GLdouble) ctx->Visual.accumAlphaBits;
1517
         break;
1518
      case GL_ACCUM_CLEAR_VALUE:
1519
         params[0] = (GLdouble) ctx->Accum.ClearColor[0];
1520
         params[1] = (GLdouble) ctx->Accum.ClearColor[1];
1521
         params[2] = (GLdouble) ctx->Accum.ClearColor[2];
1522
         params[3] = (GLdouble) ctx->Accum.ClearColor[3];
1523
         break;
1524
      case GL_ALPHA_BIAS:
1525
         *params = (GLdouble) ctx->Pixel.AlphaBias;
1526
         break;
1527
      case GL_ALPHA_BITS:
1528
         *params = (GLdouble) ctx->Visual.alphaBits;
1529
         break;
1530
      case GL_ALPHA_SCALE:
1531
         *params = (GLdouble) ctx->Pixel.AlphaScale;
1532
         break;
1533
      case GL_ALPHA_TEST:
1534
         *params = (GLdouble) ctx->Color.AlphaEnabled;
1535
         break;
1536
      case GL_ALPHA_TEST_FUNC:
1537
         *params = ENUM_TO_DOUBLE(ctx->Color.AlphaFunc);
1538
         break;
1539
      case GL_ALPHA_TEST_REF:
1540
         *params = (GLdouble) ctx->Color.AlphaRef;
1541
         break;
1542
      case GL_ATTRIB_STACK_DEPTH:
1543
         *params = (GLdouble ) (ctx->AttribStackDepth);
1544
         break;
1545
      case GL_AUTO_NORMAL:
1546
         *params = (GLdouble) ctx->Eval.AutoNormal;
1547
         break;
1548
      case GL_AUX_BUFFERS:
1549
         *params = (GLdouble) ctx->Const.NumAuxBuffers;
1550
         break;
1551
      case GL_BLEND:
1552
         *params = (GLdouble) ctx->Color.BlendEnabled;
1553
         break;
1554
      case GL_BLEND_DST:
1555
         *params = ENUM_TO_DOUBLE(ctx->Color.BlendDstRGB);
1556
         break;
1557
      case GL_BLEND_SRC:
1558
         *params = ENUM_TO_DOUBLE(ctx->Color.BlendSrcRGB);
1559
         break;
1560
      case GL_BLEND_SRC_RGB_EXT:
1561
         *params = ENUM_TO_DOUBLE(ctx->Color.BlendSrcRGB);
1562
         break;
1563
      case GL_BLEND_DST_RGB_EXT:
1564
         *params = ENUM_TO_DOUBLE(ctx->Color.BlendDstRGB);
1565
         break;
1566
      case GL_BLEND_SRC_ALPHA_EXT:
1567
         *params = ENUM_TO_DOUBLE(ctx->Color.BlendSrcA);
1568
         break;
1569
      case GL_BLEND_DST_ALPHA_EXT:
1570
         *params = ENUM_TO_DOUBLE(ctx->Color.BlendDstA);
1571
         break;
1572
      case GL_BLEND_EQUATION_EXT:
1573
         *params = ENUM_TO_DOUBLE(ctx->Color.BlendEquation);
1574
         break;
1575
      case GL_BLEND_COLOR_EXT:
1576
         params[0] = (GLdouble) ctx->Color.BlendColor[0];
1577
         params[1] = (GLdouble) ctx->Color.BlendColor[1];
1578
         params[2] = (GLdouble) ctx->Color.BlendColor[2];
1579
         params[3] = (GLdouble) ctx->Color.BlendColor[3];
1580
         break;
1581
      case GL_BLUE_BIAS:
1582
         *params = (GLdouble) ctx->Pixel.BlueBias;
1583
         break;
1584
      case GL_BLUE_BITS:
1585
         *params = (GLdouble) ctx->Visual.blueBits;
1586
         break;
1587
      case GL_BLUE_SCALE:
1588
         *params = (GLdouble) ctx->Pixel.BlueScale;
1589
         break;
1590
      case GL_CLIENT_ATTRIB_STACK_DEPTH:
1591
         *params = (GLdouble) (ctx->ClientAttribStackDepth);
1592
         break;
1593
      case GL_CLIP_PLANE0:
1594
      case GL_CLIP_PLANE1:
1595
      case GL_CLIP_PLANE2:
1596
      case GL_CLIP_PLANE3:
1597
      case GL_CLIP_PLANE4:
1598
      case GL_CLIP_PLANE5:
1599
         if (ctx->Transform.ClipPlanesEnabled & (1 << (pname - GL_CLIP_PLANE0)))
1600
            *params = 1.0;
1601
         else
1602
            *params = 0.0;
1603
         break;
1604
      case GL_COLOR_CLEAR_VALUE:
1605
         params[0] = (GLdouble) ctx->Color.ClearColor[0];
1606
         params[1] = (GLdouble) ctx->Color.ClearColor[1];
1607
         params[2] = (GLdouble) ctx->Color.ClearColor[2];
1608
         params[3] = (GLdouble) ctx->Color.ClearColor[3];
1609
         break;
1610
      case GL_COLOR_MATERIAL:
1611
         *params = (GLdouble) ctx->Light.ColorMaterialEnabled;
1612
         break;
1613
      case GL_COLOR_MATERIAL_FACE:
1614
         *params = ENUM_TO_DOUBLE(ctx->Light.ColorMaterialFace);
1615
         break;
1616
      case GL_COLOR_MATERIAL_PARAMETER:
1617
         *params = ENUM_TO_DOUBLE(ctx->Light.ColorMaterialMode);
1618
         break;
1619
      case GL_COLOR_WRITEMASK:
1620
         params[0] = ctx->Color.ColorMask[RCOMP] ? 1.0 : 0.0;
1621
         params[1] = ctx->Color.ColorMask[GCOMP] ? 1.0 : 0.0;
1622
         params[2] = ctx->Color.ColorMask[BCOMP] ? 1.0 : 0.0;
1623
         params[3] = ctx->Color.ColorMask[ACOMP] ? 1.0 : 0.0;
1624
         break;
1625
      case GL_CULL_FACE:
1626
         *params = (GLdouble) ctx->Polygon.CullFlag;
1627
         break;
1628
      case GL_CULL_FACE_MODE:
1629
         *params = ENUM_TO_DOUBLE(ctx->Polygon.CullFaceMode);
1630
         break;
1631
      case GL_CURRENT_COLOR:
1632
         FLUSH_CURRENT(ctx, 0);
1633
         params[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0];
1634
         params[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1];
1635
         params[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2];
1636
         params[3] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3];
1637
         break;
1638
      case GL_CURRENT_INDEX:
1639
         FLUSH_CURRENT(ctx, 0);
1640
         *params = (GLdouble) ctx->Current.Index;
1641
         break;
1642
      case GL_CURRENT_NORMAL:
1643
         FLUSH_CURRENT(ctx, 0);
1644
         params[0] = (GLdouble) ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0];
1645
         params[1] = (GLdouble) ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1];
1646
         params[2] = (GLdouble) ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2];
1647
         break;
1648
      case GL_CURRENT_RASTER_COLOR:
1649
         params[0] = (GLdouble) ctx->Current.RasterColor[0];
1650
         params[1] = (GLdouble) ctx->Current.RasterColor[1];
1651
         params[2] = (GLdouble) ctx->Current.RasterColor[2];
1652
         params[3] = (GLdouble) ctx->Current.RasterColor[3];
1653
         break;
1654
      case GL_CURRENT_RASTER_DISTANCE:
1655
         params[0] = (GLdouble) ctx->Current.RasterDistance;
1656
         break;
1657
      case GL_CURRENT_RASTER_INDEX:
1658
         *params = (GLdouble) ctx->Current.RasterIndex;
1659
         break;
1660
      case GL_CURRENT_RASTER_POSITION:
1661
         params[0] = (GLdouble) ctx->Current.RasterPos[0];
1662
         params[1] = (GLdouble) ctx->Current.RasterPos[1];
1663
         params[2] = (GLdouble) ctx->Current.RasterPos[2];
1664
         params[3] = (GLdouble) ctx->Current.RasterPos[3];
1665
         break;
1666
      case GL_CURRENT_RASTER_TEXTURE_COORDS:
1667
         params[0] = (GLdouble) ctx->Current.RasterTexCoords[texUnit][0];
1668
         params[1] = (GLdouble) ctx->Current.RasterTexCoords[texUnit][1];
1669
         params[2] = (GLdouble) ctx->Current.RasterTexCoords[texUnit][2];
1670
         params[3] = (GLdouble) ctx->Current.RasterTexCoords[texUnit][3];
1671
         break;
1672
      case GL_CURRENT_RASTER_POSITION_VALID:
1673
         *params = (GLdouble) ctx->Current.RasterPosValid;
1674
         break;
1675
      case GL_CURRENT_TEXTURE_COORDS:
1676
         FLUSH_CURRENT(ctx, 0);
1677
         params[0] = (GLdouble) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][0];
1678
         params[1] = (GLdouble) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][1];
1679
         params[2] = (GLdouble) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][2];
1680
         params[3] = (GLdouble) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3];
1681
         break;
1682
      case GL_DEPTH_BIAS:
1683
         *params = (GLdouble) ctx->Pixel.DepthBias;
1684
         break;
1685
      case GL_DEPTH_BITS:
1686
         *params = (GLdouble) ctx->Visual.depthBits;
1687
         break;
1688
      case GL_DEPTH_CLEAR_VALUE:
1689
         *params = (GLdouble) ctx->Depth.Clear;
1690
         break;
1691
      case GL_DEPTH_FUNC:
1692
         *params = ENUM_TO_DOUBLE(ctx->Depth.Func);
1693
         break;
1694
      case GL_DEPTH_RANGE:
1695
         params[0] = (GLdouble) ctx->Viewport.Near;
1696
         params[1] = (GLdouble) ctx->Viewport.Far;
1697
         break;
1698
      case GL_DEPTH_SCALE:
1699
         *params = (GLdouble) ctx->Pixel.DepthScale;
1700
         break;
1701
      case GL_DEPTH_TEST:
1702
         *params = (GLdouble) ctx->Depth.Test;
1703
         break;
1704
      case GL_DEPTH_WRITEMASK:
1705
         *params = (GLdouble) ctx->Depth.Mask;
1706
         break;
1707
      case GL_DITHER:
1708
         *params = (GLdouble) ctx->Color.DitherFlag;
1709
         break;
1710
      case GL_DOUBLEBUFFER:
1711
         *params = (GLdouble) ctx->Visual.doubleBufferMode;
1712
         break;
1713
      case GL_DRAW_BUFFER:
1714
         *params = ENUM_TO_DOUBLE(ctx->Color.DrawBuffer);
1715
         break;
1716
      case GL_EDGE_FLAG:
1717
         FLUSH_CURRENT(ctx, 0);
1718
         *params = (GLdouble) ctx->Current.EdgeFlag;
1719
         break;
1720
      case GL_FEEDBACK_BUFFER_SIZE:
1721
         *params = (GLdouble) ctx->Feedback.BufferSize;
1722
         break;
1723
      case GL_FEEDBACK_BUFFER_TYPE:
1724
         *params = ENUM_TO_DOUBLE(ctx->Feedback.Type);
1725
         break;
1726
      case GL_FOG:
1727
         *params = (GLdouble) ctx->Fog.Enabled;
1728
         break;
1729
      case GL_FOG_COLOR:
1730
         params[0] = (GLdouble) ctx->Fog.Color[0];
1731
         params[1] = (GLdouble) ctx->Fog.Color[1];
1732
         params[2] = (GLdouble) ctx->Fog.Color[2];
1733
         params[3] = (GLdouble) ctx->Fog.Color[3];
1734
         break;
1735
      case GL_FOG_DENSITY:
1736
         *params = (GLdouble) ctx->Fog.Density;
1737
         break;
1738
      case GL_FOG_END:
1739
         *params = (GLdouble) ctx->Fog.End;
1740
         break;
1741
      case GL_FOG_HINT:
1742
         *params = ENUM_TO_DOUBLE(ctx->Hint.Fog);
1743
         break;
1744
      case GL_FOG_INDEX:
1745
         *params = (GLdouble) ctx->Fog.Index;
1746
         break;
1747
      case GL_FOG_MODE:
1748
         *params = ENUM_TO_DOUBLE(ctx->Fog.Mode);
1749
         break;
1750
      case GL_FOG_START:
1751
         *params = (GLdouble) ctx->Fog.Start;
1752
         break;
1753
      case GL_FRONT_FACE:
1754
         *params = ENUM_TO_DOUBLE(ctx->Polygon.FrontFace);
1755
         break;
1756
      case GL_GREEN_BIAS:
1757
         *params = (GLdouble) ctx->Pixel.GreenBias;
1758
         break;
1759
      case GL_GREEN_BITS:
1760
         *params = (GLdouble) ctx->Visual.greenBits;
1761
         break;
1762
      case GL_GREEN_SCALE:
1763
         *params = (GLdouble) ctx->Pixel.GreenScale;
1764
         break;
1765
      case GL_INDEX_BITS:
1766
         *params = (GLdouble) ctx->Visual.indexBits;
1767
         break;
1768
      case GL_INDEX_CLEAR_VALUE:
1769
         *params = (GLdouble) ctx->Color.ClearIndex;
1770
         break;
1771
      case GL_INDEX_MODE:
1772
         *params = ctx->Visual.rgbMode ? 0.0 : 1.0;
1773
         break;
1774
      case GL_INDEX_OFFSET:
1775
         *params = (GLdouble) ctx->Pixel.IndexOffset;
1776
         break;
1777
      case GL_INDEX_SHIFT:
1778
         *params = (GLdouble) ctx->Pixel.IndexShift;
1779
         break;
1780
      case GL_INDEX_WRITEMASK:
1781
         *params = (GLdouble) ctx->Color.IndexMask;
1782
         break;
1783
      case GL_LIGHT0:
1784
      case GL_LIGHT1:
1785
      case GL_LIGHT2:
1786
      case GL_LIGHT3:
1787
      case GL_LIGHT4:
1788
      case GL_LIGHT5:
1789
      case GL_LIGHT6:
1790
      case GL_LIGHT7:
1791
         *params = (GLdouble) ctx->Light.Light[pname-GL_LIGHT0].Enabled;
1792
         break;
1793
      case GL_LIGHTING:
1794
         *params = (GLdouble) ctx->Light.Enabled;
1795
         break;
1796
      case GL_LIGHT_MODEL_AMBIENT:
1797
         params[0] = (GLdouble) ctx->Light.Model.Ambient[0];
1798
         params[1] = (GLdouble) ctx->Light.Model.Ambient[1];
1799
         params[2] = (GLdouble) ctx->Light.Model.Ambient[2];
1800
         params[3] = (GLdouble) ctx->Light.Model.Ambient[3];
1801
         break;
1802
      case GL_LIGHT_MODEL_COLOR_CONTROL:
1803
         params[0] = (GLdouble) ctx->Light.Model.ColorControl;
1804
         break;
1805
      case GL_LIGHT_MODEL_LOCAL_VIEWER:
1806
         *params = (GLdouble) ctx->Light.Model.LocalViewer;
1807
         break;
1808
      case GL_LIGHT_MODEL_TWO_SIDE:
1809
         *params = (GLdouble) ctx->Light.Model.TwoSide;
1810
         break;
1811
      case GL_LINE_SMOOTH:
1812
         *params = (GLdouble) ctx->Line.SmoothFlag;
1813
         break;
1814
      case GL_LINE_SMOOTH_HINT:
1815
         *params = ENUM_TO_DOUBLE(ctx->Hint.LineSmooth);
1816
         break;
1817
      case GL_LINE_STIPPLE:
1818
         *params = (GLdouble) ctx->Line.StippleFlag;
1819
         break;
1820
      case GL_LINE_STIPPLE_PATTERN:
1821
         *params = (GLdouble) ctx->Line.StipplePattern;
1822
         break;
1823
      case GL_LINE_STIPPLE_REPEAT:
1824
         *params = (GLdouble) ctx->Line.StippleFactor;
1825
         break;
1826
      case GL_LINE_WIDTH:
1827
         *params = (GLdouble) ctx->Line.Width;
1828
         break;
1829
      case GL_LINE_WIDTH_GRANULARITY:
1830
         *params = (GLdouble) ctx->Const.LineWidthGranularity;
1831
         break;
1832
      case GL_LINE_WIDTH_RANGE:
1833
         params[0] = (GLdouble) ctx->Const.MinLineWidthAA;
1834
         params[1] = (GLdouble) ctx->Const.MaxLineWidthAA;
1835
         break;
1836
      case GL_ALIASED_LINE_WIDTH_RANGE:
1837
         params[0] = (GLdouble) ctx->Const.MinLineWidth;
1838
         params[1] = (GLdouble) ctx->Const.MaxLineWidth;
1839
         break;
1840
      case GL_LIST_BASE:
1841
         *params = (GLdouble) ctx->List.ListBase;
1842
         break;
1843
      case GL_LIST_INDEX:
1844
         *params = (GLdouble) ctx->CurrentListNum;
1845
         break;
1846
      case GL_LIST_MODE:
1847
         *params = ctx->ExecuteFlag ? ENUM_TO_DOUBLE(GL_COMPILE_AND_EXECUTE)
1848
                                  : ENUM_TO_DOUBLE(GL_COMPILE);
1849
         break;
1850
      case GL_INDEX_LOGIC_OP:
1851
         *params = (GLdouble) ctx->Color.IndexLogicOpEnabled;
1852
         break;
1853
      case GL_COLOR_LOGIC_OP:
1854
         *params = (GLdouble) ctx->Color.ColorLogicOpEnabled;
1855
         break;
1856
      case GL_LOGIC_OP_MODE:
1857
         *params = ENUM_TO_DOUBLE(ctx->Color.LogicOp);
1858
         break;
1859
      case GL_MAP1_COLOR_4:
1860
         *params = (GLdouble) ctx->Eval.Map1Color4;
1861
         break;
1862
      case GL_MAP1_GRID_DOMAIN:
1863
         params[0] = (GLdouble) ctx->Eval.MapGrid1u1;
1864
         params[1] = (GLdouble) ctx->Eval.MapGrid1u2;
1865
         break;
1866
      case GL_MAP1_GRID_SEGMENTS:
1867
         *params = (GLdouble) ctx->Eval.MapGrid1un;
1868
         break;
1869
      case GL_MAP1_INDEX:
1870
         *params = (GLdouble) ctx->Eval.Map1Index;
1871
         break;
1872
      case GL_MAP1_NORMAL:
1873
         *params = (GLdouble) ctx->Eval.Map1Normal;
1874
         break;
1875
      case GL_MAP1_TEXTURE_COORD_1:
1876
         *params = (GLdouble) ctx->Eval.Map1TextureCoord1;
1877
         break;
1878
      case GL_MAP1_TEXTURE_COORD_2:
1879
         *params = (GLdouble) ctx->Eval.Map1TextureCoord2;
1880
         break;
1881
      case GL_MAP1_TEXTURE_COORD_3:
1882
         *params = (GLdouble) ctx->Eval.Map1TextureCoord3;
1883
         break;
1884
      case GL_MAP1_TEXTURE_COORD_4:
1885
         *params = (GLdouble) ctx->Eval.Map1TextureCoord4;
1886
         break;
1887
      case GL_MAP1_VERTEX_3:
1888
         *params = (GLdouble) ctx->Eval.Map1Vertex3;
1889
         break;
1890
      case GL_MAP1_VERTEX_4:
1891
         *params = (GLdouble) ctx->Eval.Map1Vertex4;
1892
         break;
1893
      case GL_MAP2_COLOR_4:
1894
         *params = (GLdouble) ctx->Eval.Map2Color4;
1895
         break;
1896
      case GL_MAP2_GRID_DOMAIN:
1897
         params[0] = (GLdouble) ctx->Eval.MapGrid2u1;
1898
         params[1] = (GLdouble) ctx->Eval.MapGrid2u2;
1899
         params[2] = (GLdouble) ctx->Eval.MapGrid2v1;
1900
         params[3] = (GLdouble) ctx->Eval.MapGrid2v2;
1901
         break;
1902
      case GL_MAP2_GRID_SEGMENTS:
1903
         params[0] = (GLdouble) ctx->Eval.MapGrid2un;
1904
         params[1] = (GLdouble) ctx->Eval.MapGrid2vn;
1905
         break;
1906
      case GL_MAP2_INDEX:
1907
         *params = (GLdouble) ctx->Eval.Map2Index;
1908
         break;
1909
      case GL_MAP2_NORMAL:
1910
         *params = (GLdouble) ctx->Eval.Map2Normal;
1911
         break;
1912
      case GL_MAP2_TEXTURE_COORD_1:
1913
         *params = (GLdouble) ctx->Eval.Map2TextureCoord1;
1914
         break;
1915
      case GL_MAP2_TEXTURE_COORD_2:
1916
         *params = (GLdouble) ctx->Eval.Map2TextureCoord2;
1917
         break;
1918
      case GL_MAP2_TEXTURE_COORD_3:
1919
         *params = (GLdouble) ctx->Eval.Map2TextureCoord3;
1920
         break;
1921
      case GL_MAP2_TEXTURE_COORD_4:
1922
         *params = (GLdouble) ctx->Eval.Map2TextureCoord4;
1923
         break;
1924
      case GL_MAP2_VERTEX_3:
1925
         *params = (GLdouble) ctx->Eval.Map2Vertex3;
1926
         break;
1927
      case GL_MAP2_VERTEX_4:
1928
         *params = (GLdouble) ctx->Eval.Map2Vertex4;
1929
         break;
1930
      case GL_MAP_COLOR:
1931
         *params = (GLdouble) ctx->Pixel.MapColorFlag;
1932
         break;
1933
      case GL_MAP_STENCIL:
1934
         *params = (GLdouble) ctx->Pixel.MapStencilFlag;
1935
         break;
1936
      case GL_MATRIX_MODE:
1937
         *params = ENUM_TO_DOUBLE(ctx->Transform.MatrixMode);
1938
         break;
1939
      case GL_MAX_ATTRIB_STACK_DEPTH:
1940
         *params = (GLdouble) MAX_ATTRIB_STACK_DEPTH;
1941
         break;
1942
      case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH:
1943
         *params = (GLdouble) MAX_CLIENT_ATTRIB_STACK_DEPTH;
1944
         break;
1945
      case GL_MAX_CLIP_PLANES:
1946
         *params = (GLdouble) ctx->Const.MaxClipPlanes;
1947
         break;
1948
      case GL_MAX_ELEMENTS_VERTICES:  /* GL_VERSION_1_2 */
1949
         *params = (GLdouble) ctx->Const.MaxArrayLockSize;
1950
         break;
1951
      case GL_MAX_ELEMENTS_INDICES:   /* GL_VERSION_1_2 */
1952
         *params = (GLdouble) ctx->Const.MaxArrayLockSize;
1953
         break;
1954
      case GL_MAX_EVAL_ORDER:
1955
         *params = (GLdouble) MAX_EVAL_ORDER;
1956
         break;
1957
      case GL_MAX_LIGHTS:
1958
         *params = (GLdouble) ctx->Const.MaxLights;
1959
         break;
1960
      case GL_MAX_LIST_NESTING:
1961
         *params = (GLdouble) MAX_LIST_NESTING;
1962
         break;
1963
      case GL_MAX_MODELVIEW_STACK_DEPTH:
1964
         *params = (GLdouble) MAX_MODELVIEW_STACK_DEPTH;
1965
         break;
1966
      case GL_MAX_NAME_STACK_DEPTH:
1967
         *params = (GLdouble) MAX_NAME_STACK_DEPTH;
1968
         break;
1969
      case GL_MAX_PIXEL_MAP_TABLE:
1970
         *params = (GLdouble) MAX_PIXEL_MAP_TABLE;
1971
         break;
1972
      case GL_MAX_PROJECTION_STACK_DEPTH:
1973
         *params = (GLdouble) MAX_PROJECTION_STACK_DEPTH;
1974
         break;
1975
      case GL_MAX_TEXTURE_SIZE:
1976
         *params = (GLdouble) (1 << (ctx->Const.MaxTextureLevels - 1));
1977
         break;
1978
      case GL_MAX_3D_TEXTURE_SIZE:
1979
         *params = (GLdouble) (1 << (ctx->Const.Max3DTextureLevels - 1));
1980
         break;
1981
      case GL_MAX_TEXTURE_STACK_DEPTH:
1982
         *params = (GLdouble) MAX_TEXTURE_STACK_DEPTH;
1983
         break;
1984
      case GL_MAX_VIEWPORT_DIMS:
1985
         params[0] = (GLdouble) MAX_WIDTH;
1986
         params[1] = (GLdouble) MAX_HEIGHT;
1987
         break;
1988
      case GL_MODELVIEW_MATRIX:
1989
         for (i=0;i<16;i++) {
1990
            params[i] = (GLdouble) ctx->ModelviewMatrixStack.Top->m[i];
1991
         }
1992
         break;
1993
      case GL_MODELVIEW_STACK_DEPTH:
1994
         *params = (GLdouble) (ctx->ModelviewMatrixStack.Depth + 1);
1995
         break;
1996
      case GL_NAME_STACK_DEPTH:
1997
         *params = (GLdouble) ctx->Select.NameStackDepth;
1998
         break;
1999
      case GL_NORMALIZE:
2000
         *params = (GLdouble) ctx->Transform.Normalize;
2001
         break;
2002
      case GL_PACK_ALIGNMENT:
2003
         *params = (GLdouble) ctx->Pack.Alignment;
2004
         break;
2005
      case GL_PACK_LSB_FIRST:
2006
         *params = (GLdouble) ctx->Pack.LsbFirst;
2007
         break;
2008
      case GL_PACK_ROW_LENGTH:
2009
         *params = (GLdouble) ctx->Pack.RowLength;
2010
         break;
2011
      case GL_PACK_SKIP_PIXELS:
2012
         *params = (GLdouble) ctx->Pack.SkipPixels;
2013
         break;
2014
      case GL_PACK_SKIP_ROWS:
2015
         *params = (GLdouble) ctx->Pack.SkipRows;
2016
         break;
2017
      case GL_PACK_SWAP_BYTES:
2018
         *params = (GLdouble) ctx->Pack.SwapBytes;
2019
         break;
2020
      case GL_PACK_SKIP_IMAGES_EXT:
2021
         *params = (GLdouble) ctx->Pack.SkipImages;
2022
         break;
2023
      case GL_PACK_IMAGE_HEIGHT_EXT:
2024
         *params = (GLdouble) ctx->Pack.ImageHeight;
2025
         break;
2026
      case GL_PACK_INVERT_MESA:
2027
         *params = (GLdouble) ctx->Pack.Invert;
2028
         break;
2029
      case GL_PERSPECTIVE_CORRECTION_HINT:
2030
         *params = ENUM_TO_DOUBLE(ctx->Hint.PerspectiveCorrection);
2031
         break;
2032
      case GL_PIXEL_MAP_A_TO_A_SIZE:
2033
         *params = (GLdouble) ctx->Pixel.MapAtoAsize;
2034
         break;
2035
      case GL_PIXEL_MAP_B_TO_B_SIZE:
2036
         *params = (GLdouble) ctx->Pixel.MapBtoBsize;
2037
         break;
2038
      case GL_PIXEL_MAP_G_TO_G_SIZE:
2039
         *params = (GLdouble) ctx->Pixel.MapGtoGsize;
2040
         break;
2041
      case GL_PIXEL_MAP_I_TO_A_SIZE:
2042
         *params = (GLdouble) ctx->Pixel.MapItoAsize;
2043
         break;
2044
      case GL_PIXEL_MAP_I_TO_B_SIZE:
2045
         *params = (GLdouble) ctx->Pixel.MapItoBsize;
2046
         break;
2047
      case GL_PIXEL_MAP_I_TO_G_SIZE:
2048
         *params = (GLdouble) ctx->Pixel.MapItoGsize;
2049
         break;
2050
      case GL_PIXEL_MAP_I_TO_I_SIZE:
2051
         *params = (GLdouble) ctx->Pixel.MapItoIsize;
2052
         break;
2053
      case GL_PIXEL_MAP_I_TO_R_SIZE:
2054
         *params = (GLdouble) ctx->Pixel.MapItoRsize;
2055
         break;
2056
      case GL_PIXEL_MAP_R_TO_R_SIZE:
2057
         *params = (GLdouble) ctx->Pixel.MapRtoRsize;
2058
         break;
2059
      case GL_PIXEL_MAP_S_TO_S_SIZE:
2060
         *params = (GLdouble) ctx->Pixel.MapStoSsize;
2061
         break;
2062
      case GL_POINT_SIZE:
2063
         *params = (GLdouble) ctx->Point.Size;
2064
         break;
2065
      case GL_POINT_SIZE_GRANULARITY:
2066
         *params = (GLdouble) ctx->Const.PointSizeGranularity;
2067
         break;
2068
      case GL_POINT_SIZE_RANGE:
2069
         params[0] = (GLdouble) ctx->Const.MinPointSizeAA;
2070
         params[1] = (GLdouble) ctx->Const.MaxPointSizeAA;
2071
         break;
2072
      case GL_ALIASED_POINT_SIZE_RANGE:
2073
         params[0] = (GLdouble) ctx->Const.MinPointSize;
2074
         params[1] = (GLdouble) ctx->Const.MaxPointSize;
2075
         break;
2076
      case GL_POINT_SMOOTH:
2077
         *params = (GLdouble) ctx->Point.SmoothFlag;
2078
         break;
2079
      case GL_POINT_SMOOTH_HINT:
2080
         *params = ENUM_TO_DOUBLE(ctx->Hint.PointSmooth);
2081
         break;
2082
      case GL_POINT_SIZE_MIN_EXT:
2083
         *params = (GLdouble) (ctx->Point.MinSize);
2084
         break;
2085
      case GL_POINT_SIZE_MAX_EXT:
2086
         *params = (GLdouble) (ctx->Point.MaxSize);
2087
         break;
2088
      case GL_POINT_FADE_THRESHOLD_SIZE_EXT:
2089
         *params = (GLdouble) (ctx->Point.Threshold);
2090
         break;
2091
      case GL_DISTANCE_ATTENUATION_EXT:
2092
         params[0] = (GLdouble) (ctx->Point.Params[0]);
2093
         params[1] = (GLdouble) (ctx->Point.Params[1]);
2094
         params[2] = (GLdouble) (ctx->Point.Params[2]);
2095
         break;
2096
      case GL_POLYGON_MODE:
2097
         params[0] = ENUM_TO_DOUBLE(ctx->Polygon.FrontMode);
2098
         params[1] = ENUM_TO_DOUBLE(ctx->Polygon.BackMode);
2099
         break;
2100
      case GL_POLYGON_OFFSET_BIAS_EXT:  /* GL_EXT_polygon_offset */
2101
         *params = (GLdouble) ctx->Polygon.OffsetUnits;
2102
         break;
2103
      case GL_POLYGON_OFFSET_FACTOR:
2104
         *params = (GLdouble) ctx->Polygon.OffsetFactor;
2105
         break;
2106
      case GL_POLYGON_OFFSET_UNITS:
2107
         *params = (GLdouble) ctx->Polygon.OffsetUnits;
2108
         break;
2109
      case GL_POLYGON_SMOOTH:
2110
         *params = (GLdouble) ctx->Polygon.SmoothFlag;
2111
         break;
2112
      case GL_POLYGON_SMOOTH_HINT:
2113
         *params = ENUM_TO_DOUBLE(ctx->Hint.PolygonSmooth);
2114
         break;
2115
      case GL_POLYGON_STIPPLE:
2116
         *params = (GLdouble) ctx->Polygon.StippleFlag;
2117
         break;
2118
      case GL_PROJECTION_MATRIX:
2119
         for (i=0;i<16;i++) {
2120
            params[i] = (GLdouble) ctx->ProjectionMatrixStack.Top->m[i];
2121
         }
2122
         break;
2123
      case GL_PROJECTION_STACK_DEPTH:
2124
         *params = (GLdouble) (ctx->ProjectionMatrixStack.Depth + 1);
2125
         break;
2126
      case GL_READ_BUFFER:
2127
         *params = ENUM_TO_DOUBLE(ctx->Pixel.ReadBuffer);
2128
         break;
2129
      case GL_RED_BIAS:
2130
         *params = (GLdouble) ctx->Pixel.RedBias;
2131
         break;
2132
      case GL_RED_BITS:
2133
         *params = (GLdouble) ctx->Visual.redBits;
2134
         break;
2135
      case GL_RED_SCALE:
2136
         *params = (GLdouble) ctx->Pixel.RedScale;
2137
         break;
2138
      case GL_RENDER_MODE:
2139
         *params = ENUM_TO_DOUBLE(ctx->RenderMode);
2140
         break;
2141
      case GL_RESCALE_NORMAL:
2142
         *params = (GLdouble) ctx->Transform.RescaleNormals;
2143
         break;
2144
      case GL_RGBA_MODE:
2145
         *params = (GLdouble) ctx->Visual.rgbMode;
2146
         break;
2147
      case GL_SCISSOR_BOX:
2148
         params[0] = (GLdouble) ctx->Scissor.X;
2149
         params[1] = (GLdouble) ctx->Scissor.Y;
2150
         params[2] = (GLdouble) ctx->Scissor.Width;
2151
         params[3] = (GLdouble) ctx->Scissor.Height;
2152
         break;
2153
      case GL_SCISSOR_TEST:
2154
         *params = (GLdouble) ctx->Scissor.Enabled;
2155
         break;
2156
      case GL_SELECTION_BUFFER_SIZE:
2157
         *params = (GLdouble) ctx->Select.BufferSize;
2158
         break;
2159
      case GL_SHADE_MODEL:
2160
         *params = ENUM_TO_DOUBLE(ctx->Light.ShadeModel);
2161
         break;
2162
      case GL_SHARED_TEXTURE_PALETTE_EXT:
2163
         *params = (GLdouble) ctx->Texture.SharedPalette;
2164
         break;
2165
      case GL_STENCIL_BITS:
2166
         *params = (GLdouble) ctx->Visual.stencilBits;
2167
         break;
2168
      case GL_STENCIL_CLEAR_VALUE:
2169
         *params = (GLdouble) ctx->Stencil.Clear;
2170
         break;
2171
      case GL_STENCIL_FAIL:
2172
         *params = ENUM_TO_DOUBLE(ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]);
2173
         break;
2174
      case GL_STENCIL_FUNC:
2175
         *params = ENUM_TO_DOUBLE(ctx->Stencil.Function[ctx->Stencil.ActiveFace]);
2176
         break;
2177
      case GL_STENCIL_PASS_DEPTH_FAIL:
2178
         *params = ENUM_TO_DOUBLE(ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]);
2179
         break;
2180
      case GL_STENCIL_PASS_DEPTH_PASS:
2181
         *params = ENUM_TO_DOUBLE(ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]);
2182
         break;
2183
      case GL_STENCIL_REF:
2184
         *params = (GLdouble) ctx->Stencil.Ref[ctx->Stencil.ActiveFace];
2185
         break;
2186
      case GL_STENCIL_TEST:
2187
         *params = (GLdouble) ctx->Stencil.Enabled;
2188
         break;
2189
      case GL_STENCIL_VALUE_MASK:
2190
         *params = (GLdouble) ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace];
2191
         break;
2192
      case GL_STENCIL_WRITEMASK:
2193
         *params = (GLdouble) ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace];
2194
         break;
2195
      case GL_STEREO:
2196
         *params = (GLdouble) ctx->Visual.stereoMode;
2197
         break;
2198
      case GL_SUBPIXEL_BITS:
2199
         *params = (GLdouble) ctx->Const.SubPixelBits;
2200
         break;
2201
      case GL_TEXTURE_1D:
2202
         *params = _mesa_IsEnabled(GL_TEXTURE_1D) ? 1.0 : 0.0;
2203
         break;
2204
      case GL_TEXTURE_2D:
2205
         *params = _mesa_IsEnabled(GL_TEXTURE_2D) ? 1.0 : 0.0;
2206
         break;
2207
      case GL_TEXTURE_3D:
2208
         *params = _mesa_IsEnabled(GL_TEXTURE_3D) ? 1.0 : 0.0;
2209
         break;
2210
      case GL_TEXTURE_BINDING_1D:
2211
         *params = (GLdouble) textureUnit->Current1D->Name;
2212
          break;
2213
      case GL_TEXTURE_BINDING_2D:
2214
         *params = (GLdouble) textureUnit->Current2D->Name;
2215
          break;
2216
      case GL_TEXTURE_BINDING_3D:
2217
         *params = (GLdouble) textureUnit->Current3D->Name;
2218
          break;
2219
      case GL_TEXTURE_ENV_COLOR:
2220
         params[0] = (GLdouble) textureUnit->EnvColor[0];
2221
         params[1] = (GLdouble) textureUnit->EnvColor[1];
2222
         params[2] = (GLdouble) textureUnit->EnvColor[2];
2223
         params[3] = (GLdouble) textureUnit->EnvColor[3];
2224
         break;
2225
      case GL_TEXTURE_ENV_MODE:
2226
         *params = ENUM_TO_DOUBLE(textureUnit->EnvMode);
2227
         break;
2228
      case GL_TEXTURE_GEN_S:
2229
         *params = (textureUnit->TexGenEnabled & S_BIT) ? 1.0 : 0.0;
2230
         break;
2231
      case GL_TEXTURE_GEN_T:
2232
         *params = (textureUnit->TexGenEnabled & T_BIT) ? 1.0 : 0.0;
2233
         break;
2234
      case GL_TEXTURE_GEN_R:
2235
         *params = (textureUnit->TexGenEnabled & R_BIT) ? 1.0 : 0.0;
2236
         break;
2237
      case GL_TEXTURE_GEN_Q:
2238
         *params = (textureUnit->TexGenEnabled & Q_BIT) ? 1.0 : 0.0;
2239
         break;
2240
      case GL_TEXTURE_MATRIX:
2241
         for (i=0;i<16;i++) {
2242
            params[i] = (GLdouble) ctx->TextureMatrixStack[texUnit].Top->m[i];
2243
         }
2244
         break;
2245
      case GL_TEXTURE_STACK_DEPTH:
2246
         *params = (GLdouble) (ctx->TextureMatrixStack[texUnit].Depth + 1);
2247
         break;
2248
      case GL_UNPACK_ALIGNMENT:
2249
         *params = (GLdouble) ctx->Unpack.Alignment;
2250
         break;
2251
      case GL_UNPACK_LSB_FIRST:
2252
         *params = (GLdouble) ctx->Unpack.LsbFirst;
2253
         break;
2254
      case GL_UNPACK_ROW_LENGTH:
2255
         *params = (GLdouble) ctx->Unpack.RowLength;
2256
         break;
2257
      case GL_UNPACK_SKIP_PIXELS:
2258
         *params = (GLdouble) ctx->Unpack.SkipPixels;
2259
         break;
2260
      case GL_UNPACK_SKIP_ROWS:
2261
         *params = (GLdouble) ctx->Unpack.SkipRows;
2262
         break;
2263
      case GL_UNPACK_SWAP_BYTES:
2264
         *params = (GLdouble) ctx->Unpack.SwapBytes;
2265
         break;
2266
      case GL_UNPACK_SKIP_IMAGES_EXT:
2267
         *params = (GLdouble) ctx->Unpack.SkipImages;
2268
         break;
2269
      case GL_UNPACK_IMAGE_HEIGHT_EXT:
2270
         *params = (GLdouble) ctx->Unpack.ImageHeight;
2271
         break;
2272
      case GL_UNPACK_CLIENT_STORAGE_APPLE:
2273
         *params = (GLdouble) ctx->Unpack.ClientStorage;
2274
         break;
2275
      case GL_VIEWPORT:
2276
         params[0] = (GLdouble) ctx->Viewport.X;
2277
         params[1] = (GLdouble) ctx->Viewport.Y;
2278
         params[2] = (GLdouble) ctx->Viewport.Width;
2279
         params[3] = (GLdouble) ctx->Viewport.Height;
2280
         break;
2281
      case GL_ZOOM_X:
2282
         *params = (GLdouble) ctx->Pixel.ZoomX;
2283
         break;
2284
      case GL_ZOOM_Y:
2285
         *params = (GLdouble) ctx->Pixel.ZoomY;
2286
         break;
2287
      case GL_VERTEX_ARRAY:
2288
         *params = (GLdouble) ctx->Array.Vertex.Enabled;
2289
         break;
2290
      case GL_VERTEX_ARRAY_SIZE:
2291
         *params = (GLdouble) ctx->Array.Vertex.Size;
2292
         break;
2293
      case GL_VERTEX_ARRAY_TYPE:
2294
         *params = ENUM_TO_DOUBLE(ctx->Array.Vertex.Type);
2295
         break;
2296
      case GL_VERTEX_ARRAY_STRIDE:
2297
         *params = (GLdouble) ctx->Array.Vertex.Stride;
2298
         break;
2299
      case GL_VERTEX_ARRAY_COUNT_EXT:
2300
         *params = 0.0;
2301
         break;
2302
      case GL_NORMAL_ARRAY:
2303
         *params = (GLdouble) ctx->Array.Normal.Enabled;
2304
         break;
2305
      case GL_NORMAL_ARRAY_TYPE:
2306
         *params = ENUM_TO_DOUBLE(ctx->Array.Normal.Type);
2307
         break;
2308
      case GL_NORMAL_ARRAY_STRIDE:
2309
         *params = (GLdouble) ctx->Array.Normal.Stride;
2310
         break;
2311
      case GL_NORMAL_ARRAY_COUNT_EXT:
2312
         *params = 0.0;
2313
         break;
2314
      case GL_COLOR_ARRAY:
2315
         *params = (GLdouble) ctx->Array.Color.Enabled;
2316
         break;
2317
      case GL_COLOR_ARRAY_SIZE:
2318
         *params = (GLdouble) ctx->Array.Color.Size;
2319
         break;
2320
      case GL_COLOR_ARRAY_TYPE:
2321
         *params = ENUM_TO_DOUBLE(ctx->Array.Color.Type);
2322
         break;
2323
      case GL_COLOR_ARRAY_STRIDE:
2324
         *params = (GLdouble) ctx->Array.Color.Stride;
2325
         break;
2326
      case GL_COLOR_ARRAY_COUNT_EXT:
2327
         *params = 0.0;
2328
         break;
2329
      case GL_INDEX_ARRAY:
2330
         *params = (GLdouble) ctx->Array.Index.Enabled;
2331
         break;
2332
      case GL_INDEX_ARRAY_TYPE:
2333
         *params = ENUM_TO_DOUBLE(ctx->Array.Index.Type);
2334
         break;
2335
      case GL_INDEX_ARRAY_STRIDE:
2336
         *params = (GLdouble) ctx->Array.Index.Stride;
2337
         break;
2338
      case GL_INDEX_ARRAY_COUNT_EXT:
2339
         *params = 0.0;
2340
         break;
2341
      case GL_TEXTURE_COORD_ARRAY:
2342
         *params = (GLdouble) ctx->Array.TexCoord[texUnit].Enabled;
2343
         break;
2344
      case GL_TEXTURE_COORD_ARRAY_SIZE:
2345
         *params = (GLdouble) ctx->Array.TexCoord[texUnit].Size;
2346
         break;
2347
      case GL_TEXTURE_COORD_ARRAY_TYPE:
2348
         *params = ENUM_TO_DOUBLE(ctx->Array.TexCoord[texUnit].Type);
2349
         break;
2350
      case GL_TEXTURE_COORD_ARRAY_STRIDE:
2351
         *params = (GLdouble) ctx->Array.TexCoord[texUnit].Stride;
2352
         break;
2353
      case GL_TEXTURE_COORD_ARRAY_COUNT_EXT:
2354
         *params = 0.0;
2355
         break;
2356
      case GL_EDGE_FLAG_ARRAY:
2357
         *params = (GLdouble) ctx->Array.EdgeFlag.Enabled;
2358
         break;
2359
      case GL_EDGE_FLAG_ARRAY_STRIDE:
2360
         *params = (GLdouble) ctx->Array.EdgeFlag.Stride;
2361
         break;
2362
      case GL_EDGE_FLAG_ARRAY_COUNT_EXT:
2363
         *params = 0.0;
2364
         break;
2365
 
2366
      /* GL_ARB_multitexture */
2367
      case GL_MAX_TEXTURE_UNITS_ARB:
2368
         CHECK_EXTENSION_D(ARB_multitexture, pname);
2369
         *params = (GLdouble) ctx->Const.MaxTextureUnits;
2370
         break;
2371
      case GL_ACTIVE_TEXTURE_ARB:
2372
         CHECK_EXTENSION_D(ARB_multitexture, pname);
2373
         *params = (GLdouble) (GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit);
2374
         break;
2375
      case GL_CLIENT_ACTIVE_TEXTURE_ARB:
2376
         CHECK_EXTENSION_D(ARB_multitexture, pname);
2377
         *params = (GLdouble) (GL_TEXTURE0_ARB + ctx->Array.ActiveTexture);
2378
         break;
2379
 
2380
      /* GL_ARB_texture_cube_map */
2381
      case GL_TEXTURE_CUBE_MAP_ARB:
2382
         CHECK_EXTENSION_D(ARB_texture_cube_map, pname);
2383
         *params = (GLdouble) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
2384
         break;
2385
      case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
2386
         CHECK_EXTENSION_D(ARB_texture_cube_map, pname);
2387
         *params = (GLdouble) textureUnit->CurrentCubeMap->Name;
2388
         break;
2389
      case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
2390
         CHECK_EXTENSION_D(ARB_texture_cube_map, pname);
2391
         *params = (GLdouble) (1 << (ctx->Const.MaxCubeTextureLevels - 1));
2392
         break;
2393
 
2394
      /* GL_ARB_texture_compression */
2395
      case GL_TEXTURE_COMPRESSION_HINT_ARB:
2396
         CHECK_EXTENSION_D(ARB_texture_compression, pname);
2397
         *params = (GLdouble) ctx->Hint.TextureCompression;
2398
         break;
2399
      case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
2400
         CHECK_EXTENSION_D(ARB_texture_compression, pname);
2401
         *params = (GLdouble) _mesa_get_compressed_formats(ctx, NULL);
2402
         break;
2403
      case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
2404
         CHECK_EXTENSION_D(ARB_texture_compression, pname);
2405
         {
2406
            GLint formats[100];
2407
            GLuint i, n;
2408
            n = _mesa_get_compressed_formats(ctx, formats);
2409
            for (i = 0; i < n; i++)
2410
               params[i] = (GLdouble) formats[i];
2411
         }
2412
         break;
2413
 
2414
      /* GL_EXT_compiled_vertex_array */
2415
      case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT:
2416
         *params = (GLdouble) ctx->Array.LockFirst;
2417
         break;
2418
      case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT:
2419
         *params = (GLdouble) ctx->Array.LockCount;
2420
         break;
2421
 
2422
      /* GL_ARB_transpose_matrix */
2423
      case GL_TRANSPOSE_COLOR_MATRIX_ARB:
2424
         {
2425
            GLfloat tm[16];
2426
            GLuint i;
2427
            _math_transposef(tm, ctx->ColorMatrixStack.Top->m);
2428
            for (i=0;i<16;i++) {
2429
               params[i] = (GLdouble) tm[i];
2430
            }
2431
         }
2432
         break;
2433
      case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB:
2434
         {
2435
            GLfloat tm[16];
2436
            GLuint i;
2437
            _math_transposef(tm, ctx->ModelviewMatrixStack.Top->m);
2438
            for (i=0;i<16;i++) {
2439
               params[i] = (GLdouble) tm[i];
2440
            }
2441
         }
2442
         break;
2443
      case GL_TRANSPOSE_PROJECTION_MATRIX_ARB:
2444
         {
2445
            GLfloat tm[16];
2446
            GLuint i;
2447
            _math_transposef(tm, ctx->ProjectionMatrixStack.Top->m);
2448
            for (i=0;i<16;i++) {
2449
               params[i] = (GLdouble) tm[i];
2450
            }
2451
         }
2452
         break;
2453
      case GL_TRANSPOSE_TEXTURE_MATRIX_ARB:
2454
         {
2455
            GLfloat tm[16];
2456
            GLuint i;
2457
            _math_transposef(tm, ctx->TextureMatrixStack[texUnit].Top->m);
2458
            for (i=0;i<16;i++) {
2459
               params[i] = (GLdouble) tm[i];
2460
            }
2461
         }
2462
         break;
2463
 
2464
      /* GL_HP_occlusion_test */
2465
      case GL_OCCLUSION_TEST_HP:
2466
         CHECK_EXTENSION_D(HP_occlusion_test, pname);
2467
         *params = (GLdouble) ctx->Depth.OcclusionTest;
2468
         break;
2469
      case GL_OCCLUSION_TEST_RESULT_HP:
2470
         CHECK_EXTENSION_D(HP_occlusion_test, pname);
2471
         if (ctx->Depth.OcclusionTest)
2472
            *params = (GLdouble) ctx->OcclusionResult;
2473
         else
2474
            *params = (GLdouble) ctx->OcclusionResultSaved;
2475
         /* reset flag now */
2476
         ctx->OcclusionResult = GL_FALSE;
2477
         ctx->OcclusionResultSaved = GL_FALSE;
2478
         break;
2479
 
2480
      /* GL_SGIS_pixel_texture */
2481
      case GL_PIXEL_TEXTURE_SGIS:
2482
         *params = (GLdouble) ctx->Pixel.PixelTextureEnabled;
2483
         break;
2484
 
2485
      /* GL_SGIX_pixel_texture */
2486
      case GL_PIXEL_TEX_GEN_SGIX:
2487
         *params = (GLdouble) ctx->Pixel.PixelTextureEnabled;
2488
         break;
2489
      case GL_PIXEL_TEX_GEN_MODE_SGIX:
2490
         *params = (GLdouble) pixel_texgen_mode(ctx);
2491
         break;
2492
 
2493
      /* GL_SGI_color_matrix (also in 1.2 imaging) */
2494
      case GL_COLOR_MATRIX_SGI:
2495
         for (i=0;i<16;i++) {
2496
            params[i] = (GLdouble) ctx->ColorMatrixStack.Top->m[i];
2497
         }
2498
         break;
2499
      case GL_COLOR_MATRIX_STACK_DEPTH_SGI:
2500
         *params = (GLdouble) (ctx->ColorMatrixStack.Depth + 1);
2501
         break;
2502
      case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI:
2503
         *params = (GLdouble) MAX_COLOR_STACK_DEPTH;
2504
         break;
2505
      case GL_POST_COLOR_MATRIX_RED_SCALE_SGI:
2506
         *params = (GLdouble) ctx->Pixel.PostColorMatrixScale[0];
2507
         break;
2508
      case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI:
2509
         *params = (GLdouble) ctx->Pixel.PostColorMatrixScale[1];
2510
         break;
2511
      case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI:
2512
         *params = (GLdouble) ctx->Pixel.PostColorMatrixScale[2];
2513
         break;
2514
      case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI:
2515
         *params = (GLdouble) ctx->Pixel.PostColorMatrixScale[3];
2516
         break;
2517
      case GL_POST_COLOR_MATRIX_RED_BIAS_SGI:
2518
         *params = (GLdouble) ctx->Pixel.PostColorMatrixBias[0];
2519
         break;
2520
      case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI:
2521
         *params = (GLdouble) ctx->Pixel.PostColorMatrixBias[1];
2522
         break;
2523
      case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI:
2524
         *params = (GLdouble) ctx->Pixel.PostColorMatrixBias[2];
2525
         break;
2526
      case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI:
2527
         *params = (GLdouble) ctx->Pixel.PostColorMatrixBias[3];
2528
         break;
2529
 
2530
      /* GL_EXT_convolution (also in 1.2 imaging) */
2531
      case GL_CONVOLUTION_1D_EXT:
2532
         CHECK_EXTENSION_D(EXT_convolution, pname);
2533
         *params = (GLdouble) ctx->Pixel.Convolution1DEnabled;
2534
         break;
2535
      case GL_CONVOLUTION_2D:
2536
         CHECK_EXTENSION_D(EXT_convolution, pname);
2537
         *params = (GLdouble) ctx->Pixel.Convolution2DEnabled;
2538
         break;
2539
      case GL_SEPARABLE_2D:
2540
         CHECK_EXTENSION_D(EXT_convolution, pname);
2541
         *params = (GLdouble) ctx->Pixel.Separable2DEnabled;
2542
         break;
2543
      case GL_POST_CONVOLUTION_RED_SCALE_EXT:
2544
         CHECK_EXTENSION_D(EXT_convolution, pname);
2545
         *params = (GLdouble) ctx->Pixel.PostConvolutionScale[0];
2546
         break;
2547
      case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:
2548
         CHECK_EXTENSION_D(EXT_convolution, pname);
2549
         *params = (GLdouble) ctx->Pixel.PostConvolutionScale[1];
2550
         break;
2551
      case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:
2552
         CHECK_EXTENSION_D(EXT_convolution, pname);
2553
         *params = (GLdouble) ctx->Pixel.PostConvolutionScale[2];
2554
         break;
2555
      case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:
2556
         CHECK_EXTENSION_D(EXT_convolution, pname);
2557
         *params = (GLdouble) ctx->Pixel.PostConvolutionScale[3];
2558
         break;
2559
      case GL_POST_CONVOLUTION_RED_BIAS_EXT:
2560
         CHECK_EXTENSION_D(EXT_convolution, pname);
2561
         *params = (GLdouble) ctx->Pixel.PostConvolutionBias[0];
2562
         break;
2563
      case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:
2564
         CHECK_EXTENSION_D(EXT_convolution, pname);
2565
         *params = (GLdouble) ctx->Pixel.PostConvolutionBias[1];
2566
         break;
2567
      case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:
2568
         CHECK_EXTENSION_D(EXT_convolution, pname);
2569
         *params = (GLdouble) ctx->Pixel.PostConvolutionBias[2];
2570
         break;
2571
      case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:
2572
         CHECK_EXTENSION_D(EXT_convolution, pname);
2573
         *params = (GLdouble) ctx->Pixel.PostConvolutionBias[2];
2574
         break;
2575
 
2576
      /* GL_EXT_histogram (also in 1.2 imaging) */
2577
      case GL_HISTOGRAM:
2578
         CHECK_EXTENSION_D(EXT_histogram, pname);
2579
         *params = (GLdouble) ctx->Pixel.HistogramEnabled;
2580
         break;
2581
      case GL_MINMAX:
2582
         CHECK_EXTENSION_D(EXT_histogram, pname);
2583
         *params = (GLdouble) ctx->Pixel.MinMaxEnabled;
2584
         break;
2585
 
2586
      /* GL_SGI_color_table (also in 1.2 imaging */
2587
      case GL_COLOR_TABLE_SGI:
2588
         *params = (GLdouble) ctx->Pixel.ColorTableEnabled;
2589
         break;
2590
      case GL_POST_CONVOLUTION_COLOR_TABLE_SGI:
2591
         *params = (GLdouble) ctx->Pixel.PostConvolutionColorTableEnabled;
2592
         break;
2593
      case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
2594
         *params = (GLdouble) ctx->Pixel.PostColorMatrixColorTableEnabled;
2595
         break;
2596
 
2597
      /* GL_EXT_secondary_color */
2598
      case GL_COLOR_SUM_EXT:
2599
         CHECK_EXTENSION_D(EXT_secondary_color, pname);
2600
         *params = (GLdouble) ctx->Fog.ColorSumEnabled;
2601
         break;
2602
      case GL_CURRENT_SECONDARY_COLOR_EXT:
2603
         CHECK_EXTENSION_D(EXT_secondary_color, pname);
2604
         FLUSH_CURRENT(ctx, 0);
2605
         params[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0];
2606
         params[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1];
2607
         params[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2];
2608
         break;
2609
      case GL_SECONDARY_COLOR_ARRAY_EXT:
2610
         CHECK_EXTENSION_D(EXT_secondary_color, pname);
2611
         *params = (GLdouble) ctx->Array.SecondaryColor.Enabled;
2612
         break;
2613
      case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT:
2614
         CHECK_EXTENSION_D(EXT_secondary_color, pname);
2615
         *params = (GLdouble) ctx->Array.SecondaryColor.Type;
2616
         break;
2617
      case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT:
2618
         CHECK_EXTENSION_D(EXT_secondary_color, pname);
2619
         *params = (GLdouble) ctx->Array.SecondaryColor.Stride;
2620
         break;
2621
      case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT:
2622
         CHECK_EXTENSION_D(EXT_secondary_color, pname);
2623
         *params = (GLdouble) ctx->Array.SecondaryColor.Stride;
2624
         break;
2625
 
2626
      /* GL_EXT_fog_coord */
2627
      case GL_CURRENT_FOG_COORDINATE_EXT:
2628
         CHECK_EXTENSION_D(EXT_fog_coord, pname);
2629
         FLUSH_CURRENT(ctx, 0);
2630
         *params = (GLdouble) ctx->Current.Attrib[VERT_ATTRIB_FOG][0];
2631
         break;
2632
      case GL_FOG_COORDINATE_ARRAY_EXT:
2633
         CHECK_EXTENSION_D(EXT_fog_coord, pname);
2634
         *params = (GLdouble) ctx->Array.FogCoord.Enabled;
2635
         break;
2636
      case GL_FOG_COORDINATE_ARRAY_TYPE_EXT:
2637
         CHECK_EXTENSION_D(EXT_fog_coord, pname);
2638
         *params = (GLdouble) ctx->Array.FogCoord.Type;
2639
         break;
2640
      case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT:
2641
         CHECK_EXTENSION_D(EXT_fog_coord, pname);
2642
         *params = (GLdouble) ctx->Array.FogCoord.Stride;
2643
         break;
2644
 
2645
      /* GL_EXT_texture_lod_bias */
2646
      case GL_MAX_TEXTURE_LOD_BIAS_EXT:
2647
         *params = (GLdouble) ctx->Const.MaxTextureLodBias;
2648
         break;
2649
 
2650
      /* GL_EXT_texture_filter_anisotropic */
2651
      case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
2652
         CHECK_EXTENSION_D(EXT_texture_filter_anisotropic, pname);
2653
         *params = (GLdouble) ctx->Const.MaxTextureMaxAnisotropy;
2654
         break;
2655
 
2656
      /* GL_ARB_multisample */
2657
      case GL_MULTISAMPLE_ARB:
2658
         CHECK_EXTENSION_D(ARB_multisample, pname);
2659
         *params = (GLdouble) ctx->Multisample.Enabled;
2660
         break;
2661
      case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
2662
         CHECK_EXTENSION_D(ARB_multisample, pname);
2663
         *params = (GLdouble) ctx->Multisample.SampleAlphaToCoverage;
2664
         break;
2665
      case GL_SAMPLE_ALPHA_TO_ONE_ARB:
2666
         CHECK_EXTENSION_D(ARB_multisample, pname);
2667
         *params = (GLdouble) ctx->Multisample.SampleAlphaToOne;
2668
         break;
2669
      case GL_SAMPLE_COVERAGE_ARB:
2670
         CHECK_EXTENSION_D(ARB_multisample, pname);
2671
         *params = (GLdouble) ctx->Multisample.SampleCoverage;
2672
         break;
2673
      case GL_SAMPLE_COVERAGE_VALUE_ARB:
2674
         CHECK_EXTENSION_D(ARB_multisample, pname);
2675
         *params = ctx->Multisample.SampleCoverageValue;
2676
         break;
2677
      case GL_SAMPLE_COVERAGE_INVERT_ARB:
2678
         CHECK_EXTENSION_D(ARB_multisample, pname);
2679
         *params = (GLdouble) ctx->Multisample.SampleCoverageInvert;
2680
         break;
2681
      case GL_SAMPLE_BUFFERS_ARB:
2682
         CHECK_EXTENSION_D(ARB_multisample, pname);
2683
         *params = 0.0; /* XXX fix someday */
2684
         break;
2685
      case GL_SAMPLES_ARB:
2686
         CHECK_EXTENSION_D(ARB_multisample, pname);
2687
         *params = 0.0; /* XXX fix someday */
2688
         break;
2689
 
2690
      /* GL_IBM_rasterpos_clip */
2691
      case GL_RASTER_POSITION_UNCLIPPED_IBM:
2692
         CHECK_EXTENSION_D(IBM_rasterpos_clip, pname);
2693
         *params = (GLdouble) ctx->Transform.RasterPositionUnclipped;
2694
         break;
2695
 
2696
      /* GL_NV_point_sprite */
2697
      case GL_POINT_SPRITE_NV:
2698
         CHECK_EXTENSION_B(NV_point_sprite, pname);
2699
         *params = (GLdouble) ctx->Point.PointSprite;
2700
         break;
2701
      case GL_POINT_SPRITE_R_MODE_NV:
2702
         CHECK_EXTENSION_B(NV_point_sprite, pname);
2703
         *params = (GLdouble) ctx->Point.SpriteRMode;
2704
         break;
2705
 
2706
      /* GL_SGIS_generate_mipmap */
2707
      case GL_GENERATE_MIPMAP_HINT_SGIS:
2708
         CHECK_EXTENSION_D(SGIS_generate_mipmap, pname);
2709
         *params = (GLdouble) ctx->Hint.GenerateMipmap;
2710
         break;
2711
 
2712
#if FEATURE_NV_vertex_program
2713
      case GL_VERTEX_PROGRAM_NV:
2714
         CHECK_EXTENSION_D(NV_vertex_program, pname);
2715
         *params = (GLdouble) ctx->VertexProgram.Enabled;
2716
         break;
2717
      case GL_VERTEX_PROGRAM_POINT_SIZE_NV:
2718
         CHECK_EXTENSION_D(NV_vertex_program, pname);
2719
         *params = (GLdouble) ctx->VertexProgram.PointSizeEnabled;
2720
         break;
2721
      case GL_VERTEX_PROGRAM_TWO_SIDE_NV:
2722
         CHECK_EXTENSION_D(NV_vertex_program, pname);
2723
         *params = (GLdouble) ctx->VertexProgram.TwoSideEnabled;
2724
         break;
2725
      case GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV:
2726
         CHECK_EXTENSION_D(NV_vertex_program, pname);
2727
         *params = (GLdouble) MAX_PROGRAM_STACK_DEPTH;
2728
         break;
2729
      case GL_MAX_TRACK_MATRICES_NV:
2730
         CHECK_EXTENSION_D(NV_vertex_program, pname);
2731
         *params = (GLdouble) MAX_PROGRAM_MATRICES;
2732
         break;
2733
      case GL_CURRENT_MATRIX_STACK_DEPTH_NV:
2734
         CHECK_EXTENSION_D(NV_vertex_program, pname);
2735
         *params = (GLdouble) ctx->CurrentStack->Depth;
2736
         break;
2737
      case GL_CURRENT_MATRIX_NV:
2738
         CHECK_EXTENSION_D(NV_vertex_program, pname);
2739
         *params = (GLdouble) ctx->Transform.MatrixMode;
2740
         break;
2741
      case GL_VERTEX_PROGRAM_BINDING_NV:
2742
         CHECK_EXTENSION_D(NV_vertex_program, pname);
2743
         *params = (GLdouble) ctx->VertexProgram.CurrentID;
2744
         break;
2745
      case GL_PROGRAM_ERROR_POSITION_NV:
2746
         CHECK_EXTENSION_D(NV_vertex_program, pname);
2747
         *params = (GLdouble) ctx->VertexProgram.ErrorPos;
2748
         break;
2749
      case GL_VERTEX_ATTRIB_ARRAY0_NV:
2750
      case GL_VERTEX_ATTRIB_ARRAY1_NV:
2751
      case GL_VERTEX_ATTRIB_ARRAY2_NV:
2752
      case GL_VERTEX_ATTRIB_ARRAY3_NV:
2753
      case GL_VERTEX_ATTRIB_ARRAY4_NV:
2754
      case GL_VERTEX_ATTRIB_ARRAY5_NV:
2755
      case GL_VERTEX_ATTRIB_ARRAY6_NV:
2756
      case GL_VERTEX_ATTRIB_ARRAY7_NV:
2757
      case GL_VERTEX_ATTRIB_ARRAY8_NV:
2758
      case GL_VERTEX_ATTRIB_ARRAY9_NV:
2759
      case GL_VERTEX_ATTRIB_ARRAY10_NV:
2760
      case GL_VERTEX_ATTRIB_ARRAY11_NV:
2761
      case GL_VERTEX_ATTRIB_ARRAY12_NV:
2762
      case GL_VERTEX_ATTRIB_ARRAY13_NV:
2763
      case GL_VERTEX_ATTRIB_ARRAY14_NV:
2764
      case GL_VERTEX_ATTRIB_ARRAY15_NV:
2765
         CHECK_EXTENSION_D(NV_vertex_program, pname);
2766
         {
2767
            GLuint n = (GLuint) pname - GL_VERTEX_ATTRIB_ARRAY0_NV;
2768
            *params = (GLdouble) ctx->Array.VertexAttrib[n].Enabled;
2769
         }
2770
         break;
2771
      case GL_MAP1_VERTEX_ATTRIB0_4_NV:
2772
      case GL_MAP1_VERTEX_ATTRIB1_4_NV:
2773
      case GL_MAP1_VERTEX_ATTRIB2_4_NV:
2774
      case GL_MAP1_VERTEX_ATTRIB3_4_NV:
2775
      case GL_MAP1_VERTEX_ATTRIB4_4_NV:
2776
      case GL_MAP1_VERTEX_ATTRIB5_4_NV:
2777
      case GL_MAP1_VERTEX_ATTRIB6_4_NV:
2778
      case GL_MAP1_VERTEX_ATTRIB7_4_NV:
2779
      case GL_MAP1_VERTEX_ATTRIB8_4_NV:
2780
      case GL_MAP1_VERTEX_ATTRIB9_4_NV:
2781
      case GL_MAP1_VERTEX_ATTRIB10_4_NV:
2782
      case GL_MAP1_VERTEX_ATTRIB11_4_NV:
2783
      case GL_MAP1_VERTEX_ATTRIB12_4_NV:
2784
      case GL_MAP1_VERTEX_ATTRIB13_4_NV:
2785
      case GL_MAP1_VERTEX_ATTRIB14_4_NV:
2786
      case GL_MAP1_VERTEX_ATTRIB15_4_NV:
2787
         CHECK_EXTENSION_B(NV_vertex_program, pname);
2788
         {
2789
            GLuint n = (GLuint) pname - GL_MAP1_VERTEX_ATTRIB0_4_NV;
2790
            *params = (GLdouble) ctx->Eval.Map1Attrib[n];
2791
         }
2792
         break;
2793
      case GL_MAP2_VERTEX_ATTRIB0_4_NV:
2794
      case GL_MAP2_VERTEX_ATTRIB1_4_NV:
2795
      case GL_MAP2_VERTEX_ATTRIB2_4_NV:
2796
      case GL_MAP2_VERTEX_ATTRIB3_4_NV:
2797
      case GL_MAP2_VERTEX_ATTRIB4_4_NV:
2798
      case GL_MAP2_VERTEX_ATTRIB5_4_NV:
2799
      case GL_MAP2_VERTEX_ATTRIB6_4_NV:
2800
      case GL_MAP2_VERTEX_ATTRIB7_4_NV:
2801
      case GL_MAP2_VERTEX_ATTRIB8_4_NV:
2802
      case GL_MAP2_VERTEX_ATTRIB9_4_NV:
2803
      case GL_MAP2_VERTEX_ATTRIB10_4_NV:
2804
      case GL_MAP2_VERTEX_ATTRIB11_4_NV:
2805
      case GL_MAP2_VERTEX_ATTRIB12_4_NV:
2806
      case GL_MAP2_VERTEX_ATTRIB13_4_NV:
2807
      case GL_MAP2_VERTEX_ATTRIB14_4_NV:
2808
      case GL_MAP2_VERTEX_ATTRIB15_4_NV:
2809
         CHECK_EXTENSION_B(NV_vertex_program, pname);
2810
         {
2811
            GLuint n = (GLuint) pname - GL_MAP2_VERTEX_ATTRIB0_4_NV;
2812
            *params = (GLdouble) ctx->Eval.Map2Attrib[n];
2813
         }
2814
         break;
2815
#endif /* FEATURE_NV_vertex_program */
2816
 
2817
      /* GL_NV_texture_rectangle */
2818
      case GL_TEXTURE_RECTANGLE_NV:
2819
         CHECK_EXTENSION_D(NV_texture_rectangle, pname);
2820
         *params = (GLdouble) _mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV);
2821
         break;
2822
      case GL_TEXTURE_BINDING_RECTANGLE_NV:
2823
         CHECK_EXTENSION_D(NV_texture_rectangle, pname);
2824
         *params = (GLdouble) textureUnit->CurrentRect->Name;
2825
         break;
2826
      case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV:
2827
         CHECK_EXTENSION_D(NV_texture_rectangle, pname);
2828
         *params = (GLdouble) ctx->Const.MaxTextureRectSize;
2829
         break;
2830
 
2831
      /* GL_EXT_stencil_two_side */
2832
      case GL_STENCIL_TEST_TWO_SIDE_EXT:
2833
         CHECK_EXTENSION_D(EXT_stencil_two_side, pname);
2834
         *params = (GLdouble) ctx->Stencil.TestTwoSide;
2835
         break;
2836
      case GL_ACTIVE_STENCIL_FACE_EXT:
2837
         CHECK_EXTENSION_D(EXT_stencil_two_side, pname);
2838
         *params = (GLdouble) (ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT);
2839
         break;
2840
 
2841
      default:
2842
         _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev(pname=0x%x)", pname);
2843
   }
2844
}
2845
 
2846
 
2847
void
2848
_mesa_GetFloatv( GLenum pname, GLfloat *params )
2849
{
2850
   GET_CURRENT_CONTEXT(ctx);
2851
   GLuint i;
2852
   GLuint texUnit = ctx->Texture.CurrentUnit;
2853
   const struct gl_texture_unit *textureUnit = &ctx->Texture.Unit[texUnit];
2854
   ASSERT_OUTSIDE_BEGIN_END(ctx);
2855
 
2856
   if (!params)
2857
      return;
2858
 
2859
   /* We need this in order to get correct results for
2860
    * GL_OCCLUSION_TEST_RESULT_HP.  There might be other important cases.
2861
    */
2862
   FLUSH_VERTICES(ctx, 0);
2863
 
2864
   if (MESA_VERBOSE & VERBOSE_API)
2865
      _mesa_debug(ctx, "glGetFloatv %s\n", _mesa_lookup_enum_by_nr(pname));
2866
 
2867
   if (ctx->Driver.GetFloatv && (*ctx->Driver.GetFloatv)(ctx, pname, params))
2868
      return;
2869
 
2870
   switch (pname) {
2871
      case GL_ACCUM_RED_BITS:
2872
         *params = (GLfloat) ctx->Visual.accumRedBits;
2873
         break;
2874
      case GL_ACCUM_GREEN_BITS:
2875
         *params = (GLfloat) ctx->Visual.accumGreenBits;
2876
         break;
2877
      case GL_ACCUM_BLUE_BITS:
2878
         *params = (GLfloat) ctx->Visual.accumBlueBits;
2879
         break;
2880
      case GL_ACCUM_ALPHA_BITS:
2881
         *params = (GLfloat) ctx->Visual.accumAlphaBits;
2882
         break;
2883
      case GL_ACCUM_CLEAR_VALUE:
2884
         params[0] = ctx->Accum.ClearColor[0];
2885
         params[1] = ctx->Accum.ClearColor[1];
2886
         params[2] = ctx->Accum.ClearColor[2];
2887
         params[3] = ctx->Accum.ClearColor[3];
2888
         break;
2889
      case GL_ALPHA_BIAS:
2890
         *params = ctx->Pixel.AlphaBias;
2891
         break;
2892
      case GL_ALPHA_BITS:
2893
         *params = (GLfloat) ctx->Visual.alphaBits;
2894
         break;
2895
      case GL_ALPHA_SCALE:
2896
         *params = ctx->Pixel.AlphaScale;
2897
         break;
2898
      case GL_ALPHA_TEST:
2899
         *params = (GLfloat) ctx->Color.AlphaEnabled;
2900
         break;
2901
      case GL_ALPHA_TEST_FUNC:
2902
         *params = ENUM_TO_FLOAT(ctx->Color.AlphaFunc);
2903
         break;
2904
      case GL_ALPHA_TEST_REF:
2905
         *params = (GLfloat) ctx->Color.AlphaRef;
2906
         break;
2907
      case GL_ATTRIB_STACK_DEPTH:
2908
         *params = (GLfloat) (ctx->AttribStackDepth);
2909
         break;
2910
      case GL_AUTO_NORMAL:
2911
         *params = (GLfloat) ctx->Eval.AutoNormal;
2912
         break;
2913
      case GL_AUX_BUFFERS:
2914
         *params = (GLfloat) ctx->Const.NumAuxBuffers;
2915
         break;
2916
      case GL_BLEND:
2917
         *params = (GLfloat) ctx->Color.BlendEnabled;
2918
         break;
2919
      case GL_BLEND_DST:
2920
         *params = ENUM_TO_FLOAT(ctx->Color.BlendDstRGB);
2921
         break;
2922
      case GL_BLEND_SRC:
2923
         *params = ENUM_TO_FLOAT(ctx->Color.BlendSrcRGB);
2924
         break;
2925
      case GL_BLEND_SRC_RGB_EXT:
2926
         *params = ENUM_TO_FLOAT(ctx->Color.BlendSrcRGB);
2927
         break;
2928
      case GL_BLEND_DST_RGB_EXT:
2929
         *params = ENUM_TO_FLOAT(ctx->Color.BlendDstRGB);
2930
         break;
2931
      case GL_BLEND_SRC_ALPHA_EXT:
2932
         *params = ENUM_TO_FLOAT(ctx->Color.BlendSrcA);
2933
         break;
2934
      case GL_BLEND_DST_ALPHA_EXT:
2935
         *params = ENUM_TO_FLOAT(ctx->Color.BlendDstA);
2936
         break;
2937
      case GL_BLEND_EQUATION_EXT:
2938
         *params = ENUM_TO_FLOAT(ctx->Color.BlendEquation);
2939
         break;
2940
      case GL_BLEND_COLOR_EXT:
2941
         params[0] = ctx->Color.BlendColor[0];
2942
         params[1] = ctx->Color.BlendColor[1];
2943
         params[2] = ctx->Color.BlendColor[2];
2944
         params[3] = ctx->Color.BlendColor[3];
2945
         break;
2946
      case GL_BLUE_BIAS:
2947
         *params = ctx->Pixel.BlueBias;
2948
         break;
2949
      case GL_BLUE_BITS:
2950
         *params = (GLfloat) ctx->Visual.blueBits;
2951
         break;
2952
      case GL_BLUE_SCALE:
2953
         *params = ctx->Pixel.BlueScale;
2954
         break;
2955
      case GL_CLIENT_ATTRIB_STACK_DEPTH:
2956
         *params = (GLfloat) (ctx->ClientAttribStackDepth);
2957
         break;
2958
      case GL_CLIP_PLANE0:
2959
      case GL_CLIP_PLANE1:
2960
      case GL_CLIP_PLANE2:
2961
      case GL_CLIP_PLANE3:
2962
      case GL_CLIP_PLANE4:
2963
      case GL_CLIP_PLANE5:
2964
         if (ctx->Transform.ClipPlanesEnabled & (1 << (pname - GL_CLIP_PLANE0)))
2965
            *params = 1.0;
2966
         else
2967
            *params = 0.0;
2968
         break;
2969
      case GL_COLOR_CLEAR_VALUE:
2970
         params[0] = ctx->Color.ClearColor[0];
2971
         params[1] = ctx->Color.ClearColor[1];
2972
         params[2] = ctx->Color.ClearColor[2];
2973
         params[3] = ctx->Color.ClearColor[3];
2974
         break;
2975
      case GL_COLOR_MATERIAL:
2976
         *params = (GLfloat) ctx->Light.ColorMaterialEnabled;
2977
         break;
2978
      case GL_COLOR_MATERIAL_FACE:
2979
         *params = ENUM_TO_FLOAT(ctx->Light.ColorMaterialFace);
2980
         break;
2981
      case GL_COLOR_MATERIAL_PARAMETER:
2982
         *params = ENUM_TO_FLOAT(ctx->Light.ColorMaterialMode);
2983
         break;
2984
      case GL_COLOR_WRITEMASK:
2985
         params[0] = ctx->Color.ColorMask[RCOMP] ? 1.0F : 0.0F;
2986
         params[1] = ctx->Color.ColorMask[GCOMP] ? 1.0F : 0.0F;
2987
         params[2] = ctx->Color.ColorMask[BCOMP] ? 1.0F : 0.0F;
2988
         params[3] = ctx->Color.ColorMask[ACOMP] ? 1.0F : 0.0F;
2989
         break;
2990
      case GL_CULL_FACE:
2991
         *params = (GLfloat) ctx->Polygon.CullFlag;
2992
         break;
2993
      case GL_CULL_FACE_MODE:
2994
         *params = ENUM_TO_FLOAT(ctx->Polygon.CullFaceMode);
2995
         break;
2996
      case GL_CURRENT_COLOR:
2997
         FLUSH_CURRENT(ctx, 0);
2998
         params[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0];
2999
         params[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1];
3000
         params[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2];
3001
         params[3] = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3];
3002
         break;
3003
      case GL_CURRENT_INDEX:
3004
         FLUSH_CURRENT(ctx, 0);
3005
         *params = (GLfloat) ctx->Current.Index;
3006
         break;
3007
      case GL_CURRENT_NORMAL:
3008
         FLUSH_CURRENT(ctx, 0);
3009
         params[0] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0];
3010
         params[1] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1];
3011
         params[2] = ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2];
3012
         break;
3013
      case GL_CURRENT_RASTER_COLOR:
3014
         params[0] = ctx->Current.RasterColor[0];
3015
         params[1] = ctx->Current.RasterColor[1];
3016
         params[2] = ctx->Current.RasterColor[2];
3017
         params[3] = ctx->Current.RasterColor[3];
3018
         break;
3019
      case GL_CURRENT_RASTER_DISTANCE:
3020
         params[0] = ctx->Current.RasterDistance;
3021
         break;
3022
      case GL_CURRENT_RASTER_INDEX:
3023
         *params = (GLfloat) ctx->Current.RasterIndex;
3024
         break;
3025
      case GL_CURRENT_RASTER_POSITION:
3026
         params[0] = ctx->Current.RasterPos[0];
3027
         params[1] = ctx->Current.RasterPos[1];
3028
         params[2] = ctx->Current.RasterPos[2];
3029
         params[3] = ctx->Current.RasterPos[3];
3030
         break;
3031
      case GL_CURRENT_RASTER_TEXTURE_COORDS:
3032
         params[0] = ctx->Current.RasterTexCoords[texUnit][0];
3033
         params[1] = ctx->Current.RasterTexCoords[texUnit][1];
3034
         params[2] = ctx->Current.RasterTexCoords[texUnit][2];
3035
         params[3] = ctx->Current.RasterTexCoords[texUnit][3];
3036
         break;
3037
      case GL_CURRENT_RASTER_POSITION_VALID:
3038
         *params = (GLfloat) ctx->Current.RasterPosValid;
3039
         break;
3040
      case GL_CURRENT_TEXTURE_COORDS:
3041
         FLUSH_CURRENT(ctx, 0);
3042
         params[0] = (GLfloat) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][0];
3043
         params[1] = (GLfloat) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][1];
3044
         params[2] = (GLfloat) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][2];
3045
         params[3] = (GLfloat) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3];
3046
         break;
3047
      case GL_DEPTH_BIAS:
3048
         *params = (GLfloat) ctx->Pixel.DepthBias;
3049
         break;
3050
      case GL_DEPTH_BITS:
3051
         *params = (GLfloat) ctx->Visual.depthBits;
3052
         break;
3053
      case GL_DEPTH_CLEAR_VALUE:
3054
         *params = (GLfloat) ctx->Depth.Clear;
3055
         break;
3056
      case GL_DEPTH_FUNC:
3057
         *params = ENUM_TO_FLOAT(ctx->Depth.Func);
3058
         break;
3059
      case GL_DEPTH_RANGE:
3060
         params[0] = (GLfloat) ctx->Viewport.Near;
3061
         params[1] = (GLfloat) ctx->Viewport.Far;
3062
         break;
3063
      case GL_DEPTH_SCALE:
3064
         *params = (GLfloat) ctx->Pixel.DepthScale;
3065
         break;
3066
      case GL_DEPTH_TEST:
3067
         *params = (GLfloat) ctx->Depth.Test;
3068
         break;
3069
      case GL_DEPTH_WRITEMASK:
3070
         *params = (GLfloat) ctx->Depth.Mask;
3071
         break;
3072
      case GL_DITHER:
3073
         *params = (GLfloat) ctx->Color.DitherFlag;
3074
         break;
3075
      case GL_DOUBLEBUFFER:
3076
         *params = (GLfloat) ctx->Visual.doubleBufferMode;
3077
         break;
3078
      case GL_DRAW_BUFFER:
3079
         *params = ENUM_TO_FLOAT(ctx->Color.DrawBuffer);
3080
         break;
3081
      case GL_EDGE_FLAG:
3082
         FLUSH_CURRENT(ctx, 0);
3083
         *params = (GLfloat) ctx->Current.EdgeFlag;
3084
         break;
3085
      case GL_FEEDBACK_BUFFER_SIZE:
3086
         *params = (GLfloat) ctx->Feedback.BufferSize;
3087
         break;
3088
      case GL_FEEDBACK_BUFFER_TYPE:
3089
         *params = ENUM_TO_FLOAT(ctx->Feedback.Type);
3090
         break;
3091
      case GL_FOG:
3092
         *params = (GLfloat) ctx->Fog.Enabled;
3093
         break;
3094
      case GL_FOG_COLOR:
3095
         params[0] = ctx->Fog.Color[0];
3096
         params[1] = ctx->Fog.Color[1];
3097
         params[2] = ctx->Fog.Color[2];
3098
         params[3] = ctx->Fog.Color[3];
3099
         break;
3100
      case GL_FOG_DENSITY:
3101
         *params = ctx->Fog.Density;
3102
         break;
3103
      case GL_FOG_END:
3104
         *params = ctx->Fog.End;
3105
         break;
3106
      case GL_FOG_HINT:
3107
         *params = ENUM_TO_FLOAT(ctx->Hint.Fog);
3108
         break;
3109
      case GL_FOG_INDEX:
3110
         *params = ctx->Fog.Index;
3111
         break;
3112
      case GL_FOG_MODE:
3113
         *params = ENUM_TO_FLOAT(ctx->Fog.Mode);
3114
         break;
3115
      case GL_FOG_START:
3116
         *params = ctx->Fog.Start;
3117
         break;
3118
      case GL_FRONT_FACE:
3119
         *params = ENUM_TO_FLOAT(ctx->Polygon.FrontFace);
3120
         break;
3121
      case GL_GREEN_BIAS:
3122
         *params = (GLfloat) ctx->Pixel.GreenBias;
3123
         break;
3124
      case GL_GREEN_BITS:
3125
         *params = (GLfloat) ctx->Visual.greenBits;
3126
         break;
3127
      case GL_GREEN_SCALE:
3128
         *params = (GLfloat) ctx->Pixel.GreenScale;
3129
         break;
3130
      case GL_INDEX_BITS:
3131
         *params = (GLfloat) ctx->Visual.indexBits;
3132
         break;
3133
      case GL_INDEX_CLEAR_VALUE:
3134
         *params = (GLfloat) ctx->Color.ClearIndex;
3135
         break;
3136
      case GL_INDEX_MODE:
3137
         *params = ctx->Visual.rgbMode ? 0.0F : 1.0F;
3138
         break;
3139
      case GL_INDEX_OFFSET:
3140
         *params = (GLfloat) ctx->Pixel.IndexOffset;
3141
         break;
3142
      case GL_INDEX_SHIFT:
3143
         *params = (GLfloat) ctx->Pixel.IndexShift;
3144
         break;
3145
      case GL_INDEX_WRITEMASK:
3146
         *params = (GLfloat) ctx->Color.IndexMask;
3147
         break;
3148
      case GL_LIGHT0:
3149
      case GL_LIGHT1:
3150
      case GL_LIGHT2:
3151
      case GL_LIGHT3:
3152
      case GL_LIGHT4:
3153
      case GL_LIGHT5:
3154
      case GL_LIGHT6:
3155
      case GL_LIGHT7:
3156
         *params = (GLfloat) ctx->Light.Light[pname-GL_LIGHT0].Enabled;
3157
         break;
3158
      case GL_LIGHTING:
3159
         *params = (GLfloat) ctx->Light.Enabled;
3160
         break;
3161
      case GL_LIGHT_MODEL_AMBIENT:
3162
         params[0] = ctx->Light.Model.Ambient[0];
3163
         params[1] = ctx->Light.Model.Ambient[1];
3164
         params[2] = ctx->Light.Model.Ambient[2];
3165
         params[3] = ctx->Light.Model.Ambient[3];
3166
         break;
3167
      case GL_LIGHT_MODEL_COLOR_CONTROL:
3168
         params[0] = ENUM_TO_FLOAT(ctx->Light.Model.ColorControl);
3169
         break;
3170
      case GL_LIGHT_MODEL_LOCAL_VIEWER:
3171
         *params = (GLfloat) ctx->Light.Model.LocalViewer;
3172
         break;
3173
      case GL_LIGHT_MODEL_TWO_SIDE:
3174
         *params = (GLfloat) ctx->Light.Model.TwoSide;
3175
         break;
3176
      case GL_LINE_SMOOTH:
3177
         *params = (GLfloat) ctx->Line.SmoothFlag;
3178
         break;
3179
      case GL_LINE_SMOOTH_HINT:
3180
         *params = ENUM_TO_FLOAT(ctx->Hint.LineSmooth);
3181
         break;
3182
      case GL_LINE_STIPPLE:
3183
         *params = (GLfloat) ctx->Line.StippleFlag;
3184
         break;
3185
      case GL_LINE_STIPPLE_PATTERN:
3186
         *params = (GLfloat) ctx->Line.StipplePattern;
3187
         break;
3188
      case GL_LINE_STIPPLE_REPEAT:
3189
         *params = (GLfloat) ctx->Line.StippleFactor;
3190
         break;
3191
      case GL_LINE_WIDTH:
3192
         *params = (GLfloat) ctx->Line.Width;
3193
         break;
3194
      case GL_LINE_WIDTH_GRANULARITY:
3195
         *params = (GLfloat) ctx->Const.LineWidthGranularity;
3196
         break;
3197
      case GL_LINE_WIDTH_RANGE:
3198
         params[0] = (GLfloat) ctx->Const.MinLineWidthAA;
3199
         params[1] = (GLfloat) ctx->Const.MaxLineWidthAA;
3200
         break;
3201
      case GL_ALIASED_LINE_WIDTH_RANGE:
3202
         params[0] = (GLfloat) ctx->Const.MinLineWidth;
3203
         params[1] = (GLfloat) ctx->Const.MaxLineWidth;
3204
         break;
3205
      case GL_LIST_BASE:
3206
         *params = (GLfloat) ctx->List.ListBase;
3207
         break;
3208
      case GL_LIST_INDEX:
3209
         *params = (GLfloat) ctx->CurrentListNum;
3210
         break;
3211
      case GL_LIST_MODE:
3212
         *params = ctx->ExecuteFlag ? ENUM_TO_FLOAT(GL_COMPILE_AND_EXECUTE)
3213
                                  : ENUM_TO_FLOAT(GL_COMPILE);
3214
         break;
3215
      case GL_INDEX_LOGIC_OP:
3216
         *params = (GLfloat) ctx->Color.IndexLogicOpEnabled;
3217
         break;
3218
      case GL_COLOR_LOGIC_OP:
3219
         *params = (GLfloat) ctx->Color.ColorLogicOpEnabled;
3220
         break;
3221
      case GL_LOGIC_OP_MODE:
3222
         *params = ENUM_TO_FLOAT(ctx->Color.LogicOp);
3223
         break;
3224
      case GL_MAP1_COLOR_4:
3225
         *params = (GLfloat) ctx->Eval.Map1Color4;
3226
         break;
3227
      case GL_MAP1_GRID_DOMAIN:
3228
         params[0] = ctx->Eval.MapGrid1u1;
3229
         params[1] = ctx->Eval.MapGrid1u2;
3230
         break;
3231
      case GL_MAP1_GRID_SEGMENTS:
3232
         *params = (GLfloat) ctx->Eval.MapGrid1un;
3233
         break;
3234
      case GL_MAP1_INDEX:
3235
         *params = (GLfloat) ctx->Eval.Map1Index;
3236
         break;
3237
      case GL_MAP1_NORMAL:
3238
         *params = (GLfloat) ctx->Eval.Map1Normal;
3239
         break;
3240
      case GL_MAP1_TEXTURE_COORD_1:
3241
         *params = (GLfloat) ctx->Eval.Map1TextureCoord1;
3242
         break;
3243
      case GL_MAP1_TEXTURE_COORD_2:
3244
         *params = (GLfloat) ctx->Eval.Map1TextureCoord2;
3245
         break;
3246
      case GL_MAP1_TEXTURE_COORD_3:
3247
         *params = (GLfloat) ctx->Eval.Map1TextureCoord3;
3248
         break;
3249
      case GL_MAP1_TEXTURE_COORD_4:
3250
         *params = (GLfloat) ctx->Eval.Map1TextureCoord4;
3251
         break;
3252
      case GL_MAP1_VERTEX_3:
3253
         *params = (GLfloat) ctx->Eval.Map1Vertex3;
3254
         break;
3255
      case GL_MAP1_VERTEX_4:
3256
         *params = (GLfloat) ctx->Eval.Map1Vertex4;
3257
         break;
3258
      case GL_MAP2_COLOR_4:
3259
         *params = (GLfloat) ctx->Eval.Map2Color4;
3260
         break;
3261
      case GL_MAP2_GRID_DOMAIN:
3262
         params[0] = ctx->Eval.MapGrid2u1;
3263
         params[1] = ctx->Eval.MapGrid2u2;
3264
         params[2] = ctx->Eval.MapGrid2v1;
3265
         params[3] = ctx->Eval.MapGrid2v2;
3266
         break;
3267
      case GL_MAP2_GRID_SEGMENTS:
3268
         params[0] = (GLfloat) ctx->Eval.MapGrid2un;
3269
         params[1] = (GLfloat) ctx->Eval.MapGrid2vn;
3270
         break;
3271
      case GL_MAP2_INDEX:
3272
         *params = (GLfloat) ctx->Eval.Map2Index;
3273
         break;
3274
      case GL_MAP2_NORMAL:
3275
         *params = (GLfloat) ctx->Eval.Map2Normal;
3276
         break;
3277
      case GL_MAP2_TEXTURE_COORD_1:
3278
         *params = ctx->Eval.Map2TextureCoord1;
3279
         break;
3280
      case GL_MAP2_TEXTURE_COORD_2:
3281
         *params = ctx->Eval.Map2TextureCoord2;
3282
         break;
3283
      case GL_MAP2_TEXTURE_COORD_3:
3284
         *params = ctx->Eval.Map2TextureCoord3;
3285
         break;
3286
      case GL_MAP2_TEXTURE_COORD_4:
3287
         *params = ctx->Eval.Map2TextureCoord4;
3288
         break;
3289
      case GL_MAP2_VERTEX_3:
3290
         *params = (GLfloat) ctx->Eval.Map2Vertex3;
3291
         break;
3292
      case GL_MAP2_VERTEX_4:
3293
         *params = (GLfloat) ctx->Eval.Map2Vertex4;
3294
         break;
3295
      case GL_MAP_COLOR:
3296
         *params = (GLfloat) ctx->Pixel.MapColorFlag;
3297
         break;
3298
      case GL_MAP_STENCIL:
3299
         *params = (GLfloat) ctx->Pixel.MapStencilFlag;
3300
         break;
3301
      case GL_MATRIX_MODE:
3302
         *params = ENUM_TO_FLOAT(ctx->Transform.MatrixMode);
3303
         break;
3304
      case GL_MAX_ATTRIB_STACK_DEPTH:
3305
         *params = (GLfloat) MAX_ATTRIB_STACK_DEPTH;
3306
         break;
3307
      case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH:
3308
         *params = (GLfloat) MAX_CLIENT_ATTRIB_STACK_DEPTH;
3309
         break;
3310
      case GL_MAX_CLIP_PLANES:
3311
         *params = (GLfloat) ctx->Const.MaxClipPlanes;
3312
         break;
3313
      case GL_MAX_ELEMENTS_VERTICES:  /* GL_VERSION_1_2 */
3314
         *params = (GLfloat) ctx->Const.MaxArrayLockSize;
3315
         break;
3316
      case GL_MAX_ELEMENTS_INDICES:   /* GL_VERSION_1_2 */
3317
         *params = (GLfloat) ctx->Const.MaxArrayLockSize;
3318
         break;
3319
      case GL_MAX_EVAL_ORDER:
3320
         *params = (GLfloat) MAX_EVAL_ORDER;
3321
         break;
3322
      case GL_MAX_LIGHTS:
3323
         *params = (GLfloat) ctx->Const.MaxLights;
3324
         break;
3325
      case GL_MAX_LIST_NESTING:
3326
         *params = (GLfloat) MAX_LIST_NESTING;
3327
         break;
3328
      case GL_MAX_MODELVIEW_STACK_DEPTH:
3329
         *params = (GLfloat) MAX_MODELVIEW_STACK_DEPTH;
3330
         break;
3331
      case GL_MAX_NAME_STACK_DEPTH:
3332
         *params = (GLfloat) MAX_NAME_STACK_DEPTH;
3333
         break;
3334
      case GL_MAX_PIXEL_MAP_TABLE:
3335
         *params = (GLfloat) MAX_PIXEL_MAP_TABLE;
3336
         break;
3337
      case GL_MAX_PROJECTION_STACK_DEPTH:
3338
         *params = (GLfloat) MAX_PROJECTION_STACK_DEPTH;
3339
         break;
3340
      case GL_MAX_TEXTURE_SIZE:
3341
         *params = (GLfloat) (1 << (ctx->Const.MaxTextureLevels - 1));
3342
         break;
3343
      case GL_MAX_3D_TEXTURE_SIZE:
3344
         *params = (GLfloat) (1 << (ctx->Const.Max3DTextureLevels - 1));
3345
         break;
3346
      case GL_MAX_TEXTURE_STACK_DEPTH:
3347
         *params = (GLfloat) MAX_TEXTURE_STACK_DEPTH;
3348
         break;
3349
      case GL_MAX_VIEWPORT_DIMS:
3350
         params[0] = (GLfloat) MAX_WIDTH;
3351
         params[1] = (GLfloat) MAX_HEIGHT;
3352
         break;
3353
      case GL_MODELVIEW_MATRIX:
3354
         for (i=0;i<16;i++) {
3355
            params[i] = ctx->ModelviewMatrixStack.Top->m[i];
3356
         }
3357
         break;
3358
      case GL_MODELVIEW_STACK_DEPTH:
3359
         *params = (GLfloat) (ctx->ModelviewMatrixStack.Depth + 1);
3360
         break;
3361
      case GL_NAME_STACK_DEPTH:
3362
         *params = (GLfloat) ctx->Select.NameStackDepth;
3363
         break;
3364
      case GL_NORMALIZE:
3365
         *params = (GLfloat) ctx->Transform.Normalize;
3366
         break;
3367
      case GL_PACK_ALIGNMENT:
3368
         *params = (GLfloat) ctx->Pack.Alignment;
3369
         break;
3370
      case GL_PACK_LSB_FIRST:
3371
         *params = (GLfloat) ctx->Pack.LsbFirst;
3372
         break;
3373
      case GL_PACK_ROW_LENGTH:
3374
         *params = (GLfloat) ctx->Pack.RowLength;
3375
         break;
3376
      case GL_PACK_SKIP_PIXELS:
3377
         *params = (GLfloat) ctx->Pack.SkipPixels;
3378
         break;
3379
      case GL_PACK_SKIP_ROWS:
3380
         *params = (GLfloat) ctx->Pack.SkipRows;
3381
         break;
3382
      case GL_PACK_SWAP_BYTES:
3383
         *params = (GLfloat) ctx->Pack.SwapBytes;
3384
         break;
3385
      case GL_PACK_SKIP_IMAGES_EXT:
3386
         *params = (GLfloat) ctx->Pack.SkipImages;
3387
         break;
3388
      case GL_PACK_IMAGE_HEIGHT_EXT:
3389
         *params = (GLfloat) ctx->Pack.ImageHeight;
3390
         break;
3391
      case GL_PACK_INVERT_MESA:
3392
         *params = (GLfloat) ctx->Pack.Invert;
3393
         break;
3394
      case GL_PERSPECTIVE_CORRECTION_HINT:
3395
         *params = ENUM_TO_FLOAT(ctx->Hint.PerspectiveCorrection);
3396
         break;
3397
      case GL_PIXEL_MAP_A_TO_A_SIZE:
3398
         *params = (GLfloat) ctx->Pixel.MapAtoAsize;
3399
         break;
3400
      case GL_PIXEL_MAP_B_TO_B_SIZE:
3401
         *params = (GLfloat) ctx->Pixel.MapBtoBsize;
3402
         break;
3403
      case GL_PIXEL_MAP_G_TO_G_SIZE:
3404
         *params = (GLfloat) ctx->Pixel.MapGtoGsize;
3405
         break;
3406
      case GL_PIXEL_MAP_I_TO_A_SIZE:
3407
         *params = (GLfloat) ctx->Pixel.MapItoAsize;
3408
         break;
3409
      case GL_PIXEL_MAP_I_TO_B_SIZE:
3410
         *params = (GLfloat) ctx->Pixel.MapItoBsize;
3411
         break;
3412
      case GL_PIXEL_MAP_I_TO_G_SIZE:
3413
         *params = (GLfloat) ctx->Pixel.MapItoGsize;
3414
         break;
3415
      case GL_PIXEL_MAP_I_TO_I_SIZE:
3416
         *params = (GLfloat) ctx->Pixel.MapItoIsize;
3417
         break;
3418
      case GL_PIXEL_MAP_I_TO_R_SIZE:
3419
         *params = (GLfloat) ctx->Pixel.MapItoRsize;
3420
         break;
3421
      case GL_PIXEL_MAP_R_TO_R_SIZE:
3422
         *params = (GLfloat) ctx->Pixel.MapRtoRsize;
3423
         break;
3424
      case GL_PIXEL_MAP_S_TO_S_SIZE:
3425
         *params = (GLfloat) ctx->Pixel.MapStoSsize;
3426
         break;
3427
      case GL_POINT_SIZE:
3428
         *params = (GLfloat) ctx->Point.Size;
3429
         break;
3430
      case GL_POINT_SIZE_GRANULARITY:
3431
         *params = (GLfloat) ctx->Const.PointSizeGranularity;
3432
         break;
3433
      case GL_POINT_SIZE_RANGE:
3434
         params[0] = (GLfloat) ctx->Const.MinPointSizeAA;
3435
         params[1] = (GLfloat) ctx->Const.MaxPointSizeAA;
3436
         break;
3437
      case GL_ALIASED_POINT_SIZE_RANGE:
3438
         params[0] = (GLfloat) ctx->Const.MinPointSize;
3439
         params[1] = (GLfloat) ctx->Const.MaxPointSize;
3440
         break;
3441
      case GL_POINT_SMOOTH:
3442
         *params = (GLfloat) ctx->Point.SmoothFlag;
3443
         break;
3444
      case GL_POINT_SMOOTH_HINT:
3445
         *params = ENUM_TO_FLOAT(ctx->Hint.PointSmooth);
3446
         break;
3447
      case GL_POINT_SIZE_MIN_EXT:
3448
         *params = (GLfloat) (ctx->Point.MinSize);
3449
         break;
3450
      case GL_POINT_SIZE_MAX_EXT:
3451
         *params = (GLfloat) (ctx->Point.MaxSize);
3452
         break;
3453
      case GL_POINT_FADE_THRESHOLD_SIZE_EXT:
3454
         *params = (GLfloat) (ctx->Point.Threshold);
3455
         break;
3456
      case GL_DISTANCE_ATTENUATION_EXT:
3457
         params[0] = (GLfloat) (ctx->Point.Params[0]);
3458
         params[1] = (GLfloat) (ctx->Point.Params[1]);
3459
         params[2] = (GLfloat) (ctx->Point.Params[2]);
3460
         break;
3461
      case GL_POLYGON_MODE:
3462
         params[0] = ENUM_TO_FLOAT(ctx->Polygon.FrontMode);
3463
         params[1] = ENUM_TO_FLOAT(ctx->Polygon.BackMode);
3464
         break;
3465
#ifdef GL_EXT_polygon_offset
3466
      case GL_POLYGON_OFFSET_BIAS_EXT:
3467
         *params = ctx->Polygon.OffsetUnits;
3468
         break;
3469
#endif
3470
      case GL_POLYGON_OFFSET_FACTOR:
3471
         *params = ctx->Polygon.OffsetFactor;
3472
         break;
3473
      case GL_POLYGON_OFFSET_UNITS:
3474
         *params = ctx->Polygon.OffsetUnits;
3475
         break;
3476
      case GL_POLYGON_SMOOTH:
3477
         *params = (GLfloat) ctx->Polygon.SmoothFlag;
3478
         break;
3479
      case GL_POLYGON_SMOOTH_HINT:
3480
         *params = ENUM_TO_FLOAT(ctx->Hint.PolygonSmooth);
3481
         break;
3482
      case GL_POLYGON_STIPPLE:
3483
         *params = (GLfloat) ctx->Polygon.StippleFlag;
3484
         break;
3485
      case GL_PROJECTION_MATRIX:
3486
         for (i=0;i<16;i++) {
3487
            params[i] = ctx->ProjectionMatrixStack.Top->m[i];
3488
         }
3489
         break;
3490
      case GL_PROJECTION_STACK_DEPTH:
3491
         *params = (GLfloat) (ctx->ProjectionMatrixStack.Depth + 1);
3492
         break;
3493
      case GL_READ_BUFFER:
3494
         *params = ENUM_TO_FLOAT(ctx->Pixel.ReadBuffer);
3495
         break;
3496
      case GL_RED_BIAS:
3497
         *params = ctx->Pixel.RedBias;
3498
         break;
3499
      case GL_RED_BITS:
3500
         *params = (GLfloat) ctx->Visual.redBits;
3501
         break;
3502
      case GL_RED_SCALE:
3503
         *params = ctx->Pixel.RedScale;
3504
         break;
3505
      case GL_RENDER_MODE:
3506
         *params = ENUM_TO_FLOAT(ctx->RenderMode);
3507
         break;
3508
      case GL_RESCALE_NORMAL:
3509
         *params = (GLfloat) ctx->Transform.RescaleNormals;
3510
         break;
3511
      case GL_RGBA_MODE:
3512
         *params = (GLfloat) ctx->Visual.rgbMode;
3513
         break;
3514
      case GL_SCISSOR_BOX:
3515
         params[0] = (GLfloat) ctx->Scissor.X;
3516
         params[1] = (GLfloat) ctx->Scissor.Y;
3517
         params[2] = (GLfloat) ctx->Scissor.Width;
3518
         params[3] = (GLfloat) ctx->Scissor.Height;
3519
         break;
3520
      case GL_SCISSOR_TEST:
3521
         *params = (GLfloat) ctx->Scissor.Enabled;
3522
         break;
3523
      case GL_SELECTION_BUFFER_SIZE:
3524
         *params = (GLfloat) ctx->Select.BufferSize;
3525
         break;
3526
      case GL_SHADE_MODEL:
3527
         *params = ENUM_TO_FLOAT(ctx->Light.ShadeModel);
3528
         break;
3529
      case GL_SHARED_TEXTURE_PALETTE_EXT:
3530
         *params = (GLfloat) ctx->Texture.SharedPalette;
3531
         break;
3532
      case GL_STENCIL_BITS:
3533
         *params = (GLfloat) ctx->Visual.stencilBits;
3534
         break;
3535
      case GL_STENCIL_CLEAR_VALUE:
3536
         *params = (GLfloat) ctx->Stencil.Clear;
3537
         break;
3538
      case GL_STENCIL_FAIL:
3539
         *params = ENUM_TO_FLOAT(ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]);
3540
         break;
3541
      case GL_STENCIL_FUNC:
3542
         *params = ENUM_TO_FLOAT(ctx->Stencil.Function[ctx->Stencil.ActiveFace]);
3543
         break;
3544
      case GL_STENCIL_PASS_DEPTH_FAIL:
3545
         *params = ENUM_TO_FLOAT(ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]);
3546
         break;
3547
      case GL_STENCIL_PASS_DEPTH_PASS:
3548
         *params = ENUM_TO_FLOAT(ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]);
3549
         break;
3550
      case GL_STENCIL_REF:
3551
         *params = (GLfloat) ctx->Stencil.Ref[ctx->Stencil.ActiveFace];
3552
         break;
3553
      case GL_STENCIL_TEST:
3554
         *params = (GLfloat) ctx->Stencil.Enabled;
3555
         break;
3556
      case GL_STENCIL_VALUE_MASK:
3557
         *params = (GLfloat) ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace];
3558
         break;
3559
      case GL_STENCIL_WRITEMASK:
3560
         *params = (GLfloat) ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace];
3561
         break;
3562
      case GL_STEREO:
3563
         *params = (GLfloat) ctx->Visual.stereoMode;
3564
         break;
3565
      case GL_SUBPIXEL_BITS:
3566
         *params = (GLfloat) ctx->Const.SubPixelBits;
3567
         break;
3568
      case GL_TEXTURE_1D:
3569
         *params = _mesa_IsEnabled(GL_TEXTURE_1D) ? 1.0F : 0.0F;
3570
         break;
3571
      case GL_TEXTURE_2D:
3572
         *params = _mesa_IsEnabled(GL_TEXTURE_2D) ? 1.0F : 0.0F;
3573
         break;
3574
      case GL_TEXTURE_3D:
3575
         *params = _mesa_IsEnabled(GL_TEXTURE_3D) ? 1.0F : 0.0F;
3576
         break;
3577
      case GL_TEXTURE_BINDING_1D:
3578
         *params = (GLfloat) textureUnit->Current1D->Name;
3579
          break;
3580
      case GL_TEXTURE_BINDING_2D:
3581
         *params = (GLfloat) textureUnit->Current2D->Name;
3582
          break;
3583
      case GL_TEXTURE_BINDING_3D:
3584
         *params = (GLfloat) textureUnit->Current2D->Name;
3585
          break;
3586
      case GL_TEXTURE_ENV_COLOR:
3587
         params[0] = textureUnit->EnvColor[0];
3588
         params[1] = textureUnit->EnvColor[1];
3589
         params[2] = textureUnit->EnvColor[2];
3590
         params[3] = textureUnit->EnvColor[3];
3591
         break;
3592
      case GL_TEXTURE_ENV_MODE:
3593
         *params = ENUM_TO_FLOAT(textureUnit->EnvMode);
3594
         break;
3595
      case GL_TEXTURE_GEN_S:
3596
         *params = (textureUnit->TexGenEnabled & S_BIT) ? 1.0F : 0.0F;
3597
         break;
3598
      case GL_TEXTURE_GEN_T:
3599
         *params = (textureUnit->TexGenEnabled & T_BIT) ? 1.0F : 0.0F;
3600
         break;
3601
      case GL_TEXTURE_GEN_R:
3602
         *params = (textureUnit->TexGenEnabled & R_BIT) ? 1.0F : 0.0F;
3603
         break;
3604
      case GL_TEXTURE_GEN_Q:
3605
         *params = (textureUnit->TexGenEnabled & Q_BIT) ? 1.0F : 0.0F;
3606
         break;
3607
      case GL_TEXTURE_MATRIX:
3608
         for (i=0;i<16;i++) {
3609
            params[i] = ctx->TextureMatrixStack[texUnit].Top->m[i];
3610
         }
3611
         break;
3612
      case GL_TEXTURE_STACK_DEPTH:
3613
         *params = (GLfloat) (ctx->TextureMatrixStack[texUnit].Depth + 1);
3614
         break;
3615
      case GL_UNPACK_ALIGNMENT:
3616
         *params = (GLfloat) ctx->Unpack.Alignment;
3617
         break;
3618
      case GL_UNPACK_LSB_FIRST:
3619
         *params = (GLfloat) ctx->Unpack.LsbFirst;
3620
         break;
3621
      case GL_UNPACK_ROW_LENGTH:
3622
         *params = (GLfloat) ctx->Unpack.RowLength;
3623
         break;
3624
      case GL_UNPACK_SKIP_PIXELS:
3625
         *params = (GLfloat) ctx->Unpack.SkipPixels;
3626
         break;
3627
      case GL_UNPACK_SKIP_ROWS:
3628
         *params = (GLfloat) ctx->Unpack.SkipRows;
3629
         break;
3630
      case GL_UNPACK_SWAP_BYTES:
3631
         *params = (GLfloat) ctx->Unpack.SwapBytes;
3632
         break;
3633
      case GL_UNPACK_SKIP_IMAGES_EXT:
3634
         *params = (GLfloat) ctx->Unpack.SkipImages;
3635
         break;
3636
      case GL_UNPACK_IMAGE_HEIGHT_EXT:
3637
         *params = (GLfloat) ctx->Unpack.ImageHeight;
3638
         break;
3639
      case GL_UNPACK_CLIENT_STORAGE_APPLE:
3640
         *params = (GLfloat) ctx->Unpack.ClientStorage;
3641
         break;
3642
      case GL_VIEWPORT:
3643
         params[0] = (GLfloat) ctx->Viewport.X;
3644
         params[1] = (GLfloat) ctx->Viewport.Y;
3645
         params[2] = (GLfloat) ctx->Viewport.Width;
3646
         params[3] = (GLfloat) ctx->Viewport.Height;
3647
         break;
3648
      case GL_ZOOM_X:
3649
         *params = (GLfloat) ctx->Pixel.ZoomX;
3650
         break;
3651
      case GL_ZOOM_Y:
3652
         *params = (GLfloat) ctx->Pixel.ZoomY;
3653
         break;
3654
      case GL_VERTEX_ARRAY:
3655
         *params = (GLfloat) ctx->Array.Vertex.Enabled;
3656
         break;
3657
      case GL_VERTEX_ARRAY_SIZE:
3658
         *params = (GLfloat) ctx->Array.Vertex.Size;
3659
         break;
3660
      case GL_VERTEX_ARRAY_TYPE:
3661
         *params = ENUM_TO_FLOAT(ctx->Array.Vertex.Type);
3662
         break;
3663
      case GL_VERTEX_ARRAY_STRIDE:
3664
         *params = (GLfloat) ctx->Array.Vertex.Stride;
3665
         break;
3666
      case GL_VERTEX_ARRAY_COUNT_EXT:
3667
         *params = 0.0;
3668
         break;
3669
      case GL_NORMAL_ARRAY:
3670
         *params = (GLfloat) ctx->Array.Normal.Enabled;
3671
         break;
3672
      case GL_NORMAL_ARRAY_TYPE:
3673
         *params = ENUM_TO_FLOAT(ctx->Array.Normal.Type);
3674
         break;
3675
      case GL_NORMAL_ARRAY_STRIDE:
3676
         *params = (GLfloat) ctx->Array.Normal.Stride;
3677
         break;
3678
      case GL_NORMAL_ARRAY_COUNT_EXT:
3679
         *params = 0.0;
3680
         break;
3681
      case GL_COLOR_ARRAY:
3682
         *params = (GLfloat) ctx->Array.Color.Enabled;
3683
         break;
3684
      case GL_COLOR_ARRAY_SIZE:
3685
         *params = (GLfloat) ctx->Array.Color.Size;
3686
         break;
3687
      case GL_COLOR_ARRAY_TYPE:
3688
         *params = ENUM_TO_FLOAT(ctx->Array.Color.Type);
3689
         break;
3690
      case GL_COLOR_ARRAY_STRIDE:
3691
         *params = (GLfloat) ctx->Array.Color.Stride;
3692
         break;
3693
      case GL_COLOR_ARRAY_COUNT_EXT:
3694
         *params = 0.0;
3695
         break;
3696
      case GL_INDEX_ARRAY:
3697
         *params = (GLfloat) ctx->Array.Index.Enabled;
3698
         break;
3699
      case GL_INDEX_ARRAY_TYPE:
3700
         *params = ENUM_TO_FLOAT(ctx->Array.Index.Type);
3701
         break;
3702
      case GL_INDEX_ARRAY_STRIDE:
3703
         *params = (GLfloat) ctx->Array.Index.Stride;
3704
         break;
3705
      case GL_INDEX_ARRAY_COUNT_EXT:
3706
         *params = 0.0;
3707
         break;
3708
      case GL_TEXTURE_COORD_ARRAY:
3709
         *params = (GLfloat) ctx->Array.TexCoord[texUnit].Enabled;
3710
         break;
3711
      case GL_TEXTURE_COORD_ARRAY_SIZE:
3712
         *params = (GLfloat) ctx->Array.TexCoord[texUnit].Size;
3713
         break;
3714
      case GL_TEXTURE_COORD_ARRAY_TYPE:
3715
         *params = ENUM_TO_FLOAT(ctx->Array.TexCoord[texUnit].Type);
3716
         break;
3717
      case GL_TEXTURE_COORD_ARRAY_STRIDE:
3718
         *params = (GLfloat) ctx->Array.TexCoord[texUnit].Stride;
3719
         break;
3720
      case GL_TEXTURE_COORD_ARRAY_COUNT_EXT:
3721
         *params = 0.0;
3722
         break;
3723
      case GL_EDGE_FLAG_ARRAY:
3724
         *params = (GLfloat) ctx->Array.EdgeFlag.Enabled;
3725
         break;
3726
      case GL_EDGE_FLAG_ARRAY_STRIDE:
3727
         *params = (GLfloat) ctx->Array.EdgeFlag.Stride;
3728
         break;
3729
      case GL_EDGE_FLAG_ARRAY_COUNT_EXT:
3730
         *params = 0.0;
3731
         break;
3732
 
3733
      /* GL_ARB_multitexture */
3734
      case GL_MAX_TEXTURE_UNITS_ARB:
3735
         CHECK_EXTENSION_F(ARB_multitexture, pname);
3736
         *params = (GLfloat) ctx->Const.MaxTextureUnits;
3737
         break;
3738
      case GL_ACTIVE_TEXTURE_ARB:
3739
         CHECK_EXTENSION_F(ARB_multitexture, pname);
3740
         *params = (GLfloat) (GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit);
3741
         break;
3742
      case GL_CLIENT_ACTIVE_TEXTURE_ARB:
3743
         CHECK_EXTENSION_F(ARB_multitexture, pname);
3744
         *params = (GLfloat) (GL_TEXTURE0_ARB + ctx->Array.ActiveTexture);
3745
         break;
3746
 
3747
      /* GL_ARB_texture_cube_map */
3748
      case GL_TEXTURE_CUBE_MAP_ARB:
3749
         CHECK_EXTENSION_F(ARB_texture_cube_map, pname);
3750
         *params = (GLfloat) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
3751
         break;
3752
      case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
3753
         CHECK_EXTENSION_F(ARB_texture_cube_map, pname);
3754
         *params = (GLfloat) textureUnit->CurrentCubeMap->Name;
3755
         break;
3756
      case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
3757
         CHECK_EXTENSION_F(ARB_texture_cube_map, pname);
3758
         *params = (GLfloat) (1 << (ctx->Const.MaxCubeTextureLevels - 1));
3759
         break;
3760
 
3761
      /* GL_ARB_texture_compression */
3762
      case GL_TEXTURE_COMPRESSION_HINT_ARB:
3763
         CHECK_EXTENSION_F(ARB_texture_compression, pname);
3764
         *params = (GLfloat) ctx->Hint.TextureCompression;
3765
         break;
3766
      case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
3767
         CHECK_EXTENSION_F(ARB_texture_compression, pname);
3768
         *params = (GLfloat) _mesa_get_compressed_formats(ctx, NULL);
3769
         break;
3770
      case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
3771
         CHECK_EXTENSION_F(ARB_texture_compression, pname);
3772
         {
3773
            GLint formats[100];
3774
            GLuint i, n;
3775
            n = _mesa_get_compressed_formats(ctx, formats);
3776
            for (i = 0; i < n; i++)
3777
               params[i] = (GLfloat) formats[i];
3778
         }
3779
         break;
3780
 
3781
      /* GL_EXT_compiled_vertex_array */
3782
      case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT:
3783
         CHECK_EXTENSION_F(EXT_compiled_vertex_array, pname);
3784
         *params = (GLfloat) ctx->Array.LockFirst;
3785
         break;
3786
      case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT:
3787
         CHECK_EXTENSION_F(EXT_compiled_vertex_array, pname);
3788
         *params = (GLfloat) ctx->Array.LockCount;
3789
         break;
3790
 
3791
      /* GL_ARB_transpose_matrix */
3792
      case GL_TRANSPOSE_COLOR_MATRIX_ARB:
3793
         _math_transposef(params, ctx->ColorMatrixStack.Top->m);
3794
         break;
3795
      case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB:
3796
         _math_transposef(params, ctx->ModelviewMatrixStack.Top->m);
3797
         break;
3798
      case GL_TRANSPOSE_PROJECTION_MATRIX_ARB:
3799
         _math_transposef(params, ctx->ProjectionMatrixStack.Top->m);
3800
         break;
3801
      case GL_TRANSPOSE_TEXTURE_MATRIX_ARB:
3802
         _math_transposef(params, ctx->TextureMatrixStack[texUnit].Top->m);
3803
         break;
3804
 
3805
      /* GL_HP_occlusion_test */
3806
      case GL_OCCLUSION_TEST_HP:
3807
         CHECK_EXTENSION_F(HP_occlusion_test, pname);
3808
         *params = (GLfloat) ctx->Depth.OcclusionTest;
3809
         break;
3810
      case GL_OCCLUSION_TEST_RESULT_HP:
3811
         CHECK_EXTENSION_F(HP_occlusion_test, pname);
3812
         if (ctx->Depth.OcclusionTest)
3813
            *params = (GLfloat) ctx->OcclusionResult;
3814
         else
3815
            *params = (GLfloat) ctx->OcclusionResultSaved;
3816
         /* reset flag now */
3817
         ctx->OcclusionResult = GL_FALSE;
3818
         ctx->OcclusionResultSaved = GL_FALSE;
3819
         break;
3820
 
3821
      /* GL_SGIS_pixel_texture */
3822
      case GL_PIXEL_TEXTURE_SGIS:
3823
         *params = (GLfloat) ctx->Pixel.PixelTextureEnabled;
3824
         break;
3825
 
3826
      /* GL_SGIX_pixel_texture */
3827
      case GL_PIXEL_TEX_GEN_SGIX:
3828
         *params = (GLfloat) ctx->Pixel.PixelTextureEnabled;
3829
         break;
3830
      case GL_PIXEL_TEX_GEN_MODE_SGIX:
3831
         *params = (GLfloat) pixel_texgen_mode(ctx);
3832
         break;
3833
 
3834
      /* GL_SGI_color_matrix (also in 1.2 imaging) */
3835
      case GL_COLOR_MATRIX_SGI:
3836
         for (i=0;i<16;i++) {
3837
            params[i] = ctx->ColorMatrixStack.Top->m[i];
3838
         }
3839
         break;
3840
      case GL_COLOR_MATRIX_STACK_DEPTH_SGI:
3841
         *params = (GLfloat) (ctx->ColorMatrixStack.Depth + 1);
3842
         break;
3843
      case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI:
3844
         *params = (GLfloat) MAX_COLOR_STACK_DEPTH;
3845
         break;
3846
      case GL_POST_COLOR_MATRIX_RED_SCALE_SGI:
3847
         *params = ctx->Pixel.PostColorMatrixScale[0];
3848
         break;
3849
      case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI:
3850
         *params = ctx->Pixel.PostColorMatrixScale[1];
3851
         break;
3852
      case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI:
3853
         *params = ctx->Pixel.PostColorMatrixScale[2];
3854
         break;
3855
      case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI:
3856
         *params = ctx->Pixel.PostColorMatrixScale[3];
3857
         break;
3858
      case GL_POST_COLOR_MATRIX_RED_BIAS_SGI:
3859
         *params = ctx->Pixel.PostColorMatrixBias[0];
3860
         break;
3861
      case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI:
3862
         *params = ctx->Pixel.PostColorMatrixBias[1];
3863
         break;
3864
      case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI:
3865
         *params = ctx->Pixel.PostColorMatrixBias[2];
3866
         break;
3867
      case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI:
3868
         *params = ctx->Pixel.PostColorMatrixBias[3];
3869
         break;
3870
 
3871
      /* GL_EXT_convolution (also in 1.2 imaging) */
3872
      case GL_CONVOLUTION_1D_EXT:
3873
         CHECK_EXTENSION_F(EXT_convolution, pname);
3874
         *params = (GLfloat) ctx->Pixel.Convolution1DEnabled;
3875
         break;
3876
      case GL_CONVOLUTION_2D:
3877
         CHECK_EXTENSION_F(EXT_convolution, pname);
3878
         *params = (GLfloat) ctx->Pixel.Convolution2DEnabled;
3879
         break;
3880
      case GL_SEPARABLE_2D:
3881
         CHECK_EXTENSION_F(EXT_convolution, pname);
3882
         *params = (GLfloat) ctx->Pixel.Separable2DEnabled;
3883
         break;
3884
      case GL_POST_CONVOLUTION_RED_SCALE_EXT:
3885
         CHECK_EXTENSION_F(EXT_convolution, pname);
3886
         *params = ctx->Pixel.PostConvolutionScale[0];
3887
         break;
3888
      case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:
3889
         CHECK_EXTENSION_F(EXT_convolution, pname);
3890
         *params = ctx->Pixel.PostConvolutionScale[1];
3891
         break;
3892
      case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:
3893
         CHECK_EXTENSION_F(EXT_convolution, pname);
3894
         *params = ctx->Pixel.PostConvolutionScale[2];
3895
         break;
3896
      case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:
3897
         CHECK_EXTENSION_F(EXT_convolution, pname);
3898
         *params = ctx->Pixel.PostConvolutionScale[3];
3899
         break;
3900
      case GL_POST_CONVOLUTION_RED_BIAS_EXT:
3901
         CHECK_EXTENSION_F(EXT_convolution, pname);
3902
         *params = ctx->Pixel.PostConvolutionBias[0];
3903
         break;
3904
      case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:
3905
         CHECK_EXTENSION_F(EXT_convolution, pname);
3906
         *params = ctx->Pixel.PostConvolutionBias[1];
3907
         break;
3908
      case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:
3909
         CHECK_EXTENSION_F(EXT_convolution, pname);
3910
         *params = ctx->Pixel.PostConvolutionBias[2];
3911
         break;
3912
      case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:
3913
         CHECK_EXTENSION_F(EXT_convolution, pname);
3914
         *params = ctx->Pixel.PostConvolutionBias[2];
3915
         break;
3916
 
3917
      /* GL_EXT_histogram (also in 1.2 imaging) */
3918
      case GL_HISTOGRAM:
3919
         CHECK_EXTENSION_F(EXT_histogram, pname);
3920
         *params = (GLfloat) ctx->Pixel.HistogramEnabled;
3921
         break;
3922
      case GL_MINMAX:
3923
         CHECK_EXTENSION_F(EXT_histogram, pname);
3924
         *params = (GLfloat) ctx->Pixel.MinMaxEnabled;
3925
         break;
3926
 
3927
      /* GL_SGI_color_table (also in 1.2 imaging */
3928
      case GL_COLOR_TABLE_SGI:
3929
         *params = (GLfloat) ctx->Pixel.ColorTableEnabled;
3930
         break;
3931
      case GL_POST_CONVOLUTION_COLOR_TABLE_SGI:
3932
         *params = (GLfloat) ctx->Pixel.PostConvolutionColorTableEnabled;
3933
         break;
3934
      case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
3935
         *params = (GLfloat) ctx->Pixel.PostColorMatrixColorTableEnabled;
3936
         break;
3937
 
3938
      /* GL_EXT_secondary_color */
3939
      case GL_COLOR_SUM_EXT:
3940
         CHECK_EXTENSION_F(EXT_secondary_color, pname);
3941
         *params = (GLfloat) ctx->Fog.ColorSumEnabled;
3942
         break;
3943
      case GL_CURRENT_SECONDARY_COLOR_EXT:
3944
         CHECK_EXTENSION_F(EXT_secondary_color, pname);
3945
         FLUSH_CURRENT(ctx, 0);
3946
         params[0] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0];
3947
         params[1] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1];
3948
         params[2] = ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2];
3949
         break;
3950
      case GL_SECONDARY_COLOR_ARRAY_EXT:
3951
         CHECK_EXTENSION_F(EXT_secondary_color, pname);
3952
         *params = (GLfloat) ctx->Array.SecondaryColor.Enabled;
3953
         break;
3954
      case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT:
3955
         CHECK_EXTENSION_F(EXT_secondary_color, pname);
3956
         *params = (GLfloat) ctx->Array.SecondaryColor.Type;
3957
         break;
3958
      case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT:
3959
         CHECK_EXTENSION_F(EXT_secondary_color, pname);
3960
         *params = (GLfloat) ctx->Array.SecondaryColor.Stride;
3961
         break;
3962
      case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT:
3963
         CHECK_EXTENSION_F(EXT_secondary_color, pname);
3964
         *params = (GLfloat) ctx->Array.SecondaryColor.Stride;
3965
         break;
3966
 
3967
      /* GL_EXT_fog_coord */
3968
      case GL_CURRENT_FOG_COORDINATE_EXT:
3969
         CHECK_EXTENSION_F(EXT_fog_coord, pname);
3970
         FLUSH_CURRENT(ctx, 0);
3971
         *params = (GLfloat) ctx->Current.Attrib[VERT_ATTRIB_FOG][0];
3972
         break;
3973
      case GL_FOG_COORDINATE_ARRAY_EXT:
3974
         CHECK_EXTENSION_F(EXT_fog_coord, pname);
3975
         *params = (GLfloat) ctx->Array.FogCoord.Enabled;
3976
         break;
3977
      case GL_FOG_COORDINATE_ARRAY_TYPE_EXT:
3978
         CHECK_EXTENSION_F(EXT_fog_coord, pname);
3979
         *params = (GLfloat) ctx->Array.FogCoord.Type;
3980
         break;
3981
      case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT:
3982
         CHECK_EXTENSION_F(EXT_fog_coord, pname);
3983
         *params = (GLfloat) ctx->Array.FogCoord.Stride;
3984
         break;
3985
 
3986
      /* GL_EXT_texture_lod_bias */
3987
      case GL_MAX_TEXTURE_LOD_BIAS_EXT:
3988
         *params = ctx->Const.MaxTextureLodBias;
3989
         break;
3990
 
3991
      /* GL_EXT_texture_filter_anisotropic */
3992
      case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
3993
         CHECK_EXTENSION_F(EXT_texture_filter_anisotropic, pname);
3994
         *params = ctx->Const.MaxTextureMaxAnisotropy;
3995
         break;
3996
 
3997
      /* GL_ARB_multisample */
3998
      case GL_MULTISAMPLE_ARB:
3999
         CHECK_EXTENSION_F(ARB_multisample, pname);
4000
         *params = (GLfloat) ctx->Multisample.Enabled;
4001
         break;
4002
      case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
4003
         CHECK_EXTENSION_F(ARB_multisample, pname);
4004
         *params = (GLfloat) ctx->Multisample.SampleAlphaToCoverage;
4005
         break;
4006
      case GL_SAMPLE_ALPHA_TO_ONE_ARB:
4007
         CHECK_EXTENSION_F(ARB_multisample, pname);
4008
         *params = (GLfloat) ctx->Multisample.SampleAlphaToOne;
4009
         break;
4010
      case GL_SAMPLE_COVERAGE_ARB:
4011
         CHECK_EXTENSION_F(ARB_multisample, pname);
4012
         *params = (GLfloat) ctx->Multisample.SampleCoverage;
4013
         break;
4014
      case GL_SAMPLE_COVERAGE_VALUE_ARB:
4015
         CHECK_EXTENSION_F(ARB_multisample, pname);
4016
         *params = ctx->Multisample.SampleCoverageValue;
4017
         break;
4018
      case GL_SAMPLE_COVERAGE_INVERT_ARB:
4019
         CHECK_EXTENSION_F(ARB_multisample, pname);
4020
         *params = (GLfloat) ctx->Multisample.SampleCoverageInvert;
4021
         break;
4022
      case GL_SAMPLE_BUFFERS_ARB:
4023
         CHECK_EXTENSION_F(ARB_multisample, pname);
4024
         *params = 0.0; /* XXX fix someday */
4025
         break;
4026
      case GL_SAMPLES_ARB:
4027
         CHECK_EXTENSION_F(ARB_multisample, pname);
4028
         *params = 0.0; /* XXX fix someday */
4029
         break;
4030
 
4031
      /* GL_IBM_rasterpos_clip */
4032
      case GL_RASTER_POSITION_UNCLIPPED_IBM:
4033
         CHECK_EXTENSION_F(IBM_rasterpos_clip, pname);
4034
         *params = (GLfloat) ctx->Transform.RasterPositionUnclipped;
4035
         break;
4036
 
4037
      /* GL_NV_point_sprite */
4038
      case GL_POINT_SPRITE_NV:
4039
         CHECK_EXTENSION_B(NV_point_sprite, pname);
4040
         *params = (GLfloat) ctx->Point.PointSprite;
4041
         break;
4042
      case GL_POINT_SPRITE_R_MODE_NV:
4043
         CHECK_EXTENSION_B(NV_point_sprite, pname);
4044
         *params = (GLfloat) ctx->Point.SpriteRMode;
4045
         break;
4046
 
4047
      /* GL_SGIS_generate_mipmap */
4048
      case GL_GENERATE_MIPMAP_HINT_SGIS:
4049
         CHECK_EXTENSION_F(SGIS_generate_mipmap, pname);
4050
         *params = (GLfloat) ctx->Hint.GenerateMipmap;
4051
         break;
4052
 
4053
#if FEATURE_NV_vertex_program
4054
      case GL_VERTEX_PROGRAM_NV:
4055
         CHECK_EXTENSION_F(NV_vertex_program, pname);
4056
         *params = (GLfloat) ctx->VertexProgram.Enabled;
4057
         break;
4058
      case GL_VERTEX_PROGRAM_POINT_SIZE_NV:
4059
         CHECK_EXTENSION_F(NV_vertex_program, pname);
4060
         *params = (GLfloat) ctx->VertexProgram.PointSizeEnabled;
4061
         break;
4062
      case GL_VERTEX_PROGRAM_TWO_SIDE_NV:
4063
         CHECK_EXTENSION_F(NV_vertex_program, pname);
4064
         *params = (GLfloat) ctx->VertexProgram.TwoSideEnabled;
4065
         break;
4066
      case GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV:
4067
         CHECK_EXTENSION_F(NV_vertex_program, pname);
4068
         *params = (GLfloat) MAX_PROGRAM_STACK_DEPTH;
4069
         break;
4070
      case GL_MAX_TRACK_MATRICES_NV:
4071
         CHECK_EXTENSION_F(NV_vertex_program, pname);
4072
         *params = (GLfloat) MAX_PROGRAM_MATRICES;
4073
         break;
4074
      case GL_CURRENT_MATRIX_STACK_DEPTH_NV:
4075
         CHECK_EXTENSION_F(NV_vertex_program, pname);
4076
         *params = (GLfloat) ctx->CurrentStack->Depth;
4077
         break;
4078
      case GL_CURRENT_MATRIX_NV:
4079
         CHECK_EXTENSION_F(NV_vertex_program, pname);
4080
         *params = (GLfloat) ctx->Transform.MatrixMode;
4081
         break;
4082
      case GL_VERTEX_PROGRAM_BINDING_NV:
4083
         CHECK_EXTENSION_F(NV_vertex_program, pname);
4084
         *params = (GLfloat) ctx->VertexProgram.CurrentID;
4085
         break;
4086
      case GL_PROGRAM_ERROR_POSITION_NV:
4087
         CHECK_EXTENSION_F(NV_vertex_program, pname);
4088
         *params = (GLfloat) ctx->VertexProgram.ErrorPos;
4089
         break;
4090
      case GL_VERTEX_ATTRIB_ARRAY0_NV:
4091
      case GL_VERTEX_ATTRIB_ARRAY1_NV:
4092
      case GL_VERTEX_ATTRIB_ARRAY2_NV:
4093
      case GL_VERTEX_ATTRIB_ARRAY3_NV:
4094
      case GL_VERTEX_ATTRIB_ARRAY4_NV:
4095
      case GL_VERTEX_ATTRIB_ARRAY5_NV:
4096
      case GL_VERTEX_ATTRIB_ARRAY6_NV:
4097
      case GL_VERTEX_ATTRIB_ARRAY7_NV:
4098
      case GL_VERTEX_ATTRIB_ARRAY8_NV:
4099
      case GL_VERTEX_ATTRIB_ARRAY9_NV:
4100
      case GL_VERTEX_ATTRIB_ARRAY10_NV:
4101
      case GL_VERTEX_ATTRIB_ARRAY11_NV:
4102
      case GL_VERTEX_ATTRIB_ARRAY12_NV:
4103
      case GL_VERTEX_ATTRIB_ARRAY13_NV:
4104
      case GL_VERTEX_ATTRIB_ARRAY14_NV:
4105
      case GL_VERTEX_ATTRIB_ARRAY15_NV:
4106
         CHECK_EXTENSION_F(NV_vertex_program, pname);
4107
         {
4108
            GLuint n = (GLuint) pname - GL_VERTEX_ATTRIB_ARRAY0_NV;
4109
            *params = (GLfloat) ctx->Array.VertexAttrib[n].Enabled;
4110
         }
4111
         break;
4112
      case GL_MAP1_VERTEX_ATTRIB0_4_NV:
4113
      case GL_MAP1_VERTEX_ATTRIB1_4_NV:
4114
      case GL_MAP1_VERTEX_ATTRIB2_4_NV:
4115
      case GL_MAP1_VERTEX_ATTRIB3_4_NV:
4116
      case GL_MAP1_VERTEX_ATTRIB4_4_NV:
4117
      case GL_MAP1_VERTEX_ATTRIB5_4_NV:
4118
      case GL_MAP1_VERTEX_ATTRIB6_4_NV:
4119
      case GL_MAP1_VERTEX_ATTRIB7_4_NV:
4120
      case GL_MAP1_VERTEX_ATTRIB8_4_NV:
4121
      case GL_MAP1_VERTEX_ATTRIB9_4_NV:
4122
      case GL_MAP1_VERTEX_ATTRIB10_4_NV:
4123
      case GL_MAP1_VERTEX_ATTRIB11_4_NV:
4124
      case GL_MAP1_VERTEX_ATTRIB12_4_NV:
4125
      case GL_MAP1_VERTEX_ATTRIB13_4_NV:
4126
      case GL_MAP1_VERTEX_ATTRIB14_4_NV:
4127
      case GL_MAP1_VERTEX_ATTRIB15_4_NV:
4128
         CHECK_EXTENSION_B(NV_vertex_program, pname);
4129
         {
4130
            GLuint n = (GLuint) pname - GL_MAP1_VERTEX_ATTRIB0_4_NV;
4131
            *params = (GLfloat) ctx->Eval.Map1Attrib[n];
4132
         }
4133
         break;
4134
      case GL_MAP2_VERTEX_ATTRIB0_4_NV:
4135
      case GL_MAP2_VERTEX_ATTRIB1_4_NV:
4136
      case GL_MAP2_VERTEX_ATTRIB2_4_NV:
4137
      case GL_MAP2_VERTEX_ATTRIB3_4_NV:
4138
      case GL_MAP2_VERTEX_ATTRIB4_4_NV:
4139
      case GL_MAP2_VERTEX_ATTRIB5_4_NV:
4140
      case GL_MAP2_VERTEX_ATTRIB6_4_NV:
4141
      case GL_MAP2_VERTEX_ATTRIB7_4_NV:
4142
      case GL_MAP2_VERTEX_ATTRIB8_4_NV:
4143
      case GL_MAP2_VERTEX_ATTRIB9_4_NV:
4144
      case GL_MAP2_VERTEX_ATTRIB10_4_NV:
4145
      case GL_MAP2_VERTEX_ATTRIB11_4_NV:
4146
      case GL_MAP2_VERTEX_ATTRIB12_4_NV:
4147
      case GL_MAP2_VERTEX_ATTRIB13_4_NV:
4148
      case GL_MAP2_VERTEX_ATTRIB14_4_NV:
4149
      case GL_MAP2_VERTEX_ATTRIB15_4_NV:
4150
         CHECK_EXTENSION_B(NV_vertex_program, pname);
4151
         {
4152
            GLuint n = (GLuint) pname - GL_MAP2_VERTEX_ATTRIB0_4_NV;
4153
            *params = (GLfloat) ctx->Eval.Map2Attrib[n];
4154
         }
4155
         break;
4156
 
4157
      /* GL_NV_texture_rectangle */
4158
      case GL_TEXTURE_RECTANGLE_NV:
4159
         CHECK_EXTENSION_F(NV_texture_rectangle, pname);
4160
         *params = (GLfloat) _mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV);
4161
         break;
4162
      case GL_TEXTURE_BINDING_RECTANGLE_NV:
4163
         CHECK_EXTENSION_F(NV_texture_rectangle, pname);
4164
         *params = (GLfloat) textureUnit->CurrentRect->Name;
4165
         break;
4166
      case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV:
4167
         CHECK_EXTENSION_F(NV_texture_rectangle, pname);
4168
         *params = (GLfloat) ctx->Const.MaxTextureRectSize;
4169
         break;
4170
#endif /* FEATURE_NV_vertex_program */
4171
 
4172
      /* GL_EXT_stencil_two_side */
4173
      case GL_STENCIL_TEST_TWO_SIDE_EXT:
4174
         CHECK_EXTENSION_F(EXT_stencil_two_side, pname);
4175
         *params = (GLfloat) ctx->Stencil.TestTwoSide;
4176
         break;
4177
      case GL_ACTIVE_STENCIL_FACE_EXT:
4178
         CHECK_EXTENSION_F(EXT_stencil_two_side, pname);
4179
         *params = (GLfloat) (ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT);
4180
         break;
4181
 
4182
      default:
4183
         _mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv(0x%x)", pname);
4184
   }
4185
}
4186
 
4187
 
4188
void
4189
_mesa_GetIntegerv( GLenum pname, GLint *params )
4190
{
4191
   GET_CURRENT_CONTEXT(ctx);
4192
   GLuint i;
4193
   GLuint texUnit = ctx->Texture.CurrentUnit;
4194
   const struct gl_texture_unit *textureUnit = &ctx->Texture.Unit[texUnit];
4195
   ASSERT_OUTSIDE_BEGIN_END(ctx);
4196
 
4197
   if (!params)
4198
      return;
4199
 
4200
   /* We need this in order to get correct results for
4201
    * GL_OCCLUSION_TEST_RESULT_HP.  There might be other important cases.
4202
    */
4203
   FLUSH_VERTICES(ctx, 0);
4204
 
4205
   if (MESA_VERBOSE & VERBOSE_API)
4206
      _mesa_debug(ctx, "glGetIntegerv %s\n", _mesa_lookup_enum_by_nr(pname));
4207
 
4208
   if (ctx->Driver.GetIntegerv
4209
       && (*ctx->Driver.GetIntegerv)(ctx, pname, params))
4210
      return;
4211
 
4212
   switch (pname) {
4213
      case GL_ACCUM_RED_BITS:
4214
         *params = (GLint) ctx->Visual.accumRedBits;
4215
         break;
4216
      case GL_ACCUM_GREEN_BITS:
4217
         *params = (GLint) ctx->Visual.accumGreenBits;
4218
         break;
4219
      case GL_ACCUM_BLUE_BITS:
4220
         *params = (GLint) ctx->Visual.accumBlueBits;
4221
         break;
4222
      case GL_ACCUM_ALPHA_BITS:
4223
         *params = (GLint) ctx->Visual.accumAlphaBits;
4224
         break;
4225
      case GL_ACCUM_CLEAR_VALUE:
4226
         params[0] = FLOAT_TO_INT( ctx->Accum.ClearColor[0] );
4227
         params[1] = FLOAT_TO_INT( ctx->Accum.ClearColor[1] );
4228
         params[2] = FLOAT_TO_INT( ctx->Accum.ClearColor[2] );
4229
         params[3] = FLOAT_TO_INT( ctx->Accum.ClearColor[3] );
4230
         break;
4231
      case GL_ALPHA_BIAS:
4232
         *params = (GLint) ctx->Pixel.AlphaBias;
4233
         break;
4234
      case GL_ALPHA_BITS:
4235
         *params = ctx->Visual.alphaBits;
4236
         break;
4237
      case GL_ALPHA_SCALE:
4238
         *params = (GLint) ctx->Pixel.AlphaScale;
4239
         break;
4240
      case GL_ALPHA_TEST:
4241
         *params = (GLint) ctx->Color.AlphaEnabled;
4242
         break;
4243
      case GL_ALPHA_TEST_REF:
4244
         *params = FLOAT_TO_INT(ctx->Color.AlphaRef);
4245
         break;
4246
      case GL_ALPHA_TEST_FUNC:
4247
         *params = (GLint) ctx->Color.AlphaFunc;
4248
         break;
4249
      case GL_ATTRIB_STACK_DEPTH:
4250
         *params = (GLint) (ctx->AttribStackDepth);
4251
         break;
4252
      case GL_AUTO_NORMAL:
4253
         *params = (GLint) ctx->Eval.AutoNormal;
4254
         break;
4255
      case GL_AUX_BUFFERS:
4256
         *params = (GLint) ctx->Const.NumAuxBuffers;
4257
         break;
4258
      case GL_BLEND:
4259
         *params = (GLint) ctx->Color.BlendEnabled;
4260
         break;
4261
      case GL_BLEND_DST:
4262
         *params = (GLint) ctx->Color.BlendDstRGB;
4263
         break;
4264
      case GL_BLEND_SRC:
4265
         *params = (GLint) ctx->Color.BlendSrcRGB;
4266
         break;
4267
      case GL_BLEND_SRC_RGB_EXT:
4268
         *params = (GLint) ctx->Color.BlendSrcRGB;
4269
         break;
4270
      case GL_BLEND_DST_RGB_EXT:
4271
         *params = (GLint) ctx->Color.BlendDstRGB;
4272
         break;
4273
      case GL_BLEND_SRC_ALPHA_EXT:
4274
         *params = (GLint) ctx->Color.BlendSrcA;
4275
         break;
4276
      case GL_BLEND_DST_ALPHA_EXT:
4277
         *params = (GLint) ctx->Color.BlendDstA;
4278
         break;
4279
      case GL_BLEND_EQUATION_EXT:
4280
         *params = (GLint) ctx->Color.BlendEquation;
4281
         break;
4282
      case GL_BLEND_COLOR_EXT:
4283
         params[0] = FLOAT_TO_INT( ctx->Color.BlendColor[0] );
4284
         params[1] = FLOAT_TO_INT( ctx->Color.BlendColor[1] );
4285
         params[2] = FLOAT_TO_INT( ctx->Color.BlendColor[2] );
4286
         params[3] = FLOAT_TO_INT( ctx->Color.BlendColor[3] );
4287
         break;
4288
      case GL_BLUE_BIAS:
4289
         *params = (GLint) ctx->Pixel.BlueBias;
4290
         break;
4291
      case GL_BLUE_BITS:
4292
         *params = (GLint) ctx->Visual.blueBits;
4293
         break;
4294
      case GL_BLUE_SCALE:
4295
         *params = (GLint) ctx->Pixel.BlueScale;
4296
         break;
4297
      case GL_CLIENT_ATTRIB_STACK_DEPTH:
4298
         *params = (GLint) (ctx->ClientAttribStackDepth);
4299
         break;
4300
      case GL_CLIP_PLANE0:
4301
      case GL_CLIP_PLANE1:
4302
      case GL_CLIP_PLANE2:
4303
      case GL_CLIP_PLANE3:
4304
      case GL_CLIP_PLANE4:
4305
      case GL_CLIP_PLANE5:
4306
         if (ctx->Transform.ClipPlanesEnabled & (1 << (pname - GL_CLIP_PLANE0)))
4307
            *params = 1;
4308
         else
4309
            *params = 0;
4310
         break;
4311
      case GL_COLOR_CLEAR_VALUE:
4312
         params[0] = FLOAT_TO_INT( (ctx->Color.ClearColor[0]) );
4313
         params[1] = FLOAT_TO_INT( (ctx->Color.ClearColor[1]) );
4314
         params[2] = FLOAT_TO_INT( (ctx->Color.ClearColor[2]) );
4315
         params[3] = FLOAT_TO_INT( (ctx->Color.ClearColor[3]) );
4316
         break;
4317
      case GL_COLOR_MATERIAL:
4318
         *params = (GLint) ctx->Light.ColorMaterialEnabled;
4319
         break;
4320
      case GL_COLOR_MATERIAL_FACE:
4321
         *params = (GLint) ctx->Light.ColorMaterialFace;
4322
         break;
4323
      case GL_COLOR_MATERIAL_PARAMETER:
4324
         *params = (GLint) ctx->Light.ColorMaterialMode;
4325
         break;
4326
      case GL_COLOR_WRITEMASK:
4327
         params[0] = ctx->Color.ColorMask[RCOMP] ? 1 : 0;
4328
         params[1] = ctx->Color.ColorMask[GCOMP] ? 1 : 0;
4329
         params[2] = ctx->Color.ColorMask[BCOMP] ? 1 : 0;
4330
         params[3] = ctx->Color.ColorMask[ACOMP] ? 1 : 0;
4331
         break;
4332
      case GL_CULL_FACE:
4333
         *params = (GLint) ctx->Polygon.CullFlag;
4334
         break;
4335
      case GL_CULL_FACE_MODE:
4336
         *params = (GLint) ctx->Polygon.CullFaceMode;
4337
         break;
4338
      case GL_CURRENT_COLOR:
4339
         FLUSH_CURRENT(ctx, 0);
4340
         params[0] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]);
4341
         params[1] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]);
4342
         params[2] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]);
4343
         params[3] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]);
4344
         break;
4345
      case GL_CURRENT_INDEX:
4346
         FLUSH_CURRENT(ctx, 0);
4347
         *params = (GLint) ctx->Current.Index;
4348
         break;
4349
      case GL_CURRENT_NORMAL:
4350
         FLUSH_CURRENT(ctx, 0);
4351
         params[0] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0]);
4352
         params[1] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1]);
4353
         params[2] = FLOAT_TO_INT(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2]);
4354
         break;
4355
      case GL_CURRENT_RASTER_COLOR:
4356
         params[0] = FLOAT_TO_INT( ctx->Current.RasterColor[0] );
4357
         params[1] = FLOAT_TO_INT( ctx->Current.RasterColor[1] );
4358
         params[2] = FLOAT_TO_INT( ctx->Current.RasterColor[2] );
4359
         params[3] = FLOAT_TO_INT( ctx->Current.RasterColor[3] );
4360
         break;
4361
      case GL_CURRENT_RASTER_DISTANCE:
4362
         params[0] = (GLint) ctx->Current.RasterDistance;
4363
         break;
4364
      case GL_CURRENT_RASTER_INDEX:
4365
         *params = (GLint) ctx->Current.RasterIndex;
4366
         break;
4367
      case GL_CURRENT_RASTER_POSITION:
4368
         params[0] = (GLint) ctx->Current.RasterPos[0];
4369
         params[1] = (GLint) ctx->Current.RasterPos[1];
4370
         params[2] = (GLint) ctx->Current.RasterPos[2];
4371
         params[3] = (GLint) ctx->Current.RasterPos[3];
4372
         break;
4373
      case GL_CURRENT_RASTER_TEXTURE_COORDS:
4374
         params[0] = (GLint) ctx->Current.RasterTexCoords[texUnit][0];
4375
         params[1] = (GLint) ctx->Current.RasterTexCoords[texUnit][1];
4376
         params[2] = (GLint) ctx->Current.RasterTexCoords[texUnit][2];
4377
         params[3] = (GLint) ctx->Current.RasterTexCoords[texUnit][3];
4378
         break;
4379
      case GL_CURRENT_RASTER_POSITION_VALID:
4380
         *params = (GLint) ctx->Current.RasterPosValid;
4381
         break;
4382
      case GL_CURRENT_TEXTURE_COORDS:
4383
         FLUSH_CURRENT(ctx, 0);
4384
         params[0] = (GLint) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][0];
4385
         params[1] = (GLint) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][1];
4386
         params[2] = (GLint) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][2];
4387
         params[3] = (GLint) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3];
4388
         break;
4389
      case GL_DEPTH_BIAS:
4390
         *params = (GLint) ctx->Pixel.DepthBias;
4391
         break;
4392
      case GL_DEPTH_BITS:
4393
         *params = ctx->Visual.depthBits;
4394
         break;
4395
      case GL_DEPTH_CLEAR_VALUE:
4396
         *params = (GLint) ctx->Depth.Clear;
4397
         break;
4398
      case GL_DEPTH_FUNC:
4399
         *params = (GLint) ctx->Depth.Func;
4400
         break;
4401
      case GL_DEPTH_RANGE:
4402
         params[0] = (GLint) ctx->Viewport.Near;
4403
         params[1] = (GLint) ctx->Viewport.Far;
4404
         break;
4405
      case GL_DEPTH_SCALE:
4406
         *params = (GLint) ctx->Pixel.DepthScale;
4407
         break;
4408
      case GL_DEPTH_TEST:
4409
         *params = (GLint) ctx->Depth.Test;
4410
         break;
4411
      case GL_DEPTH_WRITEMASK:
4412
         *params = (GLint) ctx->Depth.Mask;
4413
         break;
4414
      case GL_DITHER:
4415
         *params = (GLint) ctx->Color.DitherFlag;
4416
         break;
4417
      case GL_DOUBLEBUFFER:
4418
         *params = (GLint) ctx->Visual.doubleBufferMode;
4419
         break;
4420
      case GL_DRAW_BUFFER:
4421
         *params = (GLint) ctx->Color.DrawBuffer;
4422
         break;
4423
      case GL_EDGE_FLAG:
4424
         FLUSH_CURRENT(ctx, 0);
4425
         *params = (GLint) ctx->Current.EdgeFlag;
4426
         break;
4427
      case GL_FEEDBACK_BUFFER_SIZE:
4428
         *params = ctx->Feedback.BufferSize;
4429
         break;
4430
      case GL_FEEDBACK_BUFFER_TYPE:
4431
         *params = ctx->Feedback.Type;
4432
         break;
4433
      case GL_FOG:
4434
         *params = (GLint) ctx->Fog.Enabled;
4435
         break;
4436
      case GL_FOG_COLOR:
4437
         params[0] = FLOAT_TO_INT( ctx->Fog.Color[0] );
4438
         params[1] = FLOAT_TO_INT( ctx->Fog.Color[1] );
4439
         params[2] = FLOAT_TO_INT( ctx->Fog.Color[2] );
4440
         params[3] = FLOAT_TO_INT( ctx->Fog.Color[3] );
4441
         break;
4442
      case GL_FOG_DENSITY:
4443
         *params = (GLint) ctx->Fog.Density;
4444
         break;
4445
      case GL_FOG_END:
4446
         *params = (GLint) ctx->Fog.End;
4447
         break;
4448
      case GL_FOG_HINT:
4449
         *params = (GLint) ctx->Hint.Fog;
4450
         break;
4451
      case GL_FOG_INDEX:
4452
         *params = (GLint) ctx->Fog.Index;
4453
         break;
4454
      case GL_FOG_MODE:
4455
         *params = (GLint) ctx->Fog.Mode;
4456
         break;
4457
      case GL_FOG_START:
4458
         *params = (GLint) ctx->Fog.Start;
4459
         break;
4460
      case GL_FRONT_FACE:
4461
         *params = (GLint) ctx->Polygon.FrontFace;
4462
         break;
4463
      case GL_GREEN_BIAS:
4464
         *params = (GLint) ctx->Pixel.GreenBias;
4465
         break;
4466
      case GL_GREEN_BITS:
4467
         *params = (GLint) ctx->Visual.greenBits;
4468
         break;
4469
      case GL_GREEN_SCALE:
4470
         *params = (GLint) ctx->Pixel.GreenScale;
4471
         break;
4472
      case GL_INDEX_BITS:
4473
         *params = (GLint) ctx->Visual.indexBits;
4474
         break;
4475
      case GL_INDEX_CLEAR_VALUE:
4476
         *params = (GLint) ctx->Color.ClearIndex;
4477
         break;
4478
      case GL_INDEX_MODE:
4479
         *params = ctx->Visual.rgbMode ? 0 : 1;
4480
         break;
4481
      case GL_INDEX_OFFSET:
4482
         *params = ctx->Pixel.IndexOffset;
4483
         break;
4484
      case GL_INDEX_SHIFT:
4485
         *params = ctx->Pixel.IndexShift;
4486
         break;
4487
      case GL_INDEX_WRITEMASK:
4488
         *params = (GLint) ctx->Color.IndexMask;
4489
         break;
4490
      case GL_LIGHT0:
4491
      case GL_LIGHT1:
4492
      case GL_LIGHT2:
4493
      case GL_LIGHT3:
4494
      case GL_LIGHT4:
4495
      case GL_LIGHT5:
4496
      case GL_LIGHT6:
4497
      case GL_LIGHT7:
4498
         *params = (GLint) ctx->Light.Light[pname-GL_LIGHT0].Enabled;
4499
         break;
4500
      case GL_LIGHTING:
4501
         *params = (GLint) ctx->Light.Enabled;
4502
         break;
4503
      case GL_LIGHT_MODEL_AMBIENT:
4504
         params[0] = FLOAT_TO_INT( ctx->Light.Model.Ambient[0] );
4505
         params[1] = FLOAT_TO_INT( ctx->Light.Model.Ambient[1] );
4506
         params[2] = FLOAT_TO_INT( ctx->Light.Model.Ambient[2] );
4507
         params[3] = FLOAT_TO_INT( ctx->Light.Model.Ambient[3] );
4508
         break;
4509
      case GL_LIGHT_MODEL_COLOR_CONTROL:
4510
         params[0] = (GLint) ctx->Light.Model.ColorControl;
4511
         break;
4512
      case GL_LIGHT_MODEL_LOCAL_VIEWER:
4513
         *params = (GLint) ctx->Light.Model.LocalViewer;
4514
         break;
4515
      case GL_LIGHT_MODEL_TWO_SIDE:
4516
         *params = (GLint) ctx->Light.Model.TwoSide;
4517
         break;
4518
      case GL_LINE_SMOOTH:
4519
         *params = (GLint) ctx->Line.SmoothFlag;
4520
         break;
4521
      case GL_LINE_SMOOTH_HINT:
4522
         *params = (GLint) ctx->Hint.LineSmooth;
4523
         break;
4524
      case GL_LINE_STIPPLE:
4525
         *params = (GLint) ctx->Line.StippleFlag;
4526
         break;
4527
      case GL_LINE_STIPPLE_PATTERN:
4528
         *params = (GLint) ctx->Line.StipplePattern;
4529
         break;
4530
      case GL_LINE_STIPPLE_REPEAT:
4531
         *params = (GLint) ctx->Line.StippleFactor;
4532
         break;
4533
      case GL_LINE_WIDTH:
4534
         *params = (GLint) ctx->Line.Width;
4535
         break;
4536
      case GL_LINE_WIDTH_GRANULARITY:
4537
         *params = (GLint) ctx->Const.LineWidthGranularity;
4538
         break;
4539
      case GL_LINE_WIDTH_RANGE:
4540
         params[0] = (GLint) ctx->Const.MinLineWidthAA;
4541
         params[1] = (GLint) ctx->Const.MaxLineWidthAA;
4542
         break;
4543
      case GL_ALIASED_LINE_WIDTH_RANGE:
4544
         params[0] = (GLint) ctx->Const.MinLineWidth;
4545
         params[1] = (GLint) ctx->Const.MaxLineWidth;
4546
         break;
4547
      case GL_LIST_BASE:
4548
         *params = (GLint) ctx->List.ListBase;
4549
         break;
4550
      case GL_LIST_INDEX:
4551
         *params = (GLint) ctx->CurrentListNum;
4552
         break;
4553
      case GL_LIST_MODE:
4554
         *params = ctx->ExecuteFlag ? (GLint) GL_COMPILE_AND_EXECUTE
4555
                                  : (GLint) GL_COMPILE;
4556
         break;
4557
      case GL_INDEX_LOGIC_OP:
4558
         *params = (GLint) ctx->Color.IndexLogicOpEnabled;
4559
         break;
4560
      case GL_COLOR_LOGIC_OP:
4561
         *params = (GLint) ctx->Color.ColorLogicOpEnabled;
4562
         break;
4563
      case GL_LOGIC_OP_MODE:
4564
         *params = (GLint) ctx->Color.LogicOp;
4565
         break;
4566
      case GL_MAP1_COLOR_4:
4567
         *params = (GLint) ctx->Eval.Map1Color4;
4568
         break;
4569
      case GL_MAP1_GRID_DOMAIN:
4570
         params[0] = (GLint) ctx->Eval.MapGrid1u1;
4571
         params[1] = (GLint) ctx->Eval.MapGrid1u2;
4572
         break;
4573
      case GL_MAP1_GRID_SEGMENTS:
4574
         *params = (GLint) ctx->Eval.MapGrid1un;
4575
         break;
4576
      case GL_MAP1_INDEX:
4577
         *params = (GLint) ctx->Eval.Map1Index;
4578
         break;
4579
      case GL_MAP1_NORMAL:
4580
         *params = (GLint) ctx->Eval.Map1Normal;
4581
         break;
4582
      case GL_MAP1_TEXTURE_COORD_1:
4583
         *params = (GLint) ctx->Eval.Map1TextureCoord1;
4584
         break;
4585
      case GL_MAP1_TEXTURE_COORD_2:
4586
         *params = (GLint) ctx->Eval.Map1TextureCoord2;
4587
         break;
4588
      case GL_MAP1_TEXTURE_COORD_3:
4589
         *params = (GLint) ctx->Eval.Map1TextureCoord3;
4590
         break;
4591
      case GL_MAP1_TEXTURE_COORD_4:
4592
         *params = (GLint) ctx->Eval.Map1TextureCoord4;
4593
         break;
4594
      case GL_MAP1_VERTEX_3:
4595
         *params = (GLint) ctx->Eval.Map1Vertex3;
4596
         break;
4597
      case GL_MAP1_VERTEX_4:
4598
         *params = (GLint) ctx->Eval.Map1Vertex4;
4599
         break;
4600
      case GL_MAP2_COLOR_4:
4601
         *params = (GLint) ctx->Eval.Map2Color4;
4602
         break;
4603
      case GL_MAP2_GRID_DOMAIN:
4604
         params[0] = (GLint) ctx->Eval.MapGrid2u1;
4605
         params[1] = (GLint) ctx->Eval.MapGrid2u2;
4606
         params[2] = (GLint) ctx->Eval.MapGrid2v1;
4607
         params[3] = (GLint) ctx->Eval.MapGrid2v2;
4608
         break;
4609
      case GL_MAP2_GRID_SEGMENTS:
4610
         params[0] = (GLint) ctx->Eval.MapGrid2un;
4611
         params[1] = (GLint) ctx->Eval.MapGrid2vn;
4612
         break;
4613
      case GL_MAP2_INDEX:
4614
         *params = (GLint) ctx->Eval.Map2Index;
4615
         break;
4616
      case GL_MAP2_NORMAL:
4617
         *params = (GLint) ctx->Eval.Map2Normal;
4618
         break;
4619
      case GL_MAP2_TEXTURE_COORD_1:
4620
         *params = (GLint) ctx->Eval.Map2TextureCoord1;
4621
         break;
4622
      case GL_MAP2_TEXTURE_COORD_2:
4623
         *params = (GLint) ctx->Eval.Map2TextureCoord2;
4624
         break;
4625
      case GL_MAP2_TEXTURE_COORD_3:
4626
         *params = (GLint) ctx->Eval.Map2TextureCoord3;
4627
         break;
4628
      case GL_MAP2_TEXTURE_COORD_4:
4629
         *params = (GLint) ctx->Eval.Map2TextureCoord4;
4630
         break;
4631
      case GL_MAP2_VERTEX_3:
4632
         *params = (GLint) ctx->Eval.Map2Vertex3;
4633
         break;
4634
      case GL_MAP2_VERTEX_4:
4635
         *params = (GLint) ctx->Eval.Map2Vertex4;
4636
         break;
4637
      case GL_MAP_COLOR:
4638
         *params = (GLint) ctx->Pixel.MapColorFlag;
4639
         break;
4640
      case GL_MAP_STENCIL:
4641
         *params = (GLint) ctx->Pixel.MapStencilFlag;
4642
         break;
4643
      case GL_MATRIX_MODE:
4644
         *params = (GLint) ctx->Transform.MatrixMode;
4645
         break;
4646
      case GL_MAX_ATTRIB_STACK_DEPTH:
4647
         *params = (GLint) MAX_ATTRIB_STACK_DEPTH;
4648
         break;
4649
      case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH:
4650
         *params = (GLint) MAX_CLIENT_ATTRIB_STACK_DEPTH;
4651
         break;
4652
      case GL_MAX_CLIP_PLANES:
4653
         *params = (GLint) ctx->Const.MaxClipPlanes;
4654
         break;
4655
      case GL_MAX_ELEMENTS_VERTICES:  /* GL_VERSION_1_2 */
4656
         *params = (GLint) ctx->Const.MaxArrayLockSize;
4657
         break;
4658
      case GL_MAX_ELEMENTS_INDICES:   /* GL_VERSION_1_2 */
4659
         *params = (GLint) ctx->Const.MaxArrayLockSize;
4660
         break;
4661
      case GL_MAX_EVAL_ORDER:
4662
         *params = (GLint) MAX_EVAL_ORDER;
4663
         break;
4664
      case GL_MAX_LIGHTS:
4665
         *params = (GLint) ctx->Const.MaxLights;
4666
         break;
4667
      case GL_MAX_LIST_NESTING:
4668
         *params = (GLint) MAX_LIST_NESTING;
4669
         break;
4670
      case GL_MAX_MODELVIEW_STACK_DEPTH:
4671
         *params = (GLint) MAX_MODELVIEW_STACK_DEPTH;
4672
         break;
4673
      case GL_MAX_NAME_STACK_DEPTH:
4674
         *params = (GLint) MAX_NAME_STACK_DEPTH;
4675
         break;
4676
      case GL_MAX_PIXEL_MAP_TABLE:
4677
         *params = (GLint) MAX_PIXEL_MAP_TABLE;
4678
         break;
4679
      case GL_MAX_PROJECTION_STACK_DEPTH:
4680
         *params = (GLint) MAX_PROJECTION_STACK_DEPTH;
4681
         break;
4682
      case GL_MAX_TEXTURE_SIZE:
4683
         *params = (1 << (ctx->Const.MaxTextureLevels - 1));
4684
         break;
4685
      case GL_MAX_3D_TEXTURE_SIZE:
4686
         *params = (1 << (ctx->Const.Max3DTextureLevels - 1));
4687
         break;
4688
      case GL_MAX_TEXTURE_STACK_DEPTH:
4689
         *params = (GLint) MAX_TEXTURE_STACK_DEPTH;
4690
         break;
4691
      case GL_MAX_VIEWPORT_DIMS:
4692
         params[0] = (GLint) MAX_WIDTH;
4693
         params[1] = (GLint) MAX_HEIGHT;
4694
         break;
4695
      case GL_MODELVIEW_MATRIX:
4696
         for (i=0;i<16;i++) {
4697
            params[i] = (GLint) ctx->ModelviewMatrixStack.Top->m[i];
4698
         }
4699
         break;
4700
      case GL_MODELVIEW_STACK_DEPTH:
4701
         *params = (GLint) (ctx->ModelviewMatrixStack.Depth + 1);
4702
         break;
4703
      case GL_NAME_STACK_DEPTH:
4704
         *params = (GLint) ctx->Select.NameStackDepth;
4705
         break;
4706
      case GL_NORMALIZE:
4707
         *params = (GLint) ctx->Transform.Normalize;
4708
         break;
4709
      case GL_PACK_ALIGNMENT:
4710
         *params = ctx->Pack.Alignment;
4711
         break;
4712
      case GL_PACK_LSB_FIRST:
4713
         *params = (GLint) ctx->Pack.LsbFirst;
4714
         break;
4715
      case GL_PACK_ROW_LENGTH:
4716
         *params = ctx->Pack.RowLength;
4717
         break;
4718
      case GL_PACK_SKIP_PIXELS:
4719
         *params = ctx->Pack.SkipPixels;
4720
         break;
4721
      case GL_PACK_SKIP_ROWS:
4722
         *params = ctx->Pack.SkipRows;
4723
         break;
4724
      case GL_PACK_SWAP_BYTES:
4725
         *params = (GLint) ctx->Pack.SwapBytes;
4726
         break;
4727
      case GL_PACK_SKIP_IMAGES_EXT:
4728
         *params = ctx->Pack.SkipImages;
4729
         break;
4730
      case GL_PACK_IMAGE_HEIGHT_EXT:
4731
         *params = ctx->Pack.ImageHeight;
4732
         break;
4733
      case GL_PACK_INVERT_MESA:
4734
         *params = ctx->Pack.Invert;
4735
         break;
4736
      case GL_PERSPECTIVE_CORRECTION_HINT:
4737
         *params = (GLint) ctx->Hint.PerspectiveCorrection;
4738
         break;
4739
      case GL_PIXEL_MAP_A_TO_A_SIZE:
4740
         *params = ctx->Pixel.MapAtoAsize;
4741
         break;
4742
      case GL_PIXEL_MAP_B_TO_B_SIZE:
4743
         *params = ctx->Pixel.MapBtoBsize;
4744
         break;
4745
      case GL_PIXEL_MAP_G_TO_G_SIZE:
4746
         *params = ctx->Pixel.MapGtoGsize;
4747
         break;
4748
      case GL_PIXEL_MAP_I_TO_A_SIZE:
4749
         *params = ctx->Pixel.MapItoAsize;
4750
         break;
4751
      case GL_PIXEL_MAP_I_TO_B_SIZE:
4752
         *params = ctx->Pixel.MapItoBsize;
4753
         break;
4754
      case GL_PIXEL_MAP_I_TO_G_SIZE:
4755
         *params = ctx->Pixel.MapItoGsize;
4756
         break;
4757
      case GL_PIXEL_MAP_I_TO_I_SIZE:
4758
         *params = ctx->Pixel.MapItoIsize;
4759
         break;
4760
      case GL_PIXEL_MAP_I_TO_R_SIZE:
4761
         *params = ctx->Pixel.MapItoRsize;
4762
         break;
4763
      case GL_PIXEL_MAP_R_TO_R_SIZE:
4764
         *params = ctx->Pixel.MapRtoRsize;
4765
         break;
4766
      case GL_PIXEL_MAP_S_TO_S_SIZE:
4767
         *params = ctx->Pixel.MapStoSsize;
4768
         break;
4769
      case GL_POINT_SIZE:
4770
         *params = (GLint) ctx->Point.Size;
4771
         break;
4772
      case GL_POINT_SIZE_GRANULARITY:
4773
         *params = (GLint) ctx->Const.PointSizeGranularity;
4774
         break;
4775
      case GL_POINT_SIZE_RANGE:
4776
         params[0] = (GLint) ctx->Const.MinPointSizeAA;
4777
         params[1] = (GLint) ctx->Const.MaxPointSizeAA;
4778
         break;
4779
      case GL_ALIASED_POINT_SIZE_RANGE:
4780
         params[0] = (GLint) ctx->Const.MinPointSize;
4781
         params[1] = (GLint) ctx->Const.MaxPointSize;
4782
         break;
4783
      case GL_POINT_SMOOTH:
4784
         *params = (GLint) ctx->Point.SmoothFlag;
4785
         break;
4786
      case GL_POINT_SMOOTH_HINT:
4787
         *params = (GLint) ctx->Hint.PointSmooth;
4788
         break;
4789
      case GL_POINT_SIZE_MIN_EXT:
4790
         *params = (GLint) (ctx->Point.MinSize);
4791
         break;
4792
      case GL_POINT_SIZE_MAX_EXT:
4793
         *params = (GLint) (ctx->Point.MaxSize);
4794
         break;
4795
      case GL_POINT_FADE_THRESHOLD_SIZE_EXT:
4796
         *params = (GLint) (ctx->Point.Threshold);
4797
         break;
4798
      case GL_DISTANCE_ATTENUATION_EXT:
4799
         params[0] = (GLint) (ctx->Point.Params[0]);
4800
         params[1] = (GLint) (ctx->Point.Params[1]);
4801
         params[2] = (GLint) (ctx->Point.Params[2]);
4802
         break;
4803
      case GL_POLYGON_MODE:
4804
         params[0] = (GLint) ctx->Polygon.FrontMode;
4805
         params[1] = (GLint) ctx->Polygon.BackMode;
4806
         break;
4807
      case GL_POLYGON_OFFSET_BIAS_EXT: /* GL_EXT_polygon_offset */
4808
         *params = (GLint) ctx->Polygon.OffsetUnits;
4809
         break;
4810
      case GL_POLYGON_OFFSET_FACTOR:
4811
         *params = (GLint) ctx->Polygon.OffsetFactor;
4812
         break;
4813
      case GL_POLYGON_OFFSET_UNITS:
4814
         *params = (GLint) ctx->Polygon.OffsetUnits;
4815
         break;
4816
      case GL_POLYGON_SMOOTH:
4817
         *params = (GLint) ctx->Polygon.SmoothFlag;
4818
         break;
4819
      case GL_POLYGON_SMOOTH_HINT:
4820
         *params = (GLint) ctx->Hint.PolygonSmooth;
4821
         break;
4822
      case GL_POLYGON_STIPPLE:
4823
         *params = (GLint) ctx->Polygon.StippleFlag;
4824
         break;
4825
      case GL_PROJECTION_MATRIX:
4826
         for (i=0;i<16;i++) {
4827
            params[i] = (GLint) ctx->ProjectionMatrixStack.Top->m[i];
4828
         }
4829
         break;
4830
      case GL_PROJECTION_STACK_DEPTH:
4831
         *params = (GLint) (ctx->ProjectionMatrixStack.Depth + 1);
4832
         break;
4833
      case GL_READ_BUFFER:
4834
         *params = (GLint) ctx->Pixel.ReadBuffer;
4835
         break;
4836
      case GL_RED_BIAS:
4837
         *params = (GLint) ctx->Pixel.RedBias;
4838
         break;
4839
      case GL_RED_BITS:
4840
         *params = (GLint) ctx->Visual.redBits;
4841
         break;
4842
      case GL_RED_SCALE:
4843
         *params = (GLint) ctx->Pixel.RedScale;
4844
         break;
4845
      case GL_RENDER_MODE:
4846
         *params = (GLint) ctx->RenderMode;
4847
         break;
4848
      case GL_RESCALE_NORMAL:
4849
         *params = (GLint) ctx->Transform.RescaleNormals;
4850
         break;
4851
      case GL_RGBA_MODE:
4852
         *params = (GLint) ctx->Visual.rgbMode;
4853
         break;
4854
      case GL_SCISSOR_BOX:
4855
         params[0] = (GLint) ctx->Scissor.X;
4856
         params[1] = (GLint) ctx->Scissor.Y;
4857
         params[2] = (GLint) ctx->Scissor.Width;
4858
         params[3] = (GLint) ctx->Scissor.Height;
4859
         break;
4860
      case GL_SCISSOR_TEST:
4861
         *params = (GLint) ctx->Scissor.Enabled;
4862
         break;
4863
      case GL_SELECTION_BUFFER_SIZE:
4864
         *params = (GLint) ctx->Select.BufferSize;
4865
         break;
4866
      case GL_SHADE_MODEL:
4867
         *params = (GLint) ctx->Light.ShadeModel;
4868
         break;
4869
      case GL_SHARED_TEXTURE_PALETTE_EXT:
4870
         *params = (GLint) ctx->Texture.SharedPalette;
4871
         break;
4872
      case GL_STENCIL_BITS:
4873
         *params = ctx->Visual.stencilBits;
4874
         break;
4875
      case GL_STENCIL_CLEAR_VALUE:
4876
         *params = (GLint) ctx->Stencil.Clear;
4877
         break;
4878
      case GL_STENCIL_FAIL:
4879
         *params = (GLint) ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace];
4880
         break;
4881
      case GL_STENCIL_FUNC:
4882
         *params = (GLint) ctx->Stencil.Function[ctx->Stencil.ActiveFace];
4883
         break;
4884
      case GL_STENCIL_PASS_DEPTH_FAIL:
4885
         *params = (GLint) ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace];
4886
         break;
4887
      case GL_STENCIL_PASS_DEPTH_PASS:
4888
         *params = (GLint) ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace];
4889
         break;
4890
      case GL_STENCIL_REF:
4891
         *params = (GLint) ctx->Stencil.Ref[ctx->Stencil.ActiveFace];
4892
         break;
4893
      case GL_STENCIL_TEST:
4894
         *params = (GLint) ctx->Stencil.Enabled;
4895
         break;
4896
      case GL_STENCIL_VALUE_MASK:
4897
         *params = (GLint) ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace];
4898
         break;
4899
      case GL_STENCIL_WRITEMASK:
4900
         *params = (GLint) ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace];
4901
         break;
4902
      case GL_STEREO:
4903
         *params = (GLint) ctx->Visual.stereoMode;
4904
         break;
4905
      case GL_SUBPIXEL_BITS:
4906
         *params = ctx->Const.SubPixelBits;
4907
         break;
4908
      case GL_TEXTURE_1D:
4909
         *params = _mesa_IsEnabled(GL_TEXTURE_1D) ? 1 : 0;
4910
         break;
4911
      case GL_TEXTURE_2D:
4912
         *params = _mesa_IsEnabled(GL_TEXTURE_2D) ? 1 : 0;
4913
         break;
4914
      case GL_TEXTURE_3D:
4915
         *params = _mesa_IsEnabled(GL_TEXTURE_3D) ? 1 : 0;
4916
         break;
4917
      case GL_TEXTURE_BINDING_1D:
4918
         *params = textureUnit->Current1D->Name;
4919
          break;
4920
      case GL_TEXTURE_BINDING_2D:
4921
         *params = textureUnit->Current2D->Name;
4922
          break;
4923
      case GL_TEXTURE_BINDING_3D:
4924
         *params = textureUnit->Current3D->Name;
4925
          break;
4926
      case GL_TEXTURE_ENV_COLOR:
4927
         params[0] = FLOAT_TO_INT( textureUnit->EnvColor[0] );
4928
         params[1] = FLOAT_TO_INT( textureUnit->EnvColor[1] );
4929
         params[2] = FLOAT_TO_INT( textureUnit->EnvColor[2] );
4930
         params[3] = FLOAT_TO_INT( textureUnit->EnvColor[3] );
4931
         break;
4932
      case GL_TEXTURE_ENV_MODE:
4933
         *params = (GLint) textureUnit->EnvMode;
4934
         break;
4935
      case GL_TEXTURE_GEN_S:
4936
         *params = (textureUnit->TexGenEnabled & S_BIT) ? 1 : 0;
4937
         break;
4938
      case GL_TEXTURE_GEN_T:
4939
         *params = (textureUnit->TexGenEnabled & T_BIT) ? 1 : 0;
4940
         break;
4941
      case GL_TEXTURE_GEN_R:
4942
         *params = (textureUnit->TexGenEnabled & R_BIT) ? 1 : 0;
4943
         break;
4944
      case GL_TEXTURE_GEN_Q:
4945
         *params = (textureUnit->TexGenEnabled & Q_BIT) ? 1 : 0;
4946
         break;
4947
      case GL_TEXTURE_MATRIX:
4948
         for (i=0;i<16;i++) {
4949
            params[i] = (GLint) ctx->TextureMatrixStack[texUnit].Top->m[i];
4950
         }
4951
         break;
4952
      case GL_TEXTURE_STACK_DEPTH:
4953
         *params = (GLint) (ctx->TextureMatrixStack[texUnit].Depth + 1);
4954
         break;
4955
      case GL_UNPACK_ALIGNMENT:
4956
         *params = ctx->Unpack.Alignment;
4957
         break;
4958
      case GL_UNPACK_LSB_FIRST:
4959
         *params = (GLint) ctx->Unpack.LsbFirst;
4960
         break;
4961
      case GL_UNPACK_ROW_LENGTH:
4962
         *params = ctx->Unpack.RowLength;
4963
         break;
4964
      case GL_UNPACK_SKIP_PIXELS:
4965
         *params = ctx->Unpack.SkipPixels;
4966
         break;
4967
      case GL_UNPACK_SKIP_ROWS:
4968
         *params = ctx->Unpack.SkipRows;
4969
         break;
4970
      case GL_UNPACK_SWAP_BYTES:
4971
         *params = (GLint) ctx->Unpack.SwapBytes;
4972
         break;
4973
      case GL_UNPACK_SKIP_IMAGES_EXT:
4974
         *params = ctx->Unpack.SkipImages;
4975
         break;
4976
      case GL_UNPACK_IMAGE_HEIGHT_EXT:
4977
         *params = ctx->Unpack.ImageHeight;
4978
         break;
4979
      case GL_UNPACK_CLIENT_STORAGE_APPLE:
4980
         *params = ctx->Unpack.ClientStorage;
4981
         break;
4982
      case GL_VIEWPORT:
4983
         params[0] = (GLint) ctx->Viewport.X;
4984
         params[1] = (GLint) ctx->Viewport.Y;
4985
         params[2] = (GLint) ctx->Viewport.Width;
4986
         params[3] = (GLint) ctx->Viewport.Height;
4987
         break;
4988
      case GL_ZOOM_X:
4989
         *params = (GLint) ctx->Pixel.ZoomX;
4990
         break;
4991
      case GL_ZOOM_Y:
4992
         *params = (GLint) ctx->Pixel.ZoomY;
4993
         break;
4994
      case GL_VERTEX_ARRAY:
4995
         *params = (GLint) ctx->Array.Vertex.Enabled;
4996
         break;
4997
      case GL_VERTEX_ARRAY_SIZE:
4998
         *params = ctx->Array.Vertex.Size;
4999
         break;
5000
      case GL_VERTEX_ARRAY_TYPE:
5001
         *params = ctx->Array.Vertex.Type;
5002
         break;
5003
      case GL_VERTEX_ARRAY_STRIDE:
5004
         *params = ctx->Array.Vertex.Stride;
5005
         break;
5006
      case GL_VERTEX_ARRAY_COUNT_EXT:
5007
         *params = 0;
5008
         break;
5009
      case GL_NORMAL_ARRAY:
5010
         *params = (GLint) ctx->Array.Normal.Enabled;
5011
         break;
5012
      case GL_NORMAL_ARRAY_TYPE:
5013
         *params = ctx->Array.Normal.Type;
5014
         break;
5015
      case GL_NORMAL_ARRAY_STRIDE:
5016
         *params = ctx->Array.Normal.Stride;
5017
         break;
5018
      case GL_NORMAL_ARRAY_COUNT_EXT:
5019
         *params = 0;
5020
         break;
5021
      case GL_COLOR_ARRAY:
5022
         *params = (GLint) ctx->Array.Color.Enabled;
5023
         break;
5024
      case GL_COLOR_ARRAY_SIZE:
5025
         *params = ctx->Array.Color.Size;
5026
         break;
5027
      case GL_COLOR_ARRAY_TYPE:
5028
         *params = ctx->Array.Color.Type;
5029
         break;
5030
      case GL_COLOR_ARRAY_STRIDE:
5031
         *params = ctx->Array.Color.Stride;
5032
         break;
5033
      case GL_COLOR_ARRAY_COUNT_EXT:
5034
         *params = 0;
5035
         break;
5036
      case GL_INDEX_ARRAY:
5037
         *params = (GLint) ctx->Array.Index.Enabled;
5038
         break;
5039
      case GL_INDEX_ARRAY_TYPE:
5040
         *params = ctx->Array.Index.Type;
5041
         break;
5042
      case GL_INDEX_ARRAY_STRIDE:
5043
         *params = ctx->Array.Index.Stride;
5044
         break;
5045
      case GL_INDEX_ARRAY_COUNT_EXT:
5046
         *params = 0;
5047
         break;
5048
      case GL_TEXTURE_COORD_ARRAY:
5049
         *params = (GLint) ctx->Array.TexCoord[texUnit].Enabled;
5050
         break;
5051
      case GL_TEXTURE_COORD_ARRAY_SIZE:
5052
         *params = ctx->Array.TexCoord[texUnit].Size;
5053
         break;
5054
      case GL_TEXTURE_COORD_ARRAY_TYPE:
5055
         *params = ctx->Array.TexCoord[texUnit].Type;
5056
         break;
5057
      case GL_TEXTURE_COORD_ARRAY_STRIDE:
5058
         *params = ctx->Array.TexCoord[texUnit].Stride;
5059
         break;
5060
      case GL_TEXTURE_COORD_ARRAY_COUNT_EXT:
5061
         *params = 0;
5062
         break;
5063
      case GL_EDGE_FLAG_ARRAY:
5064
         *params = (GLint) ctx->Array.EdgeFlag.Enabled;
5065
         break;
5066
      case GL_EDGE_FLAG_ARRAY_STRIDE:
5067
         *params = ctx->Array.EdgeFlag.Stride;
5068
         break;
5069
      case GL_EDGE_FLAG_ARRAY_COUNT_EXT:
5070
         *params = 0;
5071
         break;
5072
 
5073
      /* GL_ARB_multitexture */
5074
      case GL_MAX_TEXTURE_UNITS_ARB:
5075
         CHECK_EXTENSION_I(ARB_multitexture, pname);
5076
         *params = ctx->Const.MaxTextureUnits;
5077
         break;
5078
      case GL_ACTIVE_TEXTURE_ARB:
5079
         CHECK_EXTENSION_I(ARB_multitexture, pname);
5080
         *params = GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit;
5081
         break;
5082
      case GL_CLIENT_ACTIVE_TEXTURE_ARB:
5083
         CHECK_EXTENSION_I(ARB_multitexture, pname);
5084
         *params = GL_TEXTURE0_ARB + ctx->Array.ActiveTexture;
5085
         break;
5086
 
5087
      /* GL_ARB_texture_cube_map */
5088
      case GL_TEXTURE_CUBE_MAP_ARB:
5089
         CHECK_EXTENSION_I(ARB_texture_cube_map, pname);
5090
         *params = (GLint) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
5091
         break;
5092
      case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
5093
         CHECK_EXTENSION_I(ARB_texture_cube_map, pname);
5094
         *params = textureUnit->CurrentCubeMap->Name;
5095
         break;
5096
      case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
5097
         CHECK_EXTENSION_I(ARB_texture_cube_map, pname);
5098
         *params = (1 << (ctx->Const.MaxCubeTextureLevels - 1));
5099
         break;
5100
 
5101
      /* GL_ARB_texture_compression */
5102
      case GL_TEXTURE_COMPRESSION_HINT_ARB:
5103
         CHECK_EXTENSION_I(ARB_texture_compression, pname);
5104
         *params = (GLint) ctx->Hint.TextureCompression;
5105
         break;
5106
      case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
5107
         CHECK_EXTENSION_I(ARB_texture_compression, pname);
5108
         *params = (GLint) _mesa_get_compressed_formats(ctx, NULL);
5109
         break;
5110
      case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
5111
         CHECK_EXTENSION_I(ARB_texture_compression, pname);
5112
         (void) _mesa_get_compressed_formats(ctx, params);
5113
         break;
5114
 
5115
      /* GL_EXT_compiled_vertex_array */
5116
      case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT:
5117
         CHECK_EXTENSION_I(EXT_compiled_vertex_array, pname);
5118
         *params = ctx->Array.LockFirst;
5119
         break;
5120
      case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT:
5121
         CHECK_EXTENSION_I(EXT_compiled_vertex_array, pname);
5122
         *params = ctx->Array.LockCount;
5123
         break;
5124
 
5125
      /* GL_ARB_transpose_matrix */
5126
      case GL_TRANSPOSE_COLOR_MATRIX_ARB:
5127
         {
5128
            GLfloat tm[16];
5129
            GLuint i;
5130
            _math_transposef(tm, ctx->ColorMatrixStack.Top->m);
5131
            for (i=0;i<16;i++) {
5132
               params[i] = (GLint) tm[i];
5133
            }
5134
         }
5135
         break;
5136
      case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB:
5137
         {
5138
            GLfloat tm[16];
5139
            GLuint i;
5140
            _math_transposef(tm, ctx->ModelviewMatrixStack.Top->m);
5141
            for (i=0;i<16;i++) {
5142
               params[i] = (GLint) tm[i];
5143
            }
5144
         }
5145
         break;
5146
      case GL_TRANSPOSE_PROJECTION_MATRIX_ARB:
5147
         {
5148
            GLfloat tm[16];
5149
            GLuint i;
5150
            _math_transposef(tm, ctx->ProjectionMatrixStack.Top->m);
5151
            for (i=0;i<16;i++) {
5152
               params[i] = (GLint) tm[i];
5153
            }
5154
         }
5155
         break;
5156
      case GL_TRANSPOSE_TEXTURE_MATRIX_ARB:
5157
         {
5158
            GLfloat tm[16];
5159
            GLuint i;
5160
            _math_transposef(tm, ctx->TextureMatrixStack[texUnit].Top->m);
5161
            for (i=0;i<16;i++) {
5162
               params[i] = (GLint) tm[i];
5163
            }
5164
         }
5165
         break;
5166
 
5167
      /* GL_HP_occlusion_test */
5168
      case GL_OCCLUSION_TEST_HP:
5169
         CHECK_EXTENSION_I(HP_occlusion_test, pname);
5170
         *params = (GLint) ctx->Depth.OcclusionTest;
5171
         break;
5172
      case GL_OCCLUSION_TEST_RESULT_HP:
5173
         CHECK_EXTENSION_I(HP_occlusion_test, pname);
5174
         if (ctx->Depth.OcclusionTest)
5175
            *params = (GLint) ctx->OcclusionResult;
5176
         else
5177
            *params = (GLint) ctx->OcclusionResultSaved;
5178
         /* reset flag now */
5179
         ctx->OcclusionResult = GL_FALSE;
5180
         ctx->OcclusionResultSaved = GL_FALSE;
5181
         break;
5182
 
5183
      /* GL_SGIS_pixel_texture */
5184
      case GL_PIXEL_TEXTURE_SGIS:
5185
         CHECK_EXTENSION_I(SGIS_pixel_texture, pname);
5186
         *params = (GLint) ctx->Pixel.PixelTextureEnabled;
5187
         break;
5188
 
5189
      /* GL_SGIX_pixel_texture */
5190
      case GL_PIXEL_TEX_GEN_SGIX:
5191
         CHECK_EXTENSION_I(SGIX_pixel_texture, pname);
5192
         *params = (GLint) ctx->Pixel.PixelTextureEnabled;
5193
         break;
5194
      case GL_PIXEL_TEX_GEN_MODE_SGIX:
5195
         CHECK_EXTENSION_I(SGIX_pixel_texture, pname);
5196
         *params = (GLint) pixel_texgen_mode(ctx);
5197
         break;
5198
 
5199
      /* GL_SGI_color_matrix (also in 1.2 imaging) */
5200
      case GL_COLOR_MATRIX_SGI:
5201
         CHECK_EXTENSION_I(SGI_color_matrix, pname);
5202
         for (i=0;i<16;i++) {
5203
            params[i] = (GLint) ctx->ColorMatrixStack.Top->m[i];
5204
         }
5205
         break;
5206
      case GL_COLOR_MATRIX_STACK_DEPTH_SGI:
5207
         CHECK_EXTENSION_I(SGI_color_matrix, pname);
5208
         *params = ctx->ColorMatrixStack.Depth + 1;
5209
         break;
5210
      case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI:
5211
         CHECK_EXTENSION_I(SGI_color_matrix, pname);
5212
         *params = MAX_COLOR_STACK_DEPTH;
5213
         break;
5214
      case GL_POST_COLOR_MATRIX_RED_SCALE_SGI:
5215
         CHECK_EXTENSION_I(SGI_color_matrix, pname);
5216
         *params = (GLint) ctx->Pixel.PostColorMatrixScale[0];
5217
         break;
5218
      case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI:
5219
         CHECK_EXTENSION_I(SGI_color_matrix, pname);
5220
         *params = (GLint) ctx->Pixel.PostColorMatrixScale[1];
5221
         break;
5222
      case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI:
5223
         CHECK_EXTENSION_I(SGI_color_matrix, pname);
5224
         *params = (GLint) ctx->Pixel.PostColorMatrixScale[2];
5225
         break;
5226
      case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI:
5227
         CHECK_EXTENSION_I(SGI_color_matrix, pname);
5228
         *params = (GLint) ctx->Pixel.PostColorMatrixScale[3];
5229
         break;
5230
      case GL_POST_COLOR_MATRIX_RED_BIAS_SGI:
5231
         CHECK_EXTENSION_I(SGI_color_matrix, pname);
5232
         *params = (GLint) ctx->Pixel.PostColorMatrixBias[0];
5233
         break;
5234
      case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI:
5235
         CHECK_EXTENSION_I(SGI_color_matrix, pname);
5236
         *params = (GLint) ctx->Pixel.PostColorMatrixBias[1];
5237
         break;
5238
      case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI:
5239
         CHECK_EXTENSION_I(SGI_color_matrix, pname);
5240
         *params = (GLint) ctx->Pixel.PostColorMatrixBias[2];
5241
         break;
5242
      case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI:
5243
         CHECK_EXTENSION_I(SGI_color_matrix, pname);
5244
         *params = (GLint) ctx->Pixel.PostColorMatrixBias[3];
5245
         break;
5246
 
5247
      /* GL_EXT_convolution (also in 1.2 imaging) */
5248
      case GL_CONVOLUTION_1D_EXT:
5249
         CHECK_EXTENSION_I(EXT_convolution, pname);
5250
         *params = (GLint) ctx->Pixel.Convolution1DEnabled;
5251
         break;
5252
      case GL_CONVOLUTION_2D:
5253
         CHECK_EXTENSION_I(EXT_convolution, pname);
5254
         *params = (GLint) ctx->Pixel.Convolution2DEnabled;
5255
         break;
5256
      case GL_SEPARABLE_2D:
5257
         CHECK_EXTENSION_I(EXT_convolution, pname);
5258
         *params = (GLint) ctx->Pixel.Separable2DEnabled;
5259
         break;
5260
      case GL_POST_CONVOLUTION_RED_SCALE_EXT:
5261
         CHECK_EXTENSION_I(EXT_convolution, pname);
5262
         *params = (GLint) ctx->Pixel.PostConvolutionScale[0];
5263
         break;
5264
      case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:
5265
         CHECK_EXTENSION_I(EXT_convolution, pname);
5266
         *params = (GLint) ctx->Pixel.PostConvolutionScale[1];
5267
         break;
5268
      case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:
5269
         CHECK_EXTENSION_I(EXT_convolution, pname);
5270
         *params = (GLint) ctx->Pixel.PostConvolutionScale[2];
5271
         break;
5272
      case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:
5273
         CHECK_EXTENSION_I(EXT_convolution, pname);
5274
         *params = (GLint) ctx->Pixel.PostConvolutionScale[3];
5275
         break;
5276
      case GL_POST_CONVOLUTION_RED_BIAS_EXT:
5277
         CHECK_EXTENSION_I(EXT_convolution, pname);
5278
         *params = (GLint) ctx->Pixel.PostConvolutionBias[0];
5279
         break;
5280
      case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:
5281
         CHECK_EXTENSION_I(EXT_convolution, pname);
5282
         *params = (GLint) ctx->Pixel.PostConvolutionBias[1];
5283
         break;
5284
      case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:
5285
         CHECK_EXTENSION_I(EXT_convolution, pname);
5286
         *params = (GLint) ctx->Pixel.PostConvolutionBias[2];
5287
         break;
5288
      case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:
5289
         CHECK_EXTENSION_I(EXT_convolution, pname);
5290
         *params = (GLint) ctx->Pixel.PostConvolutionBias[2];
5291
         break;
5292
 
5293
      /* GL_EXT_histogram (also in 1.2 imaging) */
5294
      case GL_HISTOGRAM:
5295
         CHECK_EXTENSION_I(EXT_histogram, pname);
5296
         *params = (GLint) ctx->Pixel.HistogramEnabled;
5297
         break;
5298
      case GL_MINMAX:
5299
         CHECK_EXTENSION_I(EXT_histogram, pname);
5300
         *params = (GLint) ctx->Pixel.MinMaxEnabled;
5301
         break;
5302
 
5303
      /* GL_SGI_color_table (also in 1.2 imaging */
5304
      case GL_COLOR_TABLE_SGI:
5305
         CHECK_EXTENSION_I(SGI_color_table, pname);
5306
         *params = (GLint) ctx->Pixel.ColorTableEnabled;
5307
         break;
5308
      case GL_POST_CONVOLUTION_COLOR_TABLE_SGI:
5309
         CHECK_EXTENSION_I(SGI_color_table, pname);
5310
         *params = (GLint) ctx->Pixel.PostConvolutionColorTableEnabled;
5311
         break;
5312
      case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
5313
         CHECK_EXTENSION_I(SGI_color_table, pname);
5314
         *params = (GLint) ctx->Pixel.PostColorMatrixColorTableEnabled;
5315
         break;
5316
 
5317
 
5318
      /* GL_EXT_secondary_color */
5319
      case GL_COLOR_SUM_EXT:
5320
         CHECK_EXTENSION_I(EXT_secondary_color, pname);
5321
         *params = (GLint) ctx->Fog.ColorSumEnabled;
5322
         break;
5323
      case GL_CURRENT_SECONDARY_COLOR_EXT:
5324
         CHECK_EXTENSION_I(EXT_secondary_color, pname);
5325
         FLUSH_CURRENT(ctx, 0);
5326
         params[0] = FLOAT_TO_INT( (ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0]) );
5327
         params[1] = FLOAT_TO_INT( (ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1]) );
5328
         params[2] = FLOAT_TO_INT( (ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2]) );
5329
         break;
5330
      case GL_SECONDARY_COLOR_ARRAY_EXT:
5331
         CHECK_EXTENSION_I(EXT_secondary_color, pname);
5332
         *params = (GLint) ctx->Array.SecondaryColor.Enabled;
5333
         break;
5334
      case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT:
5335
         CHECK_EXTENSION_I(EXT_secondary_color, pname);
5336
         *params = (GLint) ctx->Array.SecondaryColor.Type;
5337
         break;
5338
      case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT:
5339
         CHECK_EXTENSION_I(EXT_secondary_color, pname);
5340
         *params = (GLint) ctx->Array.SecondaryColor.Stride;
5341
         break;
5342
      case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT:
5343
         CHECK_EXTENSION_I(EXT_secondary_color, pname);
5344
         *params = (GLint) ctx->Array.SecondaryColor.Stride;
5345
         break;
5346
 
5347
      /* GL_EXT_fog_coord */
5348
      case GL_CURRENT_FOG_COORDINATE_EXT:
5349
         CHECK_EXTENSION_I(EXT_fog_coord, pname);
5350
         FLUSH_CURRENT(ctx, 0);
5351
         *params = (GLint) ctx->Current.Attrib[VERT_ATTRIB_FOG][0];
5352
         break;
5353
      case GL_FOG_COORDINATE_ARRAY_EXT:
5354
         CHECK_EXTENSION_I(EXT_fog_coord, pname);
5355
         *params = (GLint) ctx->Array.FogCoord.Enabled;
5356
         break;
5357
      case GL_FOG_COORDINATE_ARRAY_TYPE_EXT:
5358
         CHECK_EXTENSION_I(EXT_fog_coord, pname);
5359
         *params = (GLint) ctx->Array.FogCoord.Type;
5360
         break;
5361
      case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT:
5362
         CHECK_EXTENSION_I(EXT_fog_coord, pname);
5363
         *params = (GLint) ctx->Array.FogCoord.Stride;
5364
         break;
5365
 
5366
      /* GL_EXT_texture_lod_bias */
5367
      case GL_MAX_TEXTURE_LOD_BIAS_EXT:
5368
         *params = (GLint) ctx->Const.MaxTextureLodBias;
5369
         break;
5370
 
5371
      /* GL_EXT_texture_filter_anisotropic */
5372
      case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
5373
         CHECK_EXTENSION_I(EXT_texture_filter_anisotropic, pname);
5374
         *params = (GLint) ctx->Const.MaxTextureMaxAnisotropy;
5375
         break;
5376
 
5377
      /* GL_ARB_multisample */
5378
      case GL_MULTISAMPLE_ARB:
5379
         CHECK_EXTENSION_I(ARB_multisample, pname);
5380
         *params = (GLint) ctx->Multisample.Enabled;
5381
         break;
5382
      case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
5383
         CHECK_EXTENSION_I(ARB_multisample, pname);
5384
         *params = (GLint) ctx->Multisample.SampleAlphaToCoverage;
5385
         break;
5386
      case GL_SAMPLE_ALPHA_TO_ONE_ARB:
5387
         CHECK_EXTENSION_I(ARB_multisample, pname);
5388
         *params = (GLint) ctx->Multisample.SampleAlphaToOne;
5389
         break;
5390
      case GL_SAMPLE_COVERAGE_ARB:
5391
         CHECK_EXTENSION_I(ARB_multisample, pname);
5392
         *params = (GLint) ctx->Multisample.SampleCoverage;
5393
         break;
5394
      case GL_SAMPLE_COVERAGE_VALUE_ARB:
5395
         CHECK_EXTENSION_I(ARB_multisample, pname);
5396
         *params = (GLint) ctx->Multisample.SampleCoverageValue;
5397
         break;
5398
      case GL_SAMPLE_COVERAGE_INVERT_ARB:
5399
         CHECK_EXTENSION_I(ARB_multisample, pname);
5400
         *params = (GLint) ctx->Multisample.SampleCoverageInvert;
5401
         break;
5402
      case GL_SAMPLE_BUFFERS_ARB:
5403
         CHECK_EXTENSION_I(ARB_multisample, pname);
5404
         *params = 0; /* XXX fix someday */
5405
         break;
5406
      case GL_SAMPLES_ARB:
5407
         CHECK_EXTENSION_I(ARB_multisample, pname);
5408
         *params = 0; /* XXX fix someday */
5409
         break;
5410
 
5411
      /* GL_IBM_rasterpos_clip */
5412
      case GL_RASTER_POSITION_UNCLIPPED_IBM:
5413
         CHECK_EXTENSION_I(IBM_rasterpos_clip, pname);
5414
         *params = (GLint) ctx->Transform.RasterPositionUnclipped;
5415
         break;
5416
 
5417
      /* GL_NV_point_sprite */
5418
      case GL_POINT_SPRITE_NV:
5419
         CHECK_EXTENSION_B(NV_point_sprite, pname);
5420
         *params = (GLint) ctx->Point.PointSprite;
5421
         break;
5422
      case GL_POINT_SPRITE_R_MODE_NV:
5423
         CHECK_EXTENSION_B(NV_point_sprite, pname);
5424
         *params = (GLint) ctx->Point.SpriteRMode;
5425
         break;
5426
 
5427
      /* GL_SGIS_generate_mipmap */
5428
      case GL_GENERATE_MIPMAP_HINT_SGIS:
5429
         CHECK_EXTENSION_I(SGIS_generate_mipmap, pname);
5430
         *params = (GLint) ctx->Hint.GenerateMipmap;
5431
         break;
5432
 
5433
#if FEATURE_NV_vertex_program
5434
      case GL_VERTEX_PROGRAM_NV:
5435
         CHECK_EXTENSION_I(NV_vertex_program, pname);
5436
         *params = (GLint) ctx->VertexProgram.Enabled;
5437
         break;
5438
      case GL_VERTEX_PROGRAM_POINT_SIZE_NV:
5439
         CHECK_EXTENSION_I(NV_vertex_program, pname);
5440
         *params = (GLint) ctx->VertexProgram.PointSizeEnabled;
5441
         break;
5442
      case GL_VERTEX_PROGRAM_TWO_SIDE_NV:
5443
         CHECK_EXTENSION_I(NV_vertex_program, pname);
5444
         *params = (GLint) ctx->VertexProgram.TwoSideEnabled;
5445
         break;
5446
      case GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV:
5447
         CHECK_EXTENSION_I(NV_vertex_program, pname);
5448
         *params = MAX_PROGRAM_STACK_DEPTH;
5449
         break;
5450
      case GL_MAX_TRACK_MATRICES_NV:
5451
         CHECK_EXTENSION_I(NV_vertex_program, pname);
5452
         *params = MAX_PROGRAM_MATRICES;
5453
         break;
5454
      case GL_CURRENT_MATRIX_STACK_DEPTH_NV:
5455
         CHECK_EXTENSION_I(NV_vertex_program, pname);
5456
         *params = ctx->CurrentStack->Depth;
5457
         break;
5458
      case GL_CURRENT_MATRIX_NV:
5459
         CHECK_EXTENSION_I(NV_vertex_program, pname);
5460
         *params = (GLint) ctx->Transform.MatrixMode;
5461
         break;
5462
      case GL_VERTEX_PROGRAM_BINDING_NV:
5463
         CHECK_EXTENSION_I(NV_vertex_program, pname);
5464
         *params = (GLint) ctx->VertexProgram.CurrentID;
5465
         break;
5466
      case GL_PROGRAM_ERROR_POSITION_NV:
5467
         CHECK_EXTENSION_I(NV_vertex_program, pname);
5468
         *params = (GLint) ctx->VertexProgram.ErrorPos;
5469
         break;
5470
      case GL_VERTEX_ATTRIB_ARRAY0_NV:
5471
      case GL_VERTEX_ATTRIB_ARRAY1_NV:
5472
      case GL_VERTEX_ATTRIB_ARRAY2_NV:
5473
      case GL_VERTEX_ATTRIB_ARRAY3_NV:
5474
      case GL_VERTEX_ATTRIB_ARRAY4_NV:
5475
      case GL_VERTEX_ATTRIB_ARRAY5_NV:
5476
      case GL_VERTEX_ATTRIB_ARRAY6_NV:
5477
      case GL_VERTEX_ATTRIB_ARRAY7_NV:
5478
      case GL_VERTEX_ATTRIB_ARRAY8_NV:
5479
      case GL_VERTEX_ATTRIB_ARRAY9_NV:
5480
      case GL_VERTEX_ATTRIB_ARRAY10_NV:
5481
      case GL_VERTEX_ATTRIB_ARRAY11_NV:
5482
      case GL_VERTEX_ATTRIB_ARRAY12_NV:
5483
      case GL_VERTEX_ATTRIB_ARRAY13_NV:
5484
      case GL_VERTEX_ATTRIB_ARRAY14_NV:
5485
      case GL_VERTEX_ATTRIB_ARRAY15_NV:
5486
         CHECK_EXTENSION_I(NV_vertex_program, pname);
5487
         {
5488
            GLuint n = (GLuint) pname - GL_VERTEX_ATTRIB_ARRAY0_NV;
5489
            *params = (GLint) ctx->Array.VertexAttrib[n].Enabled;
5490
         }
5491
         break;
5492
      case GL_MAP1_VERTEX_ATTRIB0_4_NV:
5493
      case GL_MAP1_VERTEX_ATTRIB1_4_NV:
5494
      case GL_MAP1_VERTEX_ATTRIB2_4_NV:
5495
      case GL_MAP1_VERTEX_ATTRIB3_4_NV:
5496
      case GL_MAP1_VERTEX_ATTRIB4_4_NV:
5497
      case GL_MAP1_VERTEX_ATTRIB5_4_NV:
5498
      case GL_MAP1_VERTEX_ATTRIB6_4_NV:
5499
      case GL_MAP1_VERTEX_ATTRIB7_4_NV:
5500
      case GL_MAP1_VERTEX_ATTRIB8_4_NV:
5501
      case GL_MAP1_VERTEX_ATTRIB9_4_NV:
5502
      case GL_MAP1_VERTEX_ATTRIB10_4_NV:
5503
      case GL_MAP1_VERTEX_ATTRIB11_4_NV:
5504
      case GL_MAP1_VERTEX_ATTRIB12_4_NV:
5505
      case GL_MAP1_VERTEX_ATTRIB13_4_NV:
5506
      case GL_MAP1_VERTEX_ATTRIB14_4_NV:
5507
      case GL_MAP1_VERTEX_ATTRIB15_4_NV:
5508
         CHECK_EXTENSION_B(NV_vertex_program, pname);
5509
         {
5510
            GLuint n = (GLuint) pname - GL_MAP1_VERTEX_ATTRIB0_4_NV;
5511
            *params = (GLint) ctx->Eval.Map1Attrib[n];
5512
         }
5513
         break;
5514
      case GL_MAP2_VERTEX_ATTRIB0_4_NV:
5515
      case GL_MAP2_VERTEX_ATTRIB1_4_NV:
5516
      case GL_MAP2_VERTEX_ATTRIB2_4_NV:
5517
      case GL_MAP2_VERTEX_ATTRIB3_4_NV:
5518
      case GL_MAP2_VERTEX_ATTRIB4_4_NV:
5519
      case GL_MAP2_VERTEX_ATTRIB5_4_NV:
5520
      case GL_MAP2_VERTEX_ATTRIB6_4_NV:
5521
      case GL_MAP2_VERTEX_ATTRIB7_4_NV:
5522
      case GL_MAP2_VERTEX_ATTRIB8_4_NV:
5523
      case GL_MAP2_VERTEX_ATTRIB9_4_NV:
5524
      case GL_MAP2_VERTEX_ATTRIB10_4_NV:
5525
      case GL_MAP2_VERTEX_ATTRIB11_4_NV:
5526
      case GL_MAP2_VERTEX_ATTRIB12_4_NV:
5527
      case GL_MAP2_VERTEX_ATTRIB13_4_NV:
5528
      case GL_MAP2_VERTEX_ATTRIB14_4_NV:
5529
      case GL_MAP2_VERTEX_ATTRIB15_4_NV:
5530
         CHECK_EXTENSION_B(NV_vertex_program, pname);
5531
         {
5532
            GLuint n = (GLuint) pname - GL_MAP2_VERTEX_ATTRIB0_4_NV;
5533
            *params = (GLint) ctx->Eval.Map2Attrib[n];
5534
         }
5535
         break;
5536
 
5537
      /* GL_NV_texture_rectangle */
5538
      case GL_TEXTURE_RECTANGLE_NV:
5539
         CHECK_EXTENSION_I(NV_texture_rectangle, pname);
5540
         *params = (GLint) _mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV);
5541
         break;
5542
      case GL_TEXTURE_BINDING_RECTANGLE_NV:
5543
         CHECK_EXTENSION_I(NV_texture_rectangle, pname);
5544
         *params = (GLint) textureUnit->CurrentRect->Name;
5545
         break;
5546
      case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV:
5547
         CHECK_EXTENSION_I(NV_texture_rectangle, pname);
5548
         *params = (GLint) ctx->Const.MaxTextureRectSize;
5549
         break;
5550
#endif /* FEATURE_NV_vertex_program */
5551
 
5552
      /* GL_EXT_stencil_two_side */
5553
      case GL_STENCIL_TEST_TWO_SIDE_EXT:
5554
         CHECK_EXTENSION_I(EXT_stencil_two_side, pname);
5555
         *params = (GLint) ctx->Stencil.TestTwoSide;
5556
         break;
5557
      case GL_ACTIVE_STENCIL_FACE_EXT:
5558
         CHECK_EXTENSION_I(EXT_stencil_two_side, pname);
5559
         *params = (GLint) (ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT);
5560
         break;
5561
 
5562
      default:
5563
         _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv(pname=0x%x)", pname);
5564
   }
5565
}
5566
 
5567
 
5568
 
5569
void
5570
_mesa_GetPointerv( GLenum pname, GLvoid **params )
5571
{
5572
   GET_CURRENT_CONTEXT(ctx);
5573
   GLuint texUnit = ctx->Texture.CurrentUnit;
5574
   ASSERT_OUTSIDE_BEGIN_END(ctx);
5575
 
5576
   if (!params)
5577
      return;
5578
 
5579
   if (MESA_VERBOSE & VERBOSE_API)
5580
      _mesa_debug(ctx, "glGetPointerv %s\n", _mesa_lookup_enum_by_nr(pname));
5581
 
5582
   if (ctx->Driver.GetPointerv
5583
       && (*ctx->Driver.GetPointerv)(ctx, pname, params))
5584
      return;
5585
 
5586
   switch (pname) {
5587
      case GL_VERTEX_ARRAY_POINTER:
5588
         *params = ctx->Array.Vertex.Ptr;
5589
         break;
5590
      case GL_NORMAL_ARRAY_POINTER:
5591
         *params = ctx->Array.Normal.Ptr;
5592
         break;
5593
      case GL_COLOR_ARRAY_POINTER:
5594
         *params = ctx->Array.Color.Ptr;
5595
         break;
5596
      case GL_SECONDARY_COLOR_ARRAY_POINTER_EXT:
5597
         *params = ctx->Array.SecondaryColor.Ptr;
5598
         break;
5599
      case GL_FOG_COORDINATE_ARRAY_POINTER_EXT:
5600
         *params = ctx->Array.FogCoord.Ptr;
5601
         break;
5602
      case GL_INDEX_ARRAY_POINTER:
5603
         *params = ctx->Array.Index.Ptr;
5604
         break;
5605
      case GL_TEXTURE_COORD_ARRAY_POINTER:
5606
         *params = ctx->Array.TexCoord[texUnit].Ptr;
5607
         break;
5608
      case GL_EDGE_FLAG_ARRAY_POINTER:
5609
         *params = ctx->Array.EdgeFlag.Ptr;
5610
         break;
5611
      case GL_FEEDBACK_BUFFER_POINTER:
5612
         *params = ctx->Feedback.Buffer;
5613
         break;
5614
      case GL_SELECTION_BUFFER_POINTER:
5615
         *params = ctx->Select.Buffer;
5616
         break;
5617
      default:
5618
         _mesa_error( ctx, GL_INVALID_ENUM, "glGetPointerv" );
5619
         return;
5620
   }
5621
}
5622
 
5623
 
5624
 
5625
const GLubyte *
5626
_mesa_GetString( GLenum name )
5627
{
5628
   GET_CURRENT_CONTEXT(ctx);
5629
   static const char *vendor = "Brian Paul";
5630
   static const char *renderer = "Mesa";
5631
   static const char *version_1_2 = "1.2 Mesa 5.0";
5632
   static const char *version_1_3 = "1.3 Mesa 5.0";
5633
   static const char *version_1_4 = "1.4 Mesa 5.0";
5634
 
5635
   ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
5636
 
5637
   /* this is a required driver function */
5638
   assert(ctx->Driver.GetString);
5639
   {
5640
      const GLubyte *str = (*ctx->Driver.GetString)(ctx, name);
5641
      if (str)
5642
         return str;
5643
 
5644
      switch (name) {
5645
         case GL_VENDOR:
5646
            return (const GLubyte *) vendor;
5647
         case GL_RENDERER:
5648
            return (const GLubyte *) renderer;
5649
         case GL_VERSION:
5650
            if (ctx->Extensions.ARB_multisample &&
5651
                ctx->Extensions.ARB_multitexture &&
5652
                ctx->Extensions.ARB_texture_border_clamp &&
5653
                ctx->Extensions.ARB_texture_compression &&
5654
                ctx->Extensions.ARB_texture_cube_map &&
5655
                ctx->Extensions.EXT_texture_env_add &&
5656
                ctx->Extensions.ARB_texture_env_combine &&
5657
                ctx->Extensions.ARB_texture_env_dot3) {
5658
               if (ctx->Extensions.ARB_depth_texture &&
5659
                   ctx->Extensions.ARB_shadow &&
5660
                   ctx->Extensions.ARB_texture_env_crossbar &&
5661
                   ctx->Extensions.ARB_texture_mirrored_repeat &&
5662
                   ctx->Extensions.ARB_window_pos &&
5663
                   ctx->Extensions.EXT_blend_color &&
5664
                   ctx->Extensions.EXT_blend_func_separate &&
5665
                   ctx->Extensions.EXT_blend_logic_op &&
5666
                   ctx->Extensions.EXT_blend_minmax &&
5667
                   ctx->Extensions.EXT_blend_subtract &&
5668
                   ctx->Extensions.EXT_fog_coord &&
5669
                   ctx->Extensions.EXT_multi_draw_arrays &&
5670
                   ctx->Extensions.EXT_point_parameters && /*aka ARB*/
5671
                   ctx->Extensions.EXT_secondary_color &&
5672
                   ctx->Extensions.EXT_stencil_wrap &&
5673
                   ctx->Extensions.SGIS_generate_mipmap) {
5674
                  return (const GLubyte *) version_1_4;
5675
               }
5676
               else {
5677
                  return (const GLubyte *) version_1_3;
5678
               }
5679
            }
5680
            else {
5681
               return (const GLubyte *) version_1_2;
5682
            }
5683
         case GL_EXTENSIONS:
5684
            return (const GLubyte *) _mesa_extensions_get_string(ctx);
5685
         default:
5686
            _mesa_error( ctx, GL_INVALID_ENUM, "glGetString" );
5687
            return (const GLubyte *) 0;
5688
      }
5689
   }
5690
}
5691
 
5692
 
5693
/*
5694
 * Execute a glGetError command
5695
 */
5696
GLenum
5697
_mesa_GetError( void )
5698
{
5699
   GET_CURRENT_CONTEXT(ctx);
5700
   GLenum e = ctx->ErrorValue;
5701
   ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
5702
 
5703
   if (MESA_VERBOSE & VERBOSE_API)
5704
      _mesa_debug(ctx, "glGetError <-- %s\n", _mesa_lookup_enum_by_nr(e));
5705
 
5706
   ctx->ErrorValue = (GLenum) GL_NO_ERROR;
5707
   return e;
5708
}