[solved]What's wrong with my code?*using GRRLIB* May 26, 2009 01:17AM | Registered: 14 years ago Posts: 13 |
/*=========================================== GRRLIB 4.0.0 Code : NoNameNo Additional Code : Crayon GX hints : RedShade Minimum Code To Use GRRLIB ============================================ Download and Help Forum : [grrlib.santo.fr] ============================================*/ #include "../../grrlib/GRRLIB/GRRLIB/GRRLIB.h" #include#include #include "gfx/font.h" Mtx GXmodelView2D; int main() { int x=10,dir=0; u32 wpaddown; GRRLIB_texImg tex_font = GRRLIB_LoadTexture(font); GRRLIB_InitTileSet(&tex_font, 32, 33, 32); GRRLIB_Init(); WPAD_Init(); PAD_Init(); while(1) { WPAD_ScanPads(); PAD_ScanPads(); wpaddown = WPAD_ButtonsDown(0); GRRLIB_FillScreen(0x0000AA77); GRRLIB_Printf(x,32,tex_font,0xAAAAAAFF, 1,"OMG TILESET"); GRRLIB_DrawImg(-20,80,tex_font,0, .75, .75, 0xFFFFFFFF); //draw the entire fontmap or w/e for the heck of it, at 3/4 size GRRLIB_Render(); x+=dir; if(x<20)dir=1; if(x>100)dir=-1; if(wpaddown & WPAD_BUTTON_HOME||PAD_ButtonsDown(0) & PAD_BUTTON_START) { exit(0); //exit } } GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB free(tex_font.data); return 0; }
Re: What's wrong with my code?*using GRRLIB* May 26, 2009 08:35PM | Registered: 15 years ago Posts: 83 |
Re: What's wrong with my code?*using GRRLIB* May 26, 2009 09:27PM | Registered: 15 years ago Posts: 384 |
Re: What's wrong with my code?*using GRRLIB* May 26, 2009 11:15PM | Admin Registered: 15 years ago Posts: 5,132 |
Re: What's wrong with my code?*using GRRLIB* May 27, 2009 01:58AM | Registered: 14 years ago Posts: 13 |
Will do.Quote
RazorChrist
Try putting GRRLIB_Render() under your if statements, like so:x+=dir; if(x<20)dir=1; if(x>100)dir=-1; GRRLIB_Render();Also, try including math.h
By looking at the GRRLIB demos, no. My wiimote works just fine with those too.Quote
profetylen
Don't you have to call GRRLIB_Init() before you call GRRLIB_InitTileSet()?
I'll try this too.Quote
Arikado
See if the Wiimote connects if you get rid of Pad_Init()
Re: What's wrong with my code?*using GRRLIB* May 27, 2009 02:17AM | Registered: 15 years ago Posts: 83 |
Re: What's wrong with my code?*using GRRLIB* May 27, 2009 02:56AM | Registered: 14 years ago Posts: 13 |