• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..05-Feb-2020-

unicode/H05-Feb-2020-8977

README.footer.mdH A D05-Feb-20204.8 KiB12182

README.header.mdH A D05-Feb-2020657 2114

README.listH A D05-Feb-20202.2 KiB2322

build_matrix.cH A D05-Feb-20204.8 KiB138125

easy_font_maker.cH A D05-Feb-20205 KiB212181

make_readme.cH A D05-Feb-20202.5 KiB6557

make_readme.dspH A D05-Feb-20204 KiB9884

mr.batH A D05-Feb-202018 21

trailing_whitespace.cH A D05-Feb-2020790 3331

unicode.cH A D05-Feb-202021.3 KiB750606

README.footer.md

1
2FAQ
3---
4
5#### What's the license?
6
7These libraries are in the public domain. You can do anything you
8want with them. You have no legal obligation
9to do anything else, although I appreciate attribution.
10
11They are also licensed under the MIT open source license, if you have lawyers
12who are unhappy with public domain. Every source file includes an explicit
13dual-license for you to choose from.
14
15#### <a name="other_libs"></a> Are there other single-file public-domain/open source libraries with minimal dependencies out there?
16
17[Yes.](https://github.com/nothings/single_file_libs)
18
19#### If I wrap an stb library in a new library, does the new library have to be public domain/MIT?
20
21No, because it's public domain you can freely relicense it to whatever license your new
22library wants to be.
23
24#### What's the deal with SSE support in GCC-based compilers?
25
26stb_image will either use SSE2 (if you compile with -msse2) or
27will not use any SIMD at all, rather than trying to detect the
28processor at runtime and handle it correctly. As I understand it,
29the approved path in GCC for runtime-detection require
30you to use multiple source files, one for each CPU configuration.
31Because stb_image is a header-file library that compiles in only
32one source file, there's no approved way to build both an
33SSE-enabled and a non-SSE-enabled variation.
34
35While we've tried to work around it, we've had multiple issues over
36the years due to specific versions of gcc breaking what we're doing,
37so we've given up on it. See https://github.com/nothings/stb/issues/280
38and https://github.com/nothings/stb/issues/410 for examples.
39
40#### Some of these libraries seem redundant to existing open source libraries. Are they better somehow?
41
42Generally they're only better in that they're easier to integrate,
43easier to use, and easier to release (single file; good API; no
44attribution requirement). They may be less featureful, slower,
45and/or use more memory. If you're already using an equivalent
46library, there's probably no good reason to switch.
47
48#### Can I link directly to the table of stb libraries?
49
50You can use [this URL](https://github.com/nothings/stb#stb_libs) to link directly to that list.
51
52#### Why do you list "lines of code"? It's a terrible metric.
53
54Just to give you some idea of the internal complexity of the library,
55to help you manage your expectations, or to let you know what you're
56getting into. While not all the libraries are written in the same
57style, they're certainly similar styles, and so comparisons between
58the libraries are probably still meaningful.
59
60Note though that the lines do include both the implementation, the
61part that corresponds to a header file, and the documentation.
62
63#### Why single-file headers?
64
65Windows doesn't have standard directories where libraries
66live. That makes deploying libraries in Windows a lot more
67painful than open source developers on Unix-derivates generally
68realize. (It also makes library dependencies a lot worse in Windows.)
69
70There's also a common problem in Windows where a library was built
71against a different version of the runtime library, which causes
72link conflicts and confusion. Shipping the libs as headers means
73you normally just compile them straight into your project without
74making libraries, thus sidestepping that problem.
75
76Making them a single file makes it very easy to just
77drop them into a project that needs them. (Of course you can
78still put them in a proper shared library tree if you want.)
79
80Why not two files, one a header and one an implementation?
81The difference between 10 files and 9 files is not a big deal,
82but the difference between 2 files and 1 file is a big deal.
83You don't need to zip or tar the files up, you don't have to
84remember to attach *two* files, etc.
85
86#### Why "stb"? Is this something to do with Set-Top Boxes?
87
88No, they are just the initials for my name, Sean T. Barrett.
89This was not chosen out of egomania, but as a moderately sane
90way of namespacing the filenames and source function names.
91
92#### Will you add more image types to stb_image.h?
93
94No. As stb_image use has grown, it has become more important
95for us to focus on security of the codebase. Adding new image
96formats increases the amount of code we need to secure, so it
97is no longer worth adding new formats.
98
99#### Do you have any advice on how to create my own single-file library?
100
101Yes. https://github.com/nothings/stb/blob/master/docs/stb_howto.txt
102
103#### Why public domain?
104
105I prefer it over GPL, LGPL, BSD, zlib, etc. for many reasons.
106Some of them are listed here:
107https://github.com/nothings/stb/blob/master/docs/why_public_domain.md
108
109#### Why C?
110
111Primarily, because I use C, not C++. But it does also make it easier
112for other people to use them from other languages.
113
114#### Why not C99? stdint.h, declare-anywhere, etc.
115
116I still use MSVC 6 (1998) as my IDE because it has better human factors
117for me than later versions of MSVC.
118
119
120
121

README.header.md

1stb
2===
3
4single-file public domain (or MIT licensed) libraries for C/C++
5
6Noteworthy:
7
8* image loader: [stb_image.h](stb_image.h)
9* image writer: [stb_image_write.h](stb_image_write.h)
10* image resizer: [stb_image_resize.h](stb_image_resize.h)
11* font text rasterizer: [stb_truetype.h](stb_truetype.h)
12* typesafe containers: [stb_ds.h](stb_ds.h)
13
14Most libraries by stb, except: stb_dxt by Fabian "ryg" Giesen, stb_image_resize
15by Jorge L. "VinoBS" Rodriguez, and stb_sprintf by Jeff Roberts.
16
17<a name="stb_libs"></a>
18
19library    | lastest version | category | LoC | description
20--------------------- | ---- | -------- | --- | --------------------------------
21

README.list

1stb_vorbis.c                | audio            | decode ogg vorbis files from file/memory to float/16-bit signed output
2stb_image.h                 | graphics         | image loading/decoding from file/memory: JPG, PNG, TGA, BMP, PSD, GIF, HDR, PIC
3stb_truetype.h              | graphics         | parse, decode, and rasterize characters from truetype fonts
4stb_image_write.h           | graphics         | image writing to disk: PNG, TGA, BMP
5stb_image_resize.h          | graphics         | resize images larger/smaller with good quality
6stb_rect_pack.h             | graphics         | simple 2D rectangle packer with decent quality
7stb_ds.h                    | utility          | typesafe dynamic array and hash tables for C, will compile in C++
8stb_sprintf.h               | utility          | fast sprintf, snprintf for C/C++
9stretchy_buffer.h           | utility          | typesafe dynamic array for C (i.e. approximation to vector<>), doesn't compile as C++
10stb_textedit.h              | user interface   | guts of a text editor for games etc implementing them from scratch
11stb_voxel_render.h          | 3D graphics      | Minecraft-esque voxel rendering "engine" with many more features
12stb_dxt.h                   | 3D graphics      | Fabian "ryg" Giesen's real-time DXT compressor
13stb_perlin.h                | 3D graphics      | revised Perlin noise (3D input, 1D output)
14stb_easy_font.h             | 3D graphics      | quick-and-dirty easy-to-deploy bitmap font for printing frame rate, etc
15stb_tilemap_editor.h        | game dev         | embeddable tilemap editor
16stb_herringbone_wang_tile.h | game dev         | herringbone Wang tile map generator
17stb_c_lexer.h               | parsing          | simplify writing parsers for C-like languages
18stb_divide.h                | math             | more useful 32-bit modulus e.g. "euclidean divide"
19stb_connected_components.h  | misc             | incrementally compute reachability on grids
20stb.h                       | misc             | helper functions for C, mostly redundant in C++; basically author's personal stuff
21stb_leakcheck.h             | misc             | quick-and-dirty malloc/free leak-checking
22stb_include.h               | misc             | implement recursive #include support, particularly for GLSL
23