initial commit

This commit is contained in:
2024-07-14 20:20:03 +03:00
commit 31953464e7
95 changed files with 4688 additions and 0 deletions

59
source/Main.cpp Normal file
View File

@@ -0,0 +1,59 @@
#include <MainApplication.hpp>
#include <data.h>
#include <fs.h>
static int nxlink_sock = -1;
extern "C" void userAppInit() {
appletInitialize();
hidInitialize();
nsInitialize();
setsysInitialize();
setInitialize();
accountInitialize(AccountServiceType_Administrator);
pmshellInitialize();
socketInitializeDefault();
pdmqryInitialize();
nxlink_sock = nxlinkStdio();
printf("userAppInit\n");
}
extern "C" void userAppExit() {
if (nxlink_sock != -1) {
close(nxlink_sock);
}
appletExit();
hidExit();
nsExit();
setsysExit();
setExit();
accountExit();
pmshellExit();
socketExit();
pdmqryExit();
}
// Main entrypoint
int main() {
printf("main\n");
// First create our renderer, where one can customize SDL or other stuff's
// initialization.
auto renderer_opts = pu::ui::render::RendererInitOptions(
SDL_INIT_EVERYTHING, pu::ui::render::RendererHardwareFlags);
renderer_opts.UseImage(pu::ui::render::IMGAllFlags);
renderer_opts.UseAudio(pu::ui::render::MixerAllFlags);
renderer_opts.UseTTF();
auto renderer = pu::ui::render::Renderer::New(renderer_opts);
data::init();
fs::init();
// Create our main application from the renderer
auto main = ui::MainApplication::New(renderer);
main->Prepare();
main->Show();
return 0;
}