diff options
author | Brian Paul <[email protected]> | 2005-02-05 17:43:33 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2005-02-05 17:43:33 +0000 |
commit | 7aafcc86c74a68206f4f48ca99c12faf469d47e0 (patch) | |
tree | 4328876884dadf094e18bf8996a0597523752cfb /src | |
parent | ce657cf7527bb5bb417577280a634a1e7b657509 (diff) |
remove dependency on Shared->TexObjectList
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/windows/gldirect/dglwgl.c | 48 |
1 files 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; i<MAX_TEXTURE_LEVELS; i++) { - image = tObj->Image[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; i<MAX_TEXTURE_LEVELS; i++) { + image = tObj->Image[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 |