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 > Bank question (2D & 3D) [solved]

#90548 - Valmond - Fri Jun 30, 2006 7:29 pm

Hi !

Just a question as my prog. works :p

I'v done a switcher so that I can switch between 2 2D-'Text' modes and a 2D 'text' main + 3D sub mode.

I use banks A,B,C and D for 2D, and VRAM_A_TEXTURE for 3D-textures.

The 2D is nothing fancy and should be 'OK', the 3D works like this :

I have some data that I convert (haven't got the time to write a converter and
been too lazy to get a free one) on the fly into some mallocated memory
then I use glTexImage2D(...) and then I free up my mallocated mem.

This I do only once, Not every time I switch state.

[EDIT] just to clairify, if I do this every time, it works 4 times, then
the mesh is only colored, not textured, in emu & hardware[/EDIT]

Well, it works (I'v tested a lot but this is the only thing that works), but
shouldn't the data VRAM_A_TEXTURE be overwritten by
VRAM_A_MAIN_BG (or something else) ?

Shouldn't I free up the texture(I bet I should) when leaving 3D and/or how can I do that ?

I'm a noob with opengl BTW :p



Thanks for your time :)

/Valmond


Last edited by Valmond on Sun Jul 02, 2006 11:28 am; edited 1 time in total

#90780 - Valmond - Sun Jul 02, 2006 11:27 am

Found it :p

glResetTextures();

/Valmond