diff --git a/README.md b/README.md index cd86f97..62986ea 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,10 @@ if (!ret) { * `TINYGLTF_NO_EXTERNAL_IMAGE` : Do not try to load external image file. This option woulde be helpful if you do not want load image file during glTF parsing. * `TINYGLTF_ANDROID_LOAD_FROM_ASSETS`: Load all files from packaged app assets instead of the regular file system. **Note:** You must pass a valid asset manager from your android app to `tinygltf::asset_manager` beforehand. * `TINYGLTF_ENABLE_DRACO`: Enable Draco compression. User must provide include path and link correspnding libraries in your project file. +* `TINYGLTF_NO_INCLUDE_JSON `: Disable including `json.hpp` from within `tiny_gltf.h` because it has been already included before or you want to include it using custom path before including `tiny_gltf.h`. +* `TINYGLTF_NO_INCLUDE_STB_IMAGE `: Disable including `stb_image.h` from within `tiny_gltf.h` because it has been already included before or you want to include it using custom path before including `tiny_gltf.h`. +* `TINYGLTF_NO_INCLUDE_STB_IMAGE_WRITE `: Disable including `stb_image_write.h` from within `tiny_gltf.h` because it has been already included before or you want to include it using custom path before including `tiny_gltf.h`. + ### Saving gltTF 2.0 model * [ ] Buffers. diff --git a/tiny_gltf.h b/tiny_gltf.h index 68df57e..ed9e497 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -1079,7 +1079,9 @@ class TinyGLTF { #endif #endif +#ifndef TINYGLTF_NO_INCLUDE_JSON #include "json.hpp" +#endif #ifdef TINYGLTF_ENABLE_DRACO #include "draco/core/decoder_buffer.h" @@ -1087,12 +1089,16 @@ class TinyGLTF { #endif #ifndef TINYGLTF_NO_STB_IMAGE +#ifndef TINYGLTF_NO_INCLUDE_STB_IMAGE #include "stb_image.h" #endif +#endif #ifndef TINYGLTF_NO_STB_IMAGE_WRITE +#ifndef TINYGLTF_NO_INCLUDE_STB_IMAGE_WRITE #include "stb_image_write.h" #endif +#endif #ifdef __clang__ #pragma clang diagnostic pop