diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-09-12 09:48:09 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-09-12 09:48:09 +0300 |
commit | cea85db580d81dd8400663f728d2e37f155abf09 (patch) | |
tree | dd287bd087e10c8b8ca114c0d11538a9f2489b40 /src/ui/visbuf.h | |
parent | fdd3d54c520269a630447576a289261bdca48f37 (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.h | 30 |
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 | |||
7 | iDeclareType(VisBuf) | ||
8 | iDeclareType(VisBufTexture) | ||
9 | |||
10 | struct Impl_VisBufTexture { | ||
11 | SDL_Texture *texture; | ||
12 | int origin; | ||
13 | iRangei validRange; | ||
14 | }; | ||
15 | |||
16 | struct Impl_VisBuf { | ||
17 | iInt2 texSize; | ||
18 | iRangei vis; | ||
19 | iVisBufTexture buffers[3]; | ||
20 | }; | ||
21 | |||
22 | iDeclareTypeConstruction(VisBuf) | ||
23 | |||
24 | void invalidate_VisBuf (iVisBuf *); | ||
25 | void alloc_VisBuf (iVisBuf *, const iInt2 size, int granularity); | ||
26 | void dealloc_VisBuf (iVisBuf *); | ||
27 | void reposition_VisBuf (iVisBuf *, const iRangei vis); | ||
28 | |||
29 | void invalidRanges_VisBuf (const iVisBuf *, const iRangei full, iRangei *out_invalidRanges); | ||
30 | void draw_VisBuf (const iVisBuf *, iInt2 topLeft); | ||