summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Fonseca <j_r_fonseca@yahoo.co.uk>2003-04-02 20:48:23 +0000
committerJose Fonseca <j_r_fonseca@yahoo.co.uk>2003-04-02 20:48:23 +0000
commitd1803f21d6cd08be5bc6902afc68cf02c0d53725 (patch)
tree0fb4fb80a7c0907e10c543508acacd783905b22f
parent49cd6d45b8403fb3df1cc45a03bfb6a991e7d1c5 (diff)
Seperate code in _mesa_delete_texture_object into _mesa_free_texture_object_data.
-rw-r--r--src/mesa/main/texobj.c40
-rw-r--r--src/mesa/main/texobj.h5
2 files changed, 35 insertions, 10 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 68d9845bbf..3db9ed0a05 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -1,4 +1,4 @@
-/* $Id: texobj.c,v 1.68 2003/04/01 18:10:10 brianp Exp $ */
+/* $Id: texobj.c,v 1.68.2.1 2003/04/02 20:48:23 jrfonseca Exp $ */
/*
* Mesa 3-D graphics library
@@ -109,18 +109,18 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj,
}
-/*
- * Deallocate a texture object. It should have already been removed from
- * the texture object pool.
- * \param texObj the texture object to deallocate
+/**
+ * Free a texture object data, but not the object itself.
+ *
+ * It should have already been removed from the texture object pool.
+ *
+ * \param texObj the texture object to free.
*/
void
-_mesa_delete_texture_object( GLcontext *ctx, struct gl_texture_object *texObj )
+_mesa_free_texture_object_data( struct gl_texture_object *texObj )
{
GLuint i;
- (void) ctx;
-
assert(texObj);
_mesa_free_colortable_data(&texObj->Palette);
@@ -134,12 +134,34 @@ _mesa_delete_texture_object( GLcontext *ctx, struct gl_texture_object *texObj )
/* destroy the mutex -- it may have allocated memory (eg on bsd) */
_glthread_DESTROY_MUTEX(texObj->Mutex);
+}
+
+/**
+ * Deallocate a texture object.
+ *
+ * It should have already been removed from the texture object pool.
+ *
+ * \param texObj the texture object to deallocate.
+ *
+ * \todo The \p ctx parameter is should never be referenced here as the texture
+ * unlinking from context data should be done \u before calling this function,
+ * and not during. Therefore it should be removed.
+ */
+void
+_mesa_delete_texture_object( GLcontext *ctx, struct gl_texture_object *texObj )
+{
+ GLuint i;
+
+ (void) ctx;
+
+ assert(texObj);
+
+ _mesa_delete_texture_object_data( texObj);
/* free this object */
_mesa_free(texObj);
}
-
/**
* Add the given texture object to the texture object pool.
*/
diff --git a/src/mesa/main/texobj.h b/src/mesa/main/texobj.h
index ff46187809..97e406f313 100644
--- a/src/mesa/main/texobj.h
+++ b/src/mesa/main/texobj.h
@@ -1,4 +1,4 @@
-/* $Id: texobj.h,v 1.9 2003/04/01 16:41:55 brianp Exp $ */
+/* $Id: texobj.h,v 1.9.2.1 2003/04/02 20:48:24 jrfonseca Exp $ */
/*
* Mesa 3-D graphics library
@@ -45,6 +45,9 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj,
GLuint name, GLenum target );
extern void
+_mesa_free_texture_object_data( struct gl_texture_object *obj );
+
+extern void
_mesa_delete_texture_object( GLcontext *ctx, struct gl_texture_object *obj );
extern void