readme: Add "how to use these libs" section

Try to be a bit more explicit still.

Fixes issue #903, or so I hope.
This commit is contained in:
Fabian Giesen 2021-07-02 22:31:41 -07:00
parent 4d3b93f589
commit 55a180671c

View File

@ -49,6 +49,24 @@ Total lines of C code: 56530
FAQ
---
#### 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.
#### What's the license?
These libraries are in the public domain. You can do anything you