From 43d915b2ceb3f5e439c09c772e9ebc7542c1a2bb Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Mon, 12 Aug 2024 01:07:35 +1000 Subject: s --- src/ral/backends/opengl/backend_opengl.h | 35 +++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'src/ral/backends') diff --git a/src/ral/backends/opengl/backend_opengl.h b/src/ral/backends/opengl/backend_opengl.h index 3e40945..805914e 100644 --- a/src/ral/backends/opengl/backend_opengl.h +++ b/src/ral/backends/opengl/backend_opengl.h @@ -68,10 +68,43 @@ typedef struct opengl_support { u32 pad; } opengl_support; -// u32 shader_create_separate(const char *vert_shader, const char *frag_shader); void uniform_vec3f(u32 program_id, const char *uniform_name, Vec3 *value); void uniform_f32(u32 program_id, const char *uniform_name, f32 value); void uniform_i32(u32 program_id, const char *uniform_name, i32 value); void uniform_mat4f(u32 program_id, const char *uniform_name, Mat4 *value); + +typedef enum GlCommandType { + GLCMD_DRAW, + GLCMD_DRAW_INDEXED, + GLCMD_BIND_VBUF, + GLCMD_BIND_IBUF, + GLCMD_SET_PROGRAM, +} GlCommandType; + +typedef struct GlCommand { + GlCommandType cmd_type; + union { + struct { + PrimitiveTopology topology; + u32 start_vertex; + u32 vertex_count; + // TODO: instance + } draw; + struct { + PrimitiveTopology topology; + u32 index_count; + } draw_indexed; + struct { + u32 buffer_id; + } bind_vbuf; + struct { + u32 buffer_id; + } bind_ibuf; + struct { + u32 program_id; + } set_program; + } data; +} GlCommand; + #endif -- cgit v1.2.3-70-g09d2