2009-11-26 21:56:20 +00:00
|
|
|
/*===========================================
|
|
|
|
NoNameNo Compositing Sample Code
|
|
|
|
============================================*/
|
|
|
|
#include <grrlib.h>
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <wiiuse/wpad.h>
|
|
|
|
|
2022-05-25 13:20:52 +00:00
|
|
|
#include "font3d_png.h"
|
2009-11-26 21:56:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
float rot=0;
|
2009-12-06 23:12:49 +00:00
|
|
|
float i;
|
2009-11-26 21:56:20 +00:00
|
|
|
int circsize=150;
|
2021-11-07 16:13:32 +00:00
|
|
|
const char text[]="GRRLIB ROXX ";
|
2009-11-26 21:56:20 +00:00
|
|
|
|
|
|
|
GRRLIB_Init();
|
|
|
|
WPAD_Init();
|
|
|
|
|
|
|
|
|
2022-05-25 13:20:52 +00:00
|
|
|
GRRLIB_texImg *tex_font = GRRLIB_LoadTexture(font3d_png);
|
2009-11-26 21:56:20 +00:00
|
|
|
GRRLIB_InitTileSet(tex_font, 64, 64, 32);
|
2015-12-28 22:00:17 +00:00
|
|
|
GRRLIB_SetHandle(tex_font, tex_font->tilew/2, tex_font->tileh+circsize);
|
2009-11-26 21:56:20 +00:00
|
|
|
|
2015-12-28 22:00:17 +00:00
|
|
|
GRRLIB_texImg *tex_screen = GRRLIB_CreateEmptyTexture(rmode->fbWidth,rmode->efbHeight);
|
2009-11-26 21:56:20 +00:00
|
|
|
|
|
|
|
GRRLIB_Settings.antialias = true;
|
|
|
|
|
|
|
|
while(1) {
|
|
|
|
WPAD_ScanPads();
|
|
|
|
if(WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) exit(0);
|
|
|
|
|
2015-12-28 22:00:17 +00:00
|
|
|
// we say that we will want to capture to a texture all the following
|
2009-12-11 21:13:57 +00:00
|
|
|
GRRLIB_CompoStart();
|
2009-12-06 18:41:29 +00:00
|
|
|
|
2015-12-28 22:00:17 +00:00
|
|
|
for(i=0; i<360; i+=30) {
|
2009-12-06 18:41:29 +00:00
|
|
|
// We draw some letters
|
2009-12-15 18:46:54 +00:00
|
|
|
GRRLIB_DrawTile((rmode->fbWidth/2)-(tex_font->tilew/2), (rmode->efbHeight/2)-(tex_font->tileh+circsize), tex_font, rot+i, 1, 1, 0xFFFFFFFF, text[(int)(i/30)]-32);
|
2009-11-26 22:46:24 +00:00
|
|
|
}
|
2009-12-06 18:41:29 +00:00
|
|
|
|
|
|
|
// we say we want to capture now, (the buffer will be cleared after the capture)
|
2009-11-26 22:46:24 +00:00
|
|
|
GRRLIB_CompoEnd(0, 0, tex_screen);
|
|
|
|
|
|
|
|
rot-=0.6;
|
|
|
|
|
2015-12-28 22:00:17 +00:00
|
|
|
// we now draw 3 times the captured buffer playing with color
|
2009-12-15 18:46:54 +00:00
|
|
|
GRRLIB_DrawImg(0, 0, tex_screen, 0, 1, 1, 0xFF00FFFF);
|
|
|
|
GRRLIB_DrawImg(50, 50, tex_screen, 0, 1, 1, 0xFFFF00FF);
|
2009-12-02 19:16:28 +00:00
|
|
|
GRRLIB_DrawImg(100, 100, tex_screen, 0, 1, 1, 0xFFFFFFFF);
|
2009-11-26 21:56:20 +00:00
|
|
|
|
|
|
|
GRRLIB_Render();
|
|
|
|
}
|
|
|
|
|
2009-11-26 22:46:24 +00:00
|
|
|
GRRLIB_FreeTexture(tex_screen);
|
|
|
|
GRRLIB_FreeTexture(tex_font);
|
2011-03-16 01:24:01 +00:00
|
|
|
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
|
2009-11-26 21:56:20 +00:00
|
|
|
exit(0);
|
|
|
|
}
|