diff options
author | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-08-12 01:07:35 +1000 |
---|---|---|
committer | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-08-12 01:07:35 +1000 |
commit | 43d915b2ceb3f5e439c09c772e9ebc7542c1a2bb (patch) | |
tree | 57c9cf036674dcb8162ae153ccb9c2000ac7a81f /src/ral/backends/opengl/backend_opengl.h | |
parent | 72b8d26fcfcee36ca67f963b9c6a4b616e2d5d4d (diff) |
s
Diffstat (limited to 'src/ral/backends/opengl/backend_opengl.h')
-rw-r--r-- | src/ral/backends/opengl/backend_opengl.h | 35 |
1 files changed, 34 insertions, 1 deletions
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 |