summaryrefslogtreecommitdiff
path: root/examples/triangle/ex_triangle.c
diff options
context:
space:
mode:
authorOmniscient <17525998+omnisci3nce@users.noreply.github.com>2024-05-08 10:37:18 +1000
committerOmniscient <17525998+omnisci3nce@users.noreply.github.com>2024-05-08 10:37:18 +1000
commitf05ce66a8e6fd0742a8314661a8dc871a5a2c0c3 (patch)
tree76d34d9e16ee98923e8eb2b08fd4be030d9feb5a /examples/triangle/ex_triangle.c
parentce318e41868ceea632ee90442fbddf4128d22817 (diff)
finishing submission + presentation for triangle example
Diffstat (limited to 'examples/triangle/ex_triangle.c')
-rw-r--r--examples/triangle/ex_triangle.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/examples/triangle/ex_triangle.c b/examples/triangle/ex_triangle.c
index 1b6fc96..50f135a 100644
--- a/examples/triangle/ex_triangle.c
+++ b/examples/triangle/ex_triangle.c
@@ -52,7 +52,24 @@ int main() {
static f64 x = 0.0;
x += 0.01;
- // insert work here
+ gpu_backend_begin_frame();
+ gpu_cmd_encoder* enc = gpu_get_default_cmd_encoder();
+ // begin recording
+ gpu_cmd_encoder_begin(*enc);
+ gpu_cmd_encoder_begin_render(enc, renderpass);
+ encode_bind_pipeline(enc, PIPELINE_GRAPHICS, gfx_pipeline);
+ encode_set_default_settings(enc);
+
+ // Record draw calls
+ gpu_temp_draw();
+
+ // End recording
+ gpu_cmd_encoder_end_render(enc);
+
+ gpu_cmd_buffer buf = gpu_cmd_encoder_finish(enc);
+ gpu_queue_submit(&buf);
+ // Submit
+ gpu_backend_end_frame();
render_frame_end(&core->renderer);
glfwSwapBuffers(core->renderer.window);