summaryrefslogtreecommitdiff
path: root/examples/cube/ex_cube.c
diff options
context:
space:
mode:
authoromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-06-17 22:08:13 +1000
committeromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-06-17 22:08:13 +1000
commitf1cb5bece520dba63fa77e4721909ab8f0a6c26f (patch)
tree33e0888475fcb10a4857db6d5570fa7cce459cb7 /examples/cube/ex_cube.c
parent9c8ef3cb95cff78bdc9d527b89ba30cf616e18c0 (diff)
add plane primitive
Diffstat (limited to 'examples/cube/ex_cube.c')
-rw-r--r--examples/cube/ex_cube.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/cube/ex_cube.c b/examples/cube/ex_cube.c
index 2cd0a51..3c98087 100644
--- a/examples/cube/ex_cube.c
+++ b/examples/cube/ex_cube.c
@@ -41,7 +41,7 @@ shader_data_layout mvp_uniforms_layout(void* data) {
my_shader_bind_group* d = (my_shader_bind_group*)data;
bool has_data = data != NULL;
- shader_binding b1 = { .label = "mvp_uniforms",
+ shader_binding b1 = { .label = "Matrices",
.type = SHADER_BINDING_BYTES,
.stores_data = has_data,
.data = { .bytes = { .size = sizeof(mvp_uniforms) } } };
@@ -154,7 +154,10 @@ int main() {
encode_bind_shader_data(enc, 0, &mvp_uniforms_data);
// Record draw calls
- draw_mesh(&cube, &model, &cam);
+ // draw_mesh(&cube, &model, &cam);
+ encode_set_vertex_buffer(enc, cube.vertex_buffer);
+ encode_set_index_buffer(enc, cube.index_buffer);
+ encode_draw_indexed(enc, cube.geometry->indices->len);
// End recording
gpu_cmd_encoder_end_render(enc);