for android

This commit is contained in:
Attila Uygun 2023-05-25 15:33:05 +02:00
parent aca0213b0a
commit b1c2e3f0d4
1 changed files with 15 additions and 15 deletions

View File

@ -294,30 +294,30 @@ void Platform::HandleCmd(android_app* app, int32_t cmd) {
DLOG << "APP_CMD_INIT_WINDOW"; DLOG << "APP_CMD_INIT_WINDOW";
if (app->window != NULL) { if (app->window != NULL) {
platform->SetFrameRate(60); platform->SetFrameRate(60);
bool res = platform->InitializeRenderer(); // bool res = platform->InitializeRenderer();
CHECK(res) << "Failed to initialize " // CHECK(res) << "Failed to initialize "
<< platform->renderer_->GetDebugName() << " renderer."; // << platform->renderer_->GetDebugName() << " renderer.";
} }
break; break;
case APP_CMD_TERM_WINDOW: case APP_CMD_TERM_WINDOW:
DLOG << "APP_CMD_TERM_WINDOW"; DLOG << "APP_CMD_TERM_WINDOW";
platform->renderer_->Shutdown(); // platform->renderer_->Shutdown();
break; break;
case APP_CMD_CONFIG_CHANGED: case APP_CMD_CONFIG_CHANGED:
DLOG << "APP_CMD_CONFIG_CHANGED"; DLOG << "APP_CMD_CONFIG_CHANGED";
if (platform->app_->window != NULL) { // if (platform->app_->window != NULL) {
int width = platform->renderer_->screen_width(); // int width = platform->renderer_->screen_width();
int height = platform->renderer_->screen_height(); // int height = platform->renderer_->screen_height();
if (width != ANativeWindow_getWidth(app->window) || // if (width != ANativeWindow_getWidth(app->window) ||
height != ANativeWindow_getHeight(app->window)) { // height != ANativeWindow_getHeight(app->window)) {
platform->renderer_->Shutdown(); // platform->renderer_->Shutdown();
bool res = platform->InitializeRenderer(); // bool res = platform->InitializeRenderer();
CHECK(res) << "Failed to initialize " // CHECK(res) << "Failed to initialize "
<< platform->renderer_->GetDebugName() << " renderer."; // << platform->renderer_->GetDebugName() << " renderer.";
} // }
} // }
break; break;
case APP_CMD_STOP: case APP_CMD_STOP: