[BUG] guOrtho() needs Mtx44 for parameter so perspective should be Mtx44

[CHG] The template is now using the left and right button to move the text
This commit is contained in:
Crayon2000 2009-01-20 03:51:03 +00:00
parent 6bc15252a7
commit 66a1014e66
2 changed files with 13 additions and 11 deletions

View file

@ -424,7 +424,7 @@ void GRRLIB_GXEngine(Vector v[], u32 color, long n, u8 fmt) {
void GRRLIB_Init () {
f32 yscale;
u32 xfbHeight;
Mtx perspective;
Mtx44 perspective;
VIDEO_Init();
rmode = VIDEO_GetPreferredMode(NULL);
@ -446,6 +446,7 @@ void GRRLIB_Init () {
gp_fifo = (u8 *) memalign(32, DEFAULT_FIFO_SIZE);
if(gp_fifo == NULL)
return;
memset(gp_fifo, 0, DEFAULT_FIFO_SIZE);
GX_Init(gp_fifo, DEFAULT_FIFO_SIZE);
// clears the bg to color and clears the z buffer
@ -495,7 +496,7 @@ void GRRLIB_Init () {
guMtxTransApply (GXmodelView2D, GXmodelView2D, 0.0F, 0.0F, -50.0F);
GX_LoadPosMtxImm(GXmodelView2D, GX_PNMTX0);
guOrtho(perspective,0, 479, 0, 639, 0, 300);
guOrtho(perspective,0, 479, 0, 639, 0, 300.0F);
GX_LoadProjectionMtx(perspective, GX_ORTHOGRAPHIC);
GX_SetViewport(0, 0, rmode->fbWidth, rmode->efbHeight, 0, 1);

View file

@ -22,7 +22,7 @@
Mtx GXmodelView2D;
int main(){
int rot = 0;
int left = 0;
ir_t ir1;
GRRLIB_Init();
@ -58,15 +58,16 @@ int main(){
GRRLIB_DrawImg(10, 10, tex_test_jpg, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_Printf(rot, 200, tex_BMfont1, 0xFFFFFFFF, 1, "X VALUE:%d", (int)ir1.sx);
GRRLIB_Printf(rot, 250, tex_BMfont4, 0xFFFFFFFF, 1, "X VALUE:%d", (int)ir1.sx);
GRRLIB_Printf(rot, 300, tex_BMfont3, 0xFFFFFFFF, 1, "X VALUE : %d", tex_test_jpg.w);
GRRLIB_Printf(rot, 350, tex_BMfont2, 0xFFFFFFFF, 1, "X VALUE : 1");
GRRLIB_Printf(left, 200, tex_BMfont1, 0xFFFFFFFF, 1, "X VALUE:%d", (int)ir1.sx);
GRRLIB_Printf(left, 250, tex_BMfont4, 0xFFFFFFFF, 1, "X VALUE:%d", (int)ir1.sx);
GRRLIB_Printf(left, 300, tex_BMfont3, 0xFFFFFFFF, 1, "X VALUE : %d", tex_test_jpg.w);
GRRLIB_Printf(left, 350, tex_BMfont2, 0xFFFFFFFF, 1, "X VALUE : 1");
GRRLIB_Render();
if (wpaddown & WPAD_BUTTON_A) exit(0);
if (wpadheld & WPAD_BUTTON_B) rot++;
if (wpadheld & WPAD_BUTTON_LEFT) left--;
if (wpadheld & WPAD_BUTTON_RIGHT) left++;
}
return 0;
}