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

..04-May-2019-

unicode/H04-May-2019-8977

README.footer.mdH A D04-May-20194.9 KiB12283

README.header.mdH A D04-May-2019386 127

README.listH A D04-May-20192.1 KiB2221

easy_font_maker.cH A D04-May-20195 KiB212181

make_readme.cH A D04-May-20192.5 KiB6557

make_readme.dspH A D04-May-20194 KiB9884

mr.batH A D04-May-201918 21

unicode.cH A D04-May-201921.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
94If people submit them, I generally add them, but the goal of stb_image
95is less for applications like image viewer apps (which need to support
96every type of image under the sun) and more for things like games which
97can choose what images to use, so I may decline to add them if they're
98too rare or if the size of implementation vs. apparent benefit is too low.
99
100#### Do you have any advice on how to create my own single-file library?
101
102Yes. https://github.com/nothings/stb/blob/master/docs/stb_howto.txt
103
104#### Why public domain?
105
106I prefer it over GPL, LGPL, BSD, zlib, etc. for many reasons.
107Some of them are listed here:
108https://github.com/nothings/stb/blob/master/docs/why_public_domain.md
109
110#### Why C?
111
112Primarily, because I use C, not C++. But it does also make it easier
113for other people to use them from other languages.
114
115#### Why not C99? stdint.h, declare-anywhere, etc.
116
117I still use MSVC 6 (1998) as my IDE because it has better human factors
118for me than later versions of MSVC.
119
120
121
122

README.header.md

1stb
2===
3
4single-file public domain (or MIT licensed) libraries for C/C++ <a name="stb_libs"></a>
5
6Most libraries by stb, except: stb_dxt by Fabian "ryg" Giesen, stb_image_resize
7by Jorge L. "VinoBS" Rodriguez, and stb_sprintf by Jeff Roberts.
8
9
10library    | lastest version | category | LoC | description
11--------------------- | ---- | -------- | --- | --------------------------------
12

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
22