From fd488f9603f22db0312eadcdb93b7880922dc9a7 Mon Sep 17 00:00:00 2001 From: quou Date: Tue, 14 Jan 2025 00:04:55 +1100 Subject: misc refactoring --- debugdraw.hpp | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 debugdraw.hpp (limited to 'debugdraw.hpp') 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 -- cgit v1.2.3-54-g00ecf