[Easy Gl2D] Sprite not displaying properly

Post Reply
tarlkea
Posts: 5
Joined: Sun Sep 05, 2010 5:51 am

[Easy Gl2D] Sprite not displaying properly

Post by tarlkea » Sun Aug 03, 2014 5:35 pm

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

tarlkea
Posts: 5
Joined: Sun Sep 05, 2010 5:51 am

Re: [Easy Gl2D] Sprite not displaying properly

Post by tarlkea » Mon Aug 11, 2014 3:08 pm

The issue was Gl2D had to be recompiled with the new version of devkitpro.

sverx
Posts: 94
Joined: Wed Aug 12, 2009 2:56 pm
Location: github.com/sverx
Contact:

Re: [Easy Gl2D] Sprite not displaying properly

Post by sverx » Wed Aug 13, 2014 4:46 pm

I don't see your code loading any palette...

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests