2009-01-15 10:08:37 +00:00
|
|
|
/*===========================================
|
|
|
|
GRRLIB (GX version) 3.0.5 alpha
|
|
|
|
Code : NoNameNo
|
2009-01-18 22:38:58 +00:00
|
|
|
Additional Code : Crayon
|
2009-01-15 10:08:37 +00:00
|
|
|
GX hints : RedShade
|
|
|
|
|
|
|
|
Template Code (Minimum Requirement)
|
|
|
|
============================================*/
|
2009-01-18 22:38:58 +00:00
|
|
|
#include "GRRLIB/GRRLIB.h"
|
|
|
|
|
2009-01-15 10:08:37 +00:00
|
|
|
#include <stdlib.h>
|
2009-01-18 22:38:58 +00:00
|
|
|
|
2009-01-15 10:08:37 +00:00
|
|
|
#include <wiiuse/wpad.h>
|
|
|
|
#include <fat.h>
|
|
|
|
|
|
|
|
#include "gfx/BMfont1.h"
|
|
|
|
#include "gfx/BMfont2.h"
|
|
|
|
#include "gfx/BMfont3.h"
|
|
|
|
#include "gfx/BMfont4.h"
|
2009-01-18 22:38:58 +00:00
|
|
|
#include "gfx/test_jpg.h"
|
2009-01-15 10:08:37 +00:00
|
|
|
|
2009-01-22 23:21:55 +00:00
|
|
|
// RGBA Colors
|
|
|
|
#define GRRLIB_BLACK 0x000000FF
|
|
|
|
#define GRRLIB_WHITE 0xFFFFFFFF
|
|
|
|
#define GRRLIB_RED 0xFF0000FF
|
|
|
|
#define GRRLIB_BLUE 0x0000FFFF
|
|
|
|
#define GRRLIB_GREEN 0x008000FF
|
|
|
|
#define GRRLIB_GRAY 0x808080FF
|
|
|
|
#define GRRLIB_YELLOW 0xFFFF00FF
|
|
|
|
#define GRRLIB_SILVER 0xC0C0C0FF
|
|
|
|
|
2009-01-15 10:08:37 +00:00
|
|
|
Mtx GXmodelView2D;
|
|
|
|
|
2009-01-20 05:17:13 +00:00
|
|
|
int main() {
|
2009-01-20 03:51:03 +00:00
|
|
|
int left = 0;
|
2009-01-19 23:08:45 +00:00
|
|
|
ir_t ir1;
|
2009-01-20 05:17:13 +00:00
|
|
|
u32 wpaddown, wpadheld;
|
2009-01-15 10:08:37 +00:00
|
|
|
|
2009-01-19 23:08:45 +00:00
|
|
|
GRRLIB_Init();
|
2009-01-15 10:08:37 +00:00
|
|
|
|
|
|
|
fatInitDefault();
|
|
|
|
WPAD_Init();
|
|
|
|
WPAD_SetDataFormat(WPAD_CHAN_0, WPAD_FMT_BTNS_ACC_IR);
|
|
|
|
|
2009-01-19 00:48:28 +00:00
|
|
|
GRRLIB_texImg tex_test_jpg = GRRLIB_LoadTextureJPG(test_jpg);
|
2009-01-15 10:08:37 +00:00
|
|
|
|
2009-01-19 00:48:28 +00:00
|
|
|
GRRLIB_texImg tex_BMfont1 = GRRLIB_LoadTexturePNG(BMfont1);
|
|
|
|
GRRLIB_InitTileSet(&tex_BMfont1, 32, 32, 32);
|
2009-01-15 10:08:37 +00:00
|
|
|
|
2009-01-19 00:48:28 +00:00
|
|
|
GRRLIB_texImg tex_BMfont2 = GRRLIB_LoadTexturePNG(BMfont2);
|
|
|
|
GRRLIB_InitTileSet(&tex_BMfont2, 16, 16, 32);
|
2009-01-15 10:08:37 +00:00
|
|
|
|
2009-01-19 00:48:28 +00:00
|
|
|
GRRLIB_texImg tex_BMfont3 = GRRLIB_LoadTexturePNG(BMfont3);
|
|
|
|
GRRLIB_InitTileSet(&tex_BMfont3, 32, 32, 32);
|
2009-01-15 10:08:37 +00:00
|
|
|
|
2009-01-19 00:48:28 +00:00
|
|
|
GRRLIB_texImg tex_BMfont4 = GRRLIB_LoadTexturePNG(BMfont4);
|
|
|
|
GRRLIB_InitTileSet(&tex_BMfont4, 16, 16, 32);
|
2009-01-15 10:08:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
while(1){
|
2009-01-18 17:59:43 +00:00
|
|
|
WPAD_SetVRes(0, 640, 480);
|
2009-01-15 10:08:37 +00:00
|
|
|
WPAD_ScanPads();
|
2009-01-20 05:17:13 +00:00
|
|
|
wpaddown = WPAD_ButtonsDown(0);
|
|
|
|
wpadheld = WPAD_ButtonsHeld(0);
|
2009-01-15 10:08:37 +00:00
|
|
|
|
2009-01-18 17:59:43 +00:00
|
|
|
WPAD_IR(WPAD_CHAN_0, &ir1);
|
2009-01-15 10:08:37 +00:00
|
|
|
|
2009-01-22 23:21:55 +00:00
|
|
|
GRRLIB_FillScreen(GRRLIB_BLACK);
|
2009-01-18 22:38:58 +00:00
|
|
|
|
2009-01-22 23:21:55 +00:00
|
|
|
GRRLIB_DrawImg(10, 10, tex_test_jpg, 0, 1, 1, GRRLIB_WHITE);
|
2009-01-18 22:38:58 +00:00
|
|
|
|
2009-01-22 23:21:55 +00:00
|
|
|
GRRLIB_Printf(left, 200, tex_BMfont1, GRRLIB_WHITE, 1, "X VALUE:%d", (int)ir1.sx);
|
|
|
|
GRRLIB_Printf(left, 250, tex_BMfont4, GRRLIB_WHITE, 1, "X VALUE:%d", (int)ir1.sx);
|
|
|
|
GRRLIB_Printf(left, 300, tex_BMfont3, GRRLIB_WHITE, 1, "X VALUE : %d", tex_test_jpg.w);
|
|
|
|
GRRLIB_Printf(left, 350, tex_BMfont2, GRRLIB_WHITE, 1, "X VALUE : 1");
|
2009-01-18 17:59:43 +00:00
|
|
|
|
2009-01-15 10:08:37 +00:00
|
|
|
GRRLIB_Render();
|
|
|
|
|
|
|
|
if (wpaddown & WPAD_BUTTON_A) exit(0);
|
2009-01-20 03:51:03 +00:00
|
|
|
if (wpadheld & WPAD_BUTTON_LEFT) left--;
|
|
|
|
if (wpadheld & WPAD_BUTTON_RIGHT) left++;
|
2009-01-15 10:08:37 +00:00
|
|
|
}
|
2009-01-21 23:16:15 +00:00
|
|
|
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
|
2009-01-15 10:08:37 +00:00
|
|
|
return 0;
|
|
|
|
}
|