floooh/sokol-samples
View on GitHub ↗ ★ 810 C
Sample code for https://github.com/floooh/sokol
19 mentions on Hacker News by 3 people: 0 stories, 19 comments · first 2019-03-07 · latest 2026-09-30
20082026
-
…the data directly without filtering. The pixel shader is indeed quite complex compared to SDF: https://github.com/floooh/sokol-samples/blob/8afa83928ce1870...
comment by flohofwoe · 2026-09-30 · in SDF vs. MSDF vs. Slug: GPU Text Rendering -
…expected by the Slug shader (this stuff should better go into an offline asset pipeline tool): https://github.com/floooh/sokol-samples/blob/master/libs/slu... ...the actual text rendering code is also taking a couple of shortcuts, e.g. no…
comment by flohofwoe · 2026-09-30 · in SDF vs. MSDF vs. Slug: GPU Text Rendering -
…minimal it is. WASM demo: https://floooh.github.io/sokol-html5/sgl-microui-sapp.html Source code: https://github.com/floooh/sokol-samples/blob/master/sapp/sgl... The renderer backend is just a bunch of C functions you need to provide:…
comment by flohofwoe · 2026-06-17 · in MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C -
…the below ozz-animation sample) with the 'Dear Bindings' approach (using a custom 'ig' prefix)): https://github.com/floooh/sokol-samples/blob/d8429d701eb7a8c... Dear ImGui is a bit of an outlier for C++ libraries though, since it is…
comment by flohofwoe · 2026-03-24 · in Testing the Swift C compatibility with Raylib (+WASM) -
…As a quick example, this C99 code block has at least 4 features that don't work in C++: https://github.com/floooh/sokol-samples/blob/91bd8c6f9f52149... - taking the address of an adhoc-created struct in a function call - random array…
comment by flohofwoe · 2026-03-03 · in Why Objective-C -
…Have you used C99 designated init vs other languages? E.g. neither Rust, Zig nor C++20 can do this: https://github.com/floooh/sokol-samples/blob/51f5a694f614253... Odin gets really close but can't chain initializers (which is ok though):…
comment by flohofwoe · 2026-02-20 · in Defer available in gcc and clang -
…X11 apps via XWayland btw (just testing here via the sokol-samples with the sokol-gfx GL backend: https://github.com/floooh/sokol-samples , just another reason to not have a native Wayland backend but instead rely on the XWayland shim I…
comment by flohofwoe · 2026-01-26 · in Ask HN: DDD was a great debugger – what would a modern equivalent look like? -
…...C99 is still the 'benchmark' when it comes to struct initialization: https://github.com/floooh/sokol-samples/blob/29d5e9f4a56ae18...
comment by flohofwoe · 2025-08-11 · in Zig's Lovely Syntax -
…one isn't all that important, but the second is). E.g. the closest Zig equivalent to this C99 code: https://github.com/floooh/sokol-samples/blob/b3bc55c4411fa03... ...is this: https://github.com/floooh/sokol-zig/blob/a4b3c287fadd153a504...…
comment by flohofwoe · 2024-01-02 · in Zig cookbook: collection of simple Zig programs that demonstrate good practices -
There's a bunch here https://github.com/floooh/sokol-samples For example, the basic demo window: https://floooh.github.io/sokol-html5/imgui-sapp.html
comment by joeld42 · 2023-12-20 · in Dear ImGui: Graphical User Interface library for C++ -
…fairly straightforward to get Raylib running in the browser. I used @flohofwoe's HTML shell file ( https://github.com/floooh/sokol-samples/blob/master/webpage/... ). Compilation is something like: emcc -o target/pong.html -Wall -Wextra…
comment by rrampage · 2023-12-12 · in Building a Web Game in C -
…a special function pointer type), there would be no need for string literal shenanigans like this: https://github.com/floooh/sokol-samples/blob/3f10c1a0620cec9... (and shader compilation would happen during the regular build and would also…
comment by flohofwoe · 2023-04-28 · in Learn WebGPU -
…APIs. For instance check out this call to create a 3D-API pipeline-state-object in C99: https://github.com/floooh/sokol-samples/blob/ad9047e228a8441...
comment by flohofwoe · 2022-11-03 · in Next C compiler is a D compiler: Introducing DMD's ImportC -
…related items, but I consider the extra field name a feature, not something that should be hidden: https://github.com/floooh/sokol-samples/blob/bfb30ea00b5948f... (also note the 'inplace initialization' which follows the state struct…
comment by flohofwoe · 2021-08-01 · in Learning that you can use unions in C for grouping things into namespaces -
…be C++ files). Here's for example such an "implementation source file" example (using stb_image.h): https://github.com/floooh/sokol-samples/blob/master/libs/stb... ...or for a whole collection of related single-file libraries:…
comment by flohofwoe · 2021-02-22 · in Nuklear: A cross-platform GUI library in C -
…setup, initialize a struct and call the function taking a pointer to that struct all in one call: https://github.com/floooh/sokol-samples/blob/89f5825ab5d3690... The Win32 window system functions and D3D11 are actually very convenient to…
comment by flohofwoe · 2021-01-24 · in Making Win32 APIs More Accessible to More Languages -
…multiple implementations into the same source file and compile that into a library, for example: https://github.com/floooh/sokol-samples/blob/master/libs/sok... That's what I usually do for projects that don't just consist of a single…
comment by flohofwoe · 2020-10-26 · in Single_file_libs: List of single-file C/C++ libraries -
…is impossible to remember the correct declaration order in big "option bag" structs like this. [1] https://github.com/floooh/sokol-samples/blob/e0a93a21b17a663...
comment by flohofwoe · 2020-09-03 · in The problem with C -
…top of slim cross-platform headers with support for Windows, Linux, macOS, iOS, Android and WASM: https://github.com/floooh/sokol-samples/blob/0576ed914290a35... (this is from this demo which is 513 KBytes all in all:…
comment by flohofwoe · 2019-03-07 · in The rise of wgpu