glDeleteTextures, anyone? (libnds)
Posted: Sun Mar 21, 2010 8:22 am
Would the developers of libnds be interested in being able to have the library allow deleting of individual textures from VRAM, rather than having to reset it all and reload what didn't want to be deleted? For the past bit, I've been working on such a modification to the videoGL files in the libnds source, and while I have it working with current tests, it does need a bit of a speedup in allocation checking (pre-optimization is the devil, right?), and it may still be buggy. I wont go into details as to how it works, but what it will allow is the following...
glDeleteTextures - works the opposite as glGenTextures, deleting individual or a group of texture names, along with references to the texture, including VRAM position.
glGenTextures - You won't notice a difference from before, but it will work with what has been deleted with glDeleteTextures, should any texture names be deleted prior (rather than continually counting up for each new generated name, it will first check any that had been deleted before, and use them instead)
glTexImage2D - works exactly how it did before, but won't restrict the new texture to have similar parameters like the old texture (think of it like realloc, but for textures).
There are also a couple of new local functions inside libnds (much like getNewTextureSlot, which btw was removed), and while I don't remember an OpenGL-like function that kept a texture name but deleted the texture associated with it (like the opposite of glTexImage2D), perhaps it wouldn't be so bad to include one, much like glResetTextures is not part of OpenGL (to my knowledge).
If this is something people are interested in, then I'll try and fix any problems it may have, and possibly speed it up, then post it here.
glDeleteTextures - works the opposite as glGenTextures, deleting individual or a group of texture names, along with references to the texture, including VRAM position.
glGenTextures - You won't notice a difference from before, but it will work with what has been deleted with glDeleteTextures, should any texture names be deleted prior (rather than continually counting up for each new generated name, it will first check any that had been deleted before, and use them instead)
glTexImage2D - works exactly how it did before, but won't restrict the new texture to have similar parameters like the old texture (think of it like realloc, but for textures).
There are also a couple of new local functions inside libnds (much like getNewTextureSlot, which btw was removed), and while I don't remember an OpenGL-like function that kept a texture name but deleted the texture associated with it (like the opposite of glTexImage2D), perhaps it wouldn't be so bad to include one, much like glResetTextures is not part of OpenGL (to my knowledge).
If this is something people are interested in, then I'll try and fix any problems it may have, and possibly speed it up, then post it here.