Hacker GitHub

← All repos

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

Mentions per year 111 mentions · busiest year 2016 (15)
20082026
  1. Out of my personal go-to c++ libs, the only ones I missed are the stb libraries ( https://github.com/nothings/stb/ , in particular the image ones are very popular) and maybe ImGui, but that might be too niche. Also I would love to have a…
    comment by s9w · 2020-01-30 · in Awesome Modern C++
  2. https://github.com/nothings/stb/blob/master/stretchy_buffer.... Although I get you want an official standard library version, or a built in language feature.
    comment by Impossible · 2019-12-26 · in I love coding in C
  3. …It's actually a pretty clever trick, and it effectively behaves as a .h / .c pair of files. See https://github.com/nothings/stb/blob/master/docs/stb_howto.t...
  4. …file headers for graphics tasks, like loading images, resizing images, rendering font glyphs, etc: https://github.com/nothings/stb
    comment by planteen · 2019-10-28 · in SQLite is easy to compile
  5. …https://ourmachinery.com/post/physical-design/ Simple libs widely used in game dev circles: https://github.com/nothings/stb This one is a full game engine with tools made for educational purpose: https://www.raylib.com/ I do write games…
    comment by stephc_int13 · 2019-09-21 · in Why I Write Games in C (yes, C)
  6. stb_image is widely used in games https://github.com/nothings/stb/blob/master/stb_image.h
  7. How does this compare to something like https://github.com/nothings/stb/blob/master/stb_image.h ? Is it just that it has more features and can handle weird edge cases?
  8. Here's a rationale for this from an author of very popular many single-header libraries: https://github.com/nothings/stb#why-single-file-headers As to how to use from two separate translation units - you need to define…
    comment by mmozeiko · 2019-08-08 · in MPEG1 Single file C library
  9. …for "bytes" if you want channel resolution, or leaving integers if you have 32bit pixel depth. https://github.com/nothings/stb/blob/master/stb_image.h#L120 https://wiki.libsdl.org/SDL_Surface
  10. I'm thinking of examples like this: https://github.com/nothings/stb/blob/master/stb_image.h It's a complete image loader library in a single header. This header contains everything I need to use that library: the entire documentation, the…
    comment by flohofwoe · 2019-05-27 · in Syntax highlighters are wrong (2014)
  11. https://github.com/nothings/stb is another set of good header only libraries. (I'm not the author and don't know them, I'm just a happy user.)
  12. …ttps://github.com/NotCamelCase/RasterizationInOneWeekend 4: http://www.scratchapixel.com/index.php 5: https://github.com/nothings/stb/blob/master/stb_truetype.h 6: https://beej.us/guide/bgnet/ 7: https://github.com/search?q=http+parser&ref=…
    comment by emmanueloga_ · 2018-12-12 · in Let’s build a browser engine (2014)
  13. …advantages as unity-builds (merging all sources into one file). PS: origin of the name "stb-style": https://github.com/nothings/stb (although I guess the general idea existed before)
  14. …of annoying that tables which are treated like arrays are 1-indexed by convention, though. [1]: https://github.com/nothings/stb
    comment by leggomylibro · 2018-09-12 · in Tables
  15. …so you can have generic containers in C. For hash's, you can also look at klib's khash [5] [1] https://github.com/nothings/stb [2] https://github.com/attractivechaos/klib [3] https://github.com/nothings/stb/blob/master/stretchy_buffer....…
    comment by dottrap · 2018-06-03 · in One year of C
  16. Sean Barrett (who I think popularized the idea) has a FAQ on this ( https://github.com/nothings/stb ) where he justifies it by pointing at difficulties with deploying libraries on Windows. Which is a fair point, but by going straight to…
  17. If you need a minimalist open-source font rendering library, look at stb_truetype: https://github.com/nothings/stb A single header file. Unfortunately it cannot do what harfbuzz or pango do, that is lay out complex scripts or do any layout
  18. …are the stb header-only libraries. There is a hash table implementation buried inside stb.h [4] https://github.com/nothings/stb
    comment by dottrap · 2017-08-23 · in Write a hash table in C
  19. …WebAssembly. There is a growing trend of header-only libraries, especially the popular stb: https://github.com/nothings/stb#stb_libs and there is a growing list here: https://github.com/nothings/single_file_libs I consult to find tiny…
    comment by satoshinm · 2017-06-02 · in WebAssembly: Mozilla Won
  20. these come to mind: https://github.com/nothings/stb https://github.com/nothings/single_file_libs
  21. …for redistributing libraries, but I've also found it useful to create these in my own projects. [0] https://github.com/nothings/stb
    comment by saticmotion · 2016-12-23 · in Building and Linking Libraries in C
  22. …another set of similar libraries called the STB Libraries, primarily aimed at gamedev/graphicsdev: https://github.com/nothings/stb
  23. You can get good subpixel rendering from a single bitmap using a larger prefiltered glyph: https://github.com/nothings/stb/tree/master/tests/oversample
  24. …is a link to it on the wiki page. The change that I am most fond of is making it an stb-style ( https://github.com/nothings/stb/ ) header library.
    comment by networked · 2016-07-03 · in The Tcl War (1994)
  25. > stb_image.h For the record, this library is a single file with 6,755 (!) lines of code [1] [1] https://github.com/nothings/stb/blob/master/stb_image.h
  26. …libs is probably the famous stb package [2]. - [1] https://bitbucket.org/rmitton/tigr/src - [2] https://github.com/nothings/stb
    comment by dmytroi · 2016-05-05 · in OS X app in plain C
  27. …They are small self-contained decoders for many common media formats, with excellent documentation: https://github.com/nothings/stb/blob/master/stb_image.h https://github.com/nothings/stb/blob/master/stb_truetype.h…
  28. Sean Barrett (of stb headers fame) has written about the reasons for header-only libraries here: https://github.com/nothings/stb/blob/master/docs/stb_howto.t... If compile-time is a concern (it isn't in my experience, at least if the rest…
    comment by flohofwoe · 2016-04-19 · in Nuklear: A small ANSI C GUI toolkit
  29. Yes! https://github.com/nothings/stb#why-single-file-headers
    comment by mmozeiko · 2016-04-19 · in Nuklear: A small ANSI C GUI toolkit
  30. …that comes to my head: For common utilities for game development stb libraries are fantastic: https://github.com/nothings/stb For general idea how to structure code you could google "data oriented design c++". Try not to structure your…
    comment by fsloth · 2016-02-01 · in Why I'm Choosing C++
  31. …can handle (similar to sqlite)? Because writing trivial scripts on Windows is also a pain? [1] https://github.com/nothings/stb [2] https://github.com/nothings/stb/blob/master/stb_c_lexer.h
  32. There is also STB stretchy buffer, popular with game devs. https://github.com/nothings/stb/blob/master/stretchy_buffer....
    comment by dottrap · 2016-01-09 · in Why I Write Games in C
  33. …not be to all tastes, but there you go. (Here's another option, that's more like the link here: https://github.com/nothings/stb/blob/master/stretchy_buffer.... - note note about strict aliasing, which I imagine could apply to the list…
  34. …are after small code, you can take zlib decode functionality from stb_image.h code (public domain): https://github.com/nothings/stb/blob/master/stb_image.h#L345...
  35. …You don't need to zip or tar the files up, you don't have to remember to attach two files, etc. https://github.com/nothings/stb/
  36. …://github.com/ValveSoftware/vogl/tree/master/src/voglco... And of course already mentioned stb_image: https://github.com/nothings/stb/blob/master/stb_image.h
  37. I'm reminded of stb_image... https://github.com/nothings/stb/blob/master/stb_image.h
  38. …(i'd call them libraries, but almost all are written to be used as a single-header file include): https://github.com/nothings/stb
    comment by binarycrusader · 2014-09-28 · in Opus beats all other lossy audio codecs. Again
  39. …asset loading: http://assimp.sourceforge.net/index.html - the STB headers (not OpenGL specific): https://github.com/nothings/stb - GLFW as window system glue and input wrapper - ...and more which I am not aware of or forgot to list GPU…
    comment by flohofwoe · 2014-09-21 · in OpenGL in 2014