2010-05-10 22:51:14 +00:00
|
|
|
/*===========================================
|
2010-05-14 02:31:28 +00:00
|
|
|
GRRLIB
|
2022-05-25 04:10:17 +00:00
|
|
|
Spot Light Sample Code
|
2010-05-10 22:51:14 +00:00
|
|
|
============================================*/
|
|
|
|
#include <grrlib.h>
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
2010-10-27 19:55:53 +00:00
|
|
|
#include <math.h>
|
2010-05-10 22:51:14 +00:00
|
|
|
#include <wiiuse/wpad.h>
|
|
|
|
|
2022-05-25 13:20:52 +00:00
|
|
|
#include "Snap_ITC_12_png.h"
|
2010-05-10 22:51:14 +00:00
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
2010-05-14 02:31:28 +00:00
|
|
|
f32 lightx=0.0f;
|
2010-05-10 22:51:14 +00:00
|
|
|
|
|
|
|
GRRLIB_Init();
|
|
|
|
|
2022-05-25 13:20:52 +00:00
|
|
|
GRRLIB_texImg *tex_font = GRRLIB_LoadTexture(Snap_ITC_12_png);
|
2010-05-14 02:31:28 +00:00
|
|
|
GRRLIB_InitTileSet(tex_font, 17, 22, 32);
|
2010-05-10 22:51:14 +00:00
|
|
|
|
|
|
|
WPAD_Init();
|
|
|
|
|
|
|
|
GRRLIB_SetBackgroundColour(0x40, 0x40, 0x40, 0xFF);
|
|
|
|
|
|
|
|
while(1) {
|
2010-05-14 02:31:28 +00:00
|
|
|
GRRLIB_2dMode();
|
2010-05-10 22:51:14 +00:00
|
|
|
WPAD_ScanPads();
|
|
|
|
if (WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) break;
|
|
|
|
|
2010-05-14 02:31:28 +00:00
|
|
|
GRRLIB_Camera3dSettings(0.0f,0.0f,3.0f, 0,1,0, 0,0,0);
|
2010-05-10 22:51:14 +00:00
|
|
|
|
2010-05-14 02:31:28 +00:00
|
|
|
GRRLIB_SetLightAmbient(0x404040FF);
|
2010-05-10 22:51:14 +00:00
|
|
|
|
2010-05-14 02:31:28 +00:00
|
|
|
GRRLIB_SetLightSpot(1, (guVector){ sin(lightx)*2.5f, 0.8f, 0 }, (guVector){ sin(lightx)*2.5f, 0.0f, 0.0f }, -4.0f, 5.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0x0000FFFF);
|
|
|
|
GRRLIB_SetLightSpot(2, (guVector){ -sin(lightx)*2.5f, 0.8f, 0 }, (guVector){ -sin(lightx)*2.5f, 0.0f, 0.0f }, -4.0f, 5.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0xFF0000FF);
|
2010-05-10 22:51:14 +00:00
|
|
|
|
2010-05-14 02:31:28 +00:00
|
|
|
GRRLIB_3dMode(0.1,1000,45,0,1);
|
|
|
|
GRRLIB_ObjectView(0,-0.8,0, -90,0,0,1,1,1);
|
2022-11-20 19:40:19 +00:00
|
|
|
GRRLIB_DrawTessPanel(6.2f, 0.17f, 3.7f, 0.1f, 0, 0xFFFFFFFF);
|
2010-05-10 22:51:14 +00:00
|
|
|
|
2010-05-14 02:31:28 +00:00
|
|
|
lightx+=0.05f;
|
2010-05-10 22:51:14 +00:00
|
|
|
|
2010-05-14 02:31:28 +00:00
|
|
|
GRRLIB_2dMode();
|
|
|
|
GRRLIB_Printf((640-(17*26))/2, 480-25, tex_font, 0xFFFFFFFF, 1, "GRRLIB SPOT LIGHT SAMPLE 1");
|
2010-05-10 22:51:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
GRRLIB_Render();
|
|
|
|
}
|
|
|
|
|
2011-03-16 01:24:01 +00:00
|
|
|
GRRLIB_FreeTexture(tex_font);
|
2010-05-10 22:51:14 +00:00
|
|
|
GRRLIB_Exit();
|
|
|
|
|
|
|
|
exit(0);
|
|
|
|
}
|