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 > 3d sprite overwrite my texture

#126595 - wykz - Wed Apr 25, 2007 2:10 am

I knows that palib not a big fan of 3d but i love it and I have a serious memory problem now when using palib and 3d.

When I use PA_3DCreateSpriteFromTex to lode more then one sprite together whit 3d texture (glTexImage2D) it will overwrite / remove my texture that I use for my 3D objects. Is there any way to restrict 3DCreateSpriteFromTex to only use (RAM_A_TEXTURE_SLOT0
VRAM_A_TEXTURE_SLOT1 or any other god solution to this problem.
I have tried to use 64x64 texture and 128x128 texture but it no different they just vanish

Some pic that shows the problems

1
Three 3D object and one 3D sprite working fine;
[Images not permitted - Click here to view it]

2
Six 3D object one sprite working fine
[Images not permitted - Click here to view it]
3
three 3D objects and two 3D sprits .. the texture is gone on the 3D objects
[Images not permitted - Click here to view it]

the nds files can be find here
http://ninja.ingame.se/nds/

gratefully for any help or hint

#126598 - Lick - Wed Apr 25, 2007 2:20 am

Wait, are you loading the same texture a few times for different objects?
_________________
http://licklick.wordpress.com

#126635 - Mollusk - Wed Apr 25, 2007 8:02 am

PAlib and libnds don't use the same code for texture loading, so that might not be a good idea ^^
_________________
PAlib official forum : http://www.palib.info
PAlib official tutorials: http://www.palib.info/wiki
Updates, help, code examples, tutorials, etc...

#126647 - wykz - Wed Apr 25, 2007 1:26 pm

Lick wrote:
Wait, are you loading the same texture a few times for different objects?


i lode the same texture multiply time for that reason that all the objects gonna have different texture in the game


back to the main post

the reason why I try to load pa libs sprites into the 3d screen(and I get a lot of problem because of that), is because I cant find another way to draw a flat 2d image on top of all the 3d objects

#126649 - Mollusk - Wed Apr 25, 2007 2:19 pm

You could just look at the PAlib sources and build from that ;) It's probably not the correct way of doing (I'm a total 3D noob) but it works
_________________
PAlib official forum : http://www.palib.info
PAlib official tutorials: http://www.palib.info/wiki
Updates, help, code examples, tutorials, etc...