You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
void* data = texture->image->buffer_view->buffer->data + texture->image->buffer_view->offset;
But this feels like not the intended way of doing this.
The text was updated successfully, but these errors were encountered: