Welcome! Log In Create A New Profile

Advanced

Program stops at GX_DrawDone();

Posted by Minishlink 
Program stops at GX_DrawDone();
October 10, 2008 11:46AM
Hi guys :)

I'm having a problem with GX_DrawDone(), when my program is at this instruction, it crashes (no Core Dump, just screen freeze)...
And it occurs when I load or draw a texture because with a simple code it works great (i.e. I can return to HBC when I hold A).

So, that's my code :
[pastebin.com] <- a part of my lib (.h and .c mixed for that post)
[pastebin.com] <- the program

Problem : Screen freezes at GX_DrawDone(); (line 158)

Thank you for helping me =)



Edited 1 time(s). Last edit at 10/10/2008 11:52AM by Minishlink.
Re: Program stops at GX_DrawDone();
October 10, 2008 12:00PM
This isn't really answering your question, but you declared an array with 1024 sprite objects? May I ask why?

Edit: just had a proper look, don't you need to start the scene rendering then finish? I haven't used GX, but all of the other graphics API's I've used (including OpenGL which this is based on) require some form of function like d3dDevice->StartRender() then all the render code then EndRender(), StopRender or something to that effect.



Edited 1 time(s). Last edit at 10/10/2008 12:03PM by WiiPhlex.
Re: Program stops at GX_DrawDone();
October 10, 2008 12:07PM
The array is just for testing ;)

"don't you need to start the scene rendering then finish?" Hum, like GX_Begin and GX_End ?
Re: Program stops at GX_DrawDone();
October 10, 2008 12:20PM
shagkur from EFNet says:
There're 2 important mistakes:
1) missing to load the projection matrix, which is essential for the system.
2) defining the vertex color attribute along with setting it in VtxDesc as direct data, but in the mesh drawing routine he doesn't set the vertex color.

GX most often ends up in freeze if certain data is missing.
Re: Program stops at GX_DrawDone();
October 10, 2008 12:21PM
Yes, there's usually functions for that kind of thing across drawing objects like textures, particles etc.
Re: Program stops at GX_DrawDone();
October 10, 2008 06:37PM
So, I changed the function ML_DrawSprite and some things (u8 alpha etc).
[pastebin.com]

If I understood well, I have to load the projection matrix after, but what is it ? ^^"
Like something like that : "GX_LoadPosMtxImm(mtx, GX_PNMTX0);" ? Or ?

EDIT : I tested and it's not stopping at GX_DrawDone() anymore but nothing is drawing x_X



Edited 1 time(s). Last edit at 10/10/2008 08:27PM by Minishlink.
Sorry, only registered users may post in this forum.

Click here to login