rearranged order of some functions
[mesa.git] / src / mesa / main / dd.h
index 60f3bcdefad5d3de7a46a5303947521cc2451091..14d27fbb57291462e25ee79f3f0b3a6869b8bf74 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: dd.h,v 1.18 2000/03/20 14:37:52 brianp Exp $ */
+/* $Id: dd.h,v 1.20 2000/03/20 23:45:59 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
  * Version:  3.3
  * 
- * Copyright (C) 1999  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2000  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"),
@@ -506,60 +506,6 @@ struct dd_function_table {
    /* This is called by glBitmap.  Works the same as DrawPixels, above.
     */
 
-   void (*RenderStart)( GLcontext *ctx );
-   void (*RenderFinish)( GLcontext *ctx );
-    /* KW: These replace Begin and End, and have more relaxed semantics.
-     * They are called prior-to and after one or more vb flush, and are
-     * thus decoupled from the gl_begin/gl_end pairs, which are possibly 
-     * more frequent.  If a begin/end pair covers >1 vertex buffer, these
-     * are called at most once for the pair. (a bit broken at present)
-     */
-
-   void (*RasterSetup)( struct vertex_buffer *VB, GLuint start, GLuint end );
-   /* This function, if not NULL, is called whenever new window coordinates
-    * are put in the vertex buffer.  The vertices in question are those n
-    * such that start <= n < end.
-    * The device driver can convert the window coords to its own specialized
-    * format.  The 3Dfx driver uses this.
-    *
-    * Note: Deprecated in favour of RegisterPipelineStages, below.
-    */
-
-
-   render_func *RenderVBClippedTab;
-   render_func *RenderVBCulledTab;
-   render_func *RenderVBRawTab;
-   /* These function tables allow the device driver to rasterize an
-    * entire begin/end group of primitives at once.  See the
-    * gl_render_vb() function in vbrender.c for more details.  
-    */
-
-
-   void (*ReducedPrimitiveChange)( GLcontext *ctx, GLenum primitive );
-   /* If registered, this will be called when rendering transitions between
-    * points, lines and triangles.  It is not called on transitions between 
-    * primtives such as GL_TRIANGLES and GL_TRIANGLE_STRIPS, or between
-    * triangles and quads or triangles and polygons.
-    */
-
-   GLuint TriangleCaps;
-   /* Holds a list of the reasons why we might normally want to call
-    * render_triangle, but which are in fact implemented by the
-    * driver.  The FX driver sets this to DD_TRI_CULL, and will soon
-    * implement DD_TRI_OFFSET.
-    */
-
-
-   GLboolean (*MultipassFunc)( struct vertex_buffer *VB, GLuint passno );
-   /* Driver may request additional render passes by returning GL_TRUE
-    * when this function is called.  This function will be called
-    * after the first pass, and passes will be made until the function
-    * returns GL_FALSE.  If no function is registered, only one pass
-    * is made.  
-    * 
-    * This function will be first invoked with passno == 1.
-    */
-
    /***
     *** Texture mapping functions:
     ***/
