From 7aafcc86c74a68206f4f48ca99c12faf469d47e0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 5 Feb 2005 17:43:33 +0000 Subject: [PATCH] remove dependency on Shared->TexObjectList --- src/mesa/drivers/windows/gldirect/dglwgl.c | 48 ++++++++++++---------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/src/mesa/drivers/windows/gldirect/dglwgl.c b/src/mesa/drivers/windows/gldirect/dglwgl.c index a1b7e5dce0e..437358ae165 100644 --- a/src/mesa/drivers/windows/gldirect/dglwgl.c +++ b/src/mesa/drivers/windows/gldirect/dglwgl.c @@ -1417,31 +1417,37 @@ DoClipperOnly: dglInitStateD3D(ctx); // Now we have to recreate all of our textures (+ mipmaps). - // Luckily, Mesa has a list of them. - tObj = ctx->Shared->TexObjectList; - while (tObj != NULL) { - if (tObj->DriverData) { - // We could call our TexImage function directly, but it's - // safer to use the driver pointer. - for (i=0; iImage[i]; - if (image) { - switch (tObj->Dimensions){ - case 1: - if (ctx->Driver.TexImage) - (*ctx->Driver.TexImage)(ctx, GL_TEXTURE_1D, tObj, i, image->Format, image); - break; - case 2: - if (ctx->Driver.TexImage) - (*ctx->Driver.TexImage)(ctx, GL_TEXTURE_2D, tObj, i, image->Format, image); - break; - default: - break; + // Walk over all textures in hash table + // XXX what about the default texture objects (id=0)? + { + struct _mesa_HashTable *textures = ctx->Shared->TexObjects; + GLuint id; + for (id = _mesa_HashFirstEntry(textures); + id; + id = _mesa_HashNextEntry(textures, id)) { + tObj = (struct gl_texture_object *) _mesa_HashLookup(textures, id); + if (tObj->DriverData) { + // We could call our TexImage function directly, but it's + // safer to use the driver pointer. + for (i=0; iImage[i]; + if (image) { + switch (tObj->Dimensions){ + case 1: + if (ctx->Driver.TexImage) + (*ctx->Driver.TexImage)(ctx, GL_TEXTURE_1D, tObj, i, image->Format, image); + break; + case 2: + if (ctx->Driver.TexImage) + (*ctx->Driver.TexImage)(ctx, GL_TEXTURE_2D, tObj, i, image->Format, image); + break; + default: + break; + } } } } } - tObj = tObj->Next; } // Re-Bind each texture Unit