nothings/stb
View on GitHub ↗ ★ 34,927 C
stb single-file public domain libraries for C/C++
111 mentions on Hacker News by 78 people: 22 stories, 89 comments · first 2014-09-21 · latest 2026-08-10
20082026
-
…for inlining; whether the compiler actually decides to inline them is a different story. [1]: https://github.com/nothings/stb
comment by wren6991 · 2026-08-10 · in Picophysics: Single file physics for games on platforms like N64, PSX, DC -
…in game development, is known among other things for still using visual c++ 6. [1] [0] https://github.com/nothings/stb [1] https://m.youtube.com/watch?v=nQrzB5P5NPE
comment by justin66 · 2026-05-29 · in Let's compile Quake like it's 1997 -
you may try https://github.com/nothings/stb/blob/master/stb_ds.h . a single header implementation for both dynamic array and string based hash table
comment by alaaalawi · 2026-05-24 · in PHP's Oddities -
…benefit from it too, Sean "nothings" Barrett said that's the primary reason for his STB libraries. https://github.com/nothings/stb
comment by throwaway2027 · 2026-03-13 · in John Carmack about open source and anti-AI activists -
…single header with `#define CANVAS_ITY_IMPLEMENTATION`? I was inspired by the STB header ibraries ( https://github.com/nothings/stb ) and by libraries inspired by those, all of which I've found very convenient. In particular, I like their…
comment by a_e_k · 2026-02-22 · in Canvas_ity: A tiny, single-header <canvas>-like 2D rasterizer for C++ -
You mean single file header only libraries. STB are the initials of the author of https://github.com/nothings/stb
comment by compressedgas · 2025-12-27 · in Ask HN: STB libraries make your work easier or you makes no difference? -
▲ 3
Stb: Single-file public domain libraries for C/C++story by pykello · 2025-09-28 · 0 comments
-
…only libraries" can be exceptions to C code not being in header files. See STB as an example https://github.com/nothings/stb . The advantage theoretically is that you can #include this library and use its code and types from just one file,…
comment by zoezoezoezoe · 2025-09-11 · in Show HN: I built a minimal Forth-like stack interpreter library in C -
…errors and why this is desirable. Look into stb lib, which in my opinion popularized this idea: https://github.com/nothings/stb?tab=readme-ov-file#how-do-i-...
comment by cornstalks · 2025-07-23 · in Show HN: Header-only GIF decoder in pure C – no malloc, easy to use -
…other languages like JS and NPM? Maybe carefully choosing which dependencies you include is better? https://github.com/nothings/stb/blob/master/stb_truetype.h#L...
comment by r1chardnl · 2025-04-23 · in Understand Your Dependencies -
…used pretty widely across game development codebases. and it supports a ton of different formats. https://github.com/nothings/stb
comment by toastie_toastie · 2025-03-12 · in Fast-PNG: PNG image decoder and encoder -
Also relevant and useful single-file public domain libraries for C/C++ https://github.com/nothings/stb
comment by s5ma6n · 2025-02-08 · in Collection of one-file C/C++ libraries with no dependencies, primarily for games -
Nice, I didn’t know stb had a rect packer: https://github.com/nothings/stb/blob/master/stb_rect_pack.h
comment by alex_suzuki · 2024-11-18 · in The Skyline algorithm for packing 2D rectangles -
▲ 3
Ask HN: Has Anyone Tried Single File Development with IDE Code Collapse?story by Decabytes · 2024-11-01 · 3 comments
-
…the compress/decompress functionality can be make standard [1] https://github.com/SpartanJ/efsw [2] https://github.com/nothings/stb [3] https://github.com/jkuhlmann/cgltf [4] https://github.com/ocornut/imgui
comment by alexvitkov · 2024-09-26 · in Rewriting Rust -
▲ 1
Lessons learned about how to make a header-file library (2013)story by Tomte · 2024-02-28 · 0 comments
-
…libraries I've used for game development - all in C/C++ - that you can piece together: General: stb https://github.com/nothings/stb 2D Phys: box2d https://box2d.org/ UI / Editor: imgui https://github.com/ocornut/imgui Platform: SDL…
comment by bellgrove · 2024-01-09 · in Nebula is an open-source and free-to-use modern C++ game engine -
…of the implementation block in stb_image.h, above that is just "cheap" public API declarations: https://github.com/nothings/stb/blob/f4a71b13373436a2866c5d6...
comment by flohofwoe · 2024-01-07 · in STB: Single-file public domain libraries for C/C++ -
▲ 85
STB: Single-file public domain libraries for C/C++story by seansh · 2024-01-06 · 35 comments
-
…used in Dear ImGUI). [1] https://handmade.network/forums/articles/t/7330-implementing... . [2] https://github.com/nothings/stb/blob/master/stb_truetype.h
comment by signaru · 2024-01-01 · in Writing a TrueType font renderer -
…will outperform the fancy new bindless rendering. Some open source starting points for packing: https://github.com/nothings/stb/blob/master/stb_rect_pack.h https://github.com/ands/trianglepacker
comment by animatethrow · 2023-11-13 · in Capturing the WebGPU Ecosystem -
The STB headers are mostly built like that: https://github.com/nothings/stb Dear ImGui is a C++ example: https://github.com/ocornut/imgui You could also add an optional 'convenience layer' over the lower-level flexible-but-inconvenient…
comment by flohofwoe · 2023-09-24 · in Www which WASM works -
My stuff for instance: https://github.com/floooh/sokol ...inspired by: https://github.com/nothings/stb (here's how the sokol headers are integrated into a Zig project, note that there is only a build.zig which builds everything:…
comment by flohofwoe · 2023-06-30 · in File for divorce from LLVM -
…up in the weeds with nothing to show for it but a tilemap class you've rewritten a dozen times. [0] https://github.com/nothings/stb
comment by krapp · 2023-05-14 · in Ask HN: Best stack to make a 2D game in 2023 -
…for the stuff I’ve made, when I have I just called stuff on the `Math` object in javascript. [1] https://github.com/nothings/stb/blob/master/stb_sprintf.h
comment by david2ndaccount · 2023-04-13 · in Switching to C over 'Modern' Programming Languages -
The guy who developed stb_image writes all his software on Visual C++ 6 from 1998 https://github.com/nothings/stb > Why not C99? stdint.h, declare-anywhere, etc. > I still use MSVC 6 (1998) as my IDE because it has better human factors for…
comment by shortrounddev · 2023-04-05 · in My long goodbye to Windows XP (2022) -
…for high performance tools when neither things like BMPs or things like PNG would suffice. [0] https://github.com/nothings/stb [1] https://github.com/richgel999/fpng/blob/main/src/fpng.cpp [2] https://github.com/jibsen/tinf/tree/master/src
comment by SideQuark · 2023-01-19 · in Hello, PNG -
The most popular "header only" (or rather "single file" libs) are mostly written in C though: https://github.com/nothings/stb Important difference to typical C++ header-only libs: STB style libs don't use the inline keyword, but instead…
comment by flohofwoe · 2022-10-13 · in Tinyphysicsengine: Minimalist 3D C99 single-header physics engine -
…as a single translation unit, e.g., a single .c file). Here is but one famous collection of them: https://github.com/nothings/stb
comment by dundarious · 2022-09-22 · in Olive.c: a simple graphics library that does not have any dependencies -
That’s not the case, if you take a bit of care. Look at STB for example ( https://github.com/nothings/stb ) -- I’ve successfully used STB functions on a bunch of different platforms. In both C and C++, even!
comment by iainmerrick · 2022-07-23 · in Embed is in C23 -
Even so, github does have a ton of very very popular C libraries(like https://github.com/nothings/stb ). I was bringing up the OS provided ones since they claimed not to be able to find any. My main point is that it is patently absurd to…
comment by melissalobos · 2022-04-20 · in C Is Still Everywhere -
…and is probably influenced by the popular stb libraries[2]. [1] Actually a token stream. [2] https://github.com/nothings/stb
comment by mananaysiempre · 2022-04-02 · in QOI – The Quite OK Image Format -
▲ 2
Lessons learned about how to make a header-file library (2013)story by Tomte · 2022-03-07 · 0 comments
-
…header file libraries that are larger and are very useful. Perfect example is the stb libraries: https://github.com/nothings/stb very widely used in the C / C++ community.
comment by chutsu · 2022-02-13 · in CJSON – Ultralightweight JSON parser in ANSI C -
…I was on the fence between doing .c/.h pair and a single .h. But finally took the inspiration from: https://github.com/nothings/stb .
comment by krychu · 2022-01-05 · in Wave Function Collapse library in pure C -
…://en.wikipedia.org/wiki/Wavefront_.obj_file [2] https://en.wikipedia.org/wiki/Netpbm#PPM_example [3] https://github.com/nothings/stb [4] https://github.com/ssloy/tinyraycaster/wiki/Part-4:-SDL [5] https://lazyfoo.net/tutorials/SDL/index.ph…
comment by pfranz · 2022-01-01 · in Finding your home in game graphics programming -
…this means. Can you give an example? Is this being used in the above library? > PS: but also see: https://github.com/nothings/stb#why-single-file-headers OK, that only offers this explanation: > Why not two files, one a header and one an…
comment by sltkr · 2021-11-24 · in QOI: Lossless Image Compression in O(n) Time -
…the extension header implementation after the base library implementation. PS: but also see: https://github.com/nothings/stb#why-single-file-headers
comment by flohofwoe · 2021-11-24 · in QOI: Lossless Image Compression in O(n) Time -
…the entire library in a header file is a somewhat recent and much welcome trend. See for example: https://github.com/nothings/stb https://github.com/nothings/single_file_libs
comment by ur-whale · 2021-11-24 · in QOI: Lossless Image Compression in O(n) Time -
…libraries [2]. [1]: https://wiki.alopex.li/LetsBeRealAboutDependencies#gotta-go-... [2]: https://github.com/nothings/stb/blob/master/docs/stb_howto.t...
comment by notriddle · 2021-11-18 · in Backdooring Rust crates for fun and profit -
…for PNG via stb_image_write [1]. [0] https://en.wikipedia.org/wiki/Netpbm#PAM_graphics_format [1] https://github.com/nothings/stb/blob/master/stb_image_write....
comment by a_e_k · 2021-11-11 · in Image file formats that didn’t make it -
▲ 2
Lessons learned about how to make a header-file library (2013)story by Tomte · 2021-07-07 · 0 comments
-
…there's a reliance on constant-time algorithms, which this may not be well-suited to, however. [1] https://github.com/nothings/stb
comment by andrewla · 2021-04-06 · in Wuffs’ PNG image decoder -
…[1], and, like you, I am always on the lookout for new things to add to the collection :) [0] https://github.com/nothings/stb [1] https://github.com/nothings/single_file_libs
comment by _dps · 2021-03-21 · in ZPL: (Almost) C99 Powerkit -
For the general reasons. https://github.com/nothings/stb#why-single-file-headers
comment by bmn__ · 2021-02-22 · in Nuklear: A cross-platform GUI library in C -
Stretch Buffers in the stb header-only library: https://github.com/nothings/stb/blob/master/stretchy_buffer.... This basically allows you to use std::vector<T> like vectors in C, but with an added benefit that you can subscript the vector…
comment by logimame · 2020-11-22 · in What is your favorite C programming trick? (2009) -
There is now a big fat disclaimer at the top of the file saying basically the same thing: https://github.com/nothings/stb/blob/master/stb_truetype.h#L...
comment by sherincall · 2020-10-26 · in Single_file_libs: List of single-file C/C++ libraries -
…libs was actually that Windows doesn't have a default place where dependencies are installed: https://github.com/nothings/stb#why-single-file-headers
comment by flohofwoe · 2020-10-26 · in Single_file_libs: List of single-file C/C++ libraries -
…in this discussion, he has a good overview for how to create a robust single header library: https://github.com/nothings/stb/blob/master/docs/stb_howto.t... If you can offer some good arguments against those, instead of generic dogma, then…
comment by mariusor · 2020-10-26 · in Single_file_libs: List of single-file C/C++ libraries -
…define in exactly one place, like the list maintainer does in his own single header libraries: https://github.com/nothings/stb/blob/b42009b3b9d4ca35bc703f5...
comment by rsaarelm · 2020-10-26 · in Single_file_libs: List of single-file C/C++ libraries