get.c 215 KB
Newer Older
jtg's avatar
jtg committed
1
2
/*
 * Mesa 3-D graphics library
Brian Paul's avatar
Brian Paul committed
3
 * Version:  5.1
Jouk Jansen's avatar
   
Jouk Jansen committed
4
 *
5
 * Copyright (C) 1999-2003  Brian Paul   All Rights Reserved.
Jouk Jansen's avatar
   
Jouk Jansen committed
6
 *
jtg's avatar
jtg committed
7
8
9
10
11
12
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
Jouk Jansen's avatar
   
Jouk Jansen committed
13
 *
jtg's avatar
jtg committed
14
15
 * The above copyright notice and this permission notice shall be included
 * in all copies or substantial portions of the Software.
Jouk Jansen's avatar
   
Jouk Jansen committed
16
 *
jtg's avatar
jtg committed
17
18
19
20
21
22
23
24
25
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */


26
#include "glheader.h"
27
#include "colormac.h"
jtg's avatar
jtg committed
28
29
30
#include "context.h"
#include "enable.h"
#include "enums.h"
Brian Paul's avatar
Brian Paul committed
31
#include "extensions.h"
jtg's avatar
jtg committed
32
33
#include "get.h"
#include "macros.h"
Jouk Jansen's avatar
   
Jouk Jansen committed
34
#include "mtypes.h"
35
#include "texcompress.h"
36
#include "version.h"
37
#include "math/m_matrix.h"
jtg's avatar
jtg committed
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54


#define FLOAT_TO_BOOL(X)	( (X)==0.0F ? GL_FALSE : GL_TRUE )
#define INT_TO_BOOL(I)		( (I)==0 ? GL_FALSE : GL_TRUE )
#define ENUM_TO_BOOL(E)		( (E)==0 ? GL_FALSE : GL_TRUE )

#ifdef SPECIALCAST
/* Needed for an Amiga compiler */
#define ENUM_TO_FLOAT(X) ((GLfloat)(GLint)(X))
#define ENUM_TO_DOUBLE(X) ((GLdouble)(GLint)(X))
#else
/* all other compilers */
#define ENUM_TO_FLOAT(X) ((GLfloat)(X))
#define ENUM_TO_DOUBLE(X) ((GLdouble)(X))
#endif


Brian Paul's avatar
Brian Paul committed
55
56
/* Check if named extension is enabled, if not generate error and return */

57
#define CHECK_EXTENSION_B(EXTNAME, PNAME)			\
Brian Paul's avatar
Brian Paul committed
58
   if (!ctx->Extensions.EXTNAME) {				\
59
60
      _mesa_error(ctx, GL_INVALID_VALUE,			\
                  "glGetBooleanv(0x%x)", (int) PNAME);		\
Brian Paul's avatar
Brian Paul committed
61
62
63
      return;							\
   }	

64
#define CHECK_EXTENSION_I(EXTNAME, PNAME)			\
Brian Paul's avatar
Brian Paul committed
65
   if (!ctx->Extensions.EXTNAME) {				\
66
67
      _mesa_error(ctx, GL_INVALID_VALUE,			\
                  "glGetIntegerv(0x%x)", (int) PNAME);		\
Brian Paul's avatar
Brian Paul committed
68
69
70
      return;							\
   }	

71
#define CHECK_EXTENSION_F(EXTNAME, PNAME)			\
Brian Paul's avatar
Brian Paul committed
72
   if (!ctx->Extensions.EXTNAME) {				\
73
74
      _mesa_error(ctx, GL_INVALID_VALUE,			\
                  "glGetFloatv(0x%x)", (int) PNAME);		\
Brian Paul's avatar
Brian Paul committed
75
76
77
      return;							\
   }	

78
#define CHECK_EXTENSION_D(EXTNAME, PNAME)			\
Brian Paul's avatar
Brian Paul committed
79
   if (!ctx->Extensions.EXTNAME) {				\
80
81
      _mesa_error(ctx, GL_INVALID_VALUE,			\
                  "glGetDoublev(0x%x)", (int) PNAME);		\
Brian Paul's avatar
Brian Paul committed
82
83
84
85
86
      return;							\
   }	



87

88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
static GLenum
pixel_texgen_mode(const GLcontext *ctx)
{
   if (ctx->Pixel.FragmentRgbSource == GL_CURRENT_RASTER_POSITION) {
      if (ctx->Pixel.FragmentAlphaSource == GL_CURRENT_RASTER_POSITION) {
         return GL_RGBA;
      }
      else {
         return GL_RGB;
      }
   }
   else {
      if (ctx->Pixel.FragmentAlphaSource == GL_CURRENT_RASTER_POSITION) {
         return GL_ALPHA;
      }
      else {
         return GL_NONE;
      }
   }
}


