background processing
Some checks failed
ContinuousIntegration / linux (pull_request) Successful in 4m22s
ContinuousDelivery / linux-ubuntu (pull_request) Failing after 5m8s
ContinuousIntegration / android (pull_request) Failing after 5m44s
ContinuousDelivery / windows (pull_request) Has been cancelled
ContinuousDelivery / windows-asan (pull_request) Has been cancelled
ContinuousIntegration / macos (pull_request) Has been cancelled
ContinuousIntegration / windows (pull_request) Has been cancelled
ContinuousDelivery / release (pull_request) Has been cancelled

This commit is contained in:
Green Sky 2024-06-04 17:53:49 +02:00
parent b0e25627b3
commit 5394c20817
No known key found for this signature in database
2 changed files with 7 additions and 4 deletions

View File

@ -76,9 +76,8 @@
android:theme="@style/AppTheme"
android:hardwareAccelerated="true" >
<!-- Example of setting SDL hints from AndroidManifest.xml:
<meta-data android:name="SDL_ENV.SDL_ANDROID_TRAP_BACK_BUTTON" android:value="0"/>
-->
<!-- setting sdl hints. uses the string value -->
<meta-data android:name="SDL_ENV.SDL_ANDROID_BLOCK_ON_PAUSE" android:value="0"/>
<activity android:name="TomatoActivity"
android:label="@string/app_name"

View File

@ -106,7 +106,7 @@ int main(int argc, char** argv) {
std::unique_ptr<Screen> screen = std::make_unique<StartScreen>(args, renderer.get(), theme);
bool is_background = false;
bool quit = false;
while (!quit) {
auto new_time = std::chrono::steady_clock::now();
@ -131,6 +131,10 @@ int main(int argc, char** argv) {
if (event.type == SDL_EVENT_QUIT) {
quit = true;
break;
} else if (event.type == SDL_EVENT_WILL_ENTER_BACKGROUND) {
is_background = true;
} else if (event.type == SDL_EVENT_DID_ENTER_FOREGROUND) {
is_background = false;
}
if (screen->handleEvent(event)) {