@@ -593,6 +539,86 @@ struct dd_function_table {
     * Called from glTexSubImage() to define a sub-region of a texture.
     */
 
+
+   GLboolean (*TexImage1D)( GLcontext *ctx, GLenum target, GLint level,
+                            GLenum format, GLenum type, const GLvoid *pixels,
+                            const struct gl_pixelstore_attrib *packing,
+                            struct gl_texture_object *texObj,
+                            struct gl_texture_image *texImage,
+                            GLboolean *retainInternalCopy );
+   GLboolean (*TexImage2D)( GLcontext *ctx, GLenum target, GLint level,
+                            GLenum format, GLenum type, const GLvoid *pixels,
+                            const struct gl_pixelstore_attrib *packing,
+                            struct gl_texture_object *texObj,
+                            struct gl_texture_image *texImage,
+                            GLboolean *retainInternalCopy );
+   GLboolean (*TexImage3D)( GLcontext *ctx, GLenum target, GLint level,
+                            GLenum format, GLenum type, const GLvoid *pixels,
+                            const struct gl_pixelstore_attrib *packing,
+                            struct gl_texture_object *texObj,
+                            struct gl_texture_image *texImage,
+                            GLboolean *retainInternalCopy );
+   /* Called by glTexImage1/2/3D.
+    * Will not be called if any glPixelTransfer operations are enabled.
+    * Arguments:
+    *   <target>, <level>, <format>, <type> and <pixels> are user specified.
+    *   <packing> indicates the image packing of pixels.
+    *   <texObj> is the target texture object.
+    *   <texImage> is the target texture image.  It will have the texture
+    *      width, height, depth, border and internalFormat information.
+    *   <retainInternalCopy> is returned by this function and indicates whether
+    *      core Mesa should keep an internal copy of the texture image.
+    * Return GL_TRUE if operation completed, return GL_FALSE if core Mesa
+    * should do the job.  If GL_FALSE is returned, this function will be
+    * called a second time after the texture image has been unpacked into
+    * GLubytes.  It may be easier for the driver to handle then.
+    */
+
+   GLboolean (*TexSubImage1D)( GLcontext *ctx, GLenum target, GLint level,
+                               GLint xoffset, GLsizei width,
+                               GLenum format, GLenum type,
+                               const GLvoid *pixels,
+                               const struct gl_pixelstore_attrib *packing,
+                               struct gl_texture_object *texObj,
+                               struct gl_texture_image *texImage,
+                               GLboolean *retainInternalCopy );
+   GLboolean (*TexSubImage2D)( GLcontext *ctx, GLenum target, GLint level,
+                               GLint xoffset, GLint yoffset,
+                               GLsizei width, GLsizei height,
+                               GLenum format, GLenum type,
+                               const GLvoid *pixels,
+                               const struct gl_pixelstore_attrib *packing,
+                               struct gl_texture_object *texObj,
+                               struct gl_texture_image *texImage,
+                               GLboolean *retainInternalCopy );
+   GLboolean (*TexSubImage3D)( GLcontext *ctx, GLenum target, GLint level,
+                               GLint xoffset, GLint yoffset, GLint zoffset,
+                               GLsizei width, GLsizei height, GLint depth,
+                               GLenum format, GLenum type,
+                               const GLvoid *pixels,
+                               const struct gl_pixelstore_attrib *packing,
+                               struct gl_texture_object *texObj,
+                               struct gl_texture_image *texImage,
+                               GLboolean *retainInternalCopy );
+
+   /* Called by glTexSubImage1/2/3D.
+    * Will not be called if any glPixelTransfer operations are enabled.
+    * Arguments:
+    *   <target>, <level>, <xoffset>, <yoffset>, <zoffset>, <width>, <height>,
+    *      <depth>, <format>, <type> and <pixels> are user specified.
+    *   <packing> indicates the image packing of pixels.
+    *   <texObj> is the target texture object.
+    *   <texImage> is the target texture image.  It will have the texture
+    *      width, height, border and internalFormat information.
+    * Return GL_TRUE if operation completed, return GL_FALSE if core Mesa
+    * should do the job.  If GL_FALSE is returned, this function will be
+    * called a second time after the texture image has been unpacked into
+    * GLubytes.  It may be easier for the driver to handle then.
+    */
+      
+
+
+
    GLboolean (*CopyTexImage1D)( GLcontext *ctx, GLenum target, GLint level,
                                 GLenum internalFormat, GLint x, GLint y,
                                 GLsizei width, GLint border );
@@ -686,12 +712,64 @@ struct dd_function_table {
    void (*PrioritizeTexture)( GLcontext *ctx, 
                              struct gl_texture_object *t,
                              GLclampf priority );
-   /*
-    * Notify driver of priority change for a texture.
+   /* Notify driver of priority change for a texture.
+    */
+
+
+   /***
+    *** Transformation/Rendering functions
+    ***/
+
+   void (*RenderStart)( GLcontext *ctx );
+   void (*RenderFinish)( GLcontext *ctx );
+    /* KW: These replace Begin and End, and have more relaxed semantics.
+     * They are called prior-to and after one or more vb flush, and are
+     * thus decoupled from the gl_begin/gl_end pairs, which are possibly 
+     * more frequent.  If a begin/end pair covers >1 vertex buffer, these
+     * are called at most once for the pair. (a bit broken at present)
+     */
+
+   void (*RasterSetup)( struct vertex_buffer *VB, GLuint start, GLuint end );
+   /* This function, if not NULL, is called whenever new window coordinates
+    * are put in the vertex buffer.  The vertices in question are those n
+    * such that start <= n < end.
+    * The device driver can convert the window coords to its own specialized
+    * format.  The 3Dfx driver uses this.
+    *
+    * Note: Deprecated in favour of RegisterPipelineStages, below.
     */
 
+   render_func *RenderVBClippedTab;
+   render_func *RenderVBCulledTab;
+   render_func *RenderVBRawTab;
+   /* These function tables allow the device driver to rasterize an
+    * entire begin/end group of primitives at once.  See the
+    * gl_render_vb() function in vbrender.c for more details.  
+    */
 
+   void (*ReducedPrimitiveChange)( GLcontext *ctx, GLenum primitive );
+   /* If registered, this will be called when rendering transitions between
+    * points, lines and triangles.  It is not called on transitions between 
+    * primtives such as GL_TRIANGLES and GL_TRIANGLE_STRIPS, or between
+    * triangles and quads or triangles and polygons.
+    */
 
+   GLuint TriangleCaps;
+   /* Holds a list of the reasons why we might normally want to call
+    * render_triangle, but which are in fact implemented by the
+    * driver.  The FX driver sets this to DD_TRI_CULL, and will soon
+    * implement DD_TRI_OFFSET.
+    */
+
+   GLboolean (*MultipassFunc)( struct vertex_buffer *VB, GLuint passno );
+   /* Driver may request additional render passes by returning GL_TRUE
+    * when this function is called.  This function will be called
+    * after the first pass, and passes will be made until the function
+    * returns GL_FALSE.  If no function is registered, only one pass
+    * is made.  
+    * 
+    * This function will be first invoked with passno == 1.
+    */
 
    /***
     *** NEW in Mesa 3.x