110
111
void
_mesa_GetBooleanv( GLenum pname, GLboolean *params )
jtg's avatar
jtg committed
112
{
113
   GET_CURRENT_CONTEXT(ctx);
jtg's avatar
jtg committed
114
115
116
   GLuint i;
   GLuint texUnit = ctx->Texture.CurrentUnit;
   const struct gl_texture_unit *textureUnit = &ctx->Texture.Unit[texUnit];
Keith Whitwell's avatar
Keith Whitwell committed
117
   ASSERT_OUTSIDE_BEGIN_END(ctx);
jtg's avatar
jtg committed
118

119
120
121
   if (!params)
      return;

122
123
124
125
126
   /* We need this in order to get correct results for
    * GL_OCCLUSION_TEST_RESULT_HP.  There might be other important cases.
    */
   FLUSH_VERTICES(ctx, 0);

Jouk Jansen's avatar
   
Jouk Jansen committed
127
   if (MESA_VERBOSE & VERBOSE_API)
128
      _mesa_debug(ctx, "glGetBooleanv %s\n", _mesa_lookup_enum_by_nr(pname));
jtg's avatar
jtg committed
129

130
131
132
133
   if (ctx->Driver.GetBooleanv
       && (*ctx->Driver.GetBooleanv)(ctx, pname, params))
      return;

jtg's avatar
jtg committed
134
135
   switch (pname) {
      case GL_ACCUM_RED_BITS:
136
         *params = INT_TO_BOOL(ctx->Visual.accumRedBits);
137
         break;
jtg's avatar
jtg committed
138
      case GL_ACCUM_GREEN_BITS:
139
         *params = INT_TO_BOOL(ctx->Visual.accumGreenBits);
140
         break;
jtg's avatar
jtg committed
141
      case GL_ACCUM_BLUE_BITS:
142
         *params = INT_TO_BOOL(ctx->Visual.accumBlueBits);
143
         break;
jtg's avatar
jtg committed
144
      case GL_ACCUM_ALPHA_BITS:
145
         *params = INT_TO_BOOL(ctx->Visual.accumAlphaBits);
jtg's avatar
jtg committed
146
147
148
149
150
151
152
153
154
155
156
         break;
      case GL_ACCUM_CLEAR_VALUE:
         params[0] = FLOAT_TO_BOOL(ctx->Accum.ClearColor[0]);
         params[1] = FLOAT_TO_BOOL(ctx->Accum.ClearColor[1]);
         params[2] = FLOAT_TO_BOOL(ctx->Accum.ClearColor[2]);
         params[3] = FLOAT_TO_BOOL(ctx->Accum.ClearColor[3]);
         break;
      case GL_ALPHA_BIAS:
         *params = FLOAT_TO_BOOL(ctx->Pixel.AlphaBias);
         break;
      case GL_ALPHA_BITS:
157
         *params = INT_TO_BOOL(ctx->Visual.alphaBits);
jtg's avatar
jtg committed
158
159
160
161
162
163
164
165
166
167
168
         break;
      case GL_ALPHA_SCALE:
         *params = FLOAT_TO_BOOL(ctx->Pixel.AlphaScale);
         break;
      case GL_ALPHA_TEST:
         *params = ctx->Color.AlphaEnabled;
         break;
      case GL_ALPHA_TEST_FUNC:
         *params = ENUM_TO_BOOL(ctx->Color.AlphaFunc);
         break;
      case GL_ALPHA_TEST_REF:
169
         *params = ctx->Color.AlphaRef ? GL_TRUE : GL_FALSE;
jtg's avatar
jtg committed
170
171
172
173
174
175
176
177
         break;
      case GL_ATTRIB_STACK_DEPTH:
         *params = INT_TO_BOOL(ctx->AttribStackDepth);
         break;
      case GL_AUTO_NORMAL:
         *params = ctx->Eval.AutoNormal;
         break;
      case GL_AUX_BUFFERS:
178
         *params = (ctx->Const.NumAuxBuffers) ? GL_TRUE : GL_FALSE;
jtg's avatar
jtg committed
179
180
181
182
183
184
185
186
187
188
         break;
      case GL_BLEND:
         *params = ctx->Color.BlendEnabled;
         break;
      case GL_BLEND_DST:
         *params = ENUM_TO_BOOL(ctx->Color.BlendDstRGB);
         break;
      case GL_BLEND_SRC:
         *params = ENUM_TO_BOOL(ctx->Color.BlendSrcRGB);
         break;
189
      case GL_BLEND_SRC_RGB_EXT:
jtg's avatar
jtg committed
190
191
         *params = ENUM_TO_BOOL(ctx->Color.BlendSrcRGB);
         break;
192
      case GL_BLEND_DST_RGB_EXT:
jtg's avatar
jtg committed
193
194
         *params = ENUM_TO_BOOL(ctx->Color.BlendDstRGB);
         break;
195
      case GL_BLEND_SRC_ALPHA_EXT:
jtg's avatar
jtg committed
196
197
         *params = ENUM_TO_BOOL(ctx->Color.BlendSrcA);
         break;
198
      case GL_BLEND_DST_ALPHA_EXT:
jtg's avatar
jtg committed
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
         *params = ENUM_TO_BOOL(ctx->Color.BlendDstA);
         break;
      case GL_BLEND_EQUATION_EXT:
	 *params = ENUM_TO_BOOL( ctx->Color.BlendEquation );
	 break;
      case GL_BLEND_COLOR_EXT:
	 params[0] = FLOAT_TO_BOOL( ctx->Color.BlendColor[0] );
	 params[1] = FLOAT_TO_BOOL( ctx->Color.BlendColor[1] );
	 params[2] = FLOAT_TO_BOOL( ctx->Color.BlendColor[2] );
	 params[3] = FLOAT_TO_BOOL( ctx->Color.BlendColor[3] );
	 break;
      case GL_BLUE_BIAS:
         *params = FLOAT_TO_BOOL(ctx->Pixel.BlueBias);
         break;
      case GL_BLUE_BITS:
214
         *params = INT_TO_BOOL( ctx->Visual.blueBits );
jtg's avatar
jtg committed
215
216
217
218
219
220
221
222
223
224
225
226
227
         break;
      case GL_BLUE_SCALE:
         *params = FLOAT_TO_BOOL(ctx->Pixel.BlueScale);
         break;
      case GL_CLIENT_ATTRIB_STACK_DEPTH:
         *params = INT_TO_BOOL(ctx->ClientAttribStackDepth);
         break;
      case GL_CLIP_PLANE0:
      case GL_CLIP_PLANE1:
      case GL_CLIP_PLANE2:
      case GL_CLIP_PLANE3:
      case GL_CLIP_PLANE4:
      case GL_CLIP_PLANE5:
228
229
230
231
         if (ctx->Transform.ClipPlanesEnabled & (1 << (pname - GL_CLIP_PLANE0)))
            *params = GL_TRUE;
         else
            *params = GL_FALSE;
jtg's avatar
jtg committed
232
233
         break;
      case GL_COLOR_CLEAR_VALUE:
Brian Paul's avatar
Brian Paul committed
234
235
236
237
         params[0] = ctx->Color.ClearColor[0] ? GL_TRUE : GL_FALSE;
         params[1] = ctx->Color.ClearColor[1] ? GL_TRUE : GL_FALSE;
         params[2] = ctx->Color.ClearColor[2] ? GL_TRUE : GL_FALSE;
         params[3] = ctx->Color.ClearColor[3] ? GL_TRUE : GL_FALSE;
jtg's avatar
jtg committed
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
         break;
      case GL_COLOR_MATERIAL:
         *params = ctx->Light.ColorMaterialEnabled;
         break;
      case GL_COLOR_MATERIAL_FACE:
         *params = ENUM_TO_BOOL(ctx->Light.ColorMaterialFace);
         break;
      case GL_COLOR_MATERIAL_PARAMETER:
         *params = ENUM_TO_BOOL(ctx->Light.ColorMaterialMode);
         break;
      case GL_COLOR_WRITEMASK:
         params[0] = ctx->Color.ColorMask[RCOMP] ? GL_TRUE : GL_FALSE;
         params[1] = ctx->Color.ColorMask[GCOMP] ? GL_TRUE : GL_FALSE;
         params[2] = ctx->Color.ColorMask[BCOMP] ? GL_TRUE : GL_FALSE;
         params[3] = ctx->Color.ColorMask[ACOMP] ? GL_TRUE : GL_FALSE;
         break;
      case GL_CULL_FACE:
         *params = ctx->Polygon.CullFlag;
         break;
      case GL_CULL_FACE_MODE:
         *params = ENUM_TO_BOOL(ctx->Polygon.CullFaceMode);
         break;
      case GL_CURRENT_COLOR:
Keith Whitwell's avatar
Keith Whitwell committed
261
	 FLUSH_CURRENT(ctx, 0);
Brian Paul's avatar
Brian Paul committed
262
263
264
265
         params[0] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]);
         params[1] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]);
         params[2] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]);
         params[3] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]);
jtg's avatar
jtg committed
266
267
         break;
      case GL_CURRENT_INDEX:
Keith Whitwell's avatar
Keith Whitwell committed
268
	 FLUSH_CURRENT(ctx, 0);
jtg's avatar
jtg committed
269
270
271
         *params = INT_TO_BOOL(ctx->Current.Index);
         break;
      case GL_CURRENT_NORMAL:
Keith Whitwell's avatar
Keith Whitwell committed
272
	 FLUSH_CURRENT(ctx, 0);
Brian Paul's avatar
Brian Paul committed
273
274
275
         params[0] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][0]);
         params[1] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][1]);
         params[2] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_NORMAL][2]);
jtg's avatar
jtg committed
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
         break;
      case GL_CURRENT_RASTER_COLOR:
	 params[0] = FLOAT_TO_BOOL(ctx->Current.RasterColor[0]);
	 params[1] = FLOAT_TO_BOOL(ctx->Current.RasterColor[1]);
	 params[2] = FLOAT_TO_BOOL(ctx->Current.RasterColor[2]);
	 params[3] = FLOAT_TO_BOOL(ctx->Current.RasterColor[3]);
	 break;
      case GL_CURRENT_RASTER_DISTANCE:
	 *params = FLOAT_TO_BOOL(ctx->Current.RasterDistance);
	 break;
      case GL_CURRENT_RASTER_INDEX:
	 *params = FLOAT_TO_BOOL(ctx->Current.RasterIndex);
	 break;
      case GL_CURRENT_RASTER_POSITION:
	 params[0] = FLOAT_TO_BOOL(ctx->Current.RasterPos[0]);
	 params[1] = FLOAT_TO_BOOL(ctx->Current.RasterPos[1]);
	 params[2] = FLOAT_TO_BOOL(ctx->Current.RasterPos[2]);
	 params[3] = FLOAT_TO_BOOL(ctx->Current.RasterPos[3]);
	 break;
      case GL_CURRENT_RASTER_TEXTURE_COORDS:
296
297
298
299
         params[0] = FLOAT_TO_BOOL(ctx->Current.RasterTexCoords[texUnit][0]);
         params[1] = FLOAT_TO_BOOL(ctx->Current.RasterTexCoords[texUnit][1]);
         params[2] = FLOAT_TO_BOOL(ctx->Current.RasterTexCoords[texUnit][2]);
         params[3] = FLOAT_TO_BOOL(ctx->Current.RasterTexCoords[texUnit][3]);
jtg's avatar
jtg committed
300
301
302
303
304
	 break;
      case GL_CURRENT_RASTER_POSITION_VALID:
         *params = ctx->Current.RasterPosValid;
	 break;
      case GL_CURRENT_TEXTURE_COORDS:
Keith Whitwell's avatar
Keith Whitwell committed
305
	 FLUSH_CURRENT(ctx, 0);
Brian Paul's avatar
Brian Paul committed
306
307
308
309
         params[0] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][0]);
         params[1] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][1]);
         params[2] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][2]);
         params[3] = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3]);
jtg's avatar
jtg committed
310
311
312
313
314
	 break;
      case GL_DEPTH_BIAS:
         *params = FLOAT_TO_BOOL(ctx->Pixel.DepthBias);
	 break;
      case GL_DEPTH_BITS:
315
	 *params = INT_TO_BOOL(ctx->Visual.depthBits);
