• Show log

    Commit

  • Hash : 0dd7024d
    Author : Francesco Abbate
    Date : 2021-03-12T21:58:20

    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.
    

  • Properties

  • Git HTTP https://git.kmx.io/kc3-lang/SDL.git
    Git SSH git@git.kmx.io:kc3-lang/SDL.git
    Public access ? public
    Description

    Fork of https://github.com/libsdl-org/SDL

    Users
    thodg_m kc3_lang_org thodg_w thodg_l www_kmx_io thodg
    Tags

  • README.md

  • Simple DirectMedia Layer (SDL) Version 2.0

    https://www.libsdl.org/

    Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. It is used by video playback software, emulators, and popular games including Valve’s award winning catalog and many Humble Bundle games.

    More extensive documentation is available in the docs directory, starting with README.md

    Enjoy!

    Sam Lantinga (slouken@libsdl.org)