GRRLIB/examples/template/source/main.c

38 lines
1 KiB
C
Raw Normal View History

2009-02-13 00:23:20 +00:00
/*===========================================
GRRLIB (GX Version)
- Template Code -
2009-02-13 00:23:20 +00:00
Minimum Code To Use GRRLIB
============================================*/
#include <grrlib.h>
2009-02-13 00:23:20 +00:00
#include <stdlib.h>
#include <wiiuse/wpad.h>
int main() {
// Initialise the Graphics & Video subsystem
2009-02-13 00:23:20 +00:00
GRRLIB_Init();
// Initialise the Wiimotes
2009-02-13 00:23:20 +00:00
WPAD_Init();
// Loop forever
2009-02-13 00:23:20 +00:00
while(1) {
WPAD_ScanPads(); // Scan the wiimotes
// If [HOME] was pressed on the first Wiimote, break out of the loop
if (WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) break ;
// ---------------------------------------------------------------------
// Place your drawing code here
// ---------------------------------------------------------------------
GRRLIB_Render(); // Render the frame buffer to the TV
2009-02-13 00:23:20 +00:00
}
2009-02-13 00:23:20 +00:00
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
exit(0); // Use exit() to exit a program, do not use 'return' from main()
2009-02-13 00:23:20 +00:00
}