jtg's avatar
jtg committed
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
	 break;
      case GL_DEPTH_CLEAR_VALUE:
         *params = FLOAT_TO_BOOL(ctx->Depth.Clear);
	 break;
      case GL_DEPTH_FUNC:
         *params = ENUM_TO_BOOL(ctx->Depth.Func);
	 break;
      case GL_DEPTH_RANGE:
         params[0] = FLOAT_TO_BOOL(ctx->Viewport.Near);
         params[1] = FLOAT_TO_BOOL(ctx->Viewport.Far);
	 break;
      case GL_DEPTH_SCALE:
         *params = FLOAT_TO_BOOL(ctx->Pixel.DepthScale);
	 break;
      case GL_DEPTH_TEST:
         *params = ctx->Depth.Test;
	 break;
      case GL_DEPTH_WRITEMASK:
	 *params = ctx->Depth.Mask;
	 break;
      case GL_DITHER:
	 *params = ctx->Color.DitherFlag;
	 break;
      case GL_DOUBLEBUFFER:
340
	 *params = ctx->Visual.doubleBufferMode;
jtg's avatar
jtg committed
341
342
343
344
345
	 break;
      case GL_DRAW_BUFFER:
	 *params = ENUM_TO_BOOL(ctx->Color.DrawBuffer);
	 break;
      case GL_EDGE_FLAG:
Keith Whitwell's avatar
Keith Whitwell committed
346
	 FLUSH_CURRENT(ctx, 0);
jtg's avatar
jtg committed
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
	 *params = ctx->Current.EdgeFlag;
	 break;
      case GL_FEEDBACK_BUFFER_SIZE:
         *params = INT_TO_BOOL(ctx->Feedback.BufferSize);
         break;
      case GL_FEEDBACK_BUFFER_TYPE:
         *params = INT_TO_BOOL(ctx->Feedback.Type);
         break;
      case GL_FOG:
	 *params = ctx->Fog.Enabled;
	 break;
      case GL_FOG_COLOR:
         params[0] = FLOAT_TO_BOOL(ctx->Fog.Color[0]);
         params[1] = FLOAT_TO_BOOL(ctx->Fog.Color[1]);
         params[2] = FLOAT_TO_BOOL(ctx->Fog.Color[2]);
         params[3] = FLOAT_TO_BOOL(ctx->Fog.Color[3]);
	 break;
      case GL_FOG_DENSITY:
         *params = FLOAT_TO_BOOL(ctx->Fog.Density);
	 break;
      case GL_FOG_END:
         *params = FLOAT_TO_BOOL(ctx->Fog.End);
	 break;
      case GL_FOG_HINT:
	 *params = ENUM_TO_BOOL(ctx->Hint.Fog);
	 break;
      case GL_FOG_INDEX:
	 *params = FLOAT_TO_BOOL(ctx->Fog.Index);
	 break;
      case GL_FOG_MODE:
	 *params = ENUM_TO_BOOL(ctx->Fog.Mode);
	 break;
      case GL_FOG_START:
         *params = FLOAT_TO_BOOL(ctx->Fog.End);
	 break;
      case GL_FRONT_FACE:
	 *params = ENUM_TO_BOOL(ctx->Polygon.FrontFace);
	 break;
      case GL_GREEN_BIAS:
         *params = FLOAT_TO_BOOL(ctx->Pixel.GreenBias);
	 break;
      case GL_GREEN_BITS:
389
         *params = INT_TO_BOOL( ctx->Visual.greenBits );
jtg's avatar
jtg committed
390
391
392
393
394
	 break;
      case GL_GREEN_SCALE:
         *params = FLOAT_TO_BOOL(ctx->Pixel.GreenScale);
	 break;
      case GL_INDEX_BITS:
395
         *params = INT_TO_BOOL( ctx->Visual.indexBits );
jtg's avatar
jtg committed
396
397
398
399
400
	 break;
      case GL_INDEX_CLEAR_VALUE:
	 *params = INT_TO_BOOL(ctx->Color.ClearIndex);
	 break;
      case GL_INDEX_MODE:
401
	 *params = ctx->Visual.rgbMode ? GL_FALSE : GL_TRUE;
jtg's avatar
jtg committed
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
	 break;
      case GL_INDEX_OFFSET:
	 *params = INT_TO_BOOL(ctx->Pixel.IndexOffset);
	 break;
      case GL_INDEX_SHIFT:
	 *params = INT_TO_BOOL(ctx->Pixel.IndexShift);
	 break;
      case GL_INDEX_WRITEMASK:
	 *params = INT_TO_BOOL(ctx->Color.IndexMask);
	 break;
      case GL_LIGHT0:
      case GL_LIGHT1:
      case GL_LIGHT2:
      case GL_LIGHT3:
      case GL_LIGHT4:
      case GL_LIGHT5:
      case GL_LIGHT6:
      case GL_LIGHT7:
	 *params = ctx->Light.Light[pname-GL_LIGHT0].Enabled;
	 break;
      case GL_LIGHTING:
	 *params = ctx->Light.Enabled;
	 break;
      case GL_LIGHT_MODEL_AMBIENT:
	 params[0] = FLOAT_TO_BOOL(ctx->Light.Model.Ambient[0]);
	 params[1] = FLOAT_TO_BOOL(ctx->Light.Model.Ambient[1]);
	 params[2] = FLOAT_TO_BOOL(ctx->Light.Model.Ambient[2]);
	 params[3] = FLOAT_TO_BOOL(ctx->Light.Model.Ambient[3]);
	 break;
      case GL_LIGHT_MODEL_COLOR_CONTROL:
         params[0] = ENUM_TO_BOOL(ctx->Light.Model.ColorControl);
         break;
      case GL_LIGHT_MODEL_LOCAL_VIEWER:
	 *params = ctx->Light.Model.LocalViewer;
	 break;
      case GL_LIGHT_MODEL_TWO_SIDE:
	 *params = ctx->Light.Model.TwoSide;
	 break;
      case GL_LINE_SMOOTH:
	 *params = ctx->Line.SmoothFlag;
	 break;
      case GL_LINE_SMOOTH_HINT:
	 *params = ENUM_TO_BOOL(ctx->Hint.LineSmooth);
	 break;
      case GL_LINE_STIPPLE:
	 *params = ctx->Line.StippleFlag;
	 break;
      case GL_LINE_STIPPLE_PATTERN:
	 *params = INT_TO_BOOL(ctx->Line.StipplePattern);
	 break;
      case GL_LINE_STIPPLE_REPEAT:
	 *params = INT_TO_BOOL(ctx->Line.StippleFactor);
	 break;
      case GL_LINE_WIDTH:
	 *params = FLOAT_TO_BOOL(ctx->Line.Width);
	 break;
      case GL_LINE_WIDTH_GRANULARITY:
459
	 *params = FLOAT_TO_BOOL(ctx->Const.LineWidthGranularity);
jtg's avatar
jtg committed
460
461
	 break;
      case GL_LINE_WIDTH_RANGE:
462
463
464
	 params[0] = FLOAT_TO_BOOL(ctx->Const.MinLineWidthAA);
	 params[1] = FLOAT_TO_BOOL(ctx->Const.MaxLineWidthAA);
         break;
465
      case GL_ALIASED_LINE_WIDTH_RANGE:
466
467
	 params[0] = FLOAT_TO_BOOL(ctx->Const.MinLineWidth);
	 params[1] = FLOAT_TO_BOOL(ctx->Const.MaxLineWidth);
jtg's avatar
jtg committed
468
469
470
471
472
473
474
475
	 break;
      case GL_LIST_BASE:
	 *params = INT_TO_BOOL(ctx->List.ListBase);
	 break;
      case GL_LIST_INDEX:
	 *params = INT_TO_BOOL( ctx->CurrentListNum );
	 break;
      case GL_LIST_MODE:
476
477
478
479
480
481
         if (!ctx->CompileFlag)
            *params = 0;
         else if (ctx->ExecuteFlag)
            *params = ENUM_TO_BOOL(GL_COMPILE_AND_EXECUTE);
         else
            *params = ENUM_TO_BOOL(GL_COMPILE);
