Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve macOS mouse latency and stale positioning #483

Merged
merged 1 commit into from
Feb 22, 2021

Conversation

randrew
Copy link

@randrew randrew commented Feb 19, 2021

Prior to this patch, _sapp_macos_update_mouse() used [window mouseLocationOutsideOfEventStream] to get the mouse position. mouseLocationOutsideOfEventStream seems to often lag behind the position of the mouse in the application's windows as reported by incoming mouse NSEvents.

Because the old code before this commit only called _sapp_macos_update_mouse() right before _sapp_frame(), the individual mouseMoved:, mouseDragged:, etc. methods on the _sapp_macos_view class, which are the only entry points for calling _sapp_macos_mouse_event() to send the mouse data to the user application, would be sending the mouse position data that was returned by _sapp_macos_update_mouse(), not by the event in the incoming NSEvent.

Let's review what this looks like:

  • _sapp_macos_update_mouse() is called right before rendering a frame. [window mouseLocationOutsideOfEventStream] is called within, and its return value is used to update the mouse position in the global _state. This data is not dispatched to the user application here. Additionally, mouseLocationOutsideOfEventStream may have returned a laggy mouse position.

  • _sapp_frame() is called and a frame is rendered.

  • Time passes.

  • NSEvents arrive on the mouseMoved:, mouseDown:, etc. methods. The mouse positions within the events are ignored, and instead, the position stored in the global _state from the previous call to _sapp_macos_update_mouse() is sent to the user application.

  • Time passes.

  • _sapp_macos_update_mouse() is called, …

This would result in the mouse input being delayed by one or more frames (at 60hz) on top of any additional latency added by vsync timing, video buffering, and display lag.

Another problem: after the user brings their mouse to a stop, the mouse position will often be incorrect — the newest mouse position has yet to be processed by the application. You can reproduce by moving the mouse quickly in a test application that draws a trail of squares along the mouse positions. When moving the mouse quickly and then coming to a stop, the trail of squares will stop short of the mouse cursor. Even if the mouse is left unmoving for seconds or minutes. Then the next time the user moves the mouse by even 1 pixel, a square will finally be drawn underneath the mouse position. (Except it will actually be the previous, old position.)


This commit makes several changes to input event handling in macOS:

_sapp_macos_update_mouse() has been changed to take an NSEvent* argument, instead of no arguments. And instead of using [window mouseLocationOutsideOfEventStream] to get the position of the mouse, it uses event.locationInWindow. This seems to sometimes eliminate a frame of mouse latency.

_sapp_macos_update_mouse() is no longer called immediately before rendering a frame. Instead, it's called at the beginning of each of the mouseMoved:, mouseDragged:,mouseDown:, etc. methods with its associated NSEvent*. Immediately after, _sapp_macos_mouse_event() is called. This eliminates a full frame of mouse latency. This also fixes situations where the mouse cursor's resting apparent position would lag behind its resting true position after the user stops moving the mouse.

_sapp_macos_poll_input_events() has been added, which calls [NSApp nextEventMatchingMask: ...] to manually read and dispatch input events from the event queue. _sapp_macos_poll_input_events() is called immediately before _sapp_macos_frame(). This will sometimes catch and dispatch input events that occurred shortly before the frame is to be rendered, but hadn't yet been dispatched by other mechanisms. This occasionally eliminates a frame of latency, and improves the worst-case bounds. This seems to happen to 5% or fewer mouse events.

[NSEvent setMouseCoalescingEnabled:NO], if it even still does anything, is now called once at during application startup instead of toggled off and on along with mouse lock.


The improvements are noticeable in both Metal and OpenGL.

This significantly improves #341 and #415 for Mac.

This commit makes several changes to input event handling in macOS:

_sapp_macos_update_mouse() has been changed to take an NSEvent*
argument, instead of no arguments. And instead of using [window
mouseLocationOutsideOfEventStream] to get the position of the mouse, it
uses event.locationInWindow. This seems to sometimes eliminate a frame
of mouse latency.

_sapp_macos_update_mouse() is no longer called immediately before
rendering a frame. Instead, it's called at the beginning of each of the
mouseMoved:, mouseDragged:, mouseDown:, etc. methods with its associated
NSEvent*. Immediately after, _sapp_macos_mouse_event() is called. This
eliminates a full frame of mouse latency. This also fixes situations
where the mouse cursor's resting apparent position would lag behind its
resting true position after the user stops moving the mouse.

_sapp_macos_poll_input_events() has been added, which calls [NSApp
nextEventMatchingMask: ...] to manually read and dispatch input events
from the event queue. _sapp_macos_poll_input_events() is called
immediately before _sapp_macos_frame(). This will sometimes catch and
dispatch input events that occurred shortly before the frame is to be
rendered, but hadn't yet been dispatched by other mechanisms. This
occasionally eliminates a frame of latency, and improves the worst-case
bounds. This seems to happen to 5% or fewer mouse events.

[NSEvent setMouseCoalescingEnabled:NO], if it even still does anything,
is now called once at during application startup instead of toggled off
and on along with mouse lock.
@randrew
Copy link
Author

randrew commented Feb 19, 2021

Disclaimer: I have only tested this on 10.12. But I would be surprised if it doesn't work in all later versions.

@floooh
Copy link
Owner

floooh commented Feb 21, 2021

Looks like a good fix, but I first need to do some git archeology to find out why mouseLocationOutsideOfEventStream is used in the first place instead of the more straightforward mouse movement events, and I need to do some testing. So it'll take a few days.

I'll start looking into this now though.

floooh added a commit that referenced this pull request Feb 22, 2021
@floooh floooh merged commit 328b924 into floooh:master Feb 22, 2021
@floooh
Copy link
Owner

floooh commented Feb 22, 2021

Ok, merged! Just wanted to mention that this was a really nice PR, very non-intrusive, nicely written and explained. Thanks :)

@floooh
Copy link
Owner

floooh commented Mar 23, 2021

Hmm, I'm still seeing infrequent odd behaviour when pressing the window close button. Sometimes the close button remains pressed, rendering stops, and the application doesn't close.

I'll remove the event polling for a little while and see if that makes any difference. Just FIY.

