MCPcopy Create free account
hub / github.com/Cpasjuste/pplay / main

Function main

src/main.cpp:308–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

306}
307
308int main() {
309
310 Vector2f size = {C2D_SCREEN_WIDTH, C2D_SCREEN_HEIGHT};
311
312#ifdef __SWITCH__
313#ifdef NDEBUG
314 socketInitializeDefault();
315#endif
316 appletMainLoop();
317 if (appletGetOperationMode() == AppletOperationMode_Console) {
318 size = {1920, 1080};
319 }
320#elif __PS4__
321 sceSysmoduleLoadModuleInternal(ORBIS_SYSMODULE_INTERNAL_NET);
322#endif
323
324 Main *main = new Main(size);
325
326#ifdef __SWITCH__
327 appletLockExit();
328 appletHook(&applet_hook_cookie, on_applet_hook, main);
329 appletSetFocusHandlingMode(AppletFocusHandlingMode_NoSuspend);
330#endif
331
332 while (main->isRunning()) {
333 main->flip();
334 }
335
336 delete (main);
337
338#ifdef __SWITCH__
339 usbHsFsExit();
340 appletUnhook(&applet_hook_cookie);
341 appletUnlockExit();
342#ifdef NDEBUG
343 socketExit();
344#endif
345#elif __PS4__
346 sceSystemServiceLoadExec((char *) "exit", nullptr);
347 while (true) {}
348#endif
349
350 return 0;
351}

Callers

nothing calls this directly

Calls 1

isRunningMethod · 0.80

Tested by

no test coverage detected