+ break;
+ case SDL_ACTIVEEVENT:
+ if (event->active.gain && !was_active) {
+ if (plat_sdl_overlay != NULL) {
+ SDL_Rect dstrect = { 0, 0, plat_sdl_screen->w, plat_sdl_screen->h };
+ SDL_DisplayYUVOverlay(plat_sdl_overlay, &dstrect);
+ }
+ else if (plat_sdl_gl_active) {
+ if (gl_quirks & GL_QUIRK_ACTIVATE_RECREATE) {
+ gl_finish();
+ plat_sdl_gl_active = (gl_init(display, window, &gl_quirks) == 0);
+ }
+ gl_flip(NULL, 0, 0);
+ }
+ // else SDL takes care of it
+ }
+ was_active = event->active.gain;
+ break;
+ case SDL_QUIT:
+ if (plat_sdl_quit_cb != NULL)
+ plat_sdl_quit_cb();
+ break;