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
-
nothings' guide on how to write single-file libraries is informative if you want to write your own: https://github.com/nothings/stb/blob/master/docs/stb_howto.t...
comment by sxp · 2020-10-26 · in Single_file_libs: List of single-file C/C++ libraries -
I'd use something like Sean Barrett's stretchy buffer [1] instead. [1] https://github.com/nothings/stb/blob/master/stretchy_buffer....
comment by adrift · 2020-10-25 · in What's Wrong with C++ Templates? (2003) -
For me the best "package manager" are single header libraries like https://github.com/nothings/stb
comment by atesti · 2020-08-18 · in Best Package Manager for C -
▲ 3
Lessons learned about how to make a header-file library (2013)story by Tomte · 2020-05-20 · 0 comments
-
▲ 2
Stb single-file public domain libraries for C/C++story by typon · 2020-05-09 · 0 comments
-
…must be in there somewhere and would be easy to extract (or by adding another API function). https://github.com/nothings/stb/blob/master/stb_truetype.h PS: looks like it's here: https://github.com/nothings/stb/blob/f54acd4e13430c5122cab4c..…
comment by flohofwoe · 2020-04-21 · in Libschrift: A lightweight TrueType font rendering library -
…these linter errors that accumulated in compilers over the years, based on a quick glance at STB. https://github.com/nothings/stb/issues?q=warning (29 + 132.) / (156 + 794) It's a big obstacle to sharing C code with others. It'd be great…
comment by jart · 2020-04-15 · in Tell HN: C Experts Panel – Ask us anything about C -
A better resource is this: https://github.com/nothings/stb/blob/master/docs/stb_howto.t... There's an important difference between C++ style header-only libs, where the implementation is often done in inline code (especially for…
comment by flohofwoe · 2020-02-02 · in Show HN: A 2D game engine in under 1000 lines of C -
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++ -
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 -
…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...
comment by cellularmitosis · 2019-12-13 · in Httpserver.h: Single header library for writing non-blocking HTTP servers in C -
▲ 4
Lessons learned about how to make a header-file library (2013)story by Tomte · 2019-11-15 · 0 comments
-
…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 -
…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) -
stb_image is widely used in games https://github.com/nothings/stb/blob/master/stb_image.h
comment by bbmario · 2019-08-21 · in Libspng – C library for reading and writing PNG files -
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?
comment by anaphor · 2019-08-21 · in Libspng – C library for reading and writing PNG files -
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 -
…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
comment by rootlocus · 2019-06-24 · in Fast key-value stores: An idea whose time has come and gone -
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) -
▲ 1
Lessons learned about how to make a header-file library (2013)story by Tomte · 2019-04-16 · 0 comments
-
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.)
comment by bla3 · 2019-03-10 · in Single-file cross-platform C/C++ headers implementing self-contained libraries -
…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) -
▲ 2
Lessons learned about how to make a header-file library (2013)story by Tomte · 2018-12-01 · 0 comments
-
…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)
comment by flohofwoe · 2018-10-20 · in Mio – Cross-platform header-only C++11 library for memory-mapped file IO -
▲ 2
Lessons learned about how to make a header-file library (2013)story by Tomte · 2018-06-17 · 0 comments
-
…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 -
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…
comment by svdree · 2018-02-10 · in Nuklear: A single-header ANSI C GUI library -
▲ 1
STB: single-file public domain libraries for C/C++story by striking · 2018-01-13 · 0 comments
-
▲ 1
Lessons learned about how to make a header-file library (2013)story by Tomte · 2017-12-12 · 0 comments
-
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
comment by atesti · 2017-10-30 · in Firefox takes a bite out of the canvas ‘super cookie’ -
▲ 3
Stb – Single-file public domain libraries for C/C++story by foob · 2017-09-26 · 0 comments
-
…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 -
▲ 1
Lessons learned about how to make a header-file library (2013)story by Tomte · 2017-08-08 · 0 comments
-
…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 -
▲ 2
Lessons learned about how to make a header-file library (2013)story by Tomte · 2017-05-04 · 0 comments
-
these come to mind: https://github.com/nothings/stb https://github.com/nothings/single_file_libs
comment by iammyIP · 2017-02-06 · in Learn C Programming with Open-Source Books -
…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 -
…another set of similar libraries called the STB Libraries, primarily aimed at gamedev/graphicsdev: https://github.com/nothings/stb
comment by cobalt · 2016-12-17 · in Single-file C/C++ public-domain/open source libraries with minimal dependencies -
▲ 1
Lessons learned about how to make a header-file library (2013)story by Tomte · 2016-12-01 · 0 comments
-
You can get good subpixel rendering from a single bitmap using a larger prefiltered glyph: https://github.com/nothings/stb/tree/master/tests/oversample
comment by panic · 2016-08-03 · in Inside font-rs, a font renderer written in Rust -
…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) -
> 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
comment by n00b101 · 2016-05-24 · in Lessons learned about how to make a header-file library (2013) -
▲ 11
Lessons learned about how to make a header-file library (2013)story by Tomte · 2016-05-23 · 6 comments
-
…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 -
…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…
comment by hthh · 2016-05-01 · in Ask HN: What are examples of GitHub repositories with high code quality? -
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 -
Yes! https://github.com/nothings/stb#why-single-file-headers
comment by mmozeiko · 2016-04-19 · in Nuklear: A small ANSI C GUI toolkit -
…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++ -
…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
comment by chubot · 2016-01-23 · in Single-file public-domain/open source C libraries with minimal dependencies