1 /* $Id: enable.c,v 1.3 1999/08/26 14:50:49 keithw 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.
39 #include "simple_list.h"
45 #include "GL/xf86glx.h"
52 * Perform glEnable and glDisable calls.
54 void gl_set_enable( GLcontext
*ctx
, GLenum cap
, GLboolean state
)
56 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx
, "gl_enable/disable" );
58 if (MESA_VERBOSE
& VERBOSE_API
)
59 fprintf(stderr
, "%s %s (newstate is %x)\n",
60 state
? "glEnable" : "glDisable",
61 gl_lookup_enum_by_nr(cap
),
66 if (ctx
->Color
.AlphaEnabled
!=state
) {
67 ctx
->Color
.AlphaEnabled
= state
;
68 ctx
->NewState
|= NEW_RASTER_OPS
;
72 ctx
->Eval
.AutoNormal
= state
;
75 if (ctx
->Color
.BlendEnabled
!=state
) {
76 ctx
->Color
.BlendEnabled
= state
;
77 /* The following needed to accomodate 1.0 RGB logic op blending */
78 if (ctx
->Color
.BlendEquation
==GL_LOGIC_OP
&& state
) {
79 ctx
->Color
.ColorLogicOpEnabled
= GL_TRUE
;
82 ctx
->Color
.ColorLogicOpEnabled
= GL_FALSE
;
84 ctx
->NewState
|= NEW_RASTER_OPS
;
93 if (cap
>= GL_CLIP_PLANE0
&&
94 cap
<= GL_CLIP_PLANE5
&&
95 ctx
->Transform
.ClipEnabled
[cap
-GL_CLIP_PLANE0
] != state
)
97 GLuint p
= cap
-GL_CLIP_PLANE0
;
99 ctx
->Transform
.ClipEnabled
[p
] = state
;
100 ctx
->NewState
|= NEW_USER_CLIP
;
103 ctx
->Enabled
|= ENABLE_USERCLIP
;
104 ctx
->Transform
.AnyClip
++;
106 if (ctx
->ProjectionMatrix
.flags
& MAT_DIRTY_ALL_OVER
) {
107 gl_matrix_analyze( &ctx
->ProjectionMatrix
);
110 gl_transform_vector( ctx
->Transform
.ClipUserPlane
[p
],
111 ctx
->Transform
.EyeUserPlane
[p
],
112 ctx
->ProjectionMatrix
.inv
);
114 if (--ctx
->Transform
.AnyClip
== 0)
115 ctx
->Enabled
&= ~ENABLE_USERCLIP
;
119 case GL_COLOR_MATERIAL
:
120 if (ctx
->Light
.ColorMaterialEnabled
!=state
) {
121 ctx
->Light
.ColorMaterialEnabled
= state
;
122 ctx
->NewState
|= NEW_LIGHTING
;
126 if (ctx
->Polygon
.CullFlag
!=state
) {
127 ctx
->Polygon
.CullFlag
= state
;
128 ctx
->TriangleCaps
^= DD_TRI_CULL
;
129 ctx
->NewState
|= NEW_POLYGON
;
133 if (state
&& ctx
->Visual
->DepthBits
==0) {
134 gl_warning(ctx
,"glEnable(GL_DEPTH_TEST) but no depth buffer");
137 if (ctx
->Depth
.Test
!=state
) {
138 ctx
->Depth
.Test
= state
;
139 ctx
->NewState
|= NEW_RASTER_OPS
;
144 /* MESA_NO_DITHER env var */
147 if (ctx
->Color
.DitherFlag
!=state
) {
148 ctx
->Color
.DitherFlag
= state
;
149 ctx
->NewState
|= NEW_RASTER_OPS
;
153 if (ctx
->Fog
.Enabled
!=state
) {
154 ctx
->Fog
.Enabled
= state
;
155 ctx
->Enabled
^= ENABLE_FOG
;
156 ctx
->NewState
|= NEW_FOG
|NEW_RASTER_OPS
;
167 if (ctx
->Light
.Light
[cap
-GL_LIGHT0
].Enabled
!= state
)
169 ctx
->Light
.Light
[cap
-GL_LIGHT0
].Enabled
= state
;
172 insert_at_tail(&ctx
->Light
.EnabledList
,
173 &ctx
->Light
.Light
[cap
-GL_LIGHT0
]);
174 if (ctx
->Light
.Enabled
)
175 ctx
->Enabled
|= ENABLE_LIGHT
;
177 remove_from_list(&ctx
->Light
.Light
[cap
-GL_LIGHT0
]);
178 if (is_empty_list(&ctx
->Light
.EnabledList
))
179 ctx
->Enabled
&= ~ENABLE_LIGHT
;
182 ctx
->NewState
|= NEW_LIGHTING
;
186 if (ctx
->Light
.Enabled
!=state
) {
187 ctx
->Light
.Enabled
= state
;
188 ctx
->Enabled
&= ~ENABLE_LIGHT
;
189 if (state
&& !is_empty_list(&ctx
->Light
.EnabledList
))
190 ctx
->Enabled
|= ENABLE_LIGHT
;
191 ctx
->NewState
|= NEW_LIGHTING
;
195 if (ctx
->Line
.SmoothFlag
!=state
) {
196 ctx
->Line
.SmoothFlag
= state
;
197 ctx
->NewState
|= NEW_RASTER_OPS
;
200 case GL_LINE_STIPPLE
:
201 if (ctx
->Line
.StippleFlag
!=state
) {
202 ctx
->Line
.StippleFlag
= state
;
203 ctx
->TriangleCaps
^= DD_LINE_STIPPLE
;
204 ctx
->NewState
|= NEW_RASTER_OPS
;
207 case GL_INDEX_LOGIC_OP
:
208 if (ctx
->Color
.IndexLogicOpEnabled
!=state
) {
209 ctx
->Color
.IndexLogicOpEnabled
= state
;
210 ctx
->NewState
|= NEW_RASTER_OPS
;
213 case GL_COLOR_LOGIC_OP
:
214 if (ctx
->Color
.ColorLogicOpEnabled
!=state
) {
215 ctx
->Color
.ColorLogicOpEnabled
= state
;
216 ctx
->NewState
|= NEW_RASTER_OPS
;
219 case GL_MAP1_COLOR_4
:
220 ctx
->Eval
.Map1Color4
= state
;
223 ctx
->Eval
.Map1Index
= state
;
226 ctx
->Eval
.Map1Normal
= state
;
228 case GL_MAP1_TEXTURE_COORD_1
:
229 ctx
->Eval
.Map1TextureCoord1
= state
;
231 case GL_MAP1_TEXTURE_COORD_2
:
232 ctx
->Eval
.Map1TextureCoord2
= state
;
234 case GL_MAP1_TEXTURE_COORD_3
:
235 ctx
->Eval
.Map1TextureCoord3
= state
;
237 case GL_MAP1_TEXTURE_COORD_4
:
238 ctx
->Eval
.Map1TextureCoord4
= state
;
240 case GL_MAP1_VERTEX_3
:
241 ctx
->Eval
.Map1Vertex3
= state
;
243 case GL_MAP1_VERTEX_4
:
244 ctx
->Eval
.Map1Vertex4
= state
;
246 case GL_MAP2_COLOR_4
:
247 ctx
->Eval
.Map2Color4
= state
;
250 ctx
->Eval
.Map2Index
= state
;
253 ctx
->Eval
.Map2Normal
= state
;
255 case GL_MAP2_TEXTURE_COORD_1
:
256 ctx
->Eval
.Map2TextureCoord1
= state
;
258 case GL_MAP2_TEXTURE_COORD_2
:
259 ctx
->Eval
.Map2TextureCoord2
= state
;
261 case GL_MAP2_TEXTURE_COORD_3
:
262 ctx
->Eval
.Map2TextureCoord3
= state
;
264 case GL_MAP2_TEXTURE_COORD_4
:
265 ctx
->Eval
.Map2TextureCoord4
= state
;
267 case GL_MAP2_VERTEX_3
:
268 ctx
->Eval
.Map2Vertex3
= state
;
270 case GL_MAP2_VERTEX_4
:
271 ctx
->Eval
.Map2Vertex4
= state
;
274 if (ctx
->Transform
.Normalize
!= state
) {
275 ctx
->Transform
.Normalize
= state
;
276 ctx
->NewState
|= NEW_NORMAL_TRANSFORM
|NEW_LIGHTING
;
277 ctx
->Enabled
^= ENABLE_NORMALIZE
;
280 case GL_POINT_SMOOTH
:
281 if (ctx
->Point
.SmoothFlag
!=state
) {
282 ctx
->Point
.SmoothFlag
= state
;
283 ctx
->NewState
|= NEW_RASTER_OPS
;
286 case GL_POLYGON_SMOOTH
:
287 if (ctx
->Polygon
.SmoothFlag
!=state
) {
288 ctx
->Polygon
.SmoothFlag
= state
;
289 ctx
->NewState
|= NEW_RASTER_OPS
;
292 case GL_POLYGON_STIPPLE
:
293 if (ctx
->Polygon
.StippleFlag
!=state
) {
294 ctx
->Polygon
.StippleFlag
= state
;
295 ctx
->TriangleCaps
^= DD_TRI_STIPPLE
;
296 ctx
->NewState
|= NEW_RASTER_OPS
;
299 case GL_POLYGON_OFFSET_POINT
:
300 if (ctx
->Polygon
.OffsetPoint
!=state
) {
301 ctx
->Polygon
.OffsetPoint
= state
;
302 ctx
->NewState
|= NEW_POLYGON
;
305 case GL_POLYGON_OFFSET_LINE
:
306 if (ctx
->Polygon
.OffsetLine
!=state
) {
307 ctx
->Polygon
.OffsetLine
= state
;
308 ctx
->NewState
|= NEW_POLYGON
;
311 case GL_POLYGON_OFFSET_FILL
:
312 /*case GL_POLYGON_OFFSET_EXT:*/
313 if (ctx
->Polygon
.OffsetFill
!=state
) {
314 ctx
->Polygon
.OffsetFill
= state
;
315 ctx
->NewState
|= NEW_POLYGON
;
318 case GL_RESCALE_NORMAL_EXT
:
319 if (ctx
->Transform
.RescaleNormals
!= state
) {
320 ctx
->Transform
.RescaleNormals
= state
;
321 ctx
->NewState
|= NEW_NORMAL_TRANSFORM
|NEW_LIGHTING
;
322 ctx
->Enabled
^= ENABLE_RESCALE
;
325 case GL_SCISSOR_TEST
:
326 if (ctx
->Scissor
.Enabled
!=state
) {
327 ctx
->Scissor
.Enabled
= state
;
328 ctx
->NewState
|= NEW_RASTER_OPS
;
331 case GL_SHARED_TEXTURE_PALETTE_EXT
:
332 ctx
->Texture
.SharedPalette
= state
;
333 if (ctx
->Driver
.UseGlobalTexturePalette
)
334 (*ctx
->Driver
.UseGlobalTexturePalette
)( ctx
, state
);
336 case GL_STENCIL_TEST
:
337 if (state
&& ctx
->Visual
->StencilBits
==0) {
338 gl_warning(ctx
, "glEnable(GL_STENCIL_TEST) but no stencil buffer");
341 if (ctx
->Stencil
.Enabled
!=state
) {
342 ctx
->Stencil
.Enabled
= state
;
343 ctx
->NewState
|= NEW_RASTER_OPS
;
347 if (ctx
->Visual
->RGBAflag
) {
348 const GLuint curr
= ctx
->Texture
.CurrentUnit
;
349 const GLuint flag
= TEXTURE0_1D
<< (curr
* 4);
350 struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[curr
];
351 ctx
->NewState
|= NEW_TEXTURE_ENABLE
;
353 texUnit
->Enabled
|= TEXTURE0_1D
;
354 ctx
->Enabled
|= flag
;
357 texUnit
->Enabled
&= ~TEXTURE0_1D
;
358 ctx
->Enabled
&= ~flag
;
363 if (ctx
->Visual
->RGBAflag
) {
364 const GLuint curr
= ctx
->Texture
.CurrentUnit
;
365 const GLuint flag
= TEXTURE0_2D
<< (curr
* 4);
366 struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[curr
];
367 ctx
->NewState
|= NEW_TEXTURE_ENABLE
;
369 texUnit
->Enabled
|= TEXTURE0_2D
;
370 ctx
->Enabled
|= flag
;
373 texUnit
->Enabled
&= ~TEXTURE0_2D
;
374 ctx
->Enabled
&= ~flag
;
379 if (ctx
->Visual
->RGBAflag
) {
380 const GLuint curr
= ctx
->Texture
.CurrentUnit
;
381 const GLuint flag
= TEXTURE0_3D
<< (curr
* 4);
382 struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[curr
];
383 ctx
->NewState
|= NEW_TEXTURE_ENABLE
;
385 texUnit
->Enabled
|= TEXTURE0_3D
;
386 ctx
->Enabled
|= flag
;
389 texUnit
->Enabled
&= ~TEXTURE0_3D
;
390 ctx
->Enabled
&= ~flag
;
394 case GL_TEXTURE_GEN_Q
:
396 struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
];
398 texUnit
->TexGenEnabled
|= Q_BIT
;
400 texUnit
->TexGenEnabled
&= ~Q_BIT
;
401 ctx
->NewState
|= NEW_TEXTURING
;
404 case GL_TEXTURE_GEN_R
:
406 struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
];
408 texUnit
->TexGenEnabled
|= R_BIT
;
410 texUnit
->TexGenEnabled
&= ~R_BIT
;
411 ctx
->NewState
|= NEW_TEXTURING
;
414 case GL_TEXTURE_GEN_S
:
416 struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
];
418 texUnit
->TexGenEnabled
|= S_BIT
;
420 texUnit
->TexGenEnabled
&= ~S_BIT
;
421 ctx
->NewState
|= NEW_TEXTURING
;
424 case GL_TEXTURE_GEN_T
:
426 struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
];
428 texUnit
->TexGenEnabled
|= T_BIT
;
430 texUnit
->TexGenEnabled
&= ~T_BIT
;
431 ctx
->NewState
|= NEW_TEXTURING
;
438 case GL_VERTEX_ARRAY
:
439 ctx
->Array
.Vertex
.Enabled
= state
;
441 case GL_NORMAL_ARRAY
:
442 ctx
->Array
.Normal
.Enabled
= state
;
445 ctx
->Array
.Color
.Enabled
= state
;
448 ctx
->Array
.Index
.Enabled
= state
;
450 case GL_TEXTURE_COORD_ARRAY
:
451 ctx
->Array
.TexCoord
[ctx
->TexCoordUnit
].Enabled
= state
;
453 case GL_EDGE_FLAG_ARRAY
:
454 ctx
->Array
.EdgeFlag
.Enabled
= state
;
459 gl_error( ctx
, GL_INVALID_ENUM
, "glEnable" );
462 gl_error( ctx
, GL_INVALID_ENUM
, "glDisable" );
467 if (ctx
->Driver
.Enable
) {
468 (*ctx
->Driver
.Enable
)( ctx
, cap
, state
);
475 void gl_Enable( GLcontext
* ctx
, GLenum cap
)
477 gl_set_enable( ctx
, cap
, GL_TRUE
);
482 void gl_Disable( GLcontext
* ctx
, GLenum cap
)
484 gl_set_enable( ctx
, cap
, GL_FALSE
);
489 GLboolean
gl_IsEnabled( GLcontext
* ctx
, GLenum cap
)
493 return ctx
->Color
.AlphaEnabled
;
495 return ctx
->Eval
.AutoNormal
;
497 return ctx
->Color
.BlendEnabled
;
504 return ctx
->Transform
.ClipEnabled
[cap
-GL_CLIP_PLANE0
];
505 case GL_COLOR_MATERIAL
:
506 return ctx
->Light
.ColorMaterialEnabled
;
508 return ctx
->Polygon
.CullFlag
;
510 return ctx
->Depth
.Test
;
512 return ctx
->Color
.DitherFlag
;
514 return ctx
->Fog
.Enabled
;
516 return ctx
->Light
.Enabled
;
525 return ctx
->Light
.Light
[cap
-GL_LIGHT0
].Enabled
;
527 return ctx
->Line
.SmoothFlag
;
528 case GL_LINE_STIPPLE
:
529 return ctx
->Line
.StippleFlag
;
530 case GL_INDEX_LOGIC_OP
:
531 return ctx
->Color
.IndexLogicOpEnabled
;
532 case GL_COLOR_LOGIC_OP
:
533 return ctx
->Color
.ColorLogicOpEnabled
;
534 case GL_MAP1_COLOR_4
:
535 return ctx
->Eval
.Map1Color4
;
537 return ctx
->Eval
.Map1Index
;
539 return ctx
->Eval
.Map1Normal
;
540 case GL_MAP1_TEXTURE_COORD_1
:
541 return ctx
->Eval
.Map1TextureCoord1
;
542 case GL_MAP1_TEXTURE_COORD_2
:
543 return ctx
->Eval
.Map1TextureCoord2
;
544 case GL_MAP1_TEXTURE_COORD_3
:
545 return ctx
->Eval
.Map1TextureCoord3
;
546 case GL_MAP1_TEXTURE_COORD_4
:
547 return ctx
->Eval
.Map1TextureCoord4
;
548 case GL_MAP1_VERTEX_3
:
549 return ctx
->Eval
.Map1Vertex3
;
550 case GL_MAP1_VERTEX_4
:
551 return ctx
->Eval
.Map1Vertex4
;
552 case GL_MAP2_COLOR_4
:
553 return ctx
->Eval
.Map2Color4
;
555 return ctx
->Eval
.Map2Index
;
557 return ctx
->Eval
.Map2Normal
;
558 case GL_MAP2_TEXTURE_COORD_1
:
559 return ctx
->Eval
.Map2TextureCoord1
;
560 case GL_MAP2_TEXTURE_COORD_2
:
561 return ctx
->Eval
.Map2TextureCoord2
;
562 case GL_MAP2_TEXTURE_COORD_3
:
563 return ctx
->Eval
.Map2TextureCoord3
;
564 case GL_MAP2_TEXTURE_COORD_4
:
565 return ctx
->Eval
.Map2TextureCoord4
;
566 case GL_MAP2_VERTEX_3
:
567 return ctx
->Eval
.Map2Vertex3
;
568 case GL_MAP2_VERTEX_4
:
569 return ctx
->Eval
.Map2Vertex4
;
571 return ctx
->Transform
.Normalize
;
572 case GL_POINT_SMOOTH
:
573 return ctx
->Point
.SmoothFlag
;
574 case GL_POLYGON_SMOOTH
:
575 return ctx
->Polygon
.SmoothFlag
;
576 case GL_POLYGON_STIPPLE
:
577 return ctx
->Polygon
.StippleFlag
;
578 case GL_POLYGON_OFFSET_POINT
:
579 return ctx
->Polygon
.OffsetPoint
;
580 case GL_POLYGON_OFFSET_LINE
:
581 return ctx
->Polygon
.OffsetLine
;
582 case GL_POLYGON_OFFSET_FILL
:
583 /*case GL_POLYGON_OFFSET_EXT:*/
584 return ctx
->Polygon
.OffsetFill
;
585 case GL_RESCALE_NORMAL_EXT
:
586 return ctx
->Transform
.RescaleNormals
;
587 case GL_SCISSOR_TEST
:
588 return ctx
->Scissor
.Enabled
;
589 case GL_SHARED_TEXTURE_PALETTE_EXT
:
590 return ctx
->Texture
.SharedPalette
;
591 case GL_STENCIL_TEST
:
592 return ctx
->Stencil
.Enabled
;
595 const struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
];
596 return (texUnit
->Enabled
& TEXTURE0_1D
) ? GL_TRUE
: GL_FALSE
;
600 const struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
];
601 return (texUnit
->Enabled
& TEXTURE0_2D
) ? GL_TRUE
: GL_FALSE
;
605 const struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
];
606 return (texUnit
->Enabled
& TEXTURE0_3D
) ? GL_TRUE
: GL_FALSE
;
608 case GL_TEXTURE_GEN_Q
:
610 const struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
];
611 return (texUnit
->TexGenEnabled
& Q_BIT
) ? GL_TRUE
: GL_FALSE
;
613 case GL_TEXTURE_GEN_R
:
615 const struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
];
616 return (texUnit
->TexGenEnabled
& R_BIT
) ? GL_TRUE
: GL_FALSE
;
618 case GL_TEXTURE_GEN_S
:
620 const struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
];
621 return (texUnit
->TexGenEnabled
& S_BIT
) ? GL_TRUE
: GL_FALSE
;
623 case GL_TEXTURE_GEN_T
:
625 const struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[ctx
->Texture
.CurrentUnit
];
626 return (texUnit
->TexGenEnabled
& T_BIT
) ? GL_TRUE
: GL_FALSE
;
632 case GL_VERTEX_ARRAY
:
633 return ctx
->Array
.Vertex
.Enabled
;
634 case GL_NORMAL_ARRAY
:
635 return ctx
->Array
.Normal
.Enabled
;
637 return ctx
->Array
.Color
.Enabled
;
639 return ctx
->Array
.Index
.Enabled
;
640 case GL_TEXTURE_COORD_ARRAY
:
641 return ctx
->Array
.TexCoord
[ctx
->TexCoordUnit
].Enabled
;
642 case GL_EDGE_FLAG_ARRAY
:
643 return ctx
->Array
.EdgeFlag
.Enabled
;
645 gl_error( ctx
, GL_INVALID_ENUM
, "glIsEnabled" );
653 static void gl_client_state( GLcontext
*ctx
, GLenum cap
, GLboolean state
)
655 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx
,
657 ? "glEnableClientState"
658 : "glDisableClientState") );
661 case GL_VERTEX_ARRAY
:
662 ctx
->Array
.Vertex
.Enabled
= state
;
664 case GL_NORMAL_ARRAY
:
665 ctx
->Array
.Normal
.Enabled
= state
;
668 ctx
->Array
.Color
.Enabled
= state
;
671 ctx
->Array
.Index
.Enabled
= state
;
673 case GL_TEXTURE_COORD_ARRAY
:
674 ctx
->Array
.TexCoord
[ctx
->TexCoordUnit
].Enabled
= state
;
676 case GL_EDGE_FLAG_ARRAY
:
677 ctx
->Array
.EdgeFlag
.Enabled
= state
;
680 gl_error( ctx
, GL_INVALID_ENUM
, "glEnable/DisableClientState" );
683 ctx
->NewState
|= NEW_CLIENT_STATE
;
688 void gl_EnableClientState( GLcontext
*ctx
, GLenum cap
)
690 gl_client_state( ctx
, cap
, GL_TRUE
);
695 void gl_DisableClientState( GLcontext
*ctx
, GLenum cap
)
697 gl_client_state( ctx
, cap
, GL_FALSE
);