mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-29 09:18:43 +00:00
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. |
||
|---|---|---|
| .. | ||
| android | ||
| arm | ||
| cocoa | ||
| directfb | ||
| dummy | ||
| emscripten | ||
| haiku | ||
| khronos | ||
| kmsdrm | ||
| nacl | ||
| offscreen | ||
| os2 | ||
| pandora | ||
| psp | ||
| qnx | ||
| raspberry | ||
| uikit | ||
| vita | ||
| vivante | ||
| wayland | ||
| windows | ||
| winrt | ||
| x11 | ||
| yuv2rgb | ||
| SDL_blit.c | ||
| SDL_blit.h | ||
| SDL_blit_0.c | ||
| SDL_blit_1.c | ||
| SDL_blit_A.c | ||
| SDL_blit_auto.c | ||
| SDL_blit_auto.h | ||
| SDL_blit_copy.c | ||
| SDL_blit_copy.h | ||
| SDL_blit_N.c | ||
| SDL_blit_slow.c | ||
| SDL_blit_slow.h | ||
| SDL_bmp.c | ||
| SDL_clipboard.c | ||
| SDL_egl.c | ||
| SDL_egl_c.h | ||
| SDL_fillrect.c | ||
| SDL_pixels.c | ||
| SDL_pixels_c.h | ||
| SDL_rect.c | ||
| SDL_rect_c.h | ||
| SDL_RLEaccel.c | ||
| SDL_RLEaccel_c.h | ||
| SDL_shape.c | ||
| SDL_shape_internals.h | ||
| SDL_stretch.c | ||
| SDL_surface.c | ||
| SDL_sysvideo.h | ||
| SDL_video.c | ||
| SDL_vulkan_internal.h | ||
| SDL_vulkan_utils.c | ||
| SDL_yuv.c | ||
| SDL_yuv_c.h | ||
| sdlgenblit.pl | ||