Initial commit
This commit is contained in:
commit
85ae941c19
10 changed files with 406 additions and 0 deletions
52
source/main.c
Normal file
52
source/main.c
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <3ds.h>
|
||||
#include "lvgl.h"
|
||||
#include "lv_ctr_disp.h"
|
||||
|
||||
|
||||
long unsigned int sys_tick(void)
|
||||
{
|
||||
long unsigned int tick = (long unsigned int)osGetTime();
|
||||
return tick;
|
||||
}
|
||||
|
||||
void sys_init(void)
|
||||
{
|
||||
gfxInitDefault();
|
||||
consoleInit(GFX_TOP, NULL);
|
||||
}
|
||||
|
||||
void sys_free(void)
|
||||
{
|
||||
gfxExit();
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
sys_init();
|
||||
lv_init();
|
||||
lv_ctr_disp_init();
|
||||
lv_tick_set_cb(sys_tick);
|
||||
|
||||
lv_obj_t * label = lv_label_create(lv_screen_active());
|
||||
lv_label_set_text(label, "Hello world");
|
||||
lv_obj_center(label);
|
||||
lv_obj_invalidate(lv_screen_active());
|
||||
|
||||
// Main loop
|
||||
while (aptMainLoop())
|
||||
{
|
||||
lv_timer_handler();
|
||||
|
||||
hidScanInput();
|
||||
|
||||
u32 kDown = hidKeysDown();
|
||||
if (kDown & KEY_START)
|
||||
break; // break in order to return to hbmenu
|
||||
}
|
||||
|
||||
sys_free();
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue