update readme
This commit is contained in:
@ -12,6 +12,24 @@ They are also licensed under the MIT open source license, if you have lawyers
|
||||
who are unhappy with public domain. Every source file includes an explicit
|
||||
dual-license for you to choose from.
|
||||
|
||||
#### How do I use these libraries?
|
||||
|
||||
The idea behind single-header file libraries is that they're easy to distribute and deploy
|
||||
because all the code is contained in a single file. By default, the .h files in here act as
|
||||
their own header files, i.e. they declare the functions contained in the file but don't
|
||||
actually result in any code getting compiled.
|
||||
|
||||
So in addition, you should select _exactly one_ C/C++ source file that actually instantiates
|
||||
the code, preferably a file you're not editing frequently. This file should define a
|
||||
specific macro (this is documented per-library) to actually enable the function definitions.
|
||||
For example, to use stb_image, you should have exactly one C/C++ file that doesn't
|
||||
include stb_image.h regularly, but instead does
|
||||
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
#include "stb_image.h"
|
||||
|
||||
The right macro to define is pointed out right at the top of each of these libraries.
|
||||
|
||||
#### <a name="other_libs"></a> Are there other single-file public-domain/open source libraries with minimal dependencies out there?
|
||||
|
||||
[Yes.](https://github.com/nothings/single_file_libs)
|
||||
|
Reference in New Issue
Block a user