Skip to content

Commit

Permalink
Fix setting multiple vertex buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
luboslenco committed Jan 21, 2024
1 parent 0158f89 commit 71c1e96
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Sources/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -732,9 +732,8 @@ namespace {
Local<Object> js_array = TO_OBJ(args[0]);
int32_t length = TO_I32(OBJ_GET(js_array, "length"));
for (int32_t i = 0; i < length; ++i) {
Local<Object> bufferobj = TO_OBJ(OBJ_GET(TO_OBJ(ARRAY_GET(js_array, i)), "buffer"));
Local<External> bufferfield = Local<External>::Cast(bufferobj->GetInternalField(0));
kinc_g4_vertex_buffer_t *buffer = (kinc_g4_vertex_buffer_t *)bufferfield->Value();
Local<Object> bufferobj = TO_OBJ(OBJ_GET(TO_OBJ(ARRAY_GET(js_array, i)), "buffer_"));
kinc_g4_vertex_buffer_t *buffer = (kinc_g4_vertex_buffer_t *)TO_EXTERNAL(GET_INTERNAL(bufferobj));
vertex_buffers[i] = buffer;
}
kinc_g4_set_vertex_buffers(vertex_buffers, length);
Expand Down

0 comments on commit 71c1e96

Please sign in to comment.