sokol-d 0.4.0
D bindings for sokol
To use this package, run the following command in your project's root directory:
						Manual usage
						
						Put the following dependency into your project's dependences section:
					
Auto-generated D bindings for the sokol headers.
Targets
By default, the backend 3D API will be selected based on the target platform:
- macOS: Metal
 - Windows: D3D11
 - Linux: GL/Wayland
 - Wasm (LDC2 required) - WebGL2/WebGPU support
 
Usage - template project
dub init -t sokol-d <project-name>
Build Requirements
- D Compiler (DMD/LDC2/GDC) v2.111.0 or higher
 - C/C++ compiler (GCC/Clang/MSVC)
 - Linux dependencies: libglu1-mesa-dev, mesa-common-dev, xorg-dev, libasound-dev (for X11/Wayland, GL and ALSA development)
 
Available Examples
- blend
 - bufferoffsets
 - clear
 - cube
 - debugtext
 - droptest
 - imgui
 - instancing
 - instancingcompute
 - saudio
 - sglcontext
 - sglpoints
 - triangle
 
See examples
All Configurations
dub build --print-configs    
Available configurations:
    sokol-static [default]   # Static library build
    sokol-shared             # Shared/dynamic library build
    sokol-wayland-static     # Wayland static build for Linux
    sokol-wayland-shared     # Wayland shared build for Linux
    imgui-static             # Sokol + Dear ImGui static build
    imgui-shared             # Sokol + Dear ImGui shared build  
    imgui-wgles3             # Sokol + Dear ImGui WebGL ES3 build
    imgui-wgpu               # Sokol + Dear ImGui WebGPU build
    sokol-wgles3             # WebGL ES3 build
    sokol-wgpu               # WebGPU build
    nuklear-static           # Sokol + Nuklear static build
    nuklear-shared           # Sokol + Nuklear shared build  
    nuklear-wgles3           # Sokol + Nuklear WebGL ES3 build
    nuklear-wgpu             # Sokol + Nuklear WebGPU build
    genshaders               # [re]Generate shader code
Additional Build Options
Library Types
- Static library: 
dub build -c sokol-static - Shared library: 
dub build -c sokol-shared 
Linux Display Server
- X11 (default with static): 
dub build -c sokol-static - Wayland static: 
dub build -c sokol-wayland-static - Wayland shared: 
dub build -c sokol-wayland-shared 
Build Modes
Available for all configurations:
- Debug: 
-b debug - Release: 
-b release - Release (no bounds checking): 
-b release-nobounds - Release (better C): 
-b release-betterc 
Shaders
Checkout sokol-tools for a sokol shader pipeline! It supports these D bindings and all shaders in the examples folder
here have been compiled using it with -f sokol_d!
dub build -c genshaders
License and attributions
This code is released under the zlib license (see LICENSE for info). Parts of gen_d.py have been copied and modified from
the zig-bindings[^1] and rust-bindings[^2] for sokol.
The sokol headers are created by Andre Weissflog (floooh) and sokol is released under its own license[^3].
- 0.4.0 released 2 months ago
 - floooh/sokol-d
 - Zlib
 
- Authors:
 - Sub packages:
 - sokol-d:init-exec
 - Dependencies:
 - none
 - Versions:
 - 
						
Show all 23 versions0.4.0 2025-Sep-28 0.3.9 2025-Sep-10 0.3.8 2025-Aug-23 0.3.7 2025-Jul-14 0.3.6 2025-Jul-06  - Download Stats:
 - 
						
- 
								
0 downloads today
 - 
								
1 downloads this week
 - 
								
27 downloads this month
 - 
								
133 downloads total
 
 - 
								
 - Score:
 - 1.8
 - Short URL:
 - sokol-d.dub.pm