MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / OnAppCmd

Function OnAppCmd

Source/Engine/Platform/Android/AndroidPlatform.cpp:409–484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407 }
408
409 void OnAppCmd(android_app* app, int32_t cmd)
410 {
411 switch (cmd)
412 {
413 case APP_CMD_START:
414 LOG(Info, "[Android] APP_CMD_START");
415 IsStarted = true;
416 UpdateOrientation();
417 break;
418 case APP_CMD_RESUME:
419 LOG(Info, "[Android] APP_CMD_RESUME");
420 IsPaused = false;
421 UpdateOrientation();
422 break;
423 case APP_CMD_PAUSE:
424 LOG(Info, "[Android] APP_CMD_PAUSE");
425 IsPaused = true;
426 break;
427 case APP_CMD_STOP:
428 LOG(Info, "[Android] APP_CMD_STOP");
429 IsStarted = false;
430 //Engine::OnExit();
431 break;
432 case APP_CMD_DESTROY:
433 LOG(Info, "[Android] APP_CMD_DESTROY");
434 break;
435 case APP_CMD_INIT_WINDOW:
436 LOG(Info, "[Android] APP_CMD_INIT_WINDOW");
437 AppWindow = app->window;
438 ANativeWindow_acquire(AppWindow);
439 UpdateOrientation();
440 if (Engine::MainWindow)
441 {
442 Engine::MainWindow->InitSwapChain();
443 }
444 break;
445 case APP_CMD_WINDOW_RESIZED:
446 LOG(Info, "[Android] APP_CMD_WINDOW_RESIZED");
447 if (Engine::MainWindow)
448 {
449 Engine::MainWindow->SetClientSize(GetWindowSize());
450 }
451 break;
452 case APP_CMD_TERM_WINDOW:
453 LOG(Info, "[Android] APP_CMD_TERM_WINDOW");
454 if (Engine::MainWindow && Engine::MainWindow->GetSwapChain())
455 {
456 Engine::MainWindow->GetSwapChain()->ReleaseGPU();
457 }
458 ANativeWindow_release(AppWindow);
459 AppWindow = nullptr;
460 break;
461 case APP_CMD_CONFIG_CHANGED:
462 {
463 LOG(Info, "[Android] APP_CMD_CONFIG_CHANGED");
464 UpdateOrientation();
465 break;
466 }

Callers

nothing calls this directly

Calls 7

UpdateOrientationFunction · 0.85
GetWindowSizeFunction · 0.85
InitSwapChainMethod · 0.80
GetSwapChainMethod · 0.80
ReleaseGPUMethod · 0.45
OnGotFocusMethod · 0.45
OnLostFocusMethod · 0.45

Tested by

no test coverage detected