summaryrefslogtreecommitdiff
path: root/src/ui/window.h
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-07-21 15:06:52 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-07-21 15:07:38 +0300
commitd773b499e595a43b9b1ae449262dcf13cabf2d02 (patch)
treeb1baeb12025a04f8316636b5d0ab18e30ceedb2c /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.h34
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
10iDeclareType(Window)
11iDeclareTypeConstruction(Window)
12
13struct 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
23iBool processEvent_Window (iWindow *, const SDL_Event *);
24void draw_Window (iWindow *);
25void resize_Window (iWindow *, int w, int h);
26void setUiScale_Window (iWindow *, float uiScale);
27
28iInt2 rootSize_Window (const iWindow *);
29float uiScale_Window (const iWindow *);
30iInt2 coord_Window (const iWindow *, int x, int y);
31iInt2 mouseCoord_Window (const iWindow *);
32uint32_t frameTime_Window (const iWindow *);
33
34iWindow * get_Window (void);