diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-07-21 15:06:52 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-07-21 15:07:38 +0300 |
commit | d773b499e595a43b9b1ae449262dcf13cabf2d02 (patch) | |
tree | b1baeb12025a04f8316636b5d0ab18e30ceedb2c /src/ui/window.h |
Initial commit
Borrowing the app skeleton from Bitwise Harmony.
Diffstat (limited to 'src/ui/window.h')
-rw-r--r-- | src/ui/window.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/ui/window.h b/src/ui/window.h new file mode 100644 index 00000000..d0413af4 --- /dev/null +++ b/src/ui/window.h | |||
@@ -0,0 +1,34 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include "widget.h" | ||
4 | |||
5 | #include <the_Foundation/defs.h> | ||
6 | #include <SDL_events.h> | ||
7 | #include <SDL_render.h> | ||
8 | #include <SDL_video.h> | ||
9 | |||
10 | iDeclareType(Window) | ||
11 | iDeclareTypeConstruction(Window) | ||
12 | |||
13 | struct Impl_Window { | ||
14 | SDL_Window * win; | ||
15 | SDL_Renderer *render; | ||
16 | iWidget * root; | ||
17 | float pixelRatio; | ||
18 | float uiScale; | ||
19 | uint32_t frameTime; | ||
20 | double presentTime; | ||
21 | }; | ||
22 | |||
23 | iBool processEvent_Window (iWindow *, const SDL_Event *); | ||
24 | void draw_Window (iWindow *); | ||
25 | void resize_Window (iWindow *, int w, int h); | ||
26 | void setUiScale_Window (iWindow *, float uiScale); | ||
27 | |||
28 | iInt2 rootSize_Window (const iWindow *); | ||
29 | float uiScale_Window (const iWindow *); | ||
30 | iInt2 coord_Window (const iWindow *, int x, int y); | ||
31 | iInt2 mouseCoord_Window (const iWindow *); | ||
32 | uint32_t frameTime_Window (const iWindow *); | ||
33 | |||
34 | iWindow * get_Window (void); | ||