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
|
|
|
|
|
|
|
Mtx GXmodelView2D;
|
|
|
|
|
|
|
|
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-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-18 17:59:43 +00:00
|
|
|
u32 wpaddown = WPAD_ButtonsDown(0);
|
|
|
|
u32 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
|
|
|
|
|
|
|
GRRLIB_FillScreen(0x000000FF);
|
2009-01-18 22:38:58 +00:00
|
|
|
|
|
|
|
GRRLIB_DrawImg(10, 10, tex_test_jpg, 0, 1, 1, 0xFFFFFFFF);
|
|
|
|
|
2009-01-20 03:51:03 +00:00
|
|
|
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");
|
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
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|