134 if (
ctx->Color.AlphaEnabled!=
state) {
143 if (
ctx->Color.BlendEnabled!=
state) {
160 if (
ctx->Transform.ClipEnabled[
p]) {
167 if (
ctx->Light.ColorMaterialEnabled!=
state) {
168 ctx->Light.ColorMaterialEnabled =
state;
171 color[0] =
ctx->Current.ByteColor[0] *
ctx->Visual->InvRedScale;
172 color[1] =
ctx->Current.ByteColor[1] *
ctx->Visual->InvGreenScale;
173 color[2] =
ctx->Current.ByteColor[2] *
ctx->Visual->InvBlueScale;
174 color[3] =
ctx->Current.ByteColor[3] *
ctx->Visual->InvAlphaScale;
189 if (
state &&
ctx->Visual->DepthBits==0) {
190 gl_warning(
ctx,
"glEnable(GL_DEPTH_TEST) but no depth buffer");
244 if (
ctx->Color.IndexLogicOpEnabled!=
state) {
247 ctx->Color.IndexLogicOpEnabled =
state;
250 if (
ctx->Color.ColorLogicOpEnabled!=
state) {
253 ctx->Color.ColorLogicOpEnabled =
state;
265 ctx->Eval.Map1TextureCoord1 =
state;
268 ctx->Eval.Map1TextureCoord2 =
state;
271 ctx->Eval.Map1TextureCoord3 =
state;
274 ctx->Eval.Map1TextureCoord4 =
state;
292 ctx->Eval.Map2TextureCoord1 =
state;
295 ctx->Eval.Map2TextureCoord2 =
state;
298 ctx->Eval.Map2TextureCoord3 =
state;
301 ctx->Eval.Map2TextureCoord4 =
state;
319 if (
ctx->Polygon.SmoothFlag!=
state) {
325 if (
ctx->Polygon.StippleFlag!=
state) {
331 if (
ctx->Polygon.OffsetPoint!=
state) {
337 if (
ctx->Polygon.OffsetLine!=
state) {
344 if (
ctx->Polygon.OffsetFill!=
state) {
356 if (
state &&
ctx->Visual->StencilBits==0) {
357 gl_warning(
ctx,
"glEnable(GL_STENCIL_TEST) but no stencil buffer");
366 if (
ctx->Visual->RGBAflag) {
372 ctx->Texture.Enabled &= (~TEXTURE_1D);
378 if (
ctx->Visual->RGBAflag) {
384 ctx->Texture.Enabled &= (~TEXTURE_2D);
391 ctx->Texture.TexGenEnabled |=
Q_BIT;
394 ctx->Texture.TexGenEnabled &= ~Q_BIT;
400 ctx->Texture.TexGenEnabled |=
R_BIT;
403 ctx->Texture.TexGenEnabled &= ~R_BIT;
409 ctx->Texture.TexGenEnabled |=
S_BIT;
412 ctx->Texture.TexGenEnabled &= ~S_BIT;
418 ctx->Texture.TexGenEnabled |=
T_BIT;
421 ctx->Texture.TexGenEnabled &= ~T_BIT;
480 return ctx->Color.AlphaEnabled;
482 return ctx->Eval.AutoNormal;
484 return ctx->Color.BlendEnabled;
493 return ctx->Light.ColorMaterialEnabled;
495 return ctx->Polygon.CullFlag;
497 return ctx->Depth.Test;
499 return ctx->Color.DitherFlag;
501 return ctx->Fog.Enabled;
503 return ctx->Light.Enabled;
514 return ctx->Line.SmoothFlag;
516 return ctx->Line.StippleFlag;
518 return ctx->Color.IndexLogicOpEnabled;
520 return ctx->Color.ColorLogicOpEnabled;
522 return ctx->Eval.Map1Color4;
524 return ctx->Eval.Map1Index;
526 return ctx->Eval.Map1Normal;
528 return ctx->Eval.Map1TextureCoord1;
530 return ctx->Eval.Map1TextureCoord2;
532 return ctx->Eval.Map1TextureCoord3;
534 return ctx->Eval.Map1TextureCoord4;
536 return ctx->Eval.Map1Vertex3;
538 return ctx->Eval.Map1Vertex4;
540 return ctx->Eval.Map2Color4;
542 return ctx->Eval.Map2Index;
544 return ctx->Eval.Map2Normal;
546 return ctx->Eval.Map2TextureCoord1;
548 return ctx->Eval.Map2TextureCoord2;
550 return ctx->Eval.Map2TextureCoord3;
552 return ctx->Eval.Map2TextureCoord4;
554 return ctx->Eval.Map2Vertex3;
556 return ctx->Eval.Map2Vertex4;
558 return ctx->Transform.Normalize;
560 return ctx->Point.SmoothFlag;
562 return ctx->Polygon.SmoothFlag;
564 return ctx->Polygon.StippleFlag;
566 return ctx->Polygon.OffsetPoint;
568 return ctx->Polygon.OffsetLine;
571 return ctx->Polygon.OffsetFill;
573 return ctx->Scissor.Enabled;
575 return ctx->Stencil.Enabled;
593 return ctx->Array.VertexEnabled;
595 return ctx->Array.NormalEnabled;
597 return ctx->Array.ColorEnabled;
599 return ctx->Array.IndexEnabled;
601 return ctx->Array.TexCoordEnabled;
603 return ctx->Array.EdgeFlagEnabled;
void gl_warning(const GLcontext *ctx, const char *s)
void gl_error(GLcontext *ctx, GLenum error, const char *s)
void gl_DisableClientState(GLcontext *ctx, GLenum cap)
void gl_EnableClientState(GLcontext *ctx, GLenum cap)
static void gl_enable(GLcontext *ctx, GLenum cap, GLboolean state)
void gl_Enable(GLcontext *ctx, GLenum cap)
void gl_Disable(GLcontext *ctx, GLenum cap)
void gl_client_state(GLcontext *ctx, GLenum cap, GLboolean state)
GLboolean gl_IsEnabled(GLcontext *ctx, GLenum cap)
#define GL_TEXTURE_COORD_ARRAY
#define GL_POLYGON_STIPPLE
#define GL_POLYGON_OFFSET_LINE
#define GL_MAP1_TEXTURE_COORD_3
#define GL_MAP2_TEXTURE_COORD_2
#define GL_POLYGON_OFFSET_FILL
#define GL_COLOR_LOGIC_OP
#define GL_POLYGON_SMOOTH
#define GL_MAP1_TEXTURE_COORD_2
#define GL_MAP2_TEXTURE_COORD_4
#define GL_INVALID_OPERATION
#define GL_INDEX_LOGIC_OP
#define GL_MAP1_TEXTURE_COORD_1
#define GL_COLOR_MATERIAL
#define GL_MAP1_TEXTURE_COORD_4
#define GL_POLYGON_OFFSET_POINT
#define GL_MAP2_TEXTURE_COORD_1
#define GL_EDGE_FLAG_ARRAY
#define GL_MAP2_TEXTURE_COORD_3
#define INSIDE_BEGIN_END(CTX)
void gl_set_material(GLcontext *ctx, GLuint bitmask, const GLfloat *params)
void gl_set_color_function(GLcontext *ctx)