PDA

View Full Version : Problems with glDeleteTextures



jeppa
04-04-2001, 06:36 AM
Hi all,
I would like to implement some sort of texture streaming from system memory to card memory... I mean, I would like to be able to load textures to VMEM and then eliminate them (when they are no more needed) to free some memory to be able to load new textures.
I tried to use a glTexImage2D to load some textures in VMEM and then glDeleteTextures to free them (passing their texture ID to the function)... the result is that this operation involve some of the other textures I have in VMEM and I see a lot of graphical problems onscreen with objects showing wrong textures or using textures of other objects (?!)... I'm sure the ID that I pass to the function glDeleteTextures are ok... why I experience these problems?

Thanks in advance.

Korval
04-04-2001, 07:20 AM
I'm pretty sure that's not the way to do it. glDelete-ing a texture means, if I understand correctly, that the texture ID you pass in is no longer valid. Instead, you should just call glTexture2D again with the new texture data. It will write over the currently stored texture data. Of course, you will have to glBindTexture the appropriate texture ID before calling glTexture.