Files
diviocity 579f1e6044 ui2 induced sokol gg improvements (#31051)
* parser, sokol.sapp: embed files on android, add the NativeActivity entry

parser:  only embedded its bytes for -prod, -os cross and
builds of V itself. Every other build re-read the file at runtime from
the compile-time paths (path/apath), which on android names locations on
the machine that compiled the app - the reload panic aborted the app at
startup. Embed on android like a portable cross snapshot does.

sokol.sapp: sokol_app.h's Android glue calls sokol_main() to get the
app's sapp_desc, and nothing on the V side provided it: V generates the
program entry as plain main(), the v1 compiler generated sokol_main only
with -apk, and the v3 driver accepts -apk as a no-op. Every android
sokol app died in dlopen with 'cannot locate symbol sokol_main'. The new
sokol_main_android glue runs main() and returns the sapp__g_desc the
module's sapp.run() recorded, which is the contract sapp_run's empty
stub implies.

* sokol.sapp: let X11 apps skip presenting frames they did not draw

sapp_set_present_on_demand(true) makes the X11 loop (EGL and GLX) present a
frame only when its frame callback called sapp_request_present(). The mode
is off by default, so existing apps keep presenting every frame. Backends
that cannot honor it, such as Wayland, Windows and macOS, return false and
keep presenting. UI2 uses it on Linux to stop repainting idle windows.

* modify thirdparty/sokol/sokol_app.h
2026-10-26 05:30:28 +03:00
..

floooh/sokol

Minimal cross-platform standalone C headers.

ZLib License

Copyright (c) 2018 Andre Weissflog

This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the
use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

    1. The origin of this software must not be misrepresented; you must not
    claim that you wrote the original software. If you use this software in a
    product, an acknowledgment in the product documentation would be
    appreciated but is not required.

    2. Altered source versions must be plainly marked as such, and must not
    be misrepresented as being the original software.

    3. This notice may not be removed or altered from any source
    distribution.