Open W4RH4WK opened 3 weeks ago
TINYGLTF_NO_FS
is primarily for reading glTF. It is not well considered in the writer.
To make TINYGLTF_NO_FS
effective for the writer(no <fstream>, <cstdio>
dependency), we need to introduce WriteGltfSceneToMemory
API, something like:
bool WriteGltfSceneToStream(const Model *model, std::vector<uint8_t> &output,
bool prettyPrint, bool writeBinary);
For reading GLTF/GLB file system access can be controlled by defining
TINYGLTF_NO_FS
and providing the necessary callback functions.Writing GLTF/GLB files seems to be missing this functionality. Even when
TINYGLTF_NO_FS
is defined, certain functions usingstd::ofstream
are still active (e.g.WriteGltfFile
).Side note: if
TINYGLTF_NO_FS
is defined,<fstream>
is not included. However, it still compiles on most platforms successfully asstd::ofstream
is pulled in transitively.