diff options
Diffstat (limited to 'debugdraw.hpp')
-rw-r--r-- | debugdraw.hpp | 42 |
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 |