gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Anyone still care to have a glDeleteTexture function?

#173112 - DiscoStew - Tue Mar 23, 2010 12:13 am

I posted this at the devkitpro forums, but it wouldn't hurt to post it here too.

I had recently made some modifications to the videoGL files, and I believe it is time I shared it. So what does it include?

It includes the ability to delete textures name or clearing a texture in VRAM from a bound texture name. What this means is that textures are now dynamically allocated to the earliest available area of texture-allocated VRAM. No more needing to use glResetTextures everytime you wanted to get rid of something. Other functions such as glGenTextures have been modified as well to work with this change.

Download Link

NOTE: Be sure to back up existing files. If you are unsure about how to install these, then it is best not to try them out.

The compressed file contains the videoGL header and source code, as well as the compiled libnds library (1.4.3) that includes my modifications. Have a spin with it if you want. It retains all the original functions, but includes 2 new ones usable by the developer...

int glDeleteTextures( int n, int *names) - For deleting names, as well as any textures bound to them in VRAM.
int glClearTexture( void ) - Removes the texture currently bound from VRAM.

It also contains the fix I mentioned in the Bug Reports thread (at devkitpro) about textures of type GL_RGB copying twice the amount it needed to, as well as the change for if you bind a different-sized texture to a texture name that already has a texture in it.

Please let me know how this turns out for everyone, and any bugs or suggestions that turn up.


I'm hoping that this could be a permanent addition to libnds, but, it is up to Wintermute, and other libnds maintainers, that will decide if something of this nature would be worthwhile to add.
_________________
DS - It's all about DiscoStew