jkuhlmann / cgltf

:diamond_shape_with_a_dot_inside: Single-file glTF 2.0 loader and writer written in C99
MIT License
1.46k stars 135 forks source link

cgltf_write to buffer ignores options -> can't create an in-memory GLB #192

Open pplux opened 1 year ago

pplux commented 1 year ago

The function cgltf_write here:

https://github.com/jkuhlmann/cgltf/blob/561455ec216fa30d546854a2cb8c89b830b7b949/cgltf_write.h#L1259

ignores the first argument options.

As an user, I thought that setting the options, and in particular telling cgltf to generate a glb, would work. But since the options parameter is completely ignored, obviously it doesn't output glb to memory either.

It is fine for cgltf not to be able to generate a GLB in memory, it is a very easy format to do manually, but ignoring the options completely really confuses users IMHO. I would a) honor the options, b) if options are not used remove it as a parameter to not mislead the user into thinking it serves a purpose.