diff options
Diffstat (limited to 'src/mesa/drivers/windows/gldirect')
-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 |