Page 1 of 1

[Easy Gl2D] Sprite not displaying properly

Posted: Sun Aug 03, 2014 5:35 pm
by tarlkea
I'm having some problems displaying a sprite using Easy GL2D Ds

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:
Image

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();
    }
}

Re: [Easy Gl2D] Sprite not displaying properly

Posted: Mon Aug 11, 2014 3:08 pm
by tarlkea
The issue was Gl2D had to be recompiled with the new version of devkitpro.

Re: [Easy Gl2D] Sprite not displaying properly

Posted: Wed Aug 13, 2014 4:46 pm
by sverx
I don't see your code loading any palette...