diff options
| author | Andre Weissflog <floooh@gmail.com> | 2020-01-10 14:21:52 +0100 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2020-01-10 14:22:08 +0100 |
| commit | 1e0de43e94fb2799894efc3ff4b09cd35c1cda8c (patch) | |
| tree | 75cebddec8a07ab938f9d43ddf1e0a70b456e35e | |
| parent | 5876cf6772f77acebe3b2940b8a5b69348f084e6 (diff) | |
sokol_app.h: add doc note about calling 3D API funcs in event handler callback
fixed #244
| -rw-r--r-- | sokol_app.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/sokol_app.h b/sokol_app.h index 69ead13b..6743c739 100644 --- a/sokol_app.h +++ b/sokol_app.h @@ -61,7 +61,7 @@ - creates a window and 3D-API context/device with a 'default framebuffer' - makes the rendered frame visible - provides keyboard-, mouse- and low-level touch-events - - platforms: MacOS, iOS, HTML5, Win32, Linux, Android (RaspberryPi) + - platforms: MacOS, iOS, HTML5, Win32, Linux, Android (TODO: RaspberryPi) - 3D-APIs: Metal, D3D11, GL3.2, GLES2, GLES3, WebGL, WebGL2 FEATURE/PLATFORM MATRIX @@ -106,7 +106,6 @@ TODO ==== - Linux clipboard support - - document sapp_consume_event() - sapp_consume_event() on non-web platforms? STEP BY STEP @@ -272,6 +271,21 @@ - the application window was resized, iconified or restored - the application was suspended or restored (on mobile platforms) - the user or application code has asked to quit the application + - a string was pasted to the system clipboard + + To explicitely 'consume' an event and prevent that the event is + forwarded for further handling to the operating system, call + sapp_consume_event() from inside the event handler (NOTE that + this behaviour is currently only implemented for some HTML5 + events, support for other platforms and event types will + be added as needed, please open a github ticket and/or provide + a PR if needed). + + NOTE: Do *not* call any 3D API functions in the event callback + function, since the 3D API context may not be active when the + event callback is called (it may work on some platforms and + 3D APIs, but not others, and the exact behaviour may change + between sokol-app versions). --- Implement the cleanup-callback function, this is called once after the user quits the application (see the section |