If anyone out there is trying out Nintendo DS programming, and takes the easy route using devkitpro and libnds and palib together, you’ll find the latest versions don’t work for the 3d demos and 3d programming in general, you get errors like these:
PA_3DSprites.o: In function `PA_3DSpriteToScreen’:PA_3DSprites.c:(.text+0x314): undefined reference to `textures’
PA_3DSprites.c:(.text+0x324): undefined reference to `activeTexture’
The problem can be resolved (thanks to sort of reading french and spanish), by making the following simple changes.
In c:\devkitpro\PAlib\lib\arm9\PA edit the file PA_3D.c to change glViewPort into glViewport and in the file PA_3DSprites.c before each occurance of the variables “textures” or “activeTexture” add glGetGlobals()-> so it becomes for example
glGetGlobals()->activeTexture
Then in c:\devkitpro\PAlib\include\nds\arm9\PA_3DSprites.h do the same glGetGlobals() addition there.
Finally, cd to c:\devkitpro\PAlib and run build.bat to rebuild the library, it should complete without errors.
I hope this saves someone else out there an hour or 2 of head scratching…
(view comments)
