Integrate cgltf into your project
mastercgltf is a single-file/stb-style C library. To integrate it, follow these steps:
- Include
cgltf.hin your project files. - In exactly one C source file, define
CGLTF_IMPLEMENTATIONbefore including the header to generate the implementation. - If you need writing support, you must also define
CGLTF_WRITE_IMPLEMENTATIONin your implementation file and includecgltf_write.h.
Note: cgltf_write.h includes cgltf.h, so ensure your implementation defines are handled correctly to avoid multiple definition errors.
#define CGLTF_IMPLEMENTATION
#include "cgltf.h"
// If writing is needed:
#define CGLTF_WRITE_IMPLEMENTATION
#include "cgltf_write.h"