added missing \'s
[mesa.git] / src / mesa / swrast / s_context.h
index 10e162b70563b360dd5f780f1283ba6b1c07fdf7..03f6961001a7ce1cab87d26ece76eb23a600e971 100644 (file)
@@ -1,19 +1,21 @@
+/* $Id: s_context.h,v 1.10 2001/05/17 09:32:17 keithw Exp $ */
+
 /*
  * Mesa 3-D graphics library
  * Version:  3.5
- * 
- * Copyright (C) 1999  Brian Paul   All Rights Reserved.
- * 
+ *
+ * Copyright (C) 1999-2001  Brian Paul   All Rights Reserved.
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  * to deal in the Software without restriction, including without limitation
  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  * and/or sell copies of the Software, and to permit persons to whom the
  * Software is furnished to do so, subject to the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice shall be included
  * in all copies or substantial portions of the Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
@@ -28,7 +30,7 @@
 #ifndef S_CONTEXT_H
 #define S_CONTEXT_H
 
-#include "types.h"
+#include "mtypes.h"
 #include "swrast.h"
 
 /*
@@ -55,10 +57,15 @@ typedef void (*blend_func)( GLcontext *ctx, GLuint n, const GLubyte mask[],
                             GLchan src[][4], CONST GLchan dst[][4] );
 #endif
 
-typedef void (*swrast_tri_func)( GLcontext *ctx, 
-                                SWvertex *, SWvertex *, SWvertex *);
-typedef void (*swrast_line_func)( GLcontext *ctx, SWvertex *, SWvertex *);
-typedef void (*swrast_point_func)( GLcontext *ctx, SWvertex *);
+typedef void (*swrast_point_func)( GLcontext *ctx, const SWvertex *);
+
+typedef void (*swrast_line_func)( GLcontext *ctx,
+                                  const SWvertex *, const SWvertex *);
+
+typedef void (*swrast_tri_func)( GLcontext *ctx, const SWvertex *,
+                                 const SWvertex *, const SWvertex *);
+
+
 
 /*
  * Bitmasks to indicate which rasterization options are enabled (RasterMask)
@@ -93,8 +100,12 @@ typedef void (*swrast_point_func)( GLcontext *ctx, SWvertex *);
 
 typedef struct
 {
+   /* Driver interface:
+    */
+   struct swrast_device_driver Driver;
+
    /* Configuration mechanisms to make software rasterizer match
-    * characteristics of the hardware rasterizer (if present): 
+    * characteristics of the hardware rasterizer (if present):
     */
    GLboolean AllowVertexFog;
    GLboolean AllowPixelFog;
@@ -103,46 +114,50 @@ typedef struct
     * _swrast_validate_derived():
     */
    GLuint _RasterMask;
-   GLboolean _MultiTextureEnabled;
-   GLuint _MinMagThresh[MAX_TEXTURE_UNITS];
+   GLfloat _MinMagThresh[MAX_TEXTURE_UNITS];
    GLfloat _backface_sign;
    GLboolean _PreferPixelFog;
 
-   /* Accum buffer temporaries.  
+   /* Accum buffer temporaries.
     */
    GLboolean _IntegerAccumMode;        /* Storing unscaled integers? */
    GLfloat _IntegerAccumScaler;        /* Implicit scale factor */
 
-   
+
    /* Working values:
     */
    struct pixel_buffer* PB;
    GLuint StippleCounter;    /* Line stipple counter */
    GLuint NewState;
    GLuint StateChanges;
-   
+
    /* Mechanism to allow driver (like X11) to register further
     * software rasterization routines.
     */
    void (*choose_point)( GLcontext * );
    void (*choose_line)( GLcontext * );
    void (*choose_triangle)( GLcontext * );
-   void (*choose_quad)( GLcontext * );
 
    GLuint invalidate_point;
    GLuint invalidate_line;
    GLuint invalidate_triangle;
-   GLuint invalidate_quad;
 
 
    /* Function pointers for dispatch behind public entrypoints.
     */
    void (*InvalidateState)( GLcontext *ctx, GLuint new_state );
-   void (*Point)( GLcontext *ctx, SWvertex *v );
-   void (*Line)( GLcontext *ctx, SWvertex *v0, SWvertex *v1 );
-   void (*Triangle)( GLcontext *ctx, SWvertex *v0, SWvertex *v1, SWvertex *v2 );
-   void (*Quad)( GLcontext *ctx, SWvertex *v0, SWvertex *v1, SWvertex *v2, 
-                SWvertex *v3);
+
+   swrast_point_func Point;
+   swrast_line_func Line;
+   swrast_tri_func Triangle;
+
+   /* Placeholders for when separate specular (or secondary color) is
+    * enabled but texturing is not.
+    */
+   swrast_point_func SpecPoint;
+   swrast_line_func SpecLine;
+   swrast_tri_func SpecTriangle;
+
 
    /* Internal hooks, kept uptodate by the same mechanism as above.
     */
@@ -158,6 +173,19 @@ _swrast_validate_derived( GLcontext *ctx );
 
 #define SWRAST_CONTEXT(ctx) ((SWcontext *)ctx->swrast_context)
 
+#define RENDER_START(SWctx, GLctx)                     \
+   do {                                                \
+      if ((SWctx)->Driver.SpanRenderStart) {           \
+         (*(SWctx)->Driver.SpanRenderStart)(GLctx);    \
+      }                                                \
+   } while (0)
+
+#define RENDER_FINISH(SWctx, GLctx)                    \
+   do {                                                \
+      if ((SWctx)->Driver.SpanRenderFinish) {          \
+         (*(SWctx)->Driver.SpanRenderFinish)(GLctx);   \
+      }                                                \
+   } while (0)
 
 
 #endif