summaryrefslogtreecommitdiff
path: root/debugdraw.hpp
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2025-01-14 00:04:55 +1100
committerquou <quou@disroot.org>2025-01-14 00:04:55 +1100
commitfd488f9603f22db0312eadcdb93b7880922dc9a7 (patch)
tree15b7986e2c06eea57575f4c97811cbc65eaa120a /debugdraw.hpp
parentdfa0b6de5a070d1be63d04574c3b8ce469518250 (diff)
misc refactoring
Diffstat (limited to 'debugdraw.hpp')
-rw-r--r--debugdraw.hpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/debugdraw.hpp b/debugdraw.hpp
new file mode 100644
index 0000000..e5142dc
--- /dev/null
+++ b/debugdraw.hpp
@@ -0,0 +1,42 @@
+#ifndef debugdraw_hpp
+#define debugdraw_hpp
+
+#include "maths.hpp"
+#include "video.hpp"
+
+struct Camera;
+
+struct Line_Renderer {
+ static constexpr int max_lines = 1024;
+ Staged_Buffer vb, cb;
+ Shader* shader;
+ int vert_binding, cbuffer_binding;
+ int cur;
+ int w, h;
+ v3f cur_col;
+
+ struct Vertex {
+ float x, y, z;
+ float r, g, b;
+ }* verts;
+
+ struct CBuffer {
+ m4f vp;
+ };
+
+ void init(Device* dev, Asset_Arena* assets);
+
+ void destroy(Device* dev);
+ void begin(int wi, int he);
+ void colour(const v3f& c);
+ void add_line(const v3f& s, const v3f& e);
+ void add_box(const AABB& b);
+ void flush(
+ const Camera& cam,
+ Device* dev,
+ Arena* a,
+ Render_Pass& rp
+ );
+};
+
+#endif