summaryrefslogtreecommitdiff
path: root/examples/triangle/ex_triangle.c
diff options
context:
space:
mode:
authorOmniscient <omniscient.oce@gmail.com>2024-06-09 11:42:17 +1000
committerOmniscient <omniscient.oce@gmail.com>2024-06-09 11:42:17 +1000
commit64830ce51a185091f54c2b42b365110d89d44f1b (patch)
tree644c4a4425c2003a649cf02af33af488cb56a148 /examples/triangle/ex_triangle.c
parent859ea7e23d2bbbc4b32b43727ae50aebe399e720 (diff)
triangle on opengl works again. happy days
Diffstat (limited to 'examples/triangle/ex_triangle.c')
-rw-r--r--examples/triangle/ex_triangle.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/examples/triangle/ex_triangle.c b/examples/triangle/ex_triangle.c
index d9954e6..cd401c7 100644
--- a/examples/triangle/ex_triangle.c
+++ b/examples/triangle/ex_triangle.c
@@ -4,6 +4,7 @@
#include "buf.h"
#include "camera.h"
#include "core.h"
+#include "defines.h"
#include "file.h"
#include "log.h"
#include "maths.h"
@@ -73,8 +74,8 @@ int main() {
gpu_pipeline* gfx_pipeline = gpu_graphics_pipeline_create(pipeline_description);
// Load triangle vertex and index data
- buffer_handle triangle_vert_buf =
- gpu_buffer_create(4 * sizeof(vertex), CEL_BUFFER_VERTEX, CEL_BUFFER_FLAG_GPU, vertices);
+ buffer_handle triangle_vert_buf = gpu_buffer_create(4 * sizeof(custom_vertex), CEL_BUFFER_VERTEX,
+ CEL_BUFFER_FLAG_GPU, vertices);
buffer_handle triangle_index_buf =
gpu_buffer_create(sizeof(indices), CEL_BUFFER_INDEX, CEL_BUFFER_FLAG_GPU, indices);
@@ -87,24 +88,24 @@ int main() {
continue;
}
gpu_cmd_encoder* enc = gpu_get_default_cmd_encoder();
- // // Begin recording
+ // // 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);
+ encode_bind_pipeline(enc, PIPELINE_GRAPHICS, gfx_pipeline);
+ encode_set_default_settings(enc);
- // // Record draw calls
- // encode_set_vertex_buffer(enc, triangle_vert_buf);
- // encode_set_index_buffer(enc, triangle_index_buf);
- // encode_draw_indexed(enc, 6);
+ // // Record draw calls
+ encode_set_vertex_buffer(enc, triangle_vert_buf);
+ encode_set_index_buffer(enc, triangle_index_buf);
+ encode_draw_indexed(enc, 6);
- // // End recording
- // gpu_cmd_encoder_end_render(enc);
+ // // End recording
+ // gpu_cmd_encoder_end_render(enc);
- // gpu_cmd_buffer buf = gpu_cmd_encoder_finish(enc); // Command buffer is no longer recording
- // and is ready to submit
- // // Submit
- // gpu_queue_submit(&buf);
+ // gpu_cmd_buffer buf = gpu_cmd_encoder_finish(enc); // Command buffer is no longer recording
+ // and is ready to submit
+ // // Submit
+ // gpu_queue_submit(&buf);
gpu_backend_end_frame();
}