⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 enable.c

📁 Mesa is an open-source implementation of the OpenGL specification - a system for rendering interacti
💻 C
📖 第 1 页 / 共 4 页
字号:
      case GL_LIGHT0:      case GL_LIGHT1:      case GL_LIGHT2:      case GL_LIGHT3:      case GL_LIGHT4:      case GL_LIGHT5:      case GL_LIGHT6:      case GL_LIGHT7:         if (ctx->Light.Light[cap-GL_LIGHT0].Enabled == state)            return;         FLUSH_VERTICES(ctx, _NEW_LIGHT);         ctx->Light.Light[cap-GL_LIGHT0].Enabled = state;         if (state) {            insert_at_tail(&ctx->Light.EnabledList,                           &ctx->Light.Light[cap-GL_LIGHT0]);         }         else {            remove_from_list(&ctx->Light.Light[cap-GL_LIGHT0]);         }         break;      case GL_LIGHTING:         if (ctx->Light.Enabled == state)            return;         FLUSH_VERTICES(ctx, _NEW_LIGHT);         ctx->Light.Enabled = state;         if (ctx->Light.Enabled && ctx->Light.Model.TwoSide)            ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE;         else            ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE;         break;      case GL_LINE_SMOOTH:         if (ctx->Line.SmoothFlag == state)            return;         FLUSH_VERTICES(ctx, _NEW_LINE);         ctx->Line.SmoothFlag = state;         ctx->_TriangleCaps ^= DD_LINE_SMOOTH;         break;      case GL_LINE_STIPPLE:         if (ctx->Line.StippleFlag == state)            return;         FLUSH_VERTICES(ctx, _NEW_LINE);         ctx->Line.StippleFlag = state;         ctx->_TriangleCaps ^= DD_LINE_STIPPLE;         break;      case GL_INDEX_LOGIC_OP:         if (ctx->Color.IndexLogicOpEnabled == state)            return;         FLUSH_VERTICES(ctx, _NEW_COLOR);         ctx->Color.IndexLogicOpEnabled = state;         break;      case GL_COLOR_LOGIC_OP:         if (ctx->Color.ColorLogicOpEnabled == state)            return;         FLUSH_VERTICES(ctx, _NEW_COLOR);         ctx->Color.ColorLogicOpEnabled = state;         break;      case GL_MAP1_COLOR_4:         if (ctx->Eval.Map1Color4 == state)            return;         FLUSH_VERTICES(ctx, _NEW_EVAL);         ctx->Eval.Map1Color4 = state;         break;      case GL_MAP1_INDEX:         if (ctx->Eval.Map1Index == state)            return;         FLUSH_VERTICES(ctx, _NEW_EVAL);         ctx->Eval.Map1Index = state;         break;      case GL_MAP1_NORMAL:         if (ctx->Eval.Map1Normal == state)            return;         FLUSH_VERTICES(ctx, _NEW_EVAL);         ctx->Eval.Map1Normal = state;         break;      case GL_MAP1_TEXTURE_COORD_1:         if (ctx->Eval.Map1TextureCoord1 == state)            return;         FLUSH_VERTICES(ctx, _NEW_EVAL);         ctx->Eval.Map1TextureCoord1 = state;         break;      case GL_MAP1_TEXTURE_COORD_2:         if (ctx->Eval.Map1TextureCoord2 == state)            return;         FLUSH_VERTICES(ctx, _NEW_EVAL);         ctx->Eval.Map1TextureCoord2 = state;         break;      case GL_MAP1_TEXTURE_COORD_3:         if (ctx->Eval.Map1TextureCoord3 == state)            return;         FLUSH_VERTICES(ctx, _NEW_EVAL);         ctx->Eval.Map1TextureCoord3 = state;         break;      case GL_MAP1_TEXTURE_COORD_4:         if (ctx->Eval.Map1TextureCoord4 == state)            return;         FLUSH_VERTICES(ctx, _NEW_EVAL);         ctx->Eval.Map1TextureCoord4 = state;         break;      case GL_MAP1_VERTEX_3:         if (ctx->Eval.Map1Vertex3 == state)            return;         FLUSH_VERTICES(ctx, _NEW_EVAL);         ctx->Eval.Map1Vertex3 = state;         break;      case GL_MAP1_VERTEX_4:         if (ctx->Eval.Map1Vertex4 == state)            return;         FLUSH_VERTICES(ctx, _NEW_EVAL);         ctx->Eval.Map1Vertex4 = state;         break;      case GL_MAP2_COLOR_4:         if (ctx->Eval.Map2Color4 == state)            return;         FLUSH_VERTICES(ctx, _NEW_EVAL);         ctx->Eval.Map2Color4 = state;         break;      case GL_MAP2_INDEX:         if (ctx->Eval.Map2Index == state)            return;         FLUSH_VERTICES(ctx, _NEW_EVAL);         ctx->Eval.Map2Index = state;         break;      case GL_MAP2_NORMAL:         if (ctx->Eval.Map2Normal == state)            return;         FLUSH_VERTICES(ctx, _NEW_EVAL);         ctx->Eval.Map2Normal = state;         break;      case GL_MAP2_TEXTURE_COORD_1:         if (ctx->Eval.Map2TextureCoord1 == state)            return;         FLUSH_VERTICES(ctx, _NEW_EVAL);         ctx->Eval.Map2TextureCoord1 = state;         break;      case GL_MAP2_TEXTURE_COORD_2:         if (ctx->Eval.Map2TextureCoord2 == state)            return;         FLUSH_VERTICES(ctx, _NEW_EVAL);         ctx->Eval.Map2TextureCoord2 = state;         break;      case GL_MAP2_TEXTURE_COORD_3:         if (ctx->Eval.Map2TextureCoord3 == state)            return;         FLUSH_VERTICES(ctx, _NEW_EVAL);         ctx->Eval.Map2TextureCoord3 = state;         break;      case GL_MAP2_TEXTURE_COORD_4:         if (ctx->Eval.Map2TextureCoord4 == state)            return;         FLUSH_VERTICES(ctx, _NEW_EVAL);         ctx->Eval.Map2TextureCoord4 = state;         break;      case GL_MAP2_VERTEX_3:         if (ctx->Eval.Map2Vertex3 == state)            return;         FLUSH_VERTICES(ctx, _NEW_EVAL);         ctx->Eval.Map2Vertex3 = state;         break;      case GL_MAP2_VERTEX_4:         if (ctx->Eval.Map2Vertex4 == state)            return;         FLUSH_VERTICES(ctx, _NEW_EVAL);         ctx->Eval.Map2Vertex4 = state;         break;      case GL_MINMAX:         if (ctx->Pixel.MinMaxEnabled == state)            return;         FLUSH_VERTICES(ctx, _NEW_PIXEL);         ctx->Pixel.MinMaxEnabled = state;         break;      case GL_NORMALIZE:         if (ctx->Transform.Normalize == state)            return;         FLUSH_VERTICES(ctx, _NEW_TRANSFORM);         ctx->Transform.Normalize = state;         break;      case GL_POINT_SMOOTH:         if (ctx->Point.SmoothFlag == state)            return;         FLUSH_VERTICES(ctx, _NEW_POINT);         ctx->Point.SmoothFlag = state;         ctx->_TriangleCaps ^= DD_POINT_SMOOTH;         break;      case GL_POLYGON_SMOOTH:         if (ctx->Polygon.SmoothFlag == state)            return;         FLUSH_VERTICES(ctx, _NEW_POLYGON);         ctx->Polygon.SmoothFlag = state;         ctx->_TriangleCaps ^= DD_TRI_SMOOTH;         break;      case GL_POLYGON_STIPPLE:         if (ctx->Polygon.StippleFlag == state)            return;         FLUSH_VERTICES(ctx, _NEW_POLYGON);         ctx->Polygon.StippleFlag = state;         ctx->_TriangleCaps ^= DD_TRI_STIPPLE;         break;      case GL_POLYGON_OFFSET_POINT:         if (ctx->Polygon.OffsetPoint == state)            return;         FLUSH_VERTICES(ctx, _NEW_POLYGON);         ctx->Polygon.OffsetPoint = state;         break;      case GL_POLYGON_OFFSET_LINE:         if (ctx->Polygon.OffsetLine == state)            return;         FLUSH_VERTICES(ctx, _NEW_POLYGON);         ctx->Polygon.OffsetLine = state;         break;      case GL_POLYGON_OFFSET_FILL:         /*case GL_POLYGON_OFFSET_EXT:*/         if (ctx->Polygon.OffsetFill == state)            return;         FLUSH_VERTICES(ctx, _NEW_POLYGON);         ctx->Polygon.OffsetFill = state;         break;      case GL_RESCALE_NORMAL_EXT:         if (ctx->Transform.RescaleNormals == state)            return;         FLUSH_VERTICES(ctx, _NEW_TRANSFORM);         ctx->Transform.RescaleNormals = state;         break;      case GL_SCISSOR_TEST:         if (ctx->Scissor.Enabled == state)            return;         FLUSH_VERTICES(ctx, _NEW_SCISSOR);         ctx->Scissor.Enabled = state;         break;      case GL_SHARED_TEXTURE_PALETTE_EXT:         if (ctx->Texture.SharedPalette == state)            return;         FLUSH_VERTICES(ctx, _NEW_TEXTURE);         ctx->Texture.SharedPalette = state;         break;      case GL_STENCIL_TEST:         if (state && ctx->DrawBuffer->Visual.stencilBits == 0) {            _mesa_warning(ctx,                          "glEnable(GL_STENCIL_TEST) but no stencil buffer");            return;         }         if (ctx->Stencil.Enabled == state)            return;         FLUSH_VERTICES(ctx, _NEW_STENCIL);         ctx->Stencil.Enabled = state;         break;      case GL_TEXTURE_1D:         if (!enable_texture(ctx, state, TEXTURE_1D_BIT)) {            return;         }         break;      case GL_TEXTURE_2D:         if (!enable_texture(ctx, state, TEXTURE_2D_BIT)) {            return;         }         break;      case GL_TEXTURE_3D:         if (!enable_texture(ctx, state, TEXTURE_3D_BIT)) {            return;         }         break;      case GL_TEXTURE_GEN_Q: {         GLuint unit = ctx->Texture.CurrentUnit;         struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];         GLuint newenabled = texUnit->TexGenEnabled & ~Q_BIT;         if (state)            newenabled |= Q_BIT;         if (texUnit->TexGenEnabled == newenabled)            return;         FLUSH_VERTICES(ctx, _NEW_TEXTURE);         texUnit->TexGenEnabled = newenabled;         break;      }      case GL_TEXTURE_GEN_R: {         GLuint unit = ctx->Texture.CurrentUnit;         struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];         GLuint newenabled = texUnit->TexGenEnabled & ~R_BIT;         if (state)            newenabled |= R_BIT;         if (texUnit->TexGenEnabled == newenabled)            return;         FLUSH_VERTICES(ctx, _NEW_TEXTURE);         texUnit->TexGenEnabled = newenabled;         break;      }      case GL_TEXTURE_GEN_S: {         GLuint unit = ctx->Texture.CurrentUnit;         struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];         GLuint newenabled = texUnit->TexGenEnabled & ~S_BIT;         if (state)            newenabled |= S_BIT;         if (texUnit->TexGenEnabled == newenabled)            return;         FLUSH_VERTICES(ctx, _NEW_TEXTURE);         texUnit->TexGenEnabled = newenabled;         break;      }      case GL_TEXTURE_GEN_T: {         GLuint unit = ctx->Texture.CurrentUnit;         struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];         GLuint newenabled = texUnit->TexGenEnabled & ~T_BIT;         if (state)            newenabled |= T_BIT;         if (texUnit->TexGenEnabled == newenabled)            return;         FLUSH_VERTICES(ctx, _NEW_TEXTURE);         texUnit->TexGenEnabled = newenabled;         break;      }      /*       * CLIENT STATE!!!       */      case GL_VERTEX_ARRAY:      case GL_NORMAL_ARRAY:      case GL_COLOR_ARRAY:      case GL_INDEX_ARRAY:      case GL_TEXTURE_COORD_ARRAY:      case GL_EDGE_FLAG_ARRAY:      case GL_FOG_COORDINATE_ARRAY_EXT:      case GL_SECONDARY_COLOR_ARRAY_EXT:         client_state( ctx, cap, state );         return;      /* GL_SGI_color_table */      case GL_COLOR_TABLE_SGI:         CHECK_EXTENSION(SGI_color_table, cap);         if (ctx->Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION] == state)            return;         FLUSH_VERTICES(ctx, _NEW_PIXEL);         ctx->Pixel.ColorTableEnabled[COLORTABLE_PRECONVOLUTION] = state;         break;      case GL_POST_CONVOLUTION_COLOR_TABLE_SGI:         CHECK_EXTENSION(SGI_color_table, cap);         if (ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCONVOLUTION] == state)            return;         FLUSH_VERTICES(ctx, _NEW_PIXEL);         ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCONVOLUTION] = state;         break;      case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:         CHECK_EXTENSION(SGI_color_table, cap);         if (ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX] == state)            return;         FLUSH_VERTICES(ctx, _NEW_PIXEL);         ctx->Pixel.ColorTableEnabled[COLORTABLE_POSTCOLORMATRIX] = state;         break;      case GL_TEXTURE_COLOR_TABLE_SGI:         CHECK_EXTENSION(SGI_texture_color_table, cap);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -