summaryrefslogtreecommitdiff
path: root/src/ral/backends/opengl/backend_opengl.c
diff options
context:
space:
mode:
authoromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-08-13 13:18:24 +1000
committeromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-08-13 13:18:24 +1000
commit0c2f902238010903388b7d9a3af00979340eff2c (patch)
treeb718d72d8761769ec4aefbfd74cbb2d695f89741 /src/ral/backends/opengl/backend_opengl.c
parent43d915b2ceb3f5e439c09c772e9ebc7542c1a2bb (diff)
add debug draw bbox and add topology to draw calls
Diffstat (limited to 'src/ral/backends/opengl/backend_opengl.c')
-rw-r--r--src/ral/backends/opengl/backend_opengl.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/ral/backends/opengl/backend_opengl.c b/src/ral/backends/opengl/backend_opengl.c
index 3822220..613d7e1 100644
--- a/src/ral/backends/opengl/backend_opengl.c
+++ b/src/ral/backends/opengl/backend_opengl.c
@@ -411,11 +411,21 @@ void GPU_EncodeSetIndexBuffer(GPU_CmdEncoder* encoder, BufferHandle buf) {
GPU_Buffer* buffer = BUFFER_GET(buf);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buffer->id.ibo);
}
-void GPU_EncodeDraw(GPU_CmdEncoder* encoder, u64 count) { glDrawArrays(GL_TRIANGLES, 0, count); }
-void GPU_EncodeDrawIndexed(GPU_CmdEncoder* encoder, u64 index_count) {
+void GPU_EncodeDrawTris(GPU_CmdEncoder* encoder, u64 count) {
+ glDrawArrays(GL_TRIANGLES, 0, count);
+}
+void GPU_EncodeDrawIndexedTris(GPU_CmdEncoder* encoder, u64 index_count) {
glDrawElements(GL_TRIANGLES, index_count, GL_UNSIGNED_INT, 0);
}
+PUB void GPU_EncodeDraw(GPU_CmdEncoder* encoder, PrimitiveTopology topology, u64 count) {
+ glDrawArrays(opengl_prim_topology(topology), 0, count);
+}
+PUB void GPU_EncodeDrawIndexed(GPU_CmdEncoder* encoder, PrimitiveTopology topology,
+ u64 index_count) {
+ glDrawElements(opengl_prim_topology(topology), index_count, GL_UNSIGNED_INT, 0);
+}
+
PUB void GPU_WriteTextureRegion(GPU_CmdEncoder* encoder, TextureHandle dst, u32 x_offset,
u32 y_offset, u32 width, u32 height, const void* data) {
CASSERT_MSG(data, "const void* data must not be NULL");