Init commit
This commit is contained in:
58
source/main.cpp
Normal file
58
source/main.cpp
Normal file
@@ -0,0 +1,58 @@
|
||||
// Include the main libnx system header, for Switch development
|
||||
#include "alipan.h"
|
||||
#include <switch.h>
|
||||
#include <curl/curl.h>
|
||||
|
||||
extern "C" {
|
||||
void userAppInit(void) {
|
||||
appletInitialize();
|
||||
setsysInitialize();
|
||||
setInitialize();
|
||||
socketInitializeDefault();
|
||||
nxlinkStdio();
|
||||
accountInitialize(AccountServiceType_Administrator);
|
||||
}
|
||||
|
||||
void userAppExit(void) {
|
||||
accountExit();
|
||||
socketExit();
|
||||
setsysExit();
|
||||
setExit();
|
||||
appletExit();
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
consoleInit(nullptr);
|
||||
curl_global_init(CURL_GLOBAL_DEFAULT);
|
||||
|
||||
alipan d;
|
||||
d.checkLogin();
|
||||
|
||||
// Configure our supported input layout: a single player with standard controller styles
|
||||
padConfigureInput(1, HidNpadStyleSet_NpadStandard);
|
||||
PadState pad;
|
||||
padInitializeDefault(&pad);
|
||||
|
||||
// Main loop
|
||||
while (appletMainLoop()) {
|
||||
// Scan the gamepad. This should be done once for each frame
|
||||
padUpdate(&pad);
|
||||
|
||||
// padGetButtonsDown returns the set of buttons that have been
|
||||
// newly pressed in this frame compared to the previous one
|
||||
u64 kDown = padGetButtonsDown(&pad);
|
||||
|
||||
if (kDown & HidNpadButton_Plus) break; // break in order to return to hbmenu
|
||||
|
||||
// Your code goes here
|
||||
|
||||
// Update the console, sending a new frame to the display
|
||||
consoleUpdate(NULL);
|
||||
}
|
||||
|
||||
curl_global_cleanup();
|
||||
// Deinitialize and clean up resources used by the console (important!)
|
||||
consoleExit(nullptr);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user