libctru/examples/templates/application/source/main.c

38 lines
754 B
C
Raw Normal View History

#include <string.h>
2014-11-07 19:12:43 +01:00
#include <3ds.h>
int main()
{
2015-01-03 01:06:22 +01:00
gfxInitDefault();
2014-11-07 19:12:43 +01:00
//gfxSet3D(true); // uncomment if using stereoscopic 3D
// Main loop
while (aptMainLoop())
{
gspWaitForVBlank();
hidScanInput();
// Your code goes here
u32 kDown = hidKeysDown();
if (kDown & KEY_START)
break; // break in order to return to hbmenu
// Example rendering code that displays a white pixel
// Please note that the 3DS screens are sideways (thus 240x400 and 240x320)
u8* fb = gfxGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL);
memset(fb, 0, 240*400*3);
fb[3*(10+10*240)] = 0xFF;
fb[3*(10+10*240)+1] = 0xFF;
fb[3*(10+10*240)+2] = 0xFF;
// Flush and swap framebuffers
gfxFlushBuffers();
gfxSwapBuffers();
}
gfxExit();
return 0;
}