1 /* $Id: enable.c,v 1.14 2000/04/07 16:27:26 brianp Exp $ */
4 * Mesa 3-D graphics library
7 * Copyright (C) 1999 Brian Paul All Rights Reserved.
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
38 #include "simple_list.h"
48 * Perform glEnable and glDisable calls.
50 void _mesa_set_enable( GLcontext
*ctx
, GLenum cap
, GLboolean state
)
52 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx
, "gl_enable/disable" );
54 if (MESA_VERBOSE
& VERBOSE_API
)
55 fprintf(stderr
, "%s %s (newstate is %x)\n",
56 state
? "glEnable" : "glDisable",
57 gl_lookup_enum_by_nr(cap
),
62 if (ctx
->Color
.AlphaEnabled
!=state
) {
63 ctx
->Color
.AlphaEnabled
= state
;
64 ctx
->NewState
|= NEW_RASTER_OPS
;
68 ctx
->Eval
.AutoNormal
= state
;
71 if (ctx
->Color
.BlendEnabled
!=state
) {
72 ctx
->Color
.BlendEnabled
= state
;
73 /* The following needed to accomodate 1.0 RGB logic op blending */
74 if (ctx
->Color
.BlendEquation
==GL_LOGIC_OP
&& state
) {
75 ctx
->Color
.ColorLogicOpEnabled
= GL_TRUE
;
78 ctx
->Color
.ColorLogicOpEnabled
= GL_FALSE
;
80 ctx
->NewState
|= NEW_RASTER_OPS
;
89 if (cap
>= GL_CLIP_PLANE0
&&
90 cap
<= GL_CLIP_PLANE5
&&
91 ctx
->Transform
.ClipEnabled
[cap
-GL_CLIP_PLANE0
] != state
)
93 GLuint p
= cap
-GL_CLIP_PLANE0
;
95 ctx
->Transform
.ClipEnabled
[p
] = state
;
96 ctx
->NewState
|= NEW_USER_CLIP
;
99 ctx
->Enabled
|= ENABLE_USERCLIP
;
100 ctx
->Transform
.AnyClip
++;
102 if (ctx
->ProjectionMatrix
.flags
& MAT_DIRTY_ALL_OVER
) {
103 gl_matrix_analyze( &ctx
->ProjectionMatrix
);
106 gl_transform_vector( ctx
->Transform
.ClipUserPlane
[p
],
107 ctx
->Transform
.EyeUserPlane
[p
],
108 ctx
->ProjectionMatrix
.inv
);
110 if (--ctx
->Transform
.AnyClip
== 0)
111 ctx
->Enabled
&= ~ENABLE_USERCLIP
;
115 case GL_COLOR_MATERIAL
:
116 if (ctx
->Light
.ColorMaterialEnabled
!=state
) {
117 ctx
->Light
.ColorMaterialEnabled
= state
;
118 ctx
->NewState
|= NEW_LIGHTING
;
120 gl_update_color_material( ctx
, ctx
->Current
.ByteColor
);
124 if (ctx
->Polygon
.CullFlag
!=state
) {
125 ctx
->Polygon
.CullFlag
= state
;
126 ctx
->TriangleCaps
^= DD_TRI_CULL
;
127 ctx
->NewState
|= NEW_POLYGON
;
131 if (state
&& ctx
->Visual
->DepthBits
==0) {
132 gl_warning(ctx
,"glEnable(GL_DEPTH_TEST) but no depth buffer");
135 if (ctx
->Depth
.Test
!=state
) {
136 ctx
->Depth
.Test
= state
;
137 ctx
->NewState
|= NEW_RASTER_OPS
;
142 /* MESA_NO_DITHER env var */
145 if (ctx
->Color
.DitherFlag
!=state
) {
146 ctx
->Color
.DitherFlag
= state
;
147 ctx
->NewState
|= NEW_RASTER_OPS
;
151 if (ctx
->Fog
.Enabled
!=state
) {
152 ctx
->Fog
.Enabled
= state
;
153 ctx
->Enabled
^= ENABLE_FOG
;
154 ctx
->NewState
|= NEW_FOG
|NEW_RASTER_OPS
;
165 if (ctx
->Light
.Light
[cap
-GL_LIGHT0
].Enabled
!= state
)
167 ctx
->Light
.Light
[cap
-GL_LIGHT0
].Enabled
= state
;
170 insert_at_tail(&ctx
->Light
.EnabledList
,
171 &ctx
->Light
.Light
[cap
-GL_LIGHT0
]);
172 if (ctx
->Light
.Enabled
)
173 ctx
->Enabled
|= ENABLE_LIGHT
;
175 remove_from_list(&ctx
->Light
.Light
[cap
-GL_LIGHT0
]);
176 if (is_empty_list(&ctx
->Light
.EnabledList
))
177 ctx
->Enabled
&= ~ENABLE_LIGHT
;
180 ctx
->NewState
|= NEW_LIGHTING
;
184 if (ctx
->Light
.Enabled
!=state
) {
185 ctx
->Light
.Enabled
= state
;
186 ctx
->Enabled
&= ~ENABLE_LIGHT
;
188 ctx
->Enabled
|= ENABLE_LIGHT
;
189 ctx
->NewState
|= NEW_LIGHTING
;
193 if (ctx
->Line
.SmoothFlag
!=state
) {
194 ctx
->Line
.SmoothFlag
= state
;
195 ctx
->NewState
|= NEW_RASTER_OPS
;
198 case GL_LINE_STIPPLE
:
199 if (ctx
->Line
.StippleFlag
!=state
) {
200 ctx
->Line
.StippleFlag
= state
;
201 ctx
->TriangleCaps
^= DD_LINE_STIPPLE
;
202 ctx
->NewState
|= NEW_RASTER_OPS
;
205 case GL_INDEX_LOGIC_OP
:
206 if (ctx
->Color
.IndexLogicOpEnabled
!=state
) {
207 ctx
->Color
.IndexLogicOpEnabled
= state
;
208 ctx
->NewState
|= NEW_RASTER_OPS
;
211 case GL_COLOR_LOGIC_OP
:
212 if (ctx
->Color
.ColorLogicOpEnabled
!=state
) {
213 ctx
->Color
.ColorLogicOpEnabled
= state
;
214 ctx
->NewState
|= NEW_RASTER_OPS
;
217 case GL_MAP1_COLOR_4
:
218 ctx
->Eval
.Map1Color4
= state
;
221 ctx
->Eval
.Map1Index
= state
;
224 ctx
->Eval
.Map1Normal
= state
;
226 case GL_MAP1_TEXTURE_COORD_1
:
227 ctx
->Eval
.Map1TextureCoord1
= state
;
229 case GL_MAP1_TEXTURE_COORD_2
:
230 ctx
->Eval
.Map1TextureCoord2
= state
;
232 case GL_MAP1_TEXTURE_COORD_3
:
233 ctx
->Eval
.Map1TextureCoord3
= state
;
235 case GL_MAP1_TEXTURE_COORD_4
:
236 ctx
->Eval
.Map1TextureCoord4
= state
;
238 case GL_MAP1_VERTEX_3
:
239 ctx
->Eval
.Map1Vertex3
= state
;
241 case GL_MAP1_VERTEX_4
:
242 ctx
->Eval
.Map1Vertex4
= state
;
244 case GL_MAP2_COLOR_4
:
245 ctx
->Eval
.Map2Color4
= state
;
248 ctx
->Eval
.Map2Index
= state
;
251 ctx
->Eval
.Map2Normal
= state
;
253 case GL_MAP2_TEXTURE_COORD_1
:
254 ctx
->Eval
.Map2TextureCoord1
= state
;
256 case GL_MAP2_TEXTURE_COORD_2
:
257 ctx
->Eval
.Map2TextureCoord2
= state
;
259 case GL_MAP2_TEXTURE_COORD_3
:
260 ctx
->Eval
.Map2TextureCoord3
= state
;
262 case GL_MAP2_TEXTURE_COORD_4
:
263 ctx
->Eval
.Map2TextureCoord4
= state
;
265 case GL_MAP2_VERTEX_3
:
266 ctx
->Eval
.Map2Vertex3
= state
;
268 case GL_MAP2_VERTEX_4
:
269 ctx
->Eval
.Map2Vertex4
= state
;
272 if (ctx
->Transform
.Normalize
!= state
) {
273 ctx
->Transform
.Normalize
= state
;
274 ctx
->NewState
|= NEW_NORMAL_TRANSFORM
|NEW_LIGHTING
;
275 ctx
->Enabled
^= ENABLE_NORMALIZE
;
278 case GL_POINT_SMOOTH
:
279 if (ctx
->Point
.SmoothFlag
!=state
) {
280 ctx
->Point
.SmoothFlag
= state
;
281 ctx
->NewState
|= NEW_RASTER_OPS
;
284 case GL_POLYGON_SMOOTH
:
285 if (ctx
->Polygon
.SmoothFlag
!=state
) {
286 ctx
->Polygon
.SmoothFlag
= state
;
287 ctx
->NewState
|= NEW_RASTER_OPS
;
290 case GL_POLYGON_STIPPLE
:
291 if (ctx
->Polygon
.StippleFlag
!=state
) {
292 ctx
->Polygon
.StippleFlag
= state
;
293 ctx
->TriangleCaps
^= DD_TRI_STIPPLE
;
294 ctx
->NewState
|= NEW_RASTER_OPS
;
297 case GL_POLYGON_OFFSET_POINT
:
298 if (ctx
->Polygon
.OffsetPoint
!=state
) {
299 ctx
->Polygon
.OffsetPoint
= state
;
300 ctx
->NewState
|= NEW_POLYGON
;
303 case GL_POLYGON_OFFSET_LINE
:
304 if (ctx
->Polygon
.OffsetLine
!=state
) {
305 ctx
->Polygon
.OffsetLine
= state
;
306 ctx
->NewState
|= NEW_POLYGON
;
309 case GL_POLYGON_OFFSET_FILL
:
310 /*case GL_POLYGON_OFFSET_EXT:*/
311 if (ctx
->Polygon
.OffsetFill
!=state
) {
312 ctx
->Polygon
.OffsetFill
= state
;
313 ctx
->NewState
|= NEW_POLYGON
;
316 case GL_RESCALE_NORMAL_EXT
:
317 if (ctx
->Transform
.RescaleNormals
!= state
) {
318 ctx
->Transform
.RescaleNormals
= state
;
319 ctx
->NewState
|= NEW_NORMAL_TRANSFORM
|NEW_LIGHTING
;
320 ctx
->Enabled
^= ENABLE_RESCALE
;
323 case GL_SCISSOR_TEST
:
324 if (ctx
->Scissor
.Enabled
!=state
) {
325 ctx
->Scissor
.Enabled
= state
;
326 ctx
->NewState
|= NEW_RASTER_OPS
;
329 case GL_SHARED_TEXTURE_PALETTE_EXT
:
330 ctx
->Texture
.SharedPalette
= state
;
332 case GL_STENCIL_TEST
:
333 if (state
&& ctx
->Visual
->StencilBits
==0) {
334 gl_warning(ctx
, "glEnable(GL_STENCIL_TEST) but no stencil buffer");
337 if (ctx
->Stencil
.Enabled
!=state
) {
338 ctx
->Stencil
.Enabled
= state
;
339 ctx
->NewState
|= NEW_RASTER_OPS
;
340 ctx
->TriangleCaps
^= DD_STENCIL
;
344 if (ctx
->Visual
->RGBAflag
) {
345 const GLuint curr
= ctx
->Texture
.CurrentUnit
;
346 const GLuint flag
= TEXTURE0_1D
<< (curr
* 4);
347 struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[curr
];
348 ctx
->NewState
|= NEW_TEXTURE_ENABLE
;
350 texUnit
->Enabled
|= TEXTURE0_1D
;
351 ctx
->Enabled
|= flag
;
354 texUnit
->Enabled
&= ~TEXTURE0_1D
;
355 ctx
->Enabled
&= ~flag
;
360 if (ctx
->Visual
->RGBAflag
) {
361 const GLuint curr
= ctx
->Texture
.CurrentUnit
;
362 const GLuint flag
= TEXTURE0_2D
<< (curr
* 4);
363 struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[curr
];
364 ctx
->NewState
|= NEW_TEXTURE_ENABLE
;
366 texUnit
->Enabled
|= TEXTURE0_2D
;
367 ctx
->Enabled
|= flag
;
370 texUnit
->Enabled
&= ~TEXTURE0_2D
;
371 ctx
->Enabled
&= ~flag
;
376 if (ctx
->Visual
->RGBAflag
) {
377 const GLuint curr
= ctx
->Texture
.CurrentUnit
;
378 const GLuint flag
= TEXTURE0_3D
<< (curr
* 4);
379 struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[curr
];
380 ctx
->NewState
|= NEW_TEXTURE_ENABLE
;
382 texUnit
->Enabled
|= TEXTURE0_3D
;
383 ctx
->Enabled
|= flag
;
386 texUnit
->Enabled
&= ~TEXTURE0_3D
;
387 ctx
->Enabled
&= ~flag
;
391 case GL_TEXTURE_GEN_Q
:
393 struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
];
395 texUnit
->TexGenEnabled
|= Q_BIT
;
397 texUnit
->TexGenEnabled
&= ~Q_BIT
;
398 ctx
->NewState
|= NEW_TEXTURING
;
401 case GL_TEXTURE_GEN_R
:
403 struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
];
405 texUnit
->TexGenEnabled
|= R_BIT
;
407 texUnit
->TexGenEnabled
&= ~R_BIT
;
408 ctx
->NewState
|= NEW_TEXTURING
;
411 case GL_TEXTURE_GEN_S
:
413 struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
];
415 texUnit
->TexGenEnabled
|= S_BIT
;
417 texUnit
->TexGenEnabled
&= ~S_BIT
;
418 ctx
->NewState
|= NEW_TEXTURING
;
421 case GL_TEXTURE_GEN_T
:
423 struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
];
425 texUnit
->TexGenEnabled
|= T_BIT
;
427 texUnit
->TexGenEnabled
&= ~T_BIT
;
428 ctx
->NewState
|= NEW_TEXTURING
;
435 case GL_VERTEX_ARRAY
:
436 ctx
->Array
.Vertex
.Enabled
= state
;
438 case GL_NORMAL_ARRAY
:
439 ctx
->Array
.Normal
.Enabled
= state
;
442 ctx
->Array
.Color
.Enabled
= state
;
445 ctx
->Array
.Index
.Enabled
= state
;
447 case GL_TEXTURE_COORD_ARRAY
:
448 ctx
->Array
.TexCoord
[ctx
->Array
.ActiveTexture
].Enabled
= state
;
450 case GL_EDGE_FLAG_ARRAY
:
451 ctx
->Array
.EdgeFlag
.Enabled
= state
;
454 /* GL_HP_occlusion_test */
455 case GL_OCCLUSION_TEST_HP
:
456 if (ctx
->Extensions
.HaveHpOcclusionTest
) {
457 ctx
->Depth
.OcclusionTest
= state
;
459 ctx
->OcclusionResult
= ctx
->OcclusionResultSaved
;
461 ctx
->OcclusionResultSaved
= ctx
->OcclusionResult
;
462 ctx
->NewState
|= NEW_RASTER_OPS
;
465 gl_error( ctx
, GL_INVALID_ENUM
, state
? "glEnable": "glDisable" );
470 /* GL_SGIS_pixel_texture */
471 case GL_PIXEL_TEXTURE_SGIS
:
472 ctx
->Pixel
.PixelTextureEnabled
= state
;
475 /* GL_SGIX_pixel_texture */
476 case GL_PIXEL_TEX_GEN_SGIX
:
477 ctx
->Pixel
.PixelTextureEnabled
= state
;
482 gl_error( ctx
, GL_INVALID_ENUM
, "glEnable" );
485 gl_error( ctx
, GL_INVALID_ENUM
, "glDisable" );
490 if (ctx
->Driver
.Enable
) {
491 (*ctx
->Driver
.Enable
)( ctx
, cap
, state
);
499 _mesa_Enable( GLenum cap
)
501 GET_CURRENT_CONTEXT(ctx
);
502 _mesa_set_enable( ctx
, cap
, GL_TRUE
);
508 _mesa_Disable( GLenum cap
)
510 GET_CURRENT_CONTEXT(ctx
);
511 _mesa_set_enable( ctx
, cap
, GL_FALSE
);
517 _mesa_IsEnabled( GLenum cap
)
519 GET_CURRENT_CONTEXT(ctx
);
522 return ctx
->Color
.AlphaEnabled
;
524 return ctx
->Eval
.AutoNormal
;
526 return ctx
->Color
.BlendEnabled
;
533 return ctx
->Transform
.ClipEnabled
[cap
-GL_CLIP_PLANE0
];
534 case GL_COLOR_MATERIAL
:
535 return ctx
->Light
.ColorMaterialEnabled
;
537 return ctx
->Polygon
.CullFlag
;
539 return ctx
->Depth
.Test
;
541 return ctx
->Color
.DitherFlag
;
543 return ctx
->Fog
.Enabled
;
545 return ctx
->Light
.Enabled
;
554 return ctx
->Light
.Light
[cap
-GL_LIGHT0
].Enabled
;
556 return ctx
->Line
.SmoothFlag
;
557 case GL_LINE_STIPPLE
:
558 return ctx
->Line
.StippleFlag
;
559 case GL_INDEX_LOGIC_OP
:
560 return ctx
->Color
.IndexLogicOpEnabled
;
561 case GL_COLOR_LOGIC_OP
:
562 return ctx
->Color
.ColorLogicOpEnabled
;
563 case GL_MAP1_COLOR_4
:
564 return ctx
->Eval
.Map1Color4
;
566 return ctx
->Eval
.Map1Index
;
568 return ctx
->Eval
.Map1Normal
;
569 case GL_MAP1_TEXTURE_COORD_1
:
570 return ctx
->Eval
.Map1TextureCoord1
;
571 case GL_MAP1_TEXTURE_COORD_2
:
572 return ctx
->Eval
.Map1TextureCoord2
;
573 case GL_MAP1_TEXTURE_COORD_3
:
574 return ctx
->Eval
.Map1TextureCoord3
;
575 case GL_MAP1_TEXTURE_COORD_4
:
576 return ctx
->Eval
.Map1TextureCoord4
;
577 case GL_MAP1_VERTEX_3
:
578 return ctx
->Eval
.Map1Vertex3
;
579 case GL_MAP1_VERTEX_4
:
580 return ctx
->Eval
.Map1Vertex4
;
581 case GL_MAP2_COLOR_4
:
582 return ctx
->Eval
.Map2Color4
;
584 return ctx
->Eval
.Map2Index
;
586 return ctx
->Eval
.Map2Normal
;
587 case GL_MAP2_TEXTURE_COORD_1
:
588 return ctx
->Eval
.Map2TextureCoord1
;
589 case GL_MAP2_TEXTURE_COORD_2
:
590 return ctx
->Eval
.Map2TextureCoord2
;
591 case GL_MAP2_TEXTURE_COORD_3
:
592 return ctx
->Eval
.Map2TextureCoord3
;
593 case GL_MAP2_TEXTURE_COORD_4
:
594 return ctx
->Eval
.Map2TextureCoord4
;
595 case GL_MAP2_VERTEX_3
:
596 return ctx
->Eval
.Map2Vertex3
;
597 case GL_MAP2_VERTEX_4
:
598 return ctx
->Eval
.Map2Vertex4
;
600 return ctx
->Transform
.Normalize
;
601 case GL_POINT_SMOOTH
:
602 return ctx
->Point
.SmoothFlag
;
603 case GL_POLYGON_SMOOTH
:
604 return ctx
->Polygon
.SmoothFlag
;
605 case GL_POLYGON_STIPPLE
:
606 return ctx
->Polygon
.StippleFlag
;
607 case GL_POLYGON_OFFSET_POINT
:
608 return ctx
->Polygon
.OffsetPoint
;
609 case GL_POLYGON_OFFSET_LINE
:
610 return ctx
->Polygon
.OffsetLine
;
611 case GL_POLYGON_OFFSET_FILL
:
612 /*case GL_POLYGON_OFFSET_EXT:*/
613 return ctx
->Polygon
.OffsetFill
;
614 case GL_RESCALE_NORMAL_EXT
:
615 return ctx
->Transform
.RescaleNormals
;
616 case GL_SCISSOR_TEST
:
617 return ctx
->Scissor
.Enabled
;
618 case GL_SHARED_TEXTURE_PALETTE_EXT
:
619 return ctx
->Texture
.SharedPalette
;
620 case GL_STENCIL_TEST
:
621 return ctx
->Stencil
.Enabled
;
624 const struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
];
625 return (texUnit
->Enabled
& TEXTURE0_1D
) ? GL_TRUE
: GL_FALSE
;
629 const struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
];
630 return (texUnit
->Enabled
& TEXTURE0_2D
) ? GL_TRUE
: GL_FALSE
;
634 const struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
];
635 return (texUnit
->Enabled
& TEXTURE0_3D
) ? GL_TRUE
: GL_FALSE
;
637 case GL_TEXTURE_GEN_Q
:
639 const struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
];
640 return (texUnit
->TexGenEnabled
& Q_BIT
) ? GL_TRUE
: GL_FALSE
;
642 case GL_TEXTURE_GEN_R
:
644 const struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
];
645 return (texUnit
->TexGenEnabled
& R_BIT
) ? GL_TRUE
: GL_FALSE
;
647 case GL_TEXTURE_GEN_S
:
649 const struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
];
650 return (texUnit
->TexGenEnabled
& S_BIT
) ? GL_TRUE
: GL_FALSE
;
652 case GL_TEXTURE_GEN_T
:
654 const struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
];
655 return (texUnit
->TexGenEnabled
& T_BIT
) ? GL_TRUE
: GL_FALSE
;
661 case GL_VERTEX_ARRAY
:
662 return ctx
->Array
.Vertex
.Enabled
;
663 case GL_NORMAL_ARRAY
:
664 return ctx
->Array
.Normal
.Enabled
;
666 return ctx
->Array
.Color
.Enabled
;
668 return ctx
->Array
.Index
.Enabled
;
669 case GL_TEXTURE_COORD_ARRAY
:
670 return ctx
->Array
.TexCoord
[ctx
->Array
.ActiveTexture
].Enabled
;
671 case GL_EDGE_FLAG_ARRAY
:
672 return ctx
->Array
.EdgeFlag
.Enabled
;
674 /* GL_HP_occlusion_test */
675 case GL_OCCLUSION_TEST_HP
:
676 if (ctx
->Extensions
.HaveHpOcclusionTest
) {
677 return ctx
->Depth
.OcclusionTest
;
680 gl_error( ctx
, GL_INVALID_ENUM
, "glIsEnabled" );
684 /* GL_SGIS_pixel_texture */
685 case GL_PIXEL_TEXTURE_SGIS
:
686 return ctx
->Pixel
.PixelTextureEnabled
;
689 /* GL_SGIX_pixel_texture */
690 case GL_PIXEL_TEX_GEN_SGIX
:
691 return ctx
->Pixel
.PixelTextureEnabled
;
695 gl_error( ctx
, GL_INVALID_ENUM
, "glIsEnabled" );
704 client_state( GLcontext
*ctx
, GLenum cap
, GLboolean state
)
706 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx
,
708 ? "glEnableClientState"
709 : "glDisableClientState") );
712 case GL_VERTEX_ARRAY
:
713 ctx
->Array
.Vertex
.Enabled
= state
;
715 case GL_NORMAL_ARRAY
:
716 ctx
->Array
.Normal
.Enabled
= state
;
719 ctx
->Array
.Color
.Enabled
= state
;
722 ctx
->Array
.Index
.Enabled
= state
;
724 case GL_TEXTURE_COORD_ARRAY
:
725 ctx
->Array
.TexCoord
[ctx
->Array
.ActiveTexture
].Enabled
= state
;
727 case GL_EDGE_FLAG_ARRAY
:
728 ctx
->Array
.EdgeFlag
.Enabled
= state
;
731 gl_error( ctx
, GL_INVALID_ENUM
, "glEnable/DisableClientState" );
734 ctx
->NewState
|= NEW_CLIENT_STATE
;
740 _mesa_EnableClientState( GLenum cap
)
742 GET_CURRENT_CONTEXT(ctx
);
743 client_state( ctx
, cap
, GL_TRUE
);
749 _mesa_DisableClientState( GLenum cap
)
751 GET_CURRENT_CONTEXT(ctx
);
752 client_state( ctx
, cap
, GL_FALSE
);