diff options
author | quou <quou@disroot.org> | 2024-12-30 12:44:28 +1100 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-12-30 14:11:22 +1100 |
commit | e8baea58dd5c92b62c4eef1b5c1ca9648f44e7d7 (patch) | |
tree | e0e9685b8ae53e7984258965b8ad486d1781c8a3 /ui.hpp | |
parent | 90eed5c3684a6dd751afc2bcb7ae0ac919c143a8 (diff) |
ui renderer clipping
Diffstat (limited to 'ui.hpp')
-rw-r--r-- | ui.hpp | 19 |
1 files changed, 14 insertions, 5 deletions
@@ -19,15 +19,26 @@ struct UI { float a_f() { return (float)a / 255.0f; }; }; + struct Rect { + int x, y, w, h; + + Rect() = default; + Rect(int x, int y, int w, int h); + }; + struct Vertex_Buffer { + Rect clip; + bool dirty; Staged_Buffer buf; Buffer_Id indices; - int usage; + int start, usage; void init(Device* dev); void init_indices(Device* dev); void destroy(UI* ui); void update_buffer(Context& ctx); + void reset(const Rect& clip); + void set_clip(const Rect& clip); void add_quad( UI* ui, @@ -66,10 +77,6 @@ struct UI { Vertex_Buffer* next; }; - struct Rect { - int x, y, w, h; - }; - Heap* heap; Device* device; Texture_Id atlas; @@ -78,6 +85,8 @@ struct UI { Sampler_Id sampler; Staged_Buffer cbuffer; Vertex_Buffer mesh; + Pipeline* pipeline; + Render_Pass* render_pass; struct UI_CBuffer { m4f projection; |