jtg's avatar
jtg committed
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
	 break;
      case GL_INDEX_LOGIC_OP:
	 *params = ctx->Color.IndexLogicOpEnabled;
	 break;
      case GL_COLOR_LOGIC_OP:
	 *params = ctx->Color.ColorLogicOpEnabled;
	 break;
      case GL_LOGIC_OP_MODE:
	 *params = ENUM_TO_BOOL(ctx->Color.LogicOp);
	 break;
      case GL_MAP1_COLOR_4:
	 *params = ctx->Eval.Map1Color4;
	 break;
      case GL_MAP1_GRID_DOMAIN:
	 params[0] = FLOAT_TO_BOOL(ctx->Eval.MapGrid1u1);
	 params[1] = FLOAT_TO_BOOL(ctx->Eval.MapGrid1u2);
	 break;
      case GL_MAP1_GRID_SEGMENTS:
	 *params = INT_TO_BOOL(ctx->Eval.MapGrid1un);
	 break;
      case GL_MAP1_INDEX:
	 *params = ctx->Eval.Map1Index;
	 break;
      case GL_MAP1_NORMAL:
	 *params = ctx->Eval.Map1Normal;
	 break;
      case GL_MAP1_TEXTURE_COORD_1:
	 *params = ctx->Eval.Map1TextureCoord1;
	 break;
      case GL_MAP1_TEXTURE_COORD_2:
	 *params = ctx->Eval.Map1TextureCoord2;
	 break;
      case GL_MAP1_TEXTURE_COORD_3:
	 *params = ctx->Eval.Map1TextureCoord3;
	 break;
      case GL_MAP1_TEXTURE_COORD_4:
	 *params = ctx->Eval.Map1TextureCoord4;
	 break;
      case GL_MAP1_VERTEX_3:
	 *params = ctx->Eval.Map1Vertex3;
	 break;
      case GL_MAP1_VERTEX_4:
	 *params = ctx->Eval.Map1Vertex4;
	 break;
      case GL_MAP2_COLOR_4:
	 *params = ctx->Eval.Map2Color4;
	 break;
      case GL_MAP2_GRID_DOMAIN:
	 params[0] = FLOAT_TO_BOOL(ctx->Eval.MapGrid2u1);
	 params[1] = FLOAT_TO_BOOL(ctx->Eval.MapGrid2u2);
	 params[2] = FLOAT_TO_BOOL(ctx->Eval.MapGrid2v1);
	 params[3] = FLOAT_TO_BOOL(ctx->Eval.MapGrid2v2);
	 break;
      case GL_MAP2_GRID_SEGMENTS:
	 params[0] = INT_TO_BOOL(ctx->Eval.MapGrid2un);
	 params[1] = INT_TO_BOOL(ctx->Eval.MapGrid2vn);
	 break;
      case GL_MAP2_INDEX:
	 *params = ctx->Eval.Map2Index;
	 break;
      case GL_MAP2_NORMAL:
	 *params = ctx->Eval.Map2Normal;
	 break;
      case GL_MAP2_TEXTURE_COORD_1:
	 *params = ctx->Eval.Map2TextureCoord1;
	 break;
      case GL_MAP2_TEXTURE_COORD_2:
	 *params = ctx->Eval.Map2TextureCoord2;
	 break;
      case GL_MAP2_TEXTURE_COORD_3:
	 *params = ctx->Eval.Map2TextureCoord3;
	 break;
      case GL_MAP2_TEXTURE_COORD_4:
	 *params = ctx->Eval.Map2TextureCoord4;
	 break;
      case GL_MAP2_VERTEX_3:
	 *params = ctx->Eval.Map2Vertex3;
	 break;
      case GL_MAP2_VERTEX_4:
	 *params = ctx->Eval.Map2Vertex4;
	 break;
      case GL_MAP_COLOR:
	 *params = ctx->Pixel.MapColorFlag;
	 break;
      case GL_MAP_STENCIL:
	 *params = ctx->Pixel.MapStencilFlag;
	 break;
      case GL_MATRIX_MODE:
	 *params = ENUM_TO_BOOL( ctx->Transform.MatrixMode );
	 break;
      case GL_MAX_ATTRIB_STACK_DEPTH:
	 *params = INT_TO_BOOL(MAX_ATTRIB_STACK_DEPTH);
	 break;
      case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH:
         *params = INT_TO_BOOL( MAX_CLIENT_ATTRIB_STACK_DEPTH);
         break;
      case GL_MAX_CLIP_PLANES:
579
	 *params = INT_TO_BOOL(ctx->Const.MaxClipPlanes);
jtg's avatar
jtg committed
580
581
	 break;
      case GL_MAX_ELEMENTS_VERTICES:  /* GL_VERSION_1_2 */
Keith Whitwell's avatar
Keith Whitwell committed
582
         *params = INT_TO_BOOL(ctx->Const.MaxArrayLockSize);
jtg's avatar
jtg committed
583
584
         break;
      case GL_MAX_ELEMENTS_INDICES:   /* GL_VERSION_1_2 */
Keith Whitwell's avatar
Keith Whitwell committed
585
         *params = INT_TO_BOOL(ctx->Const.MaxArrayLockSize);
jtg's avatar
jtg committed
586
587
588
589
590
         break;
      case GL_MAX_EVAL_ORDER:
	 *params = INT_TO_BOOL(MAX_EVAL_ORDER);
	 break;
      case GL_MAX_LIGHTS:
591
	 *params = INT_TO_BOOL(ctx->Const.MaxLights);
jtg's avatar
jtg committed
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
	 break;
      case GL_MAX_LIST_NESTING:
	 *params = INT_TO_BOOL(MAX_LIST_NESTING);
	 break;
      case GL_MAX_MODELVIEW_STACK_DEPTH:
	 *params = INT_TO_BOOL(MAX_MODELVIEW_STACK_DEPTH);
	 break;
      case GL_MAX_NAME_STACK_DEPTH:
	 *params = INT_TO_BOOL(MAX_NAME_STACK_DEPTH);
	 break;
      case GL_MAX_PIXEL_MAP_TABLE:
	 *params = INT_TO_BOOL(MAX_PIXEL_MAP_TABLE);
	 break;
      case GL_MAX_PROJECTION_STACK_DEPTH:
	 *params = INT_TO_BOOL(MAX_PROJECTION_STACK_DEPTH);
	 break;
      case GL_MAX_TEXTURE_SIZE:
609
610
         *params = INT_TO_BOOL(1 << (ctx->Const.MaxTextureLevels - 1));
	 break;
jtg's avatar
jtg committed
611
      case GL_MAX_3D_TEXTURE_SIZE:
612
         *params = INT_TO_BOOL(1 << (ctx->Const.Max3DTextureLevels - 1));
jtg's avatar
jtg committed
613
614
615
616
617
618
619
620
621
622
	 break;
      case GL_MAX_TEXTURE_STACK_DEPTH:
	 *params = INT_TO_BOOL(MAX_TEXTURE_STACK_DEPTH);
	 break;
      case GL_MAX_VIEWPORT_DIMS:
	 params[0] = INT_TO_BOOL(MAX_WIDTH);
	 params[1] = INT_TO_BOOL(MAX_HEIGHT);
	 break;
      case GL_MODELVIEW_MATRIX:
	 for (i=0;i<16;i++) {
623
	    params[i] = FLOAT_TO_BOOL(ctx->ModelviewMatrixStack.Top->m[i]);
jtg's avatar
jtg committed
624
625
626
	 }
	 break;
      case GL_MODELVIEW_STACK_DEPTH:
627
         *params = INT_TO_BOOL(ctx->ModelviewMatrixStack.Depth + 1);
jtg's avatar
jtg committed
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
	 break;
      case GL_NAME_STACK_DEPTH:
	 *params = INT_TO_BOOL(ctx->Select.NameStackDepth);
	 break;
      case GL_NORMALIZE:
	 *params = ctx->Transform.Normalize;
	 break;
      case GL_PACK_ALIGNMENT:
	 *params = INT_TO_BOOL(ctx->Pack.Alignment);
	 break;
      case GL_PACK_LSB_FIRST:
	 *params = ctx->Pack.LsbFirst;
	 break;
      case GL_PACK_ROW_LENGTH:
	 *params = INT_TO_BOOL(ctx->Pack.RowLength);
	 break;
      case GL_PACK_SKIP_PIXELS:
	 *params = INT_TO_BOOL(ctx->Pack.SkipPixels);
	 break;
      case GL_PACK_SKIP_ROWS:
	 *params = INT_TO_BOOL(ctx->Pack.SkipRows);
	 break;
      case GL_PACK_SWAP_BYTES:
	 *params = ctx->Pack.SwapBytes;
	 break;
      case GL_PACK_SKIP_IMAGES_EXT:
         *params = ctx->Pack.SkipImages;
         break;
      case GL_PACK_IMAGE_HEIGHT_EXT:
         *params = ctx->Pack.ImageHeight;
         break;
Brian Paul's avatar
Brian Paul committed
659
660
661
      case GL_PACK_INVERT_MESA:
         *params = ctx->Pack.Invert;
         break;
