intel: Add extern "C" declarations to headers
[mesa.git] / src / mesa / main / teximage.h
index bb5509e5be679d67f376a270250ca0184d9f6baf..66a0c88950b9cdaaf0c1b827fdbbe32d8e5d1d91 100644 (file)
 #include "mtypes.h"
 #include "formats.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-extern void *
-_mesa_alloc_texmemory(GLsizei bytes);
-
-extern void
-_mesa_free_texmemory(void *m);
+/** Is the given value one of the 6 cube faces? */
+static inline GLboolean
+_mesa_is_cube_face(GLenum target)
+{
+   return (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB &&
+           target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB);
+}
 
+/** Is any of the dimensions of given texture equal to zero? */
+static inline GLboolean
+_mesa_is_zero_size_texture(const struct gl_texture_image *texImage)
+{
+   return (texImage->Width == 0 ||
+           texImage->Height == 0 ||
+           texImage->Depth == 0);
+}
 
 /** \name Internal functions */
 /*@{*/
@@ -59,15 +72,12 @@ _mesa_new_texture_image( struct gl_context *ctx );
 
 
 extern void
-_mesa_delete_texture_image( struct gl_context *ctx, struct gl_texture_image *teximage );
-
-extern void
-_mesa_free_texture_image_data( struct gl_context *ctx, 
-                              struct gl_texture_image *texImage );
+_mesa_delete_texture_image( struct gl_context *ctx,
+                            struct gl_texture_image *teximage );
 
 
 extern void
-_mesa_init_teximage_fields(struct gl_context *ctx, GLenum target,
+_mesa_init_teximage_fields(struct gl_context *ctx,
                            struct gl_texture_image *img,
                            GLsizei width, GLsizei height, GLsizei depth,
                            GLint border, GLenum internalFormat,
@@ -80,19 +90,19 @@ _mesa_choose_texture_format(struct gl_context *ctx,
                             GLenum target, GLint level,
                             GLenum internalFormat, GLenum format, GLenum type);
 
-
 extern void
-_mesa_clear_texture_image(struct gl_context *ctx, struct gl_texture_image *texImage);
-
+_mesa_update_fbo_texture(struct gl_context *ctx,
+                         struct gl_texture_object *texObj,
+                         GLuint face, GLuint level);
 
 extern void
-_mesa_set_tex_image(struct gl_texture_object *tObj,
-                    GLenum target, GLint level,
-                    struct gl_texture_image *texImage);
+_mesa_clear_texture_image(struct gl_context *ctx,
+                          struct gl_texture_image *texImage);
 
 
 extern struct gl_texture_object *
-_mesa_select_tex_object(struct gl_context *ctx, const struct gl_texture_unit *texUnit,
+_mesa_select_tex_object(struct gl_context *ctx,
+                        const struct gl_texture_unit *texUnit,
                         GLenum target);
 
 extern struct gl_texture_object *
@@ -100,7 +110,8 @@ _mesa_get_current_tex_object(struct gl_context *ctx, GLenum target);
 
 
 extern struct gl_texture_image *
-_mesa_select_tex_image(struct gl_context *ctx, const struct gl_texture_object *texObj,
+_mesa_select_tex_image(struct gl_context *ctx,
+                       const struct gl_texture_object *texObj,
                        GLenum target, GLint level);
 
 
@@ -132,7 +143,7 @@ _mesa_get_texture_dimensions(GLenum target);
 /**
  * Lock a texture for updating.  See also _mesa_lock_context_textures().
  */
-static INLINE void
+static inline void
 _mesa_lock_texture(struct gl_context *ctx, struct gl_texture_object *texObj)
 {
    _glthread_LOCK_MUTEX(ctx->Shared->TexMutex);
@@ -140,9 +151,10 @@ _mesa_lock_texture(struct gl_context *ctx, struct gl_texture_object *texObj)
    (void) texObj;
 }
 
-static INLINE void
+static inline void
 _mesa_unlock_texture(struct gl_context *ctx, struct gl_texture_object *texObj)
 {
+   (void) texObj;
    _glthread_UNLOCK_MUTEX(ctx->Shared->TexMutex);
 }
 
@@ -271,6 +283,15 @@ _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
                                  GLsizei height, GLsizei depth, GLenum format,
                                  GLsizei imageSize, const GLvoid *data);
 
+
+extern void GLAPIENTRY
+_mesa_TexBuffer(GLenum target, GLenum internalFormat, GLuint buffer);
+
+
 /*@}*/
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif