summaryrefslogtreecommitdiff
path: root/src/ui/visbuf.h
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-09-12 09:48:09 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-09-12 09:48:09 +0300
commitcea85db580d81dd8400663f728d2e37f155abf09 (patch)
treedd287bd087e10c8b8ca114c0d11538a9f2489b40 /src/ui/visbuf.h
parentfdd3d54c520269a630447576a289261bdca48f37 (diff)
Separated VisBuf from ListWidget
This will be used in DocumentWidget as well.
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);