summaryrefslogtreecommitdiff
path: root/src/ui/visbuf.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/visbuf.h')
-rw-r--r--src/ui/visbuf.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/ui/visbuf.h b/src/ui/visbuf.h
new file mode 100644
index 00000000..80370b29
--- /dev/null
+++ b/src/ui/visbuf.h
@@ -0,0 +1,30 @@
1#pragma once
2
3#include <the_Foundation/range.h>
4#include <the_Foundation/vec2.h>
5#include <SDL_render.h>
6
7iDeclareType(VisBuf)
8iDeclareType(VisBufTexture)
9
10struct Impl_VisBufTexture {
11 SDL_Texture *texture;
12 int origin;
13 iRangei validRange;
14};
15
16struct Impl_VisBuf {
17 iInt2 texSize;
18 iRangei vis;
19 iVisBufTexture buffers[3];
20};
21
22iDeclareTypeConstruction(VisBuf)
23
24void invalidate_VisBuf (iVisBuf *);
25void alloc_VisBuf (iVisBuf *, const iInt2 size, int granularity);
26void dealloc_VisBuf (iVisBuf *);
27void reposition_VisBuf (iVisBuf *, const iRangei vis);
28
29void invalidRanges_VisBuf (const iVisBuf *, const iRangei full, iRangei *out_invalidRanges);
30void draw_VisBuf (const iVisBuf *, iInt2 topLeft);