handle pause on android (#958)
This commit is contained in:
parent
a447bc8104
commit
f80f0f5f02
@ -266,6 +266,12 @@ bool sdl_event_filter(void *userdata, SDL_Event *event) {
|
||||
joystick_event->joystick_id = event->jdevice.which;
|
||||
joystick_event->connected = false;
|
||||
SDL_RunOnMainThread(add_joystick_event, joystick_event, false);
|
||||
} else if (event->type == SDL_EVENT_WILL_ENTER_BACKGROUND) {
|
||||
wsi->end_frame();
|
||||
wsi->deinit_surface_and_swapchain();
|
||||
} else if (event->type == SDL_EVENT_RENDER_DEVICE_RESET) {
|
||||
wsi->init_surface_swapchain();
|
||||
wsi->begin_frame();
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@ -145,6 +145,8 @@ pub fn vertical_interrupt_event(device: &mut device::Device) {
|
||||
speed_limiter(device, speed_limiter_toggled);
|
||||
}
|
||||
|
||||
unsafe { sdl3_sys::events::SDL_PumpEvents() };
|
||||
|
||||
ui::video::update_screen();
|
||||
device.vi.vi_counter += 1;
|
||||
device.vi.elapsed_time += device.vi.frame_time;
|
||||
@ -160,8 +162,6 @@ pub fn vertical_interrupt_event(device: &mut device::Device) {
|
||||
}
|
||||
}
|
||||
|
||||
unsafe { sdl3_sys::events::SDL_PumpEvents() };
|
||||
|
||||
/* toggle vi field if in interlaced mode */
|
||||
device.vi.field ^= (device.vi.regs[VI_STATUS_REG] >> 6) & 0x1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user