jtg's avatar
jtg committed
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
      case GL_PERSPECTIVE_CORRECTION_HINT:
	 *params = ENUM_TO_BOOL(ctx->Hint.PerspectiveCorrection);
	 break;
      case GL_PIXEL_MAP_A_TO_A_SIZE:
	 *params = INT_TO_BOOL(ctx->Pixel.MapAtoAsize);
	 break;
      case GL_PIXEL_MAP_B_TO_B_SIZE:
	 *params = INT_TO_BOOL(ctx->Pixel.MapBtoBsize);
	 break;
      case GL_PIXEL_MAP_G_TO_G_SIZE:
	 *params = INT_TO_BOOL(ctx->Pixel.MapGtoGsize);
	 break;
      case GL_PIXEL_MAP_I_TO_A_SIZE:
	 *params = INT_TO_BOOL(ctx->Pixel.MapItoAsize);
	 break;
      case GL_PIXEL_MAP_I_TO_B_SIZE:
	 *params = INT_TO_BOOL(ctx->Pixel.MapItoBsize);
	 break;
      case GL_PIXEL_MAP_I_TO_G_SIZE:
	 *params = INT_TO_BOOL(ctx->Pixel.MapItoGsize);
	 break;
      case GL_PIXEL_MAP_I_TO_I_SIZE:
	 *params = INT_TO_BOOL(ctx->Pixel.MapItoIsize);
	 break;
      case GL_PIXEL_MAP_I_TO_R_SIZE:
	 *params = INT_TO_BOOL(ctx->Pixel.MapItoRsize);
	 break;
      case GL_PIXEL_MAP_R_TO_R_SIZE:
	 *params = INT_TO_BOOL(ctx->Pixel.MapRtoRsize);
	 break;
      case GL_PIXEL_MAP_S_TO_S_SIZE:
	 *params = INT_TO_BOOL(ctx->Pixel.MapStoSsize);
	 break;
      case GL_POINT_SIZE:
696
	 *params = FLOAT_TO_BOOL(ctx->Point.Size);
jtg's avatar
jtg committed
697
698
	 break;
      case GL_POINT_SIZE_GRANULARITY:
699
	 *params = FLOAT_TO_BOOL(ctx->Const.PointSizeGranularity );
jtg's avatar
jtg committed
700
701
	 break;
      case GL_POINT_SIZE_RANGE:
702
703
704
	 params[0] = FLOAT_TO_BOOL(ctx->Const.MinPointSizeAA);
	 params[1] = FLOAT_TO_BOOL(ctx->Const.MaxPointSizeAA);
         break;
705
      case GL_ALIASED_POINT_SIZE_RANGE:
706
707
	 params[0] = FLOAT_TO_BOOL(ctx->Const.MinPointSize);
	 params[1] = FLOAT_TO_BOOL(ctx->Const.MaxPointSize);
jtg's avatar
jtg committed
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
	 break;
      case GL_POINT_SMOOTH:
	 *params = ctx->Point.SmoothFlag;
	 break;
      case GL_POINT_SMOOTH_HINT:
	 *params = ENUM_TO_BOOL(ctx->Hint.PointSmooth);
	 break;
      case GL_POINT_SIZE_MIN_EXT:
	 *params = FLOAT_TO_BOOL(ctx->Point.MinSize);
	 break;
      case GL_POINT_SIZE_MAX_EXT:
	 *params = FLOAT_TO_BOOL(ctx->Point.MaxSize);
	 break;
      case GL_POINT_FADE_THRESHOLD_SIZE_EXT:
	 *params = FLOAT_TO_BOOL(ctx->Point.Threshold);
	 break;
      case GL_DISTANCE_ATTENUATION_EXT:
	 params[0] = FLOAT_TO_BOOL(ctx->Point.Params[0]);
	 params[1] = FLOAT_TO_BOOL(ctx->Point.Params[1]);
	 params[2] = FLOAT_TO_BOOL(ctx->Point.Params[2]);
	 break;
      case GL_POLYGON_MODE:
	 params[0] = ENUM_TO_BOOL(ctx->Polygon.FrontMode);
	 params[1] = ENUM_TO_BOOL(ctx->Polygon.BackMode);
	 break;
733
      case GL_POLYGON_OFFSET_BIAS_EXT:  /* GL_EXT_polygon_offset */
jtg's avatar
jtg committed
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
         *params = FLOAT_TO_BOOL( ctx->Polygon.OffsetUnits );
         break;
      case GL_POLYGON_OFFSET_FACTOR:
         *params = FLOAT_TO_BOOL( ctx->Polygon.OffsetFactor );
         break;
      case GL_POLYGON_OFFSET_UNITS:
         *params = FLOAT_TO_BOOL( ctx->Polygon.OffsetUnits );
         break;
      case GL_POLYGON_SMOOTH:
	 *params = ctx->Polygon.SmoothFlag;
	 break;
      case GL_POLYGON_SMOOTH_HINT:
	 *params = ENUM_TO_BOOL(ctx->Hint.PolygonSmooth);
	 break;
      case GL_POLYGON_STIPPLE:
	 *params = ctx->Polygon.StippleFlag;
	 break;
      case GL_PROJECTION_MATRIX:
	 for (i=0;i<16;i++) {
753
	    params[i] = FLOAT_TO_BOOL(ctx->ProjectionMatrixStack.Top->m[i]);
jtg's avatar
jtg committed
754
755
756
	 }
	 break;
      case GL_PROJECTION_STACK_DEPTH:
757
	 *params = INT_TO_BOOL(ctx->ProjectionMatrixStack.Depth + 1);
jtg's avatar
jtg committed
758
759
760
761
762
763
764
765
	 break;
      case GL_READ_BUFFER:
	 *params = ENUM_TO_BOOL(ctx->Pixel.ReadBuffer);
	 break;
      case GL_RED_BIAS:
         *params = FLOAT_TO_BOOL(ctx->Pixel.RedBias);
	 break;
      case GL_RED_BITS:
766
         *params = INT_TO_BOOL( ctx->Visual.redBits );
jtg's avatar
jtg committed
767
768
769
770
771
772
773
	 break;
      case GL_RED_SCALE:
         *params = FLOAT_TO_BOOL(ctx->Pixel.RedScale);
	 break;
      case GL_RENDER_MODE:
	 *params = ENUM_TO_BOOL(ctx->RenderMode);
	 break;
Brian Paul's avatar
Brian Paul committed
774
775
776
      case GL_RESCALE_NORMAL:
         *params = ctx->Transform.RescaleNormals;
         break;
jtg's avatar
jtg committed
777
      case GL_RGBA_MODE:
778
         *params = ctx->Visual.rgbMode;
jtg's avatar
jtg committed
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
	 break;
      case GL_SCISSOR_BOX:
	 params[0] = INT_TO_BOOL(ctx->Scissor.X);
	 params[1] = INT_TO_BOOL(ctx->Scissor.Y);
	 params[2] = INT_TO_BOOL(ctx->Scissor.Width);
	 params[3] = INT_TO_BOOL(ctx->Scissor.Height);
	 break;
      case GL_SCISSOR_TEST:
	 *params = ctx->Scissor.Enabled;
	 break;
      case GL_SELECTION_BUFFER_SIZE:
         *params = INT_TO_BOOL(ctx->Select.BufferSize);
         break;
      case GL_SHADE_MODEL:
	 *params = ENUM_TO_BOOL(ctx->Light.ShadeModel);
	 break;
      case GL_SHARED_TEXTURE_PALETTE_EXT:
         *params = ctx->Texture.SharedPalette;
         break;
      case GL_STENCIL_BITS:
799
	 *params = INT_TO_BOOL(ctx->Visual.stencilBits);
jtg's avatar
jtg committed
800
801
802
803
804
	 break;
      case GL_STENCIL_CLEAR_VALUE:
	 *params = INT_TO_BOOL(ctx->Stencil.Clear);
	 break;
      case GL_STENCIL_FAIL:
805
	 *params = ENUM_TO_BOOL(ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]);
jtg's avatar
jtg committed
806
807
	 break;
      case GL_STENCIL_FUNC:
808
	 *params = ENUM_TO_BOOL(ctx->Stencil.Function[ctx->Stencil.ActiveFace]);
jtg's avatar
jtg committed
809
810
	 break;
      case GL_STENCIL_PASS_DEPTH_FAIL:
811
	 *params = ENUM_TO_BOOL(ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]);
jtg's avatar
jtg committed
812
813
	 break;
      case GL_STENCIL_PASS_DEPTH_PASS:
814
	 *params = ENUM_TO_BOOL(ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]);
jtg's avatar
jtg committed
815
816
	 break;
      case GL_STENCIL_REF:
817
	 *params = INT_TO_BOOL(ctx->Stencil.Ref[ctx->Stencil.ActiveFace]);
