mirror of
https://github.com/GRRLIB/GRRLIB.git
synced 2024-09-20 12:45:05 +00:00
66 lines
1.5 KiB
C
66 lines
1.5 KiB
C
|
/*===========================================
|
||
|
NoNameNo Compositing Sample Code
|
||
|
Bugged since Screen2texture conversion
|
||
|
loose color precision.
|
||
|
============================================*/
|
||
|
#include <grrlib.h>
|
||
|
|
||
|
#include <stdlib.h>
|
||
|
#include <math.h>
|
||
|
#include <malloc.h>
|
||
|
#include <wiiuse/wpad.h>
|
||
|
|
||
|
#include "gfx/font3d.h"
|
||
|
extern GXRModeObj *rmode;
|
||
|
|
||
|
|
||
|
|
||
|
int main() {
|
||
|
float rot=0;
|
||
|
float i=0;
|
||
|
int circsize=150;
|
||
|
|
||
|
GRRLIB_Init();
|
||
|
WPAD_Init();
|
||
|
|
||
|
|
||
|
GRRLIB_texImg *tex_font = GRRLIB_LoadTexture(font3d);
|
||
|
GRRLIB_InitTileSet(tex_font, 64, 64, 32);
|
||
|
GRRLIB_SetHandle (tex_font, tex_font->tilew/2, tex_font->tileh+circsize);
|
||
|
|
||
|
GRRLIB_texImg *tex_screen;
|
||
|
tex_screen = GRRLIB_CreateEmptyTexture(rmode->fbWidth,rmode->efbHeight);
|
||
|
|
||
|
GRRLIB_Settings.antialias = true;
|
||
|
|
||
|
while(1) {
|
||
|
WPAD_ScanPads();
|
||
|
if(WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) exit(0);
|
||
|
|
||
|
GRRLIB_CompoStart ();
|
||
|
GRRLIB_SetAlpha(0xff);
|
||
|
for(i=0;i<360;i+=30){
|
||
|
GRRLIB_Settings.rotation= i+rot;
|
||
|
GRRLIB_DrawTile((rmode->fbWidth/2)-(tex_font->tilew/2), (rmode->efbHeight/2)-(tex_font->tileh+circsize),tex_font,65-32+((int)i/45));
|
||
|
}
|
||
|
GRRLIB_CompoEnd(0, 0, tex_screen);
|
||
|
|
||
|
GRRLIB_Settings.rotation=0;
|
||
|
rot-=0.6;
|
||
|
|
||
|
|
||
|
GRRLIB_SetAlpha(0xff);
|
||
|
GRRLIB_DrawImg(50, 50,tex_screen);
|
||
|
GRRLIB_SetAlpha(0xFF);
|
||
|
GRRLIB_DrawImg(100, 100,tex_screen);
|
||
|
|
||
|
GRRLIB_Render();
|
||
|
}
|
||
|
|
||
|
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
|
||
|
GRRLIB_FreeTexture(tex_screen);
|
||
|
GRRLIB_FreeTexture(tex_font);
|
||
|
exit(0);
|
||
|
}
|
||
|
|