Some initial RGB and RGBA floating point texture formats.
[mesa.git] / src / mesa / main / enable.c
index 8cb84d55d6ea74bf000e9bb5777d6b1eb2229511..7f076867f92eac53abb7a943d4a81d8d409faa5d 100644 (file)
@@ -156,7 +156,7 @@ client_state( GLcontext *ctx, GLenum cap, GLboolean state )
  * Get's the current context, assures that we're outside glBegin()/glEnd() and
  * calls client_state().
  */
-void
+void GLAPIENTRY
 _mesa_EnableClientState( GLenum cap )
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -175,7 +175,7 @@ _mesa_EnableClientState( GLenum cap )
  * Get's the current context, assures that we're outside glBegin()/glEnd() and
  * calls client_state().
  */
-void
+void GLAPIENTRY
 _mesa_DisableClientState( GLenum cap )
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -231,9 +231,12 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
             return;
          FLUSH_VERTICES(ctx, _NEW_COLOR);
          ctx->Color.BlendEnabled = state;
-         /* The following needed to accomodate 1.0 RGB logic op blending */
-         ctx->Color.ColorLogicOpEnabled =
-            (ctx->Color.BlendEquation == GL_LOGIC_OP && state);
+         /* This is needed to support 1.1's RGB logic ops AND
+          * 1.0's blending logicops.
+          */
+         ctx->Color._LogicOpEnabled =
+            (ctx->Color.ColorLogicOpEnabled ||
+             (state && ctx->Color.BlendEquation == GL_LOGIC_OP));
          break;
 #if FEATURE_userclip
       case GL_CLIP_PLANE0:
@@ -350,13 +353,6 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
          else
           ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE;
  
-         if ((ctx->Light.Enabled &&
-              ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR)
-             || ctx->Fog.ColorSumEnabled)
-            ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR;
-         else
-            ctx->_TriangleCaps &= ~DD_SEPARATE_SPECULAR;
-
          break;
       case GL_LINE_SMOOTH:
          if (ctx->Line.SmoothFlag == state)
@@ -383,6 +379,12 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
             return;
          FLUSH_VERTICES(ctx, _NEW_COLOR);
          ctx->Color.ColorLogicOpEnabled = state;
+         /* This is needed to support 1.1's RGB logic ops AND
+          * 1.0's blending logicops.
+          */
+         ctx->Color._LogicOpEnabled =
+            (state || (ctx->Color.BlendEnabled &&
+                       ctx->Color.BlendEquation == GL_LOGIC_OP));
          break;
       case GL_MAP1_COLOR_4:
          if (ctx->Eval.Map1Color4 == state)
@@ -782,14 +784,6 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
             return;
          FLUSH_VERTICES(ctx, _NEW_FOG);
          ctx->Fog.ColorSumEnabled = state;
-
-         if ((ctx->Light.Enabled &&
-              ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR)
-             || ctx->Fog.ColorSumEnabled)
-            ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR;
-         else
-            ctx->_TriangleCaps &= ~DD_SEPARATE_SPECULAR;
-
          break;
 
       /* GL_ARB_multisample */
@@ -852,21 +846,21 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
          CHECK_EXTENSION(NV_vertex_program, cap);
          if (ctx->VertexProgram.Enabled == state)
             return;
-         FLUSH_VERTICES(ctx, _NEW_TRANSFORM | _NEW_PROGRAM);  /* XXX OK? */
+         FLUSH_VERTICES(ctx, _NEW_PROGRAM); 
          ctx->VertexProgram.Enabled = state;
          break;
       case GL_VERTEX_PROGRAM_POINT_SIZE_NV:
          CHECK_EXTENSION(NV_vertex_program, cap);
          if (ctx->VertexProgram.PointSizeEnabled == state)
             return;
-         FLUSH_VERTICES(ctx, _NEW_POINT | _NEW_PROGRAM);
+         FLUSH_VERTICES(ctx, _NEW_PROGRAM);
          ctx->VertexProgram.PointSizeEnabled = state;
          break;
       case GL_VERTEX_PROGRAM_TWO_SIDE_NV:
          CHECK_EXTENSION(NV_vertex_program, cap);
          if (ctx->VertexProgram.TwoSideEnabled == state)
             return;
-         FLUSH_VERTICES(ctx, _NEW_PROGRAM);  /* XXX OK? */
+         FLUSH_VERTICES(ctx, _NEW_PROGRAM); 
          ctx->VertexProgram.TwoSideEnabled = state;
          break;
       case GL_MAP1_VERTEX_ATTRIB0_4_NV:
@@ -922,7 +916,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
          CHECK_EXTENSION(NV_fragment_program, cap);
          if (ctx->FragmentProgram.Enabled == state)
             return;
-         FLUSH_VERTICES(ctx, _NEW_PROGRAM | _NEW_TEXTURE);
+         FLUSH_VERTICES(ctx, _NEW_PROGRAM);
          ctx->FragmentProgram.Enabled = state;
          break;
 #endif /* FEATURE_NV_fragment_program */
@@ -958,7 +952,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
          CHECK_EXTENSION(ARB_fragment_program, cap);
          if (ctx->FragmentProgram.Enabled == state)
             return;
-         FLUSH_VERTICES(ctx, _NEW_PROGRAM | _NEW_TEXTURE);
+         FLUSH_VERTICES(ctx, _NEW_PROGRAM);
          ctx->FragmentProgram.Enabled = state;
          break;
 #endif /* FEATURE_ARB_fragment_program */
@@ -1009,7 +1003,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
  * Get's the current context, assures that we're outside glBegin()/glEnd() and
  * calls _mesa_set_enable().
  */
-void
+void GLAPIENTRY
 _mesa_Enable( GLenum cap )
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -1029,7 +1023,7 @@ _mesa_Enable( GLenum cap )
  * Get's the current context, assures that we're outside glBegin()/glEnd() and
  * calls _mesa_set_enable().
  */
-void
+void GLAPIENTRY
 _mesa_Disable( GLenum cap )
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -1056,7 +1050,7 @@ _mesa_Disable( GLenum cap )
  * For the capabilities associated with extensions verifies that those
  * extensions are effectively present before reporting.
  */
-GLboolean
+GLboolean GLAPIENTRY
 _mesa_IsEnabled( GLenum cap )
 {
    GET_CURRENT_CONTEXT(ctx);