jtg's avatar
jtg committed
818
819
820
821
822
	 break;
      case GL_STENCIL_TEST:
	 *params = ctx->Stencil.Enabled;
	 break;
      case GL_STENCIL_VALUE_MASK:
823
	 *params = INT_TO_BOOL(ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace]);
jtg's avatar
jtg committed
824
825
	 break;
      case GL_STENCIL_WRITEMASK:
826
	 *params = INT_TO_BOOL(ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]);
jtg's avatar
jtg committed
827
828
	 break;
      case GL_STEREO:
829
	 *params = ctx->Visual.stereoMode;
jtg's avatar
jtg committed
830
831
	 break;
      case GL_SUBPIXEL_BITS:
Brian Paul's avatar
Brian Paul committed
832
	 *params = INT_TO_BOOL(ctx->Const.SubPixelBits);
jtg's avatar
jtg committed
833
834
	 break;
      case GL_TEXTURE_1D:
835
         *params = _mesa_IsEnabled(GL_TEXTURE_1D);
jtg's avatar
jtg committed
836
837
	 break;
      case GL_TEXTURE_2D:
838
         *params = _mesa_IsEnabled(GL_TEXTURE_2D);
jtg's avatar
jtg committed
839
840
	 break;
      case GL_TEXTURE_3D:
841
         *params = _mesa_IsEnabled(GL_TEXTURE_3D);
jtg's avatar
jtg committed
842
843
	 break;
      case GL_TEXTURE_BINDING_1D:
844
         *params = INT_TO_BOOL(textureUnit->Current1D->Name);
jtg's avatar
jtg committed
845
846
          break;
      case GL_TEXTURE_BINDING_2D:
847
         *params = INT_TO_BOOL(textureUnit->Current2D->Name);
jtg's avatar
jtg committed
848
849
          break;
      case GL_TEXTURE_BINDING_3D:
850
         *params = INT_TO_BOOL(textureUnit->Current3D->Name);
851
         break;
jtg's avatar
jtg committed
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
      case GL_TEXTURE_ENV_COLOR:
         {
            params[0] = FLOAT_TO_BOOL(textureUnit->EnvColor[0]);
            params[1] = FLOAT_TO_BOOL(textureUnit->EnvColor[1]);
            params[2] = FLOAT_TO_BOOL(textureUnit->EnvColor[2]);
            params[3] = FLOAT_TO_BOOL(textureUnit->EnvColor[3]);
         }
	 break;
      case GL_TEXTURE_ENV_MODE:
	 *params = ENUM_TO_BOOL(textureUnit->EnvMode);
	 break;
      case GL_TEXTURE_GEN_S:
	 *params = (textureUnit->TexGenEnabled & S_BIT) ? GL_TRUE : GL_FALSE;
	 break;
      case GL_TEXTURE_GEN_T:
	 *params = (textureUnit->TexGenEnabled & T_BIT) ? GL_TRUE : GL_FALSE;
	 break;
      case GL_TEXTURE_GEN_R:
	 *params = (textureUnit->TexGenEnabled & R_BIT) ? GL_TRUE : GL_FALSE;
	 break;
      case GL_TEXTURE_GEN_Q:
	 *params = (textureUnit->TexGenEnabled & Q_BIT) ? GL_TRUE : GL_FALSE;
	 break;
      case GL_TEXTURE_MATRIX:
	 for (i=0;i<16;i++) {
Jouk Jansen's avatar
   
Jouk Jansen committed
877
	    params[i] =
878
	       FLOAT_TO_BOOL(ctx->TextureMatrixStack[texUnit].Top->m[i]);
jtg's avatar
jtg committed
879
880
881
	 }
	 break;
      case GL_TEXTURE_STACK_DEPTH:
882
	 *params = INT_TO_BOOL(ctx->TextureMatrixStack[texUnit].Depth + 1);
jtg's avatar
jtg committed
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
	 break;
      case GL_UNPACK_ALIGNMENT:
	 *params = INT_TO_BOOL(ctx->Unpack.Alignment);
	 break;
      case GL_UNPACK_LSB_FIRST:
	 *params = ctx->Unpack.LsbFirst;
	 break;
      case GL_UNPACK_ROW_LENGTH:
	 *params = INT_TO_BOOL(ctx->Unpack.RowLength);
	 break;
      case GL_UNPACK_SKIP_PIXELS:
	 *params = INT_TO_BOOL(ctx->Unpack.SkipPixels);
	 break;
      case GL_UNPACK_SKIP_ROWS:
	 *params = INT_TO_BOOL(ctx->Unpack.SkipRows);
	 break;
      case GL_UNPACK_SWAP_BYTES:
	 *params = ctx->Unpack.SwapBytes;
	 break;
      case GL_UNPACK_SKIP_IMAGES_EXT:
         *params = ctx->Unpack.SkipImages;
         break;
      case GL_UNPACK_IMAGE_HEIGHT_EXT:
         *params = ctx->Unpack.ImageHeight;
         break;
908
909
910
      case GL_UNPACK_CLIENT_STORAGE_APPLE:
         *params = ctx->Unpack.ClientStorage;
         break;
jtg's avatar
jtg committed
911
912
913
914
915
916
917
918
919
920
921
922
      case GL_VIEWPORT:
	 params[0] = INT_TO_BOOL(ctx->Viewport.X);
	 params[1] = INT_TO_BOOL(ctx->Viewport.Y);
	 params[2] = INT_TO_BOOL(ctx->Viewport.Width);
	 params[3] = INT_TO_BOOL(ctx->Viewport.Height);
	 break;
      case GL_ZOOM_X:
	 *params = FLOAT_TO_BOOL(ctx->Pixel.ZoomX);
	 break;
      case GL_ZOOM_Y:
	 *params = FLOAT_TO_BOOL(ctx->Pixel.ZoomY);
	 break;
923
924
925
      case GL_VERTEX_ARRAY:
         *params = ctx->Array.Vertex.Enabled;
         break;
jtg's avatar
jtg committed
926
927
928
929
930
931
932
933
934
935
936
937
      case GL_VERTEX_ARRAY_SIZE:
         *params = INT_TO_BOOL(ctx->Array.Vertex.Size);
         break;
      case GL_VERTEX_ARRAY_TYPE:
         *params = ENUM_TO_BOOL(ctx->Array.Vertex.Type);
         break;
      case GL_VERTEX_ARRAY_STRIDE:
         *params = INT_TO_BOOL(ctx->Array.Vertex.Stride);
         break;
      case GL_VERTEX_ARRAY_COUNT_EXT:
         *params = INT_TO_BOOL(0);
         break;
938
939
940
      case GL_NORMAL_ARRAY:
         *params = ctx->Array.Normal.Enabled;
         break;
jtg's avatar
jtg committed
941
942
943
944
945
946
947
948
949
      case GL_NORMAL_ARRAY_TYPE:
         *params = ENUM_TO_BOOL(ctx->Array.Normal.Type);
         break;
      case GL_NORMAL_ARRAY_STRIDE:
         *params = INT_TO_BOOL(ctx->Array.Normal.Stride);
         break;
      case GL_NORMAL_ARRAY_COUNT_EXT:
         *params = INT_TO_BOOL(0);
         break;
950
951
952
      case GL_COLOR_ARRAY:
         *params = ctx->Array.Color.Enabled;
         break;
jtg's avatar
jtg committed
953
954
955
956
957
958
959
960
961
962
963
964
      case GL_COLOR_ARRAY_SIZE:
         *params = INT_TO_BOOL(ctx->Array.Color.Size);
         break;
      case GL_COLOR_ARRAY_TYPE:
         *params = ENUM_TO_BOOL(ctx->Array.Color.Type);
         break;
      case GL_COLOR_ARRAY_STRIDE:
         *params = INT_TO_BOOL(ctx->Array.Color.Stride);
         break;
      case GL_COLOR_ARRAY_COUNT_EXT:
         *params = INT_TO_BOOL(0);
         break;
965
966
967
      case GL_INDEX_ARRAY:
         *params = ctx->Array.Index.Enabled;
         break;
jtg's avatar
jtg committed
968
969
970
971
972
973
974
975
976
      case GL_INDEX_ARRAY_TYPE:
         *params = ENUM_TO_BOOL(ctx->Array.Index.Type);
         break;
      case GL_INDEX_ARRAY_STRIDE:
         *params = INT_TO_BOOL(ctx->Array.Index.Stride);
         break;
      case GL_INDEX_ARRAY_COUNT_EXT:
         *params = INT_TO_BOOL(0);
         break;
