summaryrefslogtreecommitdiff
path: root/ui.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'ui.hpp')
-rw-r--r--ui.hpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/ui.hpp b/ui.hpp
index 4dc0dd9..2b671ae 100644
--- a/ui.hpp
+++ b/ui.hpp
@@ -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;