summaryrefslogtreecommitdiff
path: root/src/render/immdraw.c
diff options
context:
space:
mode:
authoromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-08-16 18:54:44 +1000
committeromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-08-16 18:54:44 +1000
commita4074b0feb6b2194af7c175fe1826c8e550f10aa (patch)
tree91449852c57936780ae316ed7d4e8ff12e4e24a6 /src/render/immdraw.c
parent938e3944fd7d55951e794224e6346488d3c701ea (diff)
cone mesh
Diffstat (limited to 'src/render/immdraw.c')
-rw-r--r--src/render/immdraw.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/render/immdraw.c b/src/render/immdraw.c
index c2589c3..d352ddf 100644
--- a/src/render/immdraw.c
+++ b/src/render/immdraw.c
@@ -25,6 +25,9 @@ void Immdraw_Init(Immdraw_Storage* storage) {
Geometry plane_geo = Geo_CreatePlane(f32x2(1.0, 1.0), 1, 1);
storage->plane = Mesh_Create(&plane_geo, true);
+ Geometry cone_geo = Geo_CreateCone(1.0, 1.0, 8);
+ storage->cone = Mesh_Create(&cone_geo, true);
+
storage->bbox = GenBboxMesh();
// Pipeline / material
@@ -78,12 +81,18 @@ void Immdraw_Plane(Transform tf, Vec4 colour, bool wireframe) {
Immdraw_Primitive(tf, CEL_TRI, 1.0, colour, wireframe, imm->plane);
}
-PUB void Immdraw_Bbox(Transform tf, Vec4 colour, bool wireframe) {
+void Immdraw_Bbox(Transform tf, Vec4 colour, bool wireframe) {
TRACE("Draw bbox");
Immdraw_Storage* imm = Render_GetImmdrawStorage();
Immdraw_Primitive(tf, CEL_LINE, 1.0, colour, wireframe, imm->bbox);
}
+void Immdraw_Cone(Transform tf, Vec4 colour, bool wireframe) {
+ TRACE("Draw cone");
+ Immdraw_Storage* imm = Render_GetImmdrawStorage();
+ Immdraw_Primitive(tf, CEL_TRI, 1.0, colour, wireframe, imm->cone);
+}
+
void Immdraw_Primitive(Transform tf, PrimitiveTopology topology, f32 size, Vec4 colour,
bool wireframe, Mesh mesh) {
Immdraw_Storage* imm = Render_GetImmdrawStorage();