summaryrefslogtreecommitdiff
path: root/src/render/immdraw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/immdraw.c')
-rw-r--r--src/render/immdraw.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/render/immdraw.c b/src/render/immdraw.c
index d352ddf..8a10c65 100644
--- a/src/render/immdraw.c
+++ b/src/render/immdraw.c
@@ -28,6 +28,9 @@ void Immdraw_Init(Immdraw_Storage* storage) {
Geometry cone_geo = Geo_CreateCone(1.0, 1.0, 8);
storage->cone = Mesh_Create(&cone_geo, true);
+ Geometry cyl_geo = Geo_CreateCylinder(1.0, 2.0, 8);
+ storage->cylinder = Mesh_Create(&cyl_geo, true);
+
storage->bbox = GenBboxMesh();
// Pipeline / material
@@ -54,7 +57,7 @@ void Immdraw_Init(Immdraw_Storage* storage) {
.vs = { .debug_name = "Immdraw Vertex Shader", .filepath = vert_path, .code = vert_shader },
.fs = { .debug_name = "Immdraw Fragment Shader", .filepath = frag_path, .code = frag_shader },
.depth_test = true,
- .wireframe = false,
+ .wireframe = true,
};
GPU_Renderpass* rpass =
GPU_Renderpass_Create((GPU_RenderpassDesc){ .default_framebuffer = true });
@@ -87,6 +90,12 @@ void Immdraw_Bbox(Transform tf, Vec4 colour, bool wireframe) {
Immdraw_Primitive(tf, CEL_LINE, 1.0, colour, wireframe, imm->bbox);
}
+void Immdraw_Cylinder(Transform tf, Vec4 colour, bool wireframe) {
+ TRACE("Draw cylinder");
+ Immdraw_Storage* imm = Render_GetImmdrawStorage();
+ Immdraw_Primitive(tf, CEL_TRI, 1.0, colour, wireframe, imm->cylinder);
+}
+
void Immdraw_Cone(Transform tf, Vec4 colour, bool wireframe) {
TRACE("Draw cone");
Immdraw_Storage* imm = Render_GetImmdrawStorage();
@@ -164,4 +173,4 @@ Mesh GenBboxMesh() {
.indices = indices };
return Mesh_Create(&geo, true);
-} \ No newline at end of file
+}