(PS: I'm seeing this odd behaviour both with GL and MTKView - there's a small chance that it's caused by the macOS Beta though).

relick added a commit to relick/sokol that referenced this pull request May 14, 2022
commit 9a6237fcdf213e6da48e4f9201f144bcb2dcb46f
Author: Andre Weissflog <[email protected]>
Date:   Mon Apr 25 14:23:09 2022 +0200

    sokol_nuklear.h: fix sg_image handling (fixes #656)

commit cc13a1e0cb9901b85fa58bcfc35aca178ba7d85d
Author: Andre Weissflog <[email protected]>
Date:   Tue Apr 12 18:31:49 2022 +0200

    sokol_fontstash.h: fix documentation (fixes #652)

commit a18031313cdf7dab461baa296c38b07337ab4d47
Author: Andre Weissflog <[email protected]>
Date:   Sun Mar 20 17:47:15 2022 +0100

    sokol_gfx.h iOS/Metal: fix framebuffer size reporting when device is rotated (fixes #645)

commit f306862f2137f43c1145902adf086c8cf3cb81de
Author: Andre Weissflog <[email protected]>
Date:   Sat Mar 19 17:09:31 2022 +0100

    sokol_gfx.h, sokol_app.h: fix a Mac specific warning when compiling as 'pedantic' C++ (fixes #644)

commit 3a389dfbb9d0d738e2f63c74dca01be30e144145
Author: Andre Weissflog <[email protected]>
Date:   Thu Mar 17 17:14:10 2022 +0100

    sokol_audio.h macOS: fix unused variable warning in latest clang

commit bc7fd22c5e15f217097b1a05906489435aa4cfcf
Merge: e8931e4 ae511b7
Author: Andre Weissflog <[email protected]>
Date:   Wed Mar 16 15:49:51 2022 +0100

    Merge pull request #643 from code-disaster/master

    sokol_app.h: fix window position after fullscreen toggle

commit ae511b76ddba6b1ced3a0966e944139e7ea1a653
Author: Daniel Ludwig <[email protected]>
Date:   Wed Mar 16 12:54:05 2022 +0100

    sokol_app.h: fix window position after fullscreen toggle

commit e8931e4399a0eb4bf026120d7bdb89825815af9e
Author: Andre Weissflog <[email protected]>
Date:   Wed Feb 9 11:38:00 2022 +0100

    sokol_imgui.h: minor doc improvements

commit df374c1090601d59a5a1a706b36d4c74f9040c49
Author: Andre Weissflog <[email protected]>
Date:   Wed Feb 9 11:16:30 2022 +0100

    fix a changelog typo

commit 173f73e27c70a9ef91443aa292220cdad76493b1
Author: Andre Weissflog <[email protected]>
Date:   Tue Feb 8 20:08:46 2022 +0100

    sokol_imgui.h: replace simgui_desc.disable_hotkeys with .disable_paste_override

commit ca04823e15e2dcc8fc9272bc56ce7bdf8d3cbab2
Author: Andre Weissflog <[email protected]>
Date:   Tue Feb 8 20:07:59 2022 +0100

    sokol_app.h: don't assert in sapp_set/get_clipboard_string()

commit f8bd3a2d6848459cf1d736a199717f1946589bed
Author: Andre Weissflog <[email protected]>
Date:   Tue Feb 8 16:37:09 2022 +0100

    update changelog (remove blurb about simgui_desc.disable_hotkeys)

commit 37805485ccb6f7b5076c0cdeb6465da18de17684
Author: Andre Weissflog <[email protected]>
Date:   Tue Feb 8 16:36:26 2022 +0100

    sokol_imgui.h: add simgui_desc.disable_hotkeys back in, but implemented differently

commit 3cfc607d9f72cee429b44a805ac8a6d59370384d
Author: Andre Weissflog <[email protected]>
Date:   Tue Feb 8 15:30:26 2022 +0100

    update readme

commit d7ccf6ea964a4a718f8aabfe1d4a06879bdd8172
Author: Andre Weissflog <[email protected]>
Date:   Tue Feb 8 15:26:42 2022 +0100

    sokol_imgui.h: updates for Dear ImGui v1.87 (#628)

    * sokol_imgui.h: update for Dear ImGui 1.87 (remove input buffer)

    * sokol_imgui.h: only cancel mouse buttons on mouseleave on Emscripten

    * update changelog

commit edd83be7ba2f18eec9ca44497a2c4b3acaa95b50
Author: Andre Weissflog <[email protected]>
Date:   Wed Feb 2 12:26:58 2022 +0100

    fix some changelog typos

commit e51d4e12ac6ad6fb435a4f4bae5ae01ac4c3fed0
Author: Andre Weissflog <[email protected]>
Date:   Tue Feb 1 13:58:27 2022 +0100

    sokol_shape.h: fix missing braces warning, instead of suppressing the warning

commit 89ba72f4f0da1802a2146bf799900bf803944645
Author: Andre Weissflog <[email protected]>
Date:   Tue Feb 1 13:47:47 2022 +0100

    sokol_shapes: remove the -Wmissing-braces suppression (not needed anymore?)

commit 49dc9e13d831639e7e03503228d73ade5ab44638
Merge: 1f3d3a8 7d77ac1
Author: Andre Weissflog <[email protected]>
Date:   Tue Feb 1 12:38:09 2022 +0100

    Merge pull request #624 from mlabbe/master

    Fix -wmissing-braces warning on Clang

commit 7d77ac124132939ddede8396ba52027bc2340c1d
Author: Michael Labbé <[email protected]>
Date:   Mon Jan 31 09:50:13 2022 -0800

    Fix -wmissing-braces warning on Clang

commit 1f3d3a8a4253da0e7c416fbf8490c8547861a275
Author: Andre Weissflog <[email protected]>
Date:   Fri Jan 28 16:36:35 2022 +0100

    changelog fix

commit d639860d9e8a0fde09bf9afd310ba738a8f1e383
Author: Andre Weissflog <[email protected]>
Date:   Fri Jan 28 16:32:14 2022 +0100

    Better default-window-size handling for desktop platforms. (#623)

    If sapp_desc.width/height is 0:

    - on Windows: uses CW_USEDEFAULT for the window size, also centers the window
    - on macOS: sets window size to 4/5 of display size (window was already centered before)
    - on Linux: sets window size to 4/5 of display size (and centers the window)
    - no functional changes on the other platforms.

    Some additional changes for fullscreen vs windowed behaviour on Windows:

    - stores and restores the window pos and size when switching between windowed and fullscreen
    - if the app starts in fullscreen, uses sapp_desc.width/height when switching back to windowed

commit 67c321cdbb9c46e2944e77ca7a4ba3a611b80555
Author: Andre Weissflog <[email protected]>
Date:   Fri Jan 21 17:12:57 2022 +0100

    sokol_app.h android: configure EGL_RENDERABLE_TYPE in eglChooseConfig (PR #220)

commit 67b6cdbe1c370448c88b31756dc4aca37f3a4ad9
Author: Andre Weissflog <[email protected]>
Date:   Fri Jan 21 13:39:15 2022 +0100

    sokol_gfx.h gl: fix alignment before uniform buffer size assert (fixes #618)

commit 546cc36f95a9ec0da55ee084e2ae993aad94e4d5
Merge: 3c9dbcd ae1c4b5
Author: Andre Weissflog <[email protected]>
Date:   Fri Jan 21 11:59:00 2022 +0100

    Merge pull request #621 from pixelpicosean/master

    Add missing imgui kp enter map

commit ae1c4b50545bee6efc44415502db8429ca66d883
Author: Sean Bohan <[email protected]>
Date:   Fri Jan 21 16:42:21 2022 +0800

    Add missing imgui kp enter map

commit 3c9dbcd7262a7caee15daff3e721e92714a9b49e
Author: Andre Weissflog <[email protected]>
Date:   Thu Jan 20 17:43:11 2022 +0100

    update changelog

commit af458d1e82d1d836f542487b600a975d943f3a1c
Author: Andre Weissflog <[email protected]>
Date:   Thu Jan 20 17:37:03 2022 +0100

    sokol_app.h d3d11: release IDXGIAdapter and IDXGIFactory interfaces

    This fixes two (uncritical) leak warnings at shutdown, introduced
    in 45914b5964da0541092845519ed9cd2e27302a79 (disable Alt-Enter).

commit 3ee6180322f9cb40fb57ce512263bbc72534eac4
Author: Andre Weissflog <[email protected]>
Date:   Thu Jan 20 17:29:09 2022 +0100

    fix typo in changelog

commit 0d6d5d05bb30a2ce8bdebb0b8da829df5fccd2df
Author: Andre Weissflog <[email protected]>
Date:   Thu Jan 20 17:28:01 2022 +0100

    update readme and changelog

commit 537568c405a0dc533692c676fa06b957b2b6f89c
Author: Andre Weissflog <[email protected]>
Date:   Thu Jan 20 17:16:40 2022 +0100

    sokol_audio.h win32: nChannels vs dwChannelMask compatibility fix (fixes #614)

commit df5155491a15eb39a6081a614c0def7be8f5faf2
Merge: 45914b5 dcd7721
Author: Andre Weissflog <[email protected]>
Date:   Wed Jan 19 13:03:09 2022 +0100

    Merge branch 'tjachmann-master'

commit dcd772117f9140ddd49357ad6cb2bea0cfddb58a
Author: Andre Weissflog <[email protected]>
Date:   Tue Jan 18 18:30:35 2022 +0100

    sokol_app.h win32: add WM_DPICHANGED define if it isn't defined (because Windows SDK is too old)

commit 042fff6a26a676b197b11bae999a1f866a0daab8
Author: Andre Weissflog <[email protected]>
Date:   Tue Jan 18 16:49:25 2022 +0100

    sokol_app.h win32: don't reset timing during WM_ENTER/EXITSIZEMOVE

commit d85d71b65efa71324b7544198752a30076647a35
Merge: 5a7d668 45914b5
Author: Andre Weissflog <[email protected]>
Date:   Tue Jan 18 16:14:41 2022 +0100

    Merge branch 'master' into tjachmann-master

commit 5a7d668e2edbca24875c4aaf388c7c4cfdd3aad4
Author: Andre Weissflog <[email protected]>
Date:   Tue Jan 18 16:10:31 2022 +0100

    update README and CHANGELOG

commit a924496a1afaa0f586abf5f735e086b9fcdd7e54
Author: Andre Weissflog <[email protected]>
Date:   Tue Jan 18 15:31:03 2022 +0100

    sokol_app.h: reset timing if there are too many spikes in a row (display refresh rate has probably changed)

commit 45914b5964da0541092845519ed9cd2e27302a79
Author: Andre Weissflog <[email protected]>
Date:   Tue Jan 18 15:13:02 2022 +0100

    sokol_app.h d3d11: disable dxgi's automatic Alt-Enter handling (fixes #612)

commit 04f59ff9d511242d2841c5f831a998986fdce055
Author: Andre Weissflog <[email protected]>
Date:   Tue Jan 18 14:42:56 2022 +0100

    sokol_app.h: fix syntax error in last commit

commit fb64006419d9c596c156a218452a37f9c1e6f761
Author: Andre Weissflog <[email protected]>
Date:   Tue Jan 18 13:55:42 2022 +0100

    sokol_app.h win32: reset frame timing when refresh rate might have changed

commit a5bafdbfc7d8a31eb8a348e023acf21d3fcef74c
Author: Andre Weissflog <[email protected]>
Date:   Tue Jan 18 13:27:57 2022 +0100

    sokol_app.h: reset frame timing when window moves to different screen

commit 6cbbe410a981a75f1701bd9101f5a65f1783e5da
Author: Andre Weissflog <[email protected]>
Date:   Tue Jan 18 12:50:27 2022 +0100

    sokol_app.h: fix undefined behaviour (shift on signed value, fixes #616)

commit 1032316dd7a7e8f4db72da1d3c2608b800bbfd56
Author: Andre Weissflog <[email protected]>
Date:   Tue Jan 18 12:40:47 2022 +0100

    gen_ir.py: accept both 'rvalue' and 'prvalue' for enums (clang change)

commit 2d052ebabebe5ad2605287b5210ab9ed5a90c1e3
Author: Andre Weissflog <[email protected]>
Date:   Mon Jan 17 17:45:14 2022 +0100

    sokol_app.h: update DPI handling documentation

commit dcf3ab858e252057241cea100dc595afe49b54cb
Author: Andre Weissflog <[email protected]>
Date:   Mon Jan 17 17:14:59 2022 +0100

    sokol_imgui.h: remove simgui_desc_t.dpi_scale, update documentation

commit 10635188f7f456c8a470b3db87599413c7214b0e
Author: Andre Weissflog <[email protected]>
Date:   Mon Jan 17 14:14:10 2022 +0100

    sokol_app.h macos: implement per-monitor dpi_scale

commit a44c05656577f2cc3000971215765636ec9a9180
Author: Andre Weissflog <[email protected]>
Date:   Mon Jan 17 14:10:25 2022 +0100

    sokol_imgui.h: add C++ wrapper for simgui_new_frame()

commit c9a36146320aa49ac79e44467d98d9eca31243f1
Author: Andre Weissflog <[email protected]>
Date:   Sun Jan 16 19:49:02 2022 +0100

    sokol_app.h d3d11: implement workaround for 0.5sec freeze at start of window movement

    see https://gamedev.net/forums/topic/672094-keeping-things-moving-during-win32-moveresize-events/5254386/

commit dd9a1eac4efaff15e94c17896e32e3b803e36efc
Author: Andre Weissflog <[email protected]>
Date:   Sun Jan 16 19:38:10 2022 +0100

    sokol_app.h d3d11: use DXGI_PRESENT_DO_NOT_WAIT during window move/resize

    This slightly improves the sluggy window sizing/movement on Win10
    with recent NVIDIA drivers.

commit fc2678babfb7f5e25518e3873b304e70fbbcf173
Author: Andre Weissflog <[email protected]>
Date:   Sun Jan 16 17:48:47 2022 +0100

    sokol_imgui.h: breaking change to take per-frame dpi_scale value

commit 172a4b2e15733ebcf573f30fd1e9a92749492c79
Author: Andre Weissflog <[email protected]>
Date:   Sun Jan 16 16:01:22 2022 +0100

    sokol_app.h: make a comment more clear

commit dbb85ba805812f96f0cd291e048384b36bcf7604
Author: Andre Weissflog <[email protected]>
Date:   Sun Jan 16 15:53:44 2022 +0100

    sokol_app.h: minimize diffs

commit 1c1e2b8097184f30659bcb7e5c9ab9289f712eb9
Author: Andre Weissflog <[email protected]>
Date:   Sun Jan 16 15:48:41 2022 +0100

    sokol_app.h: some code cleanup

commit f748bc1f2242dd82b898922e272a1d33c88b4ba5
Merge: ae5cf2c bff1d73
Author: Andre Weissflog <[email protected]>
Date:   Sun Jan 16 14:13:35 2022 +0100

    Merge branch 'master' of https://github.com/tjachmann/sokol into tjachmann-master

commit ae5cf2c6c498b3c53b3d8f58dfa01310ba9dac76
Author: Andre Weissflog <[email protected]>
Date:   Sat Jan 15 15:58:04 2022 +0100

    fix changelog link

commit 2a7e1a83de82b93e5712139921b0ab19ee6786ca
Author: Andre Weissflog <[email protected]>
Date:   Sat Jan 15 15:34:50 2022 +0100

    update changelog

commit dd071cedde267845bb905c39e7882a7ee14a7ba6
Merge: b2f6075 ffd9fa9
Author: Andre Weissflog <[email protected]>
Date:   Sat Jan 15 15:16:06 2022 +0100

    Merge branch 'nmr8acme-master'

commit ffd9fa9681ea23935213aa57e419f3af756077a7
Author: nathan <nmr>
Date:   Thu Jan 13 15:53:14 2022 -0800

    Array uniforms should respect SG_UNIFORMLAYOUT_NATIVE

commit bff1d73ac8603772cae32aeb2a187f8a8a76691f
Author: Tom Jachmann <[email protected]>
Date:   Thu Jan 13 20:34:49 2022 +0100

    Fix requested changes

commit 82a2933387a7841db55b4bf1bbd2c58df3cd599a
Author: Tom Jachmann <[email protected]>
Date:   Thu Jan 13 14:39:53 2022 +0100

    sokol_app.h win32: implements optional per monitor DPI awareness

commit b2f60754841c0bbfad47da86974e43e494f11bef
Author: Andre Weissflog <[email protected]>
Date:   Sun Jan 9 14:32:46 2022 +0100

    sokol_fetch.h: documentation fixes

commit 2fac324669cb58f84f06f7eb0d28c1ef8da7e85a
Author: Andre Weissflog <[email protected]>
Date:   Sat Jan 8 18:07:47 2022 +0100

    mention SetMaximumFrameLatency in changelog

commit 72b4135411daa583e19de45bdc8f32ee70a1a357
Author: Andre Weissflog <[email protected]>
Date:   Sat Jan 8 18:01:24 2022 +0100

    sokol_app.h d3d11: fix C vs C++ calls for new function calls, doh

commit e1a9504493378a24ebffeab46af84dd73e005a06
Author: Andre Weissflog <[email protected]>
Date:   Sat Jan 8 17:45:33 2022 +0100

    sokol_app.h d3d11: replace __uuidof with regular IID

commit 8c179166fce56d28bfab472115ce937235471e76
Author: Andre Weissflog <[email protected]>
Date:   Sat Jan 8 17:29:33 2022 +0100

    sokol_app.h d3d11: call DXGIDevice1::SetMaxiumFrameLatency(1) to reduce frame latency

commit bd7e9793ecd7fec6e196aced5f3ca7e439e125eb
Author: Andre Weissflog <[email protected]>
Date:   Sat Jan 8 17:08:11 2022 +0100

    sokol_gfx.h d3d11: don't call DXGI GetFrameStatistics if fallback SWAP_EFFECT_DISCARD is used

commit 6dd5e57fb8e0691e04a4889ebe9902055e7b7540
Author: Andre Weissflog <[email protected]>
Date:   Sat Jan 8 16:04:31 2022 +0100

    tweak changelog

commit 6a700e073d078609d8e8484ea0baee37b47dc539
Author: Andre Weissflog <[email protected]>
Date:   Sat Jan 8 16:01:44 2022 +0100

    tweak changelog

commit aaf2c33278d047404ca434d38804a9e84bb9eda2
Author: Andre Weissflog <[email protected]>
Date:   Sat Jan 8 15:41:47 2022 +0100

    Support integer uniform types (#606)

    * sokol_gfx.h: SG_UNIFORMTYPE_INT..INT4

    * sokol_gfx.h gl: fix mixed type uniform blocks

    * fix sokol_gfx_imgui.h for new uniform types

    * sokol_gfx.h gl: fix std140 uniform offset computation

    * sokol_gfx.h win32 gl: add missing glUniform funcs to GL loader

    * sokol_gfx.h win32 gl: fix duplicates in GL loader

    * sokol_gfx.h: add new sg_uniform_layout enum (used in sg_shader_uniform_block_desc)

    * sokol_gfx.h: add a new documentation section about uniform block layout

commit e4338646cd9cd21a07d1f8bb72134b9f8327fc79
Merge: 4ff3ed7 f3b2c6f
Author: Andre Weissflog <[email protected]>
Date:   Fri Jan 7 18:30:50 2022 +0100

    Merge pull request #607 from 0x1100/IdxOffset

    sokol_imgui.h: use ImDrawCmd::IdxOffset

commit f3b2c6ff014426c45e6e2bff5430f831e006fb62
Author: Jeremy Jaussaud <[email protected]>
Date:   Fri Jan 7 19:24:03 2022 +0800

    sokol_imgui.h: use ImDrawCmd::IdxOffset

    See https://github.com/ocornut/imgui/releases/tag/v1.86

commit 4ff3ed7d604c3a876146cbf2d89597d81812de22
Author: Andre Weissflog <[email protected]>
Date:   Tue Jan 4 17:56:05 2022 +0100

    sokol_gfx.h: move a comment

commit be6cf8477da79e9ff6c093f98ef64b3f0ad3c10b
Merge: 7f268d7 be0931f
Author: Andre Weissflog <[email protected]>
Date:   Tue Jan 4 17:48:21 2022 +0100

    Merge pull request #583 from edubart/d3d11-fail

    D3D11 resource creation and updating failures no longer assert.

commit 7f268d716155a7648ac5f1dbbcbb3bc3ffec9f46
Merge: e2e9041 40e2cf3
Author: Andre Weissflog <[email protected]>
Date:   Sat Jan 1 14:51:55 2022 +0100

    Merge pull request #605 from mchiasson/patch-1

    fixed sokol_debugtext.h for SOKOL_WGPU backend

commit e2e9041eaa771c4afd3f0a225008a73b36f7dab3
Author: Andre Weissflog <[email protected]>
Date:   Fri Dec 31 16:55:20 2021 +0100

    add link to sokol_gp.h to readme

commit 40e2cf35feee47e5f6421acdb8c59ed865488efb
Author: Matt Chiasson <[email protected]>
Date:   Thu Dec 30 14:34:25 2021 -0500

    fixed sokol_debugtext.h for SOKOL_WGPU backend

    Just a minor typo and some code that probably didn't get updated during a past refactoring session.

commit 92f3c83c63456e43a5e03ebf761ff670088aea97
Author: Andre Weissflog <[email protected]>
Date:   Wed Dec 29 14:46:57 2021 +0100

    sokol_app.h: assert on invalid sapp_desc params

commit 778c692de9cff599a6a2b040496fd5818f4f7c06
Author: Andre Weissflog <[email protected]>
Date:   Tue Dec 28 20:26:29 2021 +0100

    sokol_app.h macOS: fix compilation for macOS SDK < 12.00

commit 900299b67ff4fc9e67ac74215c130d229232ccd5
Author: Andre Weissflog <[email protected]>
Date:   Tue Dec 28 20:21:12 2021 +0100

    tweak changelog

commit ad4e493a6e0a52bb5c25a246c6625f08d755a676
Author: Andre Weissflog <[email protected]>
Date:   Tue Dec 28 14:59:35 2021 +0100

    fix changelog typo

commit 0fb7c31c6a73aec61e883a5ade7239766e6879ec
Merge: d1f3ab1 a55ba2a
Author: Andre Weissflog <[email protected]>
Date:   Tue Dec 28 14:35:28 2021 +0100

    Merge pull request #603 from floooh/sapp-frame-duration

    sokol_app.h frame timing improvements:

    - a new function sapp_frame_duration() to get an averaged frame duration in seconds
    - 120Hz support on macOS and iOS (query max supported refresh rate)

commit a55ba2a991f7ff14d21de67f6ca95297582ab98f
Author: Andre Weissflog <[email protected]>
Date:   Mon Dec 27 15:08:02 2021 +0100

    update changelog

commit 9b1b387c023f2d0720568637ea979d3e47500bb7
Author: Andre Weissflog <[email protected]>
Date:   Mon Dec 27 15:07:50 2021 +0100

    sokol_app.h, sokol_time.h: update header documentation

commit 693f2ebca079070fd785f2f22203c3e2c3a62558
Author: Andre Weissflog <[email protected]>
Date:   Mon Dec 27 14:33:08 2021 +0100

    sokol_app.h: fix ifdef typo for emscripten

commit 752e3de9c856a6969d82dd2bcd2d7751e8eb68a1
Author: Andre Weissflog <[email protected]>
Date:   Sun Dec 26 21:46:14 2021 +0100

    sokol_gfx_imgui.h: fixes for cimgui v1.86

commit 0857b1ba7c01a62f2eb47290378e6d4f9060beb2
Author: Andre Weissflog <[email protected]>
Date:   Mon Dec 27 13:09:45 2021 +0100

    sokol_app.h win32: use DXGI frame statistics for timing

commit d1f3ab1e7120242a5f54a51349c1a41179955ae4
Author: Andre Weissflog <[email protected]>
Date:   Sun Dec 26 21:46:14 2021 +0100

    sokol_gfx_imgui.h: fixes for cimgui v1.86

commit 8207e1752eb1c09e2b4664da192cdcbf4d6d934d
Author: Andre Weissflog <[email protected]>
Date:   Sat Dec 25 18:48:18 2021 +0100

    sokol_app.h win32/uwp: implement frame timing

commit 8b601734cb40f0310b297d7e52ae23c576e3e3bf
Author: Andre Weissflog <[email protected]>
Date:   Sat Dec 25 17:58:40 2021 +0100

    sokol_app.h linux/android: implement frame timing

commit e85601688c0f4020427b66d7ba95090b03e547d8
Author: Andre Weissflog <[email protected]>
Date:   Fri Dec 24 15:36:44 2021 +0100

    sokol_app.h macOS/iOS: query max fps, and add a timing note comment.

    The preferredFramesPerSecond will now be computed from the
    maximumFramesPerSecond property of the mainScreen, so
    that 120Hz refresh rate is possible.

commit a0be8a5e883a2dd39619f404cddaaf1fb8b5d0b9
Author: Andre Weissflog <[email protected]>
Date:   Thu Dec 23 20:24:46 2021 +0100

    sokol_app.h: implement frame timing for macOS, iOS and Emscripten

commit d8f1118ee9ad983080156579f5cb69d222e40e2d
Author: Andre Weissflog <[email protected]>
Date:   Thu Dec 23 20:24:00 2021 +0100

    sokol_time.h: add _stm prefix to int64_muldiv()

commit 8edf0aadaf14d17402d064c692128b18321d458c
Author: Andre Weissflog <[email protected]>
Date:   Wed Dec 22 20:37:20 2021 +0100

    sokol_app.h: start with frame timing support

commit 091abb83a0b640c280c5906cf95971c41c33a8f7
Merge: 2d9b3de d728eb5
Author: Andre Weissflog <[email protected]>
Date:   Tue Dec 21 13:42:35 2021 +0100

    Merge pull request #600 from SanderMertens/patch-1

    Fix SAPP_EVENTYTPE_KEY_UP typo

commit 2d9b3deebe6d8fbbb5c0cc5a8c4b4387c21f71ec
Author: Andre Weissflog <[email protected]>
Date:   Tue Dec 21 13:04:20 2021 +0100

    bindgen/gen_zig.py: zig 0.9.0 fixes (c_void => anyopaque)

commit d728eb5c76f58d79b98b33d52033e6db545b83cc
Author: Sander Mertens <[email protected]>
Date:   Mon Dec 20 16:56:24 2021 -0800

    Fix SAPP_EVENTYTPE_KEY_UP typo

commit c919b139e24ed7bd6cb9009fb25bbbab13dee0d9
Author: Andre Weissflog <[email protected]>
Date:   Sun Dec 19 23:00:08 2021 +0100

    sokol_audio.h: add a saudio_suspended() function

commit a95d6fc4f6a261e7c7087b4d4aeec7d1110a82b4
Author: Andre Weissflog <[email protected]>
Date:   Sun Dec 19 16:49:26 2021 +0100

    sokol_audio.h: suppress unused warning in release mode

commit 40a86d52d44c749e9ea35bd96fbc0a06823d01b5
Author: Andre Weissflog <[email protected]>
Date:   Sun Dec 19 16:35:31 2021 +0100

    update changelog

commit 73e6236d95fbd05063b0182df5b5a33b468b69e1
Author: Andre Weissflog <[email protected]>
Date:   Sun Dec 19 16:31:38 2021 +0100

    sokol_audio.h win32: directly send float samples to WASAP

    Via PR #586 by iOrange (plus some code cleanup).

    On Windows, sokol_audio.h no longer converts from float to int16
    sample format but instead configures WASAPI to directly
    accept float samples.

commit c40f4f227238b17ecb75881fdea4f29d5ef519be
Author: Andre Weissflog <[email protected]>
Date:   Sat Dec 18 19:38:19 2021 +0100

    sokol_gfx.h: fix macOS/Metal build

commit 76817b78758bb9bf7ce0defed752d29ffe26f2af
Merge: a14ea77 c83eca0
Author: Andre Weissflog <[email protected]>
Date:   Sat Dec 18 19:17:04 2021 +0100

    merge changelog update

commit c83eca047c951210a03f114eb6c0cd5ab5927ad3
Author: Andre Weissflog <[email protected]>
Date:   Sat Dec 18 19:16:17 2021 +0100

    update changelog

commit a14ea778730c3f88c6d165d2d46117e43161990a
Author: Andre Weissflog <[email protected]>
Date:   Sat Dec 18 19:09:12 2021 +0100

    sokol_gfx.h: use internal pipeline flag to select instanced draw (#599)

    * sokol_gfx.h: use_instanced_draw for GL backend

    * sokol_gfx.h: use_instanced_draw for d3d11 backend

commit 69fcf21cb1a96e3a3f58940a17b3362b1103a9cf
Author: Andre Weissflog <[email protected]>
Date:   Sat Dec 18 17:21:01 2021 +0100

    sokol_gfx.h: use_instanced_draw for d3d11 backend

commit f091451fbb237b1ac964d4072c59b8080228745c
Author: Andre Weissflog <[email protected]>
Date:   Sat Dec 18 16:31:43 2021 +0100

    sokol_gfx.h: use_instanced_draw for GL backend

commit 4162b001c8292a23049d8e253d17fcd7de382ed5
Author: Andre Weissflog <[email protected]>
Date:   Sat Dec 11 18:42:01 2021 +0100

    sokol_time.h: replace performance.now() with emscripten_get_now() (fixes #592)

commit dfe57a9d8d765dc5e689d238127558dafa72b7a3
Merge: 4de1538 1347a63
Author: Andre Weissflog <[email protected]>
Date:   Wed Dec 1 19:37:51 2021 +0100

    Merge pull request #587 from jasonliang-dev/master

    add point size attribute to sokol_fontstash.h

commit 1347a63fe9c70947b1fba5f6e875a0f22bcc6ad3
Author: Jason Liang <[email protected]>
Date:   Tue Nov 30 22:20:11 2021 -0800

    add point size attribute to sokol_fontstash.h

commit 4de15383e4410e9dfdd0c4835ef99f6e51d1bab6
Author: Andre Weissflog <[email protected]>
Date:   Fri Nov 26 21:10:01 2021 +0100

    add qoiview link to readme

commit be0931f7a26abcd81ce5ccbff52c12a64932a4ee
Author: Eduardo Bart <[email protected]>
Date:   Sun Nov 21 12:18:05 2021 -0300

    Check D3D11 calls failures

commit 58e8297de30ca94097bc24bca3e6f2d6fc205856
Author: Andre Weissflog <[email protected]>
Date:   Thu Nov 18 17:58:37 2021 +0100

    fix changelog typo

commit 23adfde98eac29a30b1fc1e7926f315ad0a87f1a
Author: Andre Weissflog <[email protected]>
Date:   Thu Nov 18 17:56:03 2021 +0100

    Add point size support to sokol_gl.h (#581)

commit 8fcd271f7d4cb19c77aa9f0bbfe8cb7f319dbffc
Merge: f5ca9b5 087dd59
Author: Andre Weissflog <[email protected]>
Date:   Thu Oct 21 11:59:35 2021 +0200

    Merge pull request #573 from sjml/sjml-ios-dpi-fix

    fixing dpi scale > 2.0 on iOS

commit 087dd598dddd7b5294b704bbf4faff9d31e8770d
Author: Shane Liesegang <[email protected]>
Date:   Mon Oct 18 08:17:07 2021 -0400

    fixing dpi scale > 2.0 on iOS

commit f5ca9b5d87e4c4bcf23ee65649437ac3633d8f7e
Merge: 3825314 bfc41f3
Author: Andre Weissflog <[email protected]>
Date:   Fri Oct 15 11:50:36 2021 +0200

    Merge pull request #571 from Larpon/gfx/add-glreadpixels

    Add glReadPixels to _SG_GL_FUNCS

commit bfc41f3f13710f7fc50989215fb844a24466d9bb
Author: Larpon <[email protected]>
Date:   Thu Oct 14 12:36:44 2021 +0200

    Add glReadPixels to _SG_GL_FUNCS

commit 38253149eb489ffe6b7bd1ef9e6b163a584868eb
Author: Andre Weissflog <[email protected]>
Date:   Fri Oct 8 18:55:37 2021 +0200

    fix changelog typo

commit 66a9c8803b3eca7cceb342a4fab7b5aeb855e50d
Author: Andre Weissflog <[email protected]>
Date:   Fri Oct 8 18:26:43 2021 +0200

    Revisit compressed texture support in sokol_gfx.h (#569)

    - tighter validation checks on texture creation:
        - content data validation now also happens in ```sg_make_image()``` (previously only in ```sg_update_image()```)
        - validate that compressed textures are immutable
        - separate "no data" validation checks for immutable vs dynamic/stream textures
        - provided data size for creating or updating textures must match the expected surface sizez exactly
    - fix PVRTC row and surface pitch computation according to the GL PVRTC extension spec
    - better adhere to Metal documentation for the ```MTLTexture.replaceRegion``` parameters (when bytesPerImage is expected to be zero or not)

commit f84a68af1362493331678f9158d6ec06474b16e0
Author: Andre Weissflog <[email protected]>
Date:   Mon Oct 4 18:16:53 2021 +0200

    sokol_gfx.h metal: fix PVRTC texture data upload (fixes #566)

commit 896497ad775153ebe1385c9f95d296860ef53714
Merge: 89b1b6b 7e538a5
Author: Andre Weissflog <[email protected]>
Date:   Thu Sep 23 10:39:42 2021 +0200

    Merge pull request #564 from cedric-h/patch-2

    Fix `sapp_mouse_shown` function signature

commit 7e538a525eeec6f00aaf73ac06be4f8db1d73613
Author: Cedric Hutchings <[email protected]>
Date:   Wed Sep 22 17:53:35 2021 -0400

    Fix `sapp_mouse_shown` function signature

    I discovered this while experimenting with adding a new language to the bindgen

commit 89b1b6b1b844fd968537e633a3ded7662bb63641
Author: Andre Weissflog <[email protected]>
Date:   Mon Sep 13 18:58:44 2021 +0200

    minor followup fix for 16d7b2e1cb2deec0d3cc6e42d21278a7a849b8e5

commit 16d7b2e1cb2deec0d3cc6e42d21278a7a849b8e5
Author: Andre Weissflog <[email protected]>
Date:   Mon Sep 13 18:53:43 2021 +0200

    sokol_gfx.h Metal: cleanup resource options, used StorageModeShared for uniform buffers (fixes #556)

commit 648c66b38d6cf80f4efe74256aee80ce1999de30
Author: Andre Weissflog <[email protected]>
Date:   Mon Sep 13 18:04:08 2021 +0200

    sokol_gfx.h: add missing upd_frame_index in sq_query_image_info (fixes #559)

commit 32ce1d9e82581564dcdf26790325896c054d6a75
Author: Andre Weissflog <[email protected]>
Date:   Mon Sep 13 17:52:54 2021 +0200

    sokol_gfx.h: add missing return in sg_apply_uniforms (fixes #560)

commit 6cf9f02da8cae54a6713aeffcd764378c07a52ec
Author: Andre Weissflog <[email protected]>
Date:   Sun Sep 12 20:03:59 2021 +0200

    mention Doom-Sokol port in the README

commit cc20a3ba92246b852e1bb3a6734e0561fc733a55
Author: Andre Weissflog <[email protected]>
Date:   Sun Sep 12 18:46:49 2021 +0200

    sokol_imgui.h: fix case when rendering a cmdlist without vertices (fixes #558)

commit 667df71044ecd19c218c93c5cbdb188c9ed6eeb8
Author: Andre Weissflog <[email protected]>
Date:   Mon Sep 6 09:39:10 2021 +0200

    sokol_gfx.h: fix pipeline color count assert

commit ca40c1257e9c55f2b172c96c3fe919ac448f6680
Author: Andre Weissflog <[email protected]>
Date:   Sat Sep 4 10:18:52 2021 +0200

    sokol_gfx.h mtl: on macOS use MTLResourceStorageModeManaged for immutable buffers

commit 6d51323d49b39c304813c607f5899d46af7574b5
Author: Andre Weissflog <[email protected]>
Date:   Thu Sep 2 20:58:19 2021 +0200

    tweak changelog

commit b2fa41480064b49275aff0e98a8e267a12e629b7
Author: Andre Weissflog <[email protected]>
Date:   Thu Sep 2 20:38:00 2021 +0200

    update changelog and readme

commit 5c144b39e9578a1e5dad0f688be867f51fb5af9a
Author: Andre Weissflog <[email protected]>
Date:   Thu Sep 2 20:35:56 2021 +0200

    sokol_app.h emsc: use keyevent.code string as key code

commit 650ab0c8450059573a4155c48d235098b2499cc0
Author: Andre Weissflog <[email protected]>
Date:   Thu Sep 2 10:45:47 2021 +0200

    fix changelog typos

commit 98f6fd56d25532ebb48490e4b955ff35c9d46f62
Author: Andre Weissflog <[email protected]>
Date:   Thu Sep 2 10:44:28 2021 +0200

    sokol_app.h: FOCUSED / UNFOCUSED events added (#555)

commit 42d757c7a47a7096f15b48d491f06ef54fddb162
Merge: 9c2d96d 5e4210a
Author: Andre Weissflog <[email protected]>
Date:   Thu Aug 26 10:42:00 2021 +0200

    Merge pull request #553 from lordadamson/patch-1

    fixed documentation which said `event_cb` instead of `event_userdata_cb`

commit 5e4210a930110bcb2f16a0be72d78da14cee255b
Author: lordadamson <[email protected]>
Date:   Mon Aug 23 20:32:43 2021 +0200

    fixed documentation which said `event_cb` instead of `event_userdata_cb`

    and the same with `fail_userdata_cb`

commit 9c2d96ddbbbb60acca9204eff9e28d141c082863
Author: Andre Weissflog <[email protected]>
Date:   Sat Aug 21 14:20:49 2021 +0200

    minor API tweaks in sokol_gl.h and sokol_debugtext.h (see CHANGELOG.md)

commit a4ceb3ab5e9bae32127df45aa42d39d039048d90
Author: Andre Weissflog <[email protected]>
Date:   Fri Aug 20 19:01:37 2021 +0200

    sokol_nuklear.h: remove NK_ALIGNOF macro, which causes an UB warning in recent clang

commit 4cf67c1790aee5e1eeb3ddc892fc75380a75d221
Author: Andre Weissflog <[email protected]>
Date:   Fri Aug 20 18:36:59 2021 +0200

    sokol_gl.h: context support (#549)

commit abadc11723c860ac17a325b7e272c30696710e38
Author: Andre Weissflog <[email protected]>
Date:   Wed Aug 11 19:18:29 2021 +0200

    sokol_gl.h: fix a confusing (but correct) piece of init code

commit 9aa7891121f4495974c54cd12449c04ad9512e4d
Author: Andre Weissflog <[email protected]>
Date:   Sat Aug 7 18:10:22 2021 +0200

    sokol_gfx.h d3d11/wgpu: handle current pipeline/pass caching vs destruction

commit 66b1d898fa46a9dc9c394e92fe55edf01ea14258
Merge: 5a81f57 8fec0f2
Author: Andre Weissflog <[email protected]>
Date:   Sat Aug 7 17:19:14 2021 +0200

    Merge pull request #546 from darkuranium/master

    Fix: sg_uninit_pipeline / sg_init_pipeline pair does not work reliably in OpenGL

commit 8fec0f2c6423f89d3796fb7364c27d45c83bb069
Author: Tim Čas <[email protected]>
Date:   Fri Aug 6 13:32:19 2021 +0200

    Fix a bug with reusing an existing pipeline ID with sg_uninit_pipeline/sg_init_pipeline pairs.

commit 5a81f570f63cb23e6bd676a067c720c4de83da96
Author: Andre Weissflog <[email protected]>
Date:   Tue Aug 3 19:35:11 2021 +0200

    sokol_gfx_imgui.h: add public struct names (fixes #544)

commit 7c0dcbf284f3d4ad89100f42320a695810243fd6
Merge: b326f33 77492e5
Author: Andre Weissflog <[email protected]>
Date:   Wed Jul 21 12:06:36 2021 +0200

    Merge branch 'leecannon-patch-1'

commit 77492e57b6a4e92b41b72ca2c7241b16cf28fb1c
Author: Lee Cannon <[email protected]>
Date:   Tue Jul 20 08:34:11 2021 +0100

    Update gen_zig to support 0.8.0 and master

    These changes are required for zig master and are also valid for the latest stable version 0.8.0

commit b326f332163d16d9210b7d0790bd4772e30137f5
Author: Andre Weissflog <[email protected]>
Date:   Sat Jul 17 16:55:11 2021 +0200

    sokol_app.h: fix size-changed check in _sapp_win32_update_dimensions()

    The size-changed check was misfiring each frame when the window
    was minimized and the client rectangle is size 0x0, which caused
    a redundant reallocation of the DXGI render targets. Thanks to
    @nyalloc for discovering the issue.

commit 01b2916b071e20eff0e76ca717d7deb18869c553
Merge: 6af7379 109a14a
Author: Andre Weissflog <[email protected]>
Date:   Fri Jul 16 10:53:09 2021 +0200

    Merge pull request #537 from geekynils/sokol-fetch_docs_fix

    sokol_fetch docs fix

commit 109a14a11223a01edbe606e6c1799c04676ca3a4
Author: Nils Bruenggel <[email protected]>
Date:   Thu Jul 15 23:05:03 2021 +0200

    sokol_fetch docs fix

    The TL;DR instructions should also mention that you need to call sfetch_dowork().

commit 6af7379b31abf9b8ba5ee08d2241f7d04a96a70f
Author: Andre Weissflog <[email protected]>
Date:   Wed Jul 7 11:08:18 2021 +0200

    fix the changelog entry from the future

commit c1bf1a9448e98cb4f626aa5fe837278ac8b12be0
Author: Andre Weissflog <[email protected]>
Date:   Thu Jun 24 10:24:39 2021 +0200

    sokol_gfx.h d3d11: remove no longer required zero-array items from backend state

commit 444bca192dcc284d4d9ea4eed7eff4dde4b44e70
Author: Andre Weissflog <[email protected]>
Date:   Tue Jun 22 18:16:32 2021 +0200

    sokol_gfx.h d3d11: use ID3D11DeviceContext::ClearState() to clear device state

commit 974d3cd7309d13bc579404418987722da79261ce
Author: Andre Weissflog <[email protected]>
Date:   Mon Jun 21 20:03:17 2021 +0200

    mention sokol_gl.h in changelog

commit 7d3565bb63abed48908bfda6355fe44355d96fe4
Merge: bf663b0 91828ef
Author: Andre Weissflog <[email protected]>
Date:   Mon Jun 21 18:59:41 2021 +0200

    Merge pull request #533 from nyalloc/patch-2

    Updated README.md to add link to sokol_color.h

commit 91828efee15d9318c790bcce25f5d5959ba588c5
Author: Stuart Adams <[email protected]>
Date:   Mon Jun 21 17:48:17 2021 +0100

    Updated README.md to add link to sokol_color.h

commit bf663b04e3e65cd7d2f741529a82f32a25034cad
Author: Stuart Adams <[email protected]>
Date:   Mon Jun 21 17:27:02 2021 +0100

    sg_color utilities (#527)

commit 8f39840687d2675c199c6b34d6b3c64ba4a8786b
Author: Andre Weissflog <[email protected]>
Date:   Mon Jun 7 19:44:26 2021 +0200

    sokol_app.h x11: fix UB in _sapp_x11_set_icon

commit b3ffdf3e561fe157fa8a03f08e49d0278c3624fd
Author: Andre Weissflog <[email protected]>
Date:   Sun Jun 6 16:03:31 2021 +0200

    d3d11 backends: remove dxguid dependency

commit be081ef0487017d85e03cd8f526dace502551d9e
Author: Andre Weissflog <[email protected]>
Date:   Wed May 26 19:16:42 2021 +0200

    bindgen/README: add a note about clang and python3, fixes #253

commit bd2066fcc105cf6afb951b1ad04f40a0a45de2ef
Author: Andre Weissflog <[email protected]>
Date:   Wed May 26 19:09:50 2021 +0200

    sokol_app.h win32: always link with gdi32, not just in the GL backend

commit 2966fb395d2e7aa4b70de4fe59a43e14704335c8
Author: Andre Weissflog <[email protected]>
Date:   Tue May 11 20:38:39 2021 +0200

    sokol_gfx_imgui.h: add missing ETC2 pixel format names

commit 40034cbc2561bd7b6ab2dedb9e7a928e2d0965c7
Author: Andre Weissflog <[email protected]>
Date:   Tue May 11 20:27:14 2021 +0200

    sokol_gfx win32: add GL_MAX_VERTEX_UNIFORM_VECTORS to GL loader

commit 63f14c4752d7b898f0802b9288cebf18921ab36d
Author: Andre Weissflog <[email protected]>
Date:   Tue May 11 20:14:14 2021 +0200

    sokol_gfx.h: add a gl_max_vertex_uniform_vectors item to sg_limits

commit 76eff5fd6665087f09222a2c3506fb198f194d3a
Author: Andre Weissflog <[email protected]>
Date:   Tue May 11 20:03:12 2021 +0200

    sokol_gfx.h gl: expand _sg_gl_uniform_t.count from uint8_t to uint16_t, fixes #522

commit 6286c5328a29afcb3d22c316abb49422adcb0aff
Merge: d7936e4 0e255f9
Author: Andre Weissflog <[email protected]>
Date:   Tue May 11 19:30:37 2021 +0200

    Merge pull request #521 from nyalloc/patch-1

    Typo fix in sokol_fontstash.h documentation

commit 0e255f9d7d14bef0ee3f0c070e96cd35ac505daf
Author: Stuart Adams <[email protected]>
Date:   Tue May 11 13:21:55 2021 +0100

    Typo fix in sokol_fontstash.h documentation

    `sg_v2f_t2f_c1i` -> `sgl_v2f_t2f_c1i`

commit d7936e4f56dbf6056fa1bfcf1cc5da888ab1db06
Author: Andre Weissflog <[email protected]>
Date:   Wed Apr 28 19:47:16 2021 +0200

    sokol_app.h fix: fullscreen function had SOKOL_APP_API_DECL attributes

commit 5fcfb868edd9af6686fe359dfd6041d581ce63ca
Author: Andre Weissflog <[email protected]>
Date:   Fri Apr 23 18:07:54 2021 +0200

    sokol_app.h macos: wrap the view's draw method in an autoreleasepool, as recommended by the Metal docs

commit c7506acdf621978fcc9f122863144452df4bece2
Merge: e892cde fb5c6c4
Author: Andre Weissflog <[email protected]>
Date:   Wed Apr 21 19:02:12 2021 +0200

    Merge branch 'stevinz-stevinz-menu-activate'

commit fb5c6c48113753e80f0ee0d13171d5264a635167
Author: Stephens Nunnally <[email protected]>
Date:   Tue Apr 20 13:56:44 2021 -0400

    MacOS main menu bar activation fix.

    On MacOS 10.14.6, after implementing a quit menu item (seen in pull request #362, https://github.com/floooh/sokol/pull/362) and subsequently additional menu items, I found that upon initial App launch the Apple menu and the App's menus in the main menu bar do not respond to mouse clicks. Switching away from the App and then back again resolves the issue.

    I found others having the same issue (with Swift, not Sokol App) on stack overflow along with a fix: (https://stackoverflow.com/questions/62739862/why-doesnt-activateignoringotherapps-enable-the-menu-bar). Moving the App activation to applicationDidFinishLaunching() seems to work great, after this change, the menus are clickable from first launch.

commit e892cdef598a70a70ff231f4b87d04c47bd42ca6
Merge: 0c5bc3a b347c12
Author: Andre Weissflog <[email protected]>
Date:   Mon Apr 19 13:25:03 2021 +0200

    Merge pull request #513 from code-disaster/minor-qol-changes

    Minor QoL changes

commit b347c1201fc84a76ad9be4fcc7b06d75345caabe
Author: Daniel Ludwig <[email protected]>
Date:   Sat Apr 17 20:26:35 2021 +0200

    sokol_time.h: add 100 Hz to common refresh rates

commit 6d29bea863954ea46115730842c534a1f05ef13f
Author: Daniel Ludwig <[email protected]>
Date:   Sat Apr 17 20:24:33 2021 +0200

    sokol_app.h: add function to query IDXGISwapChain object

commit 0c5bc3a7f08a507d85a83bfc0140665c9eb7cf50
Author: Andre Weissflog <[email protected]>
Date:   Wed Apr 14 18:50:42 2021 +0200

    sokol_gfx.h Metal: handle currentDrawable == nil (fixes #504)

    - presentDrawable is skipped if the drawable_cb returns nil
    - moved the completion handler block up into the first begin-pass
      of a frame, this should make a difference, but it's similar now
      to the Xcode Metal example project.
    - tested by returning nil from
      sapp_metal_get_renderpass_descriptor() and/or sapp_metal_get_drawable()

commit 4adc53e0a44fb3ee16feea394a771bccb696209f
Author: Andre Weissflog <[email protected]>
Date:   Tue Apr 13 19:13:10 2021 +0200

    sokol_app.h x11: make modifier behaviour in key/button down/up events consistent with other platforms

commit 2bd6e83c48a4271042e46cf2ba8eaf64e322092c
Author: Andre Weissflog <[email protected]>
Date:   Mon Apr 12 20:31:21 2021 +0200

    mention mouse button modifiers in changelog and readme

commit 2f97685e88749937ee8bace99979a1bb366f95e0
Author: Andre Weissflog <[email protected]>
Date:   Mon Apr 12 20:22:18 2021 +0200

    sokol_app.h: add mouse button modifiers (#511)

commit b6c5ff54156038fc4896270e023c6e9acedfa99b
Author: Andre Weissflog <[email protected]>
Date:   Sun Apr 11 00:29:23 2021 +0200

    sokol_app.h: fix a misplaced comment

commit 8af227f667f6834eb7e4d5c04db1bc9bb1c09a19
Author: Andre Weissflog <[email protected]>
Date:   Sat Apr 10 17:26:59 2021 +0200

    update sokol_app.h feature matrix and CHANGELOG

commit 54a5375fb1ac1d3a31aa6dfed60423a34cac4fa1
Author: Andre Weissflog <[email protected]>
Date:   Sat Apr 10 17:22:53 2021 +0200

    sokol_app.h: macOS icon support (dock icon), and bugfix in icon image candidate selection

commit 1f48e1a065194ea795a34142474cb3fca2fb327c
Author: Andre Weissflog <[email protected]>
Date:   Fri Apr 9 19:46:13 2021 +0200

    update README and CHANGELOG (window icon support)

commit 82e43b91117e2dcd44e997d67e264090fa70f423
Author: Andre Weissflog <[email protected]>
Date:   Fri Apr 9 19:06:32 2021 +0200

    sokol_app.h: replace _sapp_fail() with SOKOL_LOG in _sapp_image_validate()

commit 2c05e244e48a032676d22e2c1a33399b31a02f84
Author: Andre Weissflog <[email protected]>
Date:   Fri Apr 9 18:44:16 2021 +0200

    Window icon support for sokol_app.h (#509)

commit 91e7e83c96c0964f4eabf4a4f0d675984f57b379
Merge: e1058e1 d200b0f
Author: Andre Weissflog <[email protected]>
Date:   Fri Apr 9 12:47:14 2021 +0200

    Merge pull request #510 from garettbass/garett/update-sokol-nim

    Update sokol-nim and minor changes to gen_nim.py

commit d200b0ff6c393317f0c16b8844e103a5af2fd302
Author: Garett Bass <[email protected]>
Date:   Thu Apr 8 17:31:02 2021 -0700

    a few minor updates:
    * regenerated from sokol/master
    * src/ext renamed to src/nim
    * `Num` enum constants discarded

commit e1058e11ec1dfb799740bf822fb91274adadd16c
Author: Andre Weissflog <[email protected]>
Date:   Tue Apr 6 18:39:32 2021 +0200

    sokol_nuklear.h, sokol_imgui.h: cleanup no-sokol-app vs dummy-backend confusion

commit 8a01f6e498bd6364c352f0b45dbc9e3de1d48ded
Author: Andre Weissflog <[email protected]>
Date:   Tue Apr 6 18:12:57 2021 +0200

    sokol_nuklear.h: fix an unused warning with SOKOL_NUKLEAR_NO_SOKOL_APP

commit 0d955d75cd909d778d15e040fe7b8cbf857e6cc0
Author: Andre Weissflog <[email protected]>
Date:   Tue Apr 6 17:51:17 2021 +0200

    fix compilation with dummy backend in various util headers

commit 1d1ebc0ff2e7c090cc85db9d8dac541849f04fc6
Merge: c602d83 cbfd5f8
Author: Andre Weissflog <[email protected]>
Date:   Tue Apr 6 10:52:35 2021 +0200

    Merge pull request #505 from code-disaster/imgui-dummy-backend-build

    sokol_imgui.h: fix compile if built with SOKOL_DUMMY_BACKEND

commit cbfd5f8bcb9a47e6144de6ae7bc97bced468615f
Author: Daniel Ludwig <[email protected]>
Date:   Tue Apr 6 00:44:29 2021 +0200

    sokol_imgui.h: fix compile if built with SOKOL_DUMMY_BACKEND

commit c602d834ec14560653e6c86e3e41a0e620bda74e
Author: Andre Weissflog <[email protected]>
Date:   Thu Apr 1 20:27:24 2021 +0200

    update changelog and readme

commit 6183c725fe5c2aa4d930863773074f822b9a3888
Author: Andre Weissflog <[email protected]>
Date:   Thu Apr 1 20:02:42 2021 +0200

    sokol_app.h iOS: low- vs high-dpi fixes for Metal and GL.

    MTKView.contentScaleFactor seems to be ignored now, which means
    that rendering on iOS was always in HighDPI. Instead of relying
    on MTKView contentScaleFactor, the drawableSize is now set
    explicitly.

    When high_dpi is enabled, the dpi_scale factor is now queried
    from iOS (via UIScreen.mainScreen.nativeScale).

    MSAA is now supported for the iOS GL backend.

commit 1d747aaf56d73f6b27411bcdc8c270f9ba5ed83e
Author: Andre Weissflog <[email protected]>
Date:   Wed Mar 31 18:41:46 2021 +0200

    update changelog and readme

commit 101a606120cd4e72e5259fa080a8da2e481a0364
Author: Andre Weissflog <[email protected]>
Date:   Wed Mar 31 18:34:09 2021 +0200

    sokol_audio.h macOS: don't include macOS framework headers by default. (#501)

    * sokol_audio.h: optionally don't include AudioToolbox

    * sokol_audio.h: enable SAUDIO_OSX_USE_SYSTEM_HEADERS on iOS

commit 5349db0e76c70b551c5aa4b6b99eab66fba89d61
Merge: 52898ed 7b43936
Author: Andre Weissflog <[email protected]>
Date:   Wed Mar 31 17:37:13 2021 +0200

    Merge pull request #498 from garettbass/garett/update-gen_x.py

    Updated gen_nim.py and gen_zig.py

commit 52898ed656d7fa5290c8b1cab13d9752c45f59af
Author: Andre Weissflog <[email protected]>
Date:   Mon Mar 29 11:49:23 2021 +0200

    sokol_app.h: fix a comment typo

commit 7b43936769625bb1ed93204cd630d95d9dad5c14
Author: Garett Bass <[email protected]>
Date:   Sat Mar 27 16:44:45 2021 -0700

    fix Nim cstring argument type

commit 194bb42e9c367d845305610dfd34d7462d36c411
Author: Garett Bass <[email protected]>
Date:   Sat Mar 27 15:45:53 2021 -0700

    updated gen_x.py to use sokol_app.c, sokol_gfx.c, instead of sokol_app_gfx.c

commit 232bb096c615e2d2ce210c14d805956fbf9b6839
Author: Andre Weissflog <[email protected]>
Date:   Sat Mar 27 17:46:53 2021 +0100

    README: add a link to the manual build instructions in the sokol-samples README

commit 66393b6b581bdceb0715809472e1c1b6f8ef9cd0
Author: Andre Weissflog <[email protected]>
Date:   Sat Mar 27 17:43:08 2021 +0100

    sokol_app.h win32: call freopen_s() instead freopen() to silence deprecation warnings

commit ce1526a9213ebd50c5bf4ee3f2452d810df6b419
Author: Andre Weissflog <[email protected]>
Date:   Sat Mar 27 17:16:45 2021 +0100

    sokol_audio.h: add build instructions for building with MINGW gcc

commit 51330305f55b60bc5a95fa53d1b8e3441d3032db
Author: Andre Weissflog <[email protected]>
Date:   Sat Mar 27 17:16:10 2021 +0100

    sokol_app.h win32: include wchar.h (for wcslen), add build instructions for MINGW gcc

commit 40f980ae55e047f11959d5444ae5fdb205ff2088
Author: Andre Weissflog <[email protected]>
Date:   Sat Mar 27 16:40:13 2021 +0100

    sokol_audio.h: platform detection fixes

commit e4f778a25789df20c9ac7a06c693198c47df5b13
Author: Andre Weissflog <[email protected]>
Date:   Sat Mar 27 16:13:23 2021 +0100

    sokol_audio.h: clean up platform detection macros

commit d44328073d2316f73cec5a99b846593fadd51ba3
Author: Andre Weissflog <[email protected]>
Date:   Tue Mar 23 19:57:19 2021 +0100

    sokol_app.h macOS: temporarily out-comment event-polling

    See: https://github.com/floooh/sokol/pull/483#issuecomment-805148815

commit 31acf61cb0e1000e66ce55e9b60bf0b67fd9cac8
Author: Andre Weissflog <[email protected]>
Date:   Sat Mar 20 18:23:59 2021 +0100

    fix a changelog typo

commit 04718e6379fb5ab98039a2cca70f7c1bcdbe2f02
Merge: c5d55fa e1a3cd6
Author: Andre Weissflog <[email protected]>
Date:   Sat Mar 20 16:51:13 2021 +0100

    Merge pull request #495 from floooh/gl-loader

    Move Win32 GL loader from sokol_app.h to sokol_gfx.h.

commit e1a3cd6fa5b7d6f6dee6f9d958e1d432e05d6a8a
Author: Andre Weissflog <[email protected]>
Date:   Sat Mar 20 16:21:04 2021 +0100

    update readme and changelog

commit 49fd7bc66b451d06ddcc7121e05ba32985e0e826
Author: Andre Weissflog <[email protected]>
Date:   Sat Mar 20 15:32:25 2021 +0100

    sokol_gfx.h: replace SOKOL_WIN32_NO_GL_LOADER with SOKOL_EXTERNAL_GL_LOADER, plus some general defines cleanup

commit 4eb3b28aa0422662edb3045cca0949b6bfee9644
Author: Andre Weissflog <[email protected]>
Date:   Fri Mar 19 17:04:01 2021 +0100

    sokol_app.h linux: remove GL include

commit d623bfdf7a68528b367688bb0414febf5ad6fe73
Author: Andre Weissflog <[email protected]>
Date:   Fri Mar 19 16:53:43 2021 +0100

    sokol_app.h macOS,iOS,emscripten,Android: remove GL header includes

commit 1d72bbd596922e7d70cb5999ecd2d3e1ba78aabd
Author: Andre Weissflog <[email protected]>
Date:   Fri Mar 19 16:34:22 2021 +0100

    sokol_app.h, sokol_gfx.h: move Win32 GL loader from sokol_app.h to sokol_gfx.h

commit c5d55faa1036af9919bd28400e97d37548bb3789
Merge: 4c56a2e 3de9849
Author: Andre Weissflog <[email protected]>
Date:   Thu Mar 4 14:22:49 2021 +0100

    Merge pull request #489 from ikrima/fix-wrong-warn-disable

    fix: wrong disable of msvc warning based on comment and commit details

commit 3de984962fbba6ea20321ad928a1a48a808a31b8
Author: ikrima <[email protected]>
Date:   Thu Mar 4 02:07:11 2021 -0800

    fix: looks like incorrect warning disable based on comment and commit details

    C4202 => nonstandard extension used : '...': prototype parameter in name list illegal
      [https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4202?view=msvc-160]
    C4204 => VS2015: nonstandard extension used: non-constant aggregate initializer
      [https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4204?view=msvc-160]

commit 4c56a2ee15d81cac91b738bb7e740c964dc6bd56
Merge: 08a7b49 8694c54
Author: Andre Weissflog <[email protected]>
Date:   Sat Feb 27 13:39:57 2021 +0100

    Merge pull request #487 from garettbass/master

    ADDING: bindgen/gen_nim.py and related changes

commit 8694c54ba25ac6e5ebd153c9cd6826854eb3a175
Author: Garett Bass <[email protected]>
Date:   Fri Feb 26 09:03:30 2021 -0800

    remove old AttachConsole() etc from main/WinMain

commit eb99c0eeaced7c7ce6659dac75d8644fb2254378
Merge: 609900f 08a7b49
Author: Garett Bass <[email protected]>
Date:   Fri Feb 26 08:57:19 2021 -0800

    Merge branch 'master' of https://github.com/floooh/sokol

commit 08a7b497aa230750569b9ba16b5189659f0835d5
Author: Andre Weissflog <[email protected]>
Date:   Fri Feb 26 16:49:31 2021 +0100

    gen_zig.py: allow function arg-type overrides, allow ignored structs

commit 609900f2f0c183f9b27790ec1d2a74d3484d9d91
Author: Garett Bass <[email protected]>
Date:   Thu Feb 25 19:29:59 2021 -0800

    added nim support to bindgen

commit d84f79130dc6d13262f429e98fe9dc60b5320665
Merge: 9a880ce feab36e
Author: Garett Bass <[email protected]>
Date:   Thu Feb 25 19:00:05 2021 -0800

    Merge branch 'master' of https://github.com/floooh/sokol

commit feab36e67fde490bdd08d5e174f524b52aad5cd0
Author: Andre Weissflog <[email protected]>
Date:   Thu Feb 25 17:07:37 2021 +0100

    sokol_app.h macOS: use NSEventTrackingRunLoopMode for event polling

    See #486.

commit 4cd2da815a93faba4dd5368b23048ae528b63ddc
Author: Andre Weissflog <[email protected]>
Date:   Mon Feb 22 18:44:33 2021 +0100

    sokol_audio.h: ARC vs no-ARC fix for iOS

commit 08b7741d6d8685deff8ddbfded0ef607d5f7c074
Author: Andre Weissflog <[email protected]>
Date:   Mon Feb 22 18:23:19 2021 +0100

    remove the somewhat obsolete note at top of changelog

commit 7bcd5897078c71950b90b3180c7e9ece8a85310f
Author: Andre Weissflog <[email protected]>
Date:   Mon Feb 22 18:22:51 2021 +0100

    mention PR #483 in changelog and readme

commit c4ce7dd5521f7fc86f6304efecbdd9f266d7e9cc
Merge: 3cd3ea8 328b924
Author: Andre Weissflog <[email protected]>
Date:   Mon Feb 22 18:18:18 2021 +0100

    Merge branch 'randrew-app-mac-improve-input-latency'

commit 328b924a142807c17f5bb4d0760e4cc1ecfe27e1
Merge: 3cd3ea8 9ea9c48
Author: Andre Weissflog <[email protected]>
Date:   Mon Feb 22 17:59:18 2021 +0100

    Merge branch 'app-mac-improve-input-latency' of https://github.com/randrew/sokol into randrew-app-mac-improve-input-latency

commit 9ea9c481aab3aeac4e43906d048fdcf14da12d73
Author: cancel <[email protected]>
Date:   Fri Feb 19 23:34:21 2021 +0900

    Improve macOS mouse latency and stale positioning

    This commit makes several changes to input event handling in macOS:

    _sapp_macos_update_mouse() has been changed to take an NSEvent*
    argument, instead of no arguments. And instead of using [window
    mouseLocationOutsideOfEventStream] to get the position of the mouse, it
    uses event.locationInWindow. This seems to sometimes eliminate a frame
    of mouse latency.

    _sapp_macos_update_mouse() is no longer called immediately before
    rendering a frame. Instead, it's called at the beginning of each of the
    mouseMoved:, mouseDragged:, mouseDown:, etc. methods with its associated
    NSEvent*. Immediately after, _sapp_macos_mouse_event() is called. This
    eliminates a full frame of mouse latency. This also fixes situations
    where the mouse cursor's resting apparent position would lag behind its
    resting true position after the user stops moving the mouse.

    _sapp_macos_poll_input_events() has been added, which calls [NSApp
    nextEventMatchingMask: ...] to manually read and dispatch input events
    from the event queue. _sapp_macos_poll_input_events() is called
    immediately before _sapp_macos_frame(). This will sometimes catch and
    dispatch input events that occurred shortly before the frame is to be
    rendered, but hadn't yet been dispatched by other mechanisms. This
    occasionally eliminates a frame of latency, and improves the worst-case
    bounds. This seems to happen to 5% or fewer mouse events.

    [NSEvent setMouseCoalescingEnabled:NO], if it even still does anything,
    is now called once at during application startup instead of toggled off
    and on along with mouse lock.

commit 9a880ce42ed055cdacc9d117dad7d3ed02ea7d28
Author: Garett Bass <[email protected]>
Date:   Sat Feb 13 11:57:14 2021 -0800

    enable console output for SOKOL_WIN32_FORCE_MAIN

commit e4177472c8209d553135b7e61e2ccc87ec629449
Author: Garett Bass <[email protected]>
Date:   Sat Feb 13 11:48:29 2021 -0800

    enable console output in WinMain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants