Hacker GitHub

← All repos

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

Mentions per year 19 mentions · busiest year 2026 (7)
20082026
  1. …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
  2. …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
  3. …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:…
  4. …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…
  5. …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
  6. …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
  7. …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…
  8. …...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
  9. …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...…
  10. 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
  11. …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
  12. …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
  13. …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...
  14. …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…
  15. …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
  16. …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…
  17. …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…
  18. …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
  19. …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