#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <3ds.h>
#include "draw.h"
int main() {
// Initialize services
srvInit();
aptInit();
hidInit(NULL);
gfxInit();
//gfxSet3D(true); // uncomment if using stereoscopic 3D
// Main loop
while (aptMainLoop())
{
gspWaitForVBlank();
hidScanInput();
u32 kDown = hidKeysDown();
u32 kUp = hidKeysUp();
if (kDown & KEY_START){
break; // break in order to return to hbmenu
}
u8* ft = gfxGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL);
u8* fb = gfxGetFramebuffer(GFX_BOTTOM, GFX_LEFT, NULL, NULL);
memset(ft, 0, 240*400*3);
memset(fb, 0, 240*320*3);
drawFillRect(0, 0, 160, 120, 255, 0, 0, fb);
drawFillRect(161, 0, 360, 120, 0, 255, 0, fb);
drawFillRect(0, 121, 160, 240, 0, 0, 255, fb);
drawFillRect(161, 121, 360, 240, 225, 225, 0, fb);
// Flush and swap framebuffers
gfxFlushBuffers();
gfxSwapBuffers();
}
// Exit services
gfxExit();
hidExit();
aptExit();
srvExit();
return 0;
}