initial commit
This commit is contained in:
59
source/Main.cpp
Normal file
59
source/Main.cpp
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user