diff options
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); | ||