I'm using pretty much the default code but when it displays on the DS the sprite appears all white. So there are palette problems it seems, but everything in the code looks fine to me, most of it is the base code from the examples.
The image on the left is the display in no$gba (it looks the same on the actual physical DS also), the image on the right is the background that should be shown:
Code: Select all
#include <nds.h>
#include <gl2d.h>
#include "testBg.h"
int main( void )
{
glImage backgroundImage[1];
videoSetMode(MODE_5_3D);
vramSetBankA(VRAM_A_TEXTURE);
vramSetBankE(VRAM_E_TEX_PALETTE);
// Initialize GL2D
glScreen2D();
int bgId = glLoadTileSet(backgroundImage, 256, 256, 256, 256, GL_RGB256, TEXTURE_SIZE_256, TEXTURE_SIZE_256, GL_TEXTURE_WRAP_S | GL_TEXTURE_WRAP_T | TEXGEN_OFF, 256, (u16*)testBgPal, (u8*)testBgBitmap);
while(1)
{
// set up GL2D for 2d mode
glBegin2D();
// call Easy GL2D's 2D rendering functions here
glSprite(50, 50, GL_FLIP_NONE, backgroundImage);
// end 2D rendering mode
glEnd2D();
glFlush(0);
swiWaitForVBlank();
}
}