977
978
979
      case GL_TEXTURE_COORD_ARRAY:
         *params = ctx->Array.TexCoord[texUnit].Enabled;
         break;
jtg's avatar
jtg committed
980
981
982
983
984
985
986
987
988
989
990
991
      case GL_TEXTURE_COORD_ARRAY_SIZE:
         *params = INT_TO_BOOL(ctx->Array.TexCoord[texUnit].Size);
         break;
      case GL_TEXTURE_COORD_ARRAY_TYPE:
         *params = ENUM_TO_BOOL(ctx->Array.TexCoord[texUnit].Type);
         break;
      case GL_TEXTURE_COORD_ARRAY_STRIDE:
         *params = INT_TO_BOOL(ctx->Array.TexCoord[texUnit].Stride);
         break;
      case GL_TEXTURE_COORD_ARRAY_COUNT_EXT:
         *params = INT_TO_BOOL(0);
         break;
992
993
994
      case GL_EDGE_FLAG_ARRAY:
         *params = ctx->Array.EdgeFlag.Enabled;
         break;
jtg's avatar
jtg committed
995
996
997
      case GL_EDGE_FLAG_ARRAY_STRIDE:
         *params = INT_TO_BOOL(ctx->Array.EdgeFlag.Stride);
         break;
998
999
1000
      case GL_EDGE_FLAG_ARRAY_COUNT_EXT:
         *params = INT_TO_BOOL(0);
         break;
jtg's avatar
jtg committed
1001

1002
      /* GL_ARB_multitexture */
jtg's avatar
jtg committed
1003
      case GL_MAX_TEXTURE_UNITS_ARB:
1004
         CHECK_EXTENSION_B(ARB_multitexture, pname);
1005
1006
         *params = INT_TO_BOOL(MIN2(ctx->Const.MaxTextureImageUnits,
                                    ctx->Const.MaxTextureCoordUnits));
jtg's avatar
jtg committed
1007
1008
         break;
      case GL_ACTIVE_TEXTURE_ARB:
1009
         CHECK_EXTENSION_B(ARB_multitexture, pname);
jtg's avatar
jtg committed
1010
1011
1012
         *params = INT_TO_BOOL(GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit);
         break;
      case GL_CLIENT_ACTIVE_TEXTURE_ARB:
1013
         CHECK_EXTENSION_B(ARB_multitexture, pname);
jtg's avatar
jtg committed
1014
1015
1016
         *params = INT_TO_BOOL(GL_TEXTURE0_ARB + ctx->Array.ActiveTexture);
         break;

1017
1018
      /* GL_ARB_texture_cube_map */
      case GL_TEXTURE_CUBE_MAP_ARB:
1019
         CHECK_EXTENSION_B(ARB_texture_cube_map, pname);
Brian Paul's avatar
Brian Paul committed
1020
1021
         *params = _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
         break;
1022
      case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
1023
         CHECK_EXTENSION_B(ARB_texture_cube_map, pname);
Brian Paul's avatar
Brian Paul committed
1024
1025
         *params = INT_TO_BOOL(textureUnit->CurrentCubeMap->Name);
         break;
1026
      case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
1027
         CHECK_EXTENSION_B(ARB_texture_cube_map, pname);
Brian Paul's avatar
Brian Paul committed
1028
         *params = INT_TO_BOOL(1 << (ctx->Const.MaxCubeTextureLevels - 1));
1029
1030
         break;

1031
1032
      /* GL_ARB_texture_compression */
      case GL_TEXTURE_COMPRESSION_HINT_ARB:
1033
         CHECK_EXTENSION_B(ARB_texture_compression, pname);
Brian Paul's avatar
Brian Paul committed
1034
         *params = INT_TO_BOOL(ctx->Hint.TextureCompression);
1035
1036
         break;
      case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
1037
         CHECK_EXTENSION_B(ARB_texture_compression, pname);
1038
         *params = INT_TO_BOOL(_mesa_get_compressed_formats(ctx, NULL));
1039
1040
         break;
      case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
1041
         CHECK_EXTENSION_B(ARB_texture_compression, pname);
Brian Paul's avatar
Brian Paul committed
1042
         {
1043
1044
1045
1046
1047
            GLint formats[100];
            GLuint i, n;
            n = _mesa_get_compressed_formats(ctx, formats);
            for (i = 0; i < n; i++)
               params[i] = INT_TO_BOOL(formats[i]);
1048
1049
1050
         }
         break;

1051
1052
1053
1054
1055
1056
1057
1058
      /* GL_EXT_compiled_vertex_array */
      case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT:
	 *params = ctx->Array.LockFirst ? GL_TRUE : GL_FALSE;
	 break;
      case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT:
	 *params = ctx->Array.LockCount ? GL_TRUE : GL_FALSE;
	 break;

1059
1060
      /* GL_ARB_transpose_matrix */
      case GL_TRANSPOSE_COLOR_MATRIX_ARB:
1061
1062
1063
         {
            GLfloat tm[16];
            GLuint i;
1064
            _math_transposef(tm, ctx->ColorMatrixStack.Top->m);
1065
1066
1067
1068
            for (i=0;i<16;i++) {
               params[i] = FLOAT_TO_BOOL(tm[i]);
            }
         }
1069
1070
1071
1072
1073
         break;
      case GL_TRANSPOSE_MODELVIEW_MATRIX_ARB:
         {
            GLfloat tm[16];
            GLuint i;
1074
            _math_transposef(tm, ctx->ModelviewMatrixStack.Top->m);
1075
1076
1077
1078
1079
1080
1081
1082
1083
            for (i=0;i<16;i++) {
               params[i] = FLOAT_TO_BOOL(tm[i]);
            }
         }
         break;
      case GL_TRANSPOSE_PROJECTION_MATRIX_ARB:
         {
            GLfloat tm[16];
            GLuint i;
1084
            _math_transposef(tm, ctx->ProjectionMatrixStack.Top->m);
1085
1086
1087
1088
1089
1090
1091
1092
1093
            for (i=0;i<16;i++) {
               params[i] = FLOAT_TO_BOOL(tm[i]);
            }
         }
         break;
      case GL_TRANSPOSE_TEXTURE_MATRIX_ARB:
         {
            GLfloat tm[16];
            GLuint i;
1094
            _math_transposef(tm, ctx->TextureMatrixStack[texUnit].Top->m);
1095
1096
1097
1098
1099
1100
            for (i=0;i<16;i++) {
               params[i] = FLOAT_TO_BOOL(tm[i]);
            }
         }
         break;

1101
1102
      /* GL_HP_occlusion_test */
      case GL_OCCLUSION_TEST_HP:
1103
         CHECK_EXTENSION_B(HP_occlusion_test, pname);
Brian Paul's avatar
Brian Paul committed
1104
         *params = ctx->Depth.OcclusionTest;
1105
1106
         return;
      case GL_OCCLUSION_TEST_RESULT_HP:
1107
         CHECK_EXTENSION_B(HP_occlusion_test, pname);
Brian Paul's avatar
Brian Paul committed
1108
1109
1110
1111
1112
1113
1114
         if (ctx->Depth.OcclusionTest)
            *params = ctx->OcclusionResult;
         else
            *params = ctx->OcclusionResultSaved;
         /* reset flag now */
         ctx->OcclusionResult = GL_FALSE;
         ctx->OcclusionResultSaved = GL_FALSE;
1115
1116
         return;

1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
      /* GL_SGIS_pixel_texture */
      case GL_PIXEL_TEXTURE_SGIS:
         *params = ctx->Pixel.PixelTextureEnabled;
         break;

      /* GL_SGIX_pixel_texture */
      case GL_PIXEL_TEX_GEN_SGIX:
         *params = ctx->Pixel.PixelTextureEnabled;
         break;
      case GL_PIXEL_TEX_GEN_MODE_SGIX:
         *params = (GLboolean) pixel_texgen_mode(ctx);
         break;

1130
1131
1132
      /* GL_SGI_color_matrix (also in 1.2 imaging) */
      case GL_COLOR_MATRIX_SGI:
         for (i=0;i<16;i++) {
1133
	    params[i] = FLOAT_TO_BOOL(ctx->ColorMatrixStack.Top->m[i]);
1134
1135
1136
	 }
	 break;
      case GL_COLOR_MATRIX_STACK_DEPTH_SGI:
1137
         *params = INT_TO_BOOL(ctx->ColorMatrixStack.Depth + 1);
1138
1139
1140
1141
1142
         break;
      case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI:
         *params = FLOAT_TO_BOOL(MAX_COLOR_STACK_DEPTH);
         break;
      case GL_POST_COLOR_MATRIX_RED_SCALE_SGI:
