-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
45 lines (34 loc) · 980 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <string.h>
#include <stdio.h>
#include <switch.h>
#include <unistd.h>
#include "swkbd.h"
void FlushGraphics() {
gfxFlushBuffers();
gfxSwapBuffers();
gfxWaitForVsync();
}
int main(int argc, char **argv) {
gfxInitDefault();
consoleInit(NULL);
Initkeyboard();
FlushGraphics();
sleep(5);
// Main loop
if (0) {
while (appletMainLoop()) {
//Scan all the inputs. This should be done once for each frame
hidScanInput();
// Your code goes here
printf("Hello World!");
//hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame)
u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO);
if (kDown & KEY_PLUS) break; // break in order to return to hbmenu
gfxFlushBuffers();
gfxSwapBuffers();
gfxWaitForVsync();
}
}
gfxExit();
return 0;
}