assorted changes for supporting GLfloat color channels (not done)
[mesa.git] / src / mesa / swrast / s_context.h
index 3bf9616d51f059b4a1b437527b647c1bbb365ef5..5aad31683ba0fa20a81c2623549140b10ef1c7d7 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: s_context.h,v 1.8 2001/03/19 02:25:36 keithw Exp $ */
+/* $Id: s_context.h,v 1.11 2001/07/13 20:07:37 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -114,7 +114,6 @@ typedef struct
     * _swrast_validate_derived():
     */
    GLuint _RasterMask;
-   GLboolean _MultiTextureEnabled;
    GLfloat _MinMagThresh[MAX_TEXTURE_UNITS];
    GLfloat _backface_sign;
    GLboolean _PreferPixelFog;
@@ -152,7 +151,7 @@ typedef struct
    swrast_line_func Line;
    swrast_tri_func Triangle;
 
-   /* Placeholders for when seperate specular (or secondary color) is
+   /* Placeholders for when separate specular (or secondary color) is
     * enabled but texturing is not.
     */
    swrast_point_func SpecPoint;
@@ -168,25 +167,39 @@ typedef struct
 } SWcontext;
 
 
-void
+extern void
 _swrast_validate_derived( GLcontext *ctx );
 
 
 #define SWRAST_CONTEXT(ctx) ((SWcontext *)ctx->swrast_context)
 
 #define RENDER_START(SWctx, GLctx)                     \
-   do {                                                \
+   do {                                                        \
       if ((SWctx)->Driver.SpanRenderStart) {           \
          (*(SWctx)->Driver.SpanRenderStart)(GLctx);    \
-      }                                                \
+      }                                                        \
    } while (0)
 
 #define RENDER_FINISH(SWctx, GLctx)                    \
-   do {                                                \
+   do {                                                        \
       if ((SWctx)->Driver.SpanRenderFinish) {          \
          (*(SWctx)->Driver.SpanRenderFinish)(GLctx);   \
-      }                                                \
+      }                                                        \
    } while (0)
 
 
+
+/*
+ * XXX these macros are just bandages for now in order to make
+ * CHAN_BITS==32 compile cleanly.
+ * These should probably go elsewhere at some point.
+ */
+#if CHAN_TYPE == GL_FLOAT
+#define ChanToFixed(X)  FloatToFixed(X)
+#define FixedToChan(X)  FixedToFloat(X)
+#else
+#define ChanToFixed(X)  IntToFixed(X)
+#define FixedToChan(X)  FixedToInt(X)
+#endif
+
 #endif