diff options
| author | Andre Weissflog <floooh@gmail.com> | 2025-06-15 13:52:21 +0200 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2025-06-15 13:52:21 +0200 |
| commit | 8e1ca354f018a8534458edcd6c4c82d7be4fb05d (patch) | |
| tree | 9b381373e1ab86b1eb53d8a5a150de3c603a8e94 | |
| parent | 127c93404f4e230add5890accf2ae12a753cc8f6 (diff) | |
sokol_gfx.h, sokol_app.h: update build instructions
| -rw-r--r-- | sokol_app.h | 8 | ||||
| -rw-r--r-- | sokol_gfx.h | 20 |
2 files changed, 27 insertions, 1 deletions
diff --git a/sokol_app.h b/sokol_app.h index 3a582150..2131e41e 100644 --- a/sokol_app.h +++ b/sokol_app.h @@ -30,7 +30,8 @@ SOKOL_ASSERT(c) - your own assert macro (default: assert(c)) SOKOL_UNREACHABLE() - a guard macro for unreachable code (default: assert(false)) SOKOL_WIN32_FORCE_MAIN - define this on Win32 to add a main() entry point - SOKOL_WIN32_FORCE_WINMAIN - define this on Win32 to add a WinMain() entry point (enabled by default unless SOKOL_WIN32_FORCE_MAIN or SOKOL_NO_ENTRY is defined) + SOKOL_WIN32_FORCE_WINMAIN - define this on Win32 to add a WinMain() entry point (enabled by default unless + SOKOL_WIN32_FORCE_MAIN or SOKOL_NO_ENTRY is defined) SOKOL_NO_ENTRY - define this if sokol_app.h shouldn't "hijack" the main() function SOKOL_APP_API_DECL - public function declaration prefix (default: extern) SOKOL_API_DECL - same as SOKOL_APP_API_DECL @@ -82,6 +83,11 @@ On macOS and iOS, the implementation must be compiled as Objective-C. + On Emscripten: + - for WebGL2: add the linker option `-s USE_WEBGL2=1` + - for WebGPU: compile and link with `--use-port=emdawnwebgpu` + (for more exotic situations, read: https://dawn.googlesource.com/dawn/+/refs/heads/main/src/emdawnwebgpu/pkg/README.md) + FEATURE OVERVIEW ================ sokol_app.h provides a minimalistic cross-platform API which diff --git a/sokol_gfx.h b/sokol_gfx.h index 2518739f..36df0411 100644 --- a/sokol_gfx.h +++ b/sokol_gfx.h @@ -66,6 +66,26 @@ SOKOL_DEBUG - by default this is defined if _DEBUG is defined + Link with the following system libraries (note that sokol_app.h has + additional linker requirements): + + - on macOS/iOS with Metal: Metal + - on macOS with GL: OpenGL + - on iOS with GL: OpenGLES + - on Linux with EGL: GL or GLESv2 + - on Linux with GLX: GL + - on Android: GLESv3, log, android + - on Windows with the MSVC or Clang toolchains: no action needed, libs are defined in-source via pragma-comment-lib + - on Windows with MINGW/MSYS2 gcc: compile with '-mwin32' so that _WIN32 is defined + - with the D3D11 backend: -ld3d11 + + On macOS and iOS, the implementation must be compiled as Objective-C. + + On Emscripten: + - for WebGL2: add the linker option `-s USE_WEBGL2=1` + - for WebGPU: compile and link with `--use-port=emdawnwebgpu` + (for more exotic situations, read: https://dawn.googlesource.com/dawn/+/refs/heads/main/src/emdawnwebgpu/pkg/README.md) + sokol_gfx DOES NOT: =================== - create a window, swapchain or the 3D-API context/device, you must do this |