SDL/src/video
Francesco Abbate 0dd7024d55 Modifies WaitEvent and WaitEventTimeout to actually wait instead of polling
When possible use native os functions to make a blocking call waiting for
an incoming event. Previous behavior was to continuously poll the event
queue with a small delay between each poll.

The blocking call uses a new optional video driver event,
WaitEventTimeout, if available. It is called only if an window
already shown is available. If present the window is designated
using the variable wakeup_window to receive a wakeup event if
needed.

The WaitEventTimeout function accept a timeout parameter. If
positive the call will wait for an event or return if the timeout
expired without any event. If the timeout is zero it will
implement a polling behavior. If the timeout is negative the
function will block indefinetely waiting for an event.

To let the main thread sees events sent form a different thread
a "wake-up" signal is sent to the main thread if the main thread
is in a blocking state. The wake-up event is sent to the designated
wakeup_window if present.

The wake-up event is sent only if the PushEvent call is coming
from a different thread. Before sending the wake-up event
the ID of the thread making the blocking call is saved using the
variable blocking_thread_id and it is compared to the current
thread's id to decide if the wake-up event should be sent.

Two new optional video device methods are introduced:

WaitEventTimeout
SendWakeupEvent

in addition the mutex

wakeup_lock

which is defined and initialized but only for the drivers supporting the
methods above.

If the methods are not present the system behaves as previously
performing a periodic polling of the events queue.

The blocking call is disabled if a joystick or sensor is detected
and falls back to previous behavior.
2021-06-04 13:50:50 -07:00
..
android Android: don't need to set the SurfaceHolder format from java code 2021-04-22 18:06:17 +02:00
arm ARM: NEON assembly optimization for SDL_FillRect 2019-10-24 21:17:52 -04:00
cocoa Modifies WaitEvent and WaitEventTimeout to actually wait instead of polling 2021-06-04 13:50:50 -07:00
directfb Expose separate keyboard and mouse grab support 2021-02-10 10:22:17 -05:00
dummy Fix format string warnings for width-based integers 2021-02-11 19:41:41 -08:00
emscripten emscripten: Fix alt key being a nav key 2021-02-13 11:56:01 -05:00
haiku SDL: Updated patches for HAIKU 2021-03-13 18:36:01 -08:00
khronos Updated Vulkan headers to version 1.2.158 2020-10-24 10:46:18 -07:00
kmsdrm kmsdrm: remove redundant modeset_pending flag 2021-06-01 15:32:02 -07:00
nacl Updated copyright for 2021 2021-01-02 10:25:38 -08:00
offscreen Updated copyright for 2021 2021-01-02 10:25:38 -08:00
os2 Expose separate keyboard and mouse grab support 2021-02-10 10:22:17 -05:00
pandora Removed non-functional window grab implementations 2021-02-10 10:22:16 -05:00
psp Removed non-functional window grab implementations 2021-02-10 10:22:16 -05:00
qnx Added events for dynamically connecting and disconnecting displays, with an iOS implementation 2020-10-08 16:42:20 -07:00
raspberry Removed non-functional window grab implementations 2021-02-10 10:22:16 -05:00
uikit Fixed bug 5524 - Pass NSString to NSLog() 2021-02-10 10:22:18 -05:00
vita Fix typecasting 2021-03-09 12:10:40 +03:00
vivante Updated copyright for 2021 2021-01-02 10:25:38 -08:00
wayland wayland: Activate the window on first ShowWindow, if possible 2021-06-02 12:59:07 -07:00
windows Modifies WaitEvent and WaitEventTimeout to actually wait instead of polling 2021-06-04 13:50:50 -07:00
winrt winrt: Fix support for multiple simultaneous mouse button presses 2021-05-14 13:33:59 -07:00
x11 Modifies WaitEvent and WaitEventTimeout to actually wait instead of polling 2021-06-04 13:50:50 -07:00
yuv2rgb Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds 2020-01-23 01:00:52 -08:00
SDL_blit.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_blit.h disable pixman ARM blitters for __aarch64__ | _M_ARM64 2021-02-25 11:38:14 -08:00
SDL_blit_0.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_blit_1.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_blit_A.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_blit_auto.c Update SDL_blit_auto.c 2021-03-04 14:36:33 +01:00
SDL_blit_auto.h Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_blit_copy.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_blit_copy.h Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_blit_N.c Fixed bug 3727 - Blit from RGB555 to ARGB1555 2021-03-11 20:06:09 +01:00
SDL_blit_slow.c Software nearest scaling: start at the middle of pixel 2021-03-04 14:33:56 +01:00
SDL_blit_slow.h Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_bmp.c loadbmp: Attempt to handle small palettes better. 2021-05-27 10:49:25 -04:00
SDL_clipboard.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_egl.c egl: Don't crash if we failed halfway through SDL_CreateWindow. 2021-05-11 14:08:17 -04:00
SDL_egl_c.h Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_fillrect.c SDL_fillrect.c: updated SSE_BEGIN macro for windows clang-cl 2021-03-04 18:27:56 +03:00
SDL_pixels.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_pixels_c.h Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_rect.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_rect_c.h Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_RLEaccel.c Error missing 'flags' initialization (see bug #2881) 2021-04-28 23:40:26 +02:00
SDL_RLEaccel_c.h Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_shape.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_shape_internals.h Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_stretch.c Software nearest scaling: start at the middle of pixel 2021-03-04 14:33:56 +01:00
SDL_surface.c SDL_ConvertColorkeyToAlpha: remove and clarify a FIXME 2021-02-10 10:22:19 -05:00
SDL_sysvideo.h Modifies WaitEvent and WaitEventTimeout to actually wait instead of polling 2021-06-04 13:50:50 -07:00
SDL_video.c Add SDL_SetWindowAlwaysOnTop() 2021-04-20 08:45:28 -07:00
SDL_vulkan_internal.h Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_vulkan_utils.c Fixed bug #4337 - compilation of 'SDL_vulkan_utils' fails with 'VK_ERROR_INCOMPATIBLE_VERSION_KHR' undeclared 2021-04-29 22:25:00 +02:00
SDL_yuv.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_yuv_c.h Updated copyright for 2021 2021-01-02 10:25:38 -08:00
sdlgenblit.pl Software nearest scaling: start at the middle of pixel 2021-03-04 14:33:56 +01:00