fix GL_BACK color material bug
[mesa.git] / src / mesa / main / dd.h
index 63325b010a3fe83ccaa374526b11d6bc66dc95b3..ad389df4a5d6da5e688e522c99fc754352c6f218 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: dd.h,v 1.22 2000/03/21 16:10:22 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -501,11 +500,6 @@ struct dd_function_table {
     *** Texture mapping functions:
     ***/
 
-   void (*TexEnv)( GLcontext *ctx, GLenum target, GLenum pname,
-                   const GLfloat *param );
-   /* Called whenever glTexEnv*() is called.
-    */
-
    void (*TexImage)( GLcontext *ctx, GLenum target,
                      struct gl_texture_object *tObj, GLint level,
                      GLint internalFormat,
@@ -631,6 +625,7 @@ struct dd_function_table {
     */
 
    GLvoid *(*GetTexImage)( GLcontext *ctx, GLenum target, GLint level,
+                           const struct gl_texture_object *texObj,
                            GLenum *formatOut, GLenum *typeOut,
                            GLboolean *freeImageOut );
    /* Called by glGetTexImage or by core Mesa when a texture image
@@ -645,21 +640,94 @@ struct dd_function_table {
     * Core Mesa will perform any image format/type conversions that are needed.
     */
 
+   GLboolean (*CompressedTexImage1D)( GLcontext *ctx, GLenum target,
+                                      GLint level, const GLvoid *data,
+                                      struct gl_texture_object *texObj,
+                                      struct gl_texture_image *texImage,
+                                      GLboolean *retainInternalCopy);
+   GLboolean (*CompressedTexImage2D)( GLcontext *ctx, GLenum target,
+                                      GLint level, const GLvoid *data,
+                                      struct gl_texture_object *texObj,
+                                      struct gl_texture_image *texImage,
+                                      GLboolean *retainInternalCopy);
+   GLboolean (*CompressedTexImage3D)( GLcontext *ctx, GLenum target,
+                                      GLint level, const GLvoid *data,
+                                      struct gl_texture_object *texObj,
+                                      struct gl_texture_image *texImage,
+                                      GLboolean *retainInternalCopy);
+   /* Called by glCompressedTexImage1/2/3D.
+    * Arguments:
+    *   <target>, <level>, <internalFormat>, <data> are user specified.
+    *   <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.
+    */
+
+   GLboolean (*CompressedTexSubImage1D)( GLcontext *ctx, GLenum target,
+                                         GLint level, GLint xoffset,
+                                         GLsizei width, GLenum format,
+                                         GLsizei imageSize, const GLvoid *data,
+                                         struct gl_texture_object *texObj,
+                                         struct gl_texture_image *texImage );
+   GLboolean (*CompressedTexSubImage2D)( GLcontext *ctx, GLenum target,
+                                         GLint level, GLint xoffset,
+                                         GLint yoffset, GLsizei width,
+                                         GLint height, GLenum format,
+                                         GLsizei imageSize, const GLvoid *data,
+                                         struct gl_texture_object *texObj,
+                                         struct gl_texture_image *texImage );
+   GLboolean (*CompressedTexSubImage3D)( GLcontext *ctx, GLenum target,
+                                         GLint level, GLint xoffset,
+                                         GLint yoffset, GLint zoffset,
+                                         GLsizei width, GLint height,
+                                         GLint depth, GLenum format,
+                                         GLsizei imageSize, const GLvoid *data,
+                                         struct gl_texture_object *texObj,
+                                         struct gl_texture_image *texImage );
+   /* Called by glCompressedTexSubImage1/2/3D.
+    * Arguments:
+    *   <target>, <level>, <x/z/zoffset>, <width>, <height>, <depth>,
+    *      <imageSize>, and <data> are user specified.
+    *   <texObj> is the target texture object.
+    *   <texImage> is the target texture image.  It will have the texture
+    *      width, height, depth, border and internalFormat information.
+    * Return GL_TRUE if operation completed, return GL_FALSE if core Mesa
+    * should do the job.
+    */
+
+   void (*GetCompressedTexImage)( GLcontext *ctx, GLenum target,
+                                  GLint lod, void *image,
+                                  const struct gl_texture_object *texObj,
+                                  struct gl_texture_image *texImage );
+   /* Called by glGetCompressedTexImageARB.
+    * <target>, <lod>, <image> are specified by user.
+    * <texObj> is the source texture object.
+    * <texImage> is the source texture image.
+    */
+
+   void (*TexEnv)( GLcontext *ctx, GLenum target, GLenum pname,
+                   const GLfloat *param );
+   /* Called by glTexEnv*().
+    */
+
    void (*TexParameter)( GLcontext *ctx, GLenum target,
-                         struct gl_texture_object *tObj,
+                         struct gl_texture_object *texObj,
                          GLenum pname, const GLfloat *params );
-   /* Called whenever glTexParameter*() is called.
-    *    target is GL_TEXTURE_1D or GL_TEXTURE_2D
-    *    texObject is the texture object to modify
-    *    pname is one of GL_TEXTURE_MIN_FILTER, GL_TEXTURE_MAG_FILTER,
-    *       GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, or GL_TEXTURE_BORDER_COLOR.
-    *    params is dependant on pname.  See man glTexParameter.
+   /* Called by glTexParameter*().
+    *    <target> is user specified
+    *    <texObj> the texture object to modify
+    *    <pname> is one of GL_TEXTURE_MIN_FILTER, GL_TEXTURE_MAG_FILTER,
+    *       GL_TEXTURE_WRAP_[STR], or GL_TEXTURE_BORDER_COLOR.
+    *    <params> is user specified.
     */
 
    void (*BindTexture)( GLcontext *ctx, GLenum target,
                         struct gl_texture_object *tObj );
-   /* Called whenever glBindTexture() is called.  This specifies which
-    * texture is to be the current one.  No dirty flags will be set.
+   /* Called by glBindTexture().
     */
 
    void (*DeleteTexture)( GLcontext *ctx, struct gl_texture_object *tObj );
@@ -667,28 +735,27 @@ struct dd_function_table {
     * should free anything attached to the DriverData pointers.
     */
 
-   void (*UpdateTexturePalette)( GLcontext *ctx,
-                                 struct gl_texture_object *tObj );
-   /* Called when the texture's color lookup table is changed.
-    * If tObj is NULL then the shared texture palette ctx->Texture.Palette
-    * was changed.
+   GLboolean (*IsTextureResident)( GLcontext *ctx, 
+                                   struct gl_texture_object *t );
+   /* Called by glAreTextureResident().
+    */
+
+   void (*PrioritizeTexture)( GLcontext *ctx,  struct gl_texture_object *t,
+                              GLclampf priority );
+   /* Called by glPrioritizeTextures().
     */
 
    void (*ActiveTexture)( GLcontext *ctx, GLuint texUnitNumber );
    /* Called by glActiveTextureARB to set current texture unit.
     */
 
-
-   GLboolean (*IsTextureResident)( GLcontext *ctx, 
-                                   struct gl_texture_object *t );
-   /* Allows the driver to implement the AreTexturesResident tests without
-    * knowing about Mesa's internal hash tables for textures.
+   void (*UpdateTexturePalette)( GLcontext *ctx,
+                                 struct gl_texture_object *tObj );
+   /* Called when the texture's color lookup table is changed.
+    * If tObj is NULL then the shared texture palette ctx->Texture.Palette
+    * is to be updated.
     */
 
-   void (*PrioritizeTexture)( GLcontext *ctx,  struct gl_texture_object *t,
-                              GLclampf priority );
-   /* Notify driver of priority change for a texture.
-    */
 
 
    /***