2009-09-13 14:27:01 +00:00
|
|
|
/*===========================================
|
|
|
|
GRRLIB (GX Version)
|
|
|
|
- Template Code -
|
|
|
|
|
|
|
|
Minimum Code To Use GRRLIB
|
|
|
|
============================================*/
|
|
|
|
#include <grrlib.h>
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <wiiuse/wpad.h>
|
|
|
|
|
2009-12-14 23:14:17 +00:00
|
|
|
int main(int argc, char **argv) {
|
2009-09-13 14:27:01 +00:00
|
|
|
// Initialise the Graphics & Video subsystem
|
|
|
|
GRRLIB_Init();
|
|
|
|
|
|
|
|
// Initialise the Wiimotes
|
|
|
|
WPAD_Init();
|
|
|
|
|
|
|
|
// Loop forever
|
|
|
|
while(1) {
|
|
|
|
|
2009-12-14 23:14:17 +00:00
|
|
|
WPAD_ScanPads(); // Scan the Wiimotes
|
2009-09-13 14:27:01 +00:00
|
|
|
|
|
|
|
// If [HOME] was pressed on the first Wiimote, break out of the loop
|
2009-12-14 23:14:17 +00:00
|
|
|
if (WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) break;
|
2009-09-13 14:27:01 +00:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
// Place your drawing code here
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
GRRLIB_Render(); // Render the frame buffer to the TV
|
|
|
|
}
|
|
|
|
|
|
|
|
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()
|
|
|
|
}
|