1143
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixScale[0]);
1144
1145
         break;
      case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI:
1146
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixScale[1]);
1147
1148
         break;
      case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI:
1149
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixScale[2]);
1150
1151
         break;
      case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI:
1152
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixScale[3]);
1153
1154
         break;
      case GL_POST_COLOR_MATRIX_RED_BIAS_SGI:
1155
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixBias[0]);
1156
1157
         break;
      case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI:
1158
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixBias[1]);
1159
1160
         break;
      case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI:
1161
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixBias[2]);
1162
1163
         break;
      case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI:
1164
1165
1166
1167
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixBias[3]);
         break;

      /* GL_EXT_convolution (also in 1.2 imaging) */
1168
      case GL_CONVOLUTION_1D_EXT:
1169
         CHECK_EXTENSION_B(EXT_convolution, pname);
Brian Paul's avatar
Brian Paul committed
1170
         *params = ctx->Pixel.Convolution1DEnabled;
1171
1172
         break;
      case GL_CONVOLUTION_2D:
1173
         CHECK_EXTENSION_B(EXT_convolution, pname);
Brian Paul's avatar
Brian Paul committed
1174
         *params = ctx->Pixel.Convolution2DEnabled;
1175
1176
         break;
      case GL_SEPARABLE_2D:
1177
         CHECK_EXTENSION_B(EXT_convolution, pname);
Brian Paul's avatar
Brian Paul committed
1178
         *params = ctx->Pixel.Separable2DEnabled;
1179
         break;
1180
      case GL_POST_CONVOLUTION_RED_SCALE_EXT:
1181
         CHECK_EXTENSION_B(EXT_convolution, pname);
1182
1183
1184
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionScale[0]);
         break;
      case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:
1185
         CHECK_EXTENSION_B(EXT_convolution, pname);
1186
1187
1188
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionScale[1]);
         break;
      case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:
1189
         CHECK_EXTENSION_B(EXT_convolution, pname);
1190
1191
1192
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionScale[2]);
         break;
      case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:
1193
         CHECK_EXTENSION_B(EXT_convolution, pname);
1194
1195
1196
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionScale[3]);
         break;
      case GL_POST_CONVOLUTION_RED_BIAS_EXT:
1197
         CHECK_EXTENSION_B(EXT_convolution, pname);
1198
1199
1200
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionBias[0]);
         break;
      case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:
1201
         CHECK_EXTENSION_B(EXT_convolution, pname);
1202
1203
1204
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionBias[1]);
         break;
      case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:
1205
         CHECK_EXTENSION_B(EXT_convolution, pname);
1206
1207
1208
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionBias[2]);
         break;
      case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:
1209
         CHECK_EXTENSION_B(EXT_convolution, pname);
1210
         *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionBias[2]);
1211
1212
         break;

Brian Paul's avatar
Brian Paul committed
1213
1214
      /* GL_EXT_histogram (also in 1.2 imaging) */
      case GL_HISTOGRAM:
1215
         CHECK_EXTENSION_B(EXT_histogram, pname);
Brian Paul's avatar
Brian Paul committed
1216
1217
1218
         *params = ctx->Pixel.HistogramEnabled;
	 break;
      case GL_MINMAX:
1219
         CHECK_EXTENSION_B(EXT_histogram, pname);
Brian Paul's avatar
Brian Paul committed
1220
1221
1222
         *params = ctx->Pixel.MinMaxEnabled;
         break;

1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
      /* GL_SGI_color_table (also in 1.2 imaging */
      case GL_COLOR_TABLE_SGI:
         *params = ctx->Pixel.ColorTableEnabled;
         break;
      case GL_POST_CONVOLUTION_COLOR_TABLE_SGI:
         *params = ctx->Pixel.PostConvolutionColorTableEnabled;
         break;
      case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
         *params = ctx->Pixel.PostColorMatrixColorTableEnabled;
         break;
1233

1234
1235
1236
      /* GL_SGI_texture_color_table */
      case GL_TEXTURE_COLOR_TABLE_SGI:
         CHECK_EXTENSION_B(SGI_texture_color_table, pname);
1237
         *params = textureUnit->ColorTableEnabled;
1238
1239
         break;

1240
      /* GL_EXT_secondary_color */
Jouk Jansen's avatar
   
Jouk Jansen committed
1241
      case GL_COLOR_SUM_EXT:
1242
         CHECK_EXTENSION_B(EXT_secondary_color, pname);
1243
1244
	 *params = ctx->Fog.ColorSumEnabled;
	 break;
Jouk Jansen's avatar
   
Jouk Jansen committed
1245
      case GL_CURRENT_SECONDARY_COLOR_EXT:
1246
         CHECK_EXTENSION_B(EXT_secondary_color, pname);
Keith Whitwell's avatar
Keith Whitwell committed
1247
	 FLUSH_CURRENT(ctx, 0);
Brian Paul's avatar
Brian Paul committed
1248
1249
1250
         params[0] = INT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0]);
         params[1] = INT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1]);
         params[2] = INT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2]);
1251
         params[3] = INT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3]);
1252
1253
	 break;
      case GL_SECONDARY_COLOR_ARRAY_EXT:
1254
         CHECK_EXTENSION_B(EXT_secondary_color, pname);
1255
1256
         *params = ctx->Array.SecondaryColor.Enabled;
         break;
Jouk Jansen's avatar
   
Jouk Jansen committed
1257
      case GL_SECONDARY_COLOR_ARRAY_TYPE_EXT:
1258
         CHECK_EXTENSION_B(EXT_secondary_color, pname);
1259
1260
	 *params = ENUM_TO_BOOL(ctx->Array.SecondaryColor.Type);
	 break;
Jouk Jansen's avatar
   
Jouk Jansen committed
1261
      case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT:
1262
         CHECK_EXTENSION_B(EXT_secondary_color, pname);
1263
1264
	 *params = INT_TO_BOOL(ctx->Array.SecondaryColor.Stride);
	 break;
Jouk Jansen's avatar
   
Jouk Jansen committed
1265
      case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT:
1266
         CHECK_EXTENSION_B(EXT_secondary_color, pname);
1267
	 *params = INT_TO_BOOL(ctx->Array.SecondaryColor.Size);
1268
1269
1270
	 break;

      /* GL_EXT_fog_coord */
Jouk Jansen's avatar
   
Jouk Jansen committed
1271
      case GL_CURRENT_FOG_COORDINATE_EXT:
1272
         CHECK_EXTENSION_B(EXT_fog_coord, pname);
Keith Whitwell's avatar
Keith Whitwell committed
1273
	 FLUSH_CURRENT(ctx, 0);
Brian Paul's avatar
Brian Paul committed
1274
	 *params = FLOAT_TO_BOOL(ctx->Current.Attrib[VERT_ATTRIB_FOG][0]);
1275
1276
	 break;
      case GL_FOG_COORDINATE_ARRAY_EXT:
1277
         CHECK_EXTENSION_B(EXT_fog_coord, pname);
1278
1279
         *params = ctx->Array.FogCoord.Enabled;
         break;
Jouk Jansen's avatar
   
Jouk Jansen committed
1280
      case GL_FOG_COORDINATE_ARRAY_TYPE_EXT:
1281
         CHECK_EXTENSION_B(EXT_fog_coord, pname);
1282
1283
	 *params = ENUM_TO_BOOL(ctx->Array.FogCoord.Type);
	 break;
Jouk Jansen's avatar
   
Jouk Jansen committed
1284
      case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT:
1285
         CHECK_EXTENSION_B(EXT_fog_coord, pname);
1286
1287
	 *params = INT_TO_BOOL(ctx->Array.FogCoord.Stride);
	 break;
1288
1289
1290
1291
      case GL_FOG_COORDINATE_SOURCE_EXT:
         CHECK_EXTENSION_B(EXT_fog_coord, pname);
	 *params = ENUM_TO_BOOL(ctx->Fog.FogCoordinateSource);
	 break;
1292

1293
1294
1295
1296
1297
      /* GL_EXT_texture_lod_bias */
      case GL_MAX_TEXTURE_LOD_BIAS_EXT:
         *params = FLOAT_TO_BOOL(ctx->Const.MaxTextureLodBias);
         break;

1298
1299
      /* GL_EXT_texture_filter_anisotropic */
      case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
1300
         CHECK_EXTENSION_B(EXT_texture_filter_anisotropic, pname);
Brian Paul's avatar
Brian Paul committed
1301
         *params = FLOAT_TO_BOOL(ctx->Const.MaxTextureMaxAnisotropy);
1302
1303
	 break;