RepositoryC
NO

nothings/stb

stb single-file public domain libraries for C/C++

35.1ksao
8.1kfork
13issue
0lượt xem

📚 One Header, Many Uses: The stb Libraries

A curated set of single-file, public-domain C/C++ libraries covering graphics, audio, math, and utility tasks.

stb is a GitHub project by Sean Barrett (nothings) offering 21 lightweight, self-contained libraries for C/C++. Each library lives in a single file, making integration trivial — just drop the file into your project and define the implementation macro when needed. It covers image loading/decoding, audio decoding (Ogg Vorbis), font rasterization, dynamic arrays, snprintf, text editing, and even voxel rendering.

✨ Highlights

  • Image loading: stb_image.h supports JPG, PNG, TGA, BMP, PSD, GIF, HDR, and PIC formats.
  • Image writing: stb_image_write.h writes PNG, TGA, and BMP files to disk.
  • Image resizing: stb_image_resize2.h resizes images with high-quality filtering.
  • Font rasterization: stb_truetype.h parses and renders TrueType fonts.
  • Typesafe containers: stb_ds.h provides dynamic arrays and hash tables for C/C++.
  • Fast formatting: stb_sprintf.h offers a fast, robust implementation of sprintf/snprintf.
  • Audio decoding: stb_vorbis.c decodes Ogg Vorbis files from memory or file input.
  • Text editing: stb_textedit.h provides core text editing functionality for custom UIs.

💡 Why it matters

stb libraries are designed for simplicity and portability. They require no external dependencies and compile cleanly across platforms. Their single-file nature makes them ideal for embedding in games, tools, or any project where minimizing build complexity is key. While not optimized for every edge case, they provide solid, readable implementations that are easy to audit and modify.

Notably, the project carries a security advisory: bugs may be discussed publicly before fixes are merged, so evaluate risk accordingly.


#C #GameDev #Graphics #OpenSource #TiniX