Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion cgltf_write.h
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,16 @@ static void cgltf_write_buffer_view(cgltf_write_context* context, const cgltf_bu
cgltf_write_sizeprop(context, "byteLength", view->size, (cgltf_size)-1);
cgltf_write_sizeprop(context, "byteOffset", view->offset, 0);
cgltf_write_sizeprop(context, "byteStride", view->stride, 0);
// NOTE: We skip writing "target" because the spec says its usage can be inferred.
switch (view->type) {
case cgltf_buffer_view_type_indices:
cgltf_write_sizeprop(context, "target", 34963, 0);
break;
case cgltf_buffer_view_type_vertices:
cgltf_write_sizeprop(context, "target", 34962, 0);
break;
default:
break;
}
cgltf_write_extras(context, &view->extras);
cgltf_write_line(context, "}");
}
Expand Down