Closed Trider12 closed 2 months ago
There is actually a comment in the definition of cgltf_buffer_view
about this:
void* data; /* overrides buffer->data if present, filled by extensions */
And then there is a helper function which does exactly what you are doing: cgltf_buffer_view_data()
. It doesn't seem to be exposed externally though. Maybe we should do that. It would help you, correct?
Ah, I saw that comment, but still miss-interpreted the purpose of the cgltf_buffer_view::data
field. I feel that the naming is a bit confusing, but understand that altering it is a breaking change, so is not possible.
But I did actually end up writing a function identical to cgltf_buffer_view_data()
myself, so maybe exposing it is a good idea.
I'm loading some
glb
files andcgltf_image::buffer_view::data
isnull
:I'm able to get the data by doing:
But this feels like not the intended way of doing this.