Tue, 05 Aug 2025 20:00:24 +0200
upgrade to SDL 3
0 | 1 | /* |
2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. | |
3 | * Copyright 2023 Mike Becker. All rights reserved. | |
4 | * | |
5 | * Redistribution and use in source and binary forms, with or without | |
6 | * modification, are permitted provided that the following conditions are met: | |
7 | * | |
8 | * 1. Redistributions of source code must retain the above copyright | |
9 | * notice, this list of conditions and the following disclaimer. | |
10 | * | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | |
14 | * | |
15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |
16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | |
19 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
20 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
21 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
24 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
25 | * POSSIBILITY OF SUCH DAMAGE. | |
26 | */ | |
27 | ||
6
302971e8599b
move window related stuff to its own unit
Mike Becker <universe@uap-core.de>
parents:
3
diff
changeset
|
28 | #ifndef ASCENSION_WINDOW_H |
302971e8599b
move window related stuff to its own unit
Mike Becker <universe@uap-core.de>
parents:
3
diff
changeset
|
29 | #define ASCENSION_WINDOW_H |
0 | 30 | |
253 | 31 | #include <SDL3/SDL.h> |
0 | 32 | |
7 | 33 | #include "datatypes.h" |
44
b3da4096c607
create own compilation unit for GL context - fixes shader not being created per context
Mike Becker <universe@uap-core.de>
parents:
37
diff
changeset
|
34 | #include "glcontext.h" |
29
1d001eb694dc
bring first scene graph to live
Mike Becker <universe@uap-core.de>
parents:
16
diff
changeset
|
35 | #include "scene.h" |
7 | 36 | |
37 | #ifndef ASC_MAX_WINDOWS | |
38 | /** The maximum number of windows that can exist simultaneously. */ | |
10
05d329adcecc
make ASC_MAX_WINDOWS an unsigned literal
Mike Becker <universe@uap-core.de>
parents:
9
diff
changeset
|
39 | #define ASC_MAX_WINDOWS 4u |
7 | 40 | #endif // ASC_MAX_WINDOWS |
41 | ||
96
9e25f080a33e
add scenes, but they don't draw yet
Mike Becker <universe@uap-core.de>
parents:
95
diff
changeset
|
42 | #ifndef ASC_MAX_SCENES |
9e25f080a33e
add scenes, but they don't draw yet
Mike Becker <universe@uap-core.de>
parents:
95
diff
changeset
|
43 | /** The maximum number of non-UI scenes per window. */ |
9e25f080a33e
add scenes, but they don't draw yet
Mike Becker <universe@uap-core.de>
parents:
95
diff
changeset
|
44 | #define ASC_MAX_SCENES 8u |
9e25f080a33e
add scenes, but they don't draw yet
Mike Becker <universe@uap-core.de>
parents:
95
diff
changeset
|
45 | #endif // ASC_MAX_SCENES |
9e25f080a33e
add scenes, but they don't draw yet
Mike Becker <universe@uap-core.de>
parents:
95
diff
changeset
|
46 | |
231
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
47 | // TODO: remove AscWindowSettings (we can set most of the stuff after creation) |
145
a3231310d66d
consistent naming of structs and their typedefs
Mike Becker <universe@uap-core.de>
parents:
125
diff
changeset
|
48 | typedef struct asc_window_settings_s { |
68
823c03733e42
add mouse and window focus - resolves #382
Mike Becker <universe@uap-core.de>
parents:
65
diff
changeset
|
49 | AscGLContextSettings glsettings; |
213 | 50 | asc_vec2u dimensions; |
149
560772519ff9
resolve east-west conflict
Mike Becker <universe@uap-core.de>
parents:
145
diff
changeset
|
51 | const char *title; |
68
823c03733e42
add mouse and window focus - resolves #382
Mike Becker <universe@uap-core.de>
parents:
65
diff
changeset
|
52 | bool fullscreen; |
0 | 53 | } AscWindowSettings; |
54 | ||
145
a3231310d66d
consistent naming of structs and their typedefs
Mike Becker <universe@uap-core.de>
parents:
125
diff
changeset
|
55 | typedef struct asc_window_s { |
16
c5dde81b6fb2
add text rendering and demo FPS counter
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
56 | Uint32 id; |
68
823c03733e42
add mouse and window focus - resolves #382
Mike Becker <universe@uap-core.de>
parents:
65
diff
changeset
|
57 | bool resized; |
823c03733e42
add mouse and window focus - resolves #382
Mike Becker <universe@uap-core.de>
parents:
65
diff
changeset
|
58 | bool focused; |
149
560772519ff9
resolve east-west conflict
Mike Becker <universe@uap-core.de>
parents:
145
diff
changeset
|
59 | SDL_Window *window; |
105 | 60 | asc_vec2u dimensions; |
44
b3da4096c607
create own compilation unit for GL context - fixes shader not being created per context
Mike Becker <universe@uap-core.de>
parents:
37
diff
changeset
|
61 | AscGLContext glctx; |
154
4dff9cc488fe
add auto-scaling of UI depending on screen resolution - resolves #682
Mike Becker <universe@uap-core.de>
parents:
149
diff
changeset
|
62 | float ui_scale; |
95
622887f7e954
in preparation of more scenes, bring back AscScene struct
Mike Becker <universe@uap-core.de>
parents:
75
diff
changeset
|
63 | AscScene ui; |
96
9e25f080a33e
add scenes, but they don't draw yet
Mike Becker <universe@uap-core.de>
parents:
95
diff
changeset
|
64 | AscScene scenes[ASC_MAX_SCENES]; |
0 | 65 | } AscWindow; |
66 | ||
64
f18dc427f86f
make use of the asc_window_active macro
Mike Becker <universe@uap-core.de>
parents:
47
diff
changeset
|
67 | /** |
0 | 68 | * Initializes the settings structure with default values. |
69 | * | |
70 | * @param settings an uninitialized settings object | |
71 | */ | |
149
560772519ff9
resolve east-west conflict
Mike Becker <universe@uap-core.de>
parents:
145
diff
changeset
|
72 | void asc_window_settings_init_defaults(AscWindowSettings *settings); |
0 | 73 | |
74 | /** | |
75 | * Creates and initializes a new window and a corresponding OpenGL context. | |
76 | * | |
16
c5dde81b6fb2
add text rendering and demo FPS counter
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
77 | * The new window will also be automatically activated (see asc_window_activate()). |
c5dde81b6fb2
add text rendering and demo FPS counter
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
78 | * |
7 | 79 | * The index specified must not be in use by another window already. |
80 | * The maximum number of windows is defined by #ASC_MAX_WINDOWS. | |
81 | * | |
82 | * @param index the index of the new window | |
0 | 83 | * @param settings the settings to be used for initialization |
84 | */ | |
149
560772519ff9
resolve east-west conflict
Mike Becker <universe@uap-core.de>
parents:
145
diff
changeset
|
85 | void asc_window_initialize(unsigned int index, const AscWindowSettings *settings); |
0 | 86 | |
87 | /** | |
88 | * Destroys the window and its OpenGL context. | |
89 | * | |
65
9c44c55d327a
consistently refer to windows by ID - fixes #381
Mike Becker <universe@uap-core.de>
parents:
64
diff
changeset
|
90 | * When this window is currently active, there |
9c44c55d327a
consistently refer to windows by ID - fixes #381
Mike Becker <universe@uap-core.de>
parents:
64
diff
changeset
|
91 | * will be \em no active window afterwards. |
16
c5dde81b6fb2
add text rendering and demo FPS counter
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
92 | * |
0 | 93 | * Still alive windows will also be destroyed by asc_context_destroy() |
94 | * automatically. | |
95 | * | |
65
9c44c55d327a
consistently refer to windows by ID - fixes #381
Mike Becker <universe@uap-core.de>
parents:
64
diff
changeset
|
96 | * @param index the index of the window |
0 | 97 | */ |
65
9c44c55d327a
consistently refer to windows by ID - fixes #381
Mike Becker <universe@uap-core.de>
parents:
64
diff
changeset
|
98 | void asc_window_destroy(unsigned int index); |
0 | 99 | |
100 | /** | |
101 | * Swaps buffers and adjusts the viewport to the current window size. | |
102 | * | |
65
9c44c55d327a
consistently refer to windows by ID - fixes #381
Mike Becker <universe@uap-core.de>
parents:
64
diff
changeset
|
103 | * This function is automatically invoked by asc_loop_next(). |
9c44c55d327a
consistently refer to windows by ID - fixes #381
Mike Becker <universe@uap-core.de>
parents:
64
diff
changeset
|
104 | * You usually should not call this function manually. |
0 | 105 | * |
65
9c44c55d327a
consistently refer to windows by ID - fixes #381
Mike Becker <universe@uap-core.de>
parents:
64
diff
changeset
|
106 | * If this function is invoked on a non-initialized window, nothing happens. |
9c44c55d327a
consistently refer to windows by ID - fixes #381
Mike Becker <universe@uap-core.de>
parents:
64
diff
changeset
|
107 | * |
9c44c55d327a
consistently refer to windows by ID - fixes #381
Mike Becker <universe@uap-core.de>
parents:
64
diff
changeset
|
108 | * @param index the index of the window |
0 | 109 | */ |
65
9c44c55d327a
consistently refer to windows by ID - fixes #381
Mike Becker <universe@uap-core.de>
parents:
64
diff
changeset
|
110 | void asc_window_sync(unsigned int index); |
0 | 111 | |
16
c5dde81b6fb2
add text rendering and demo FPS counter
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
112 | /** |
c5dde81b6fb2
add text rendering and demo FPS counter
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
113 | * Switches the active window. |
c5dde81b6fb2
add text rendering and demo FPS counter
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
114 | * |
c5dde81b6fb2
add text rendering and demo FPS counter
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
115 | * In particular that makes the corresponding OpenGL context "current". |
c5dde81b6fb2
add text rendering and demo FPS counter
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
116 | * When you only want to draw into one window, you'll never need this. |
c5dde81b6fb2
add text rendering and demo FPS counter
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
117 | * |
65
9c44c55d327a
consistently refer to windows by ID - fixes #381
Mike Becker <universe@uap-core.de>
parents:
64
diff
changeset
|
118 | * @param index the index of the window |
16
c5dde81b6fb2
add text rendering and demo FPS counter
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
119 | */ |
65
9c44c55d327a
consistently refer to windows by ID - fixes #381
Mike Becker <universe@uap-core.de>
parents:
64
diff
changeset
|
120 | void asc_window_activate(unsigned int index); |
16
c5dde81b6fb2
add text rendering and demo FPS counter
Mike Becker <universe@uap-core.de>
parents:
14
diff
changeset
|
121 | |
68
823c03733e42
add mouse and window focus - resolves #382
Mike Becker <universe@uap-core.de>
parents:
65
diff
changeset
|
122 | |
823c03733e42
add mouse and window focus - resolves #382
Mike Becker <universe@uap-core.de>
parents:
65
diff
changeset
|
123 | /** |
823c03733e42
add mouse and window focus - resolves #382
Mike Becker <universe@uap-core.de>
parents:
65
diff
changeset
|
124 | * Returns the index of the window with the specified SDL window ID. |
823c03733e42
add mouse and window focus - resolves #382
Mike Becker <universe@uap-core.de>
parents:
65
diff
changeset
|
125 | * |
823c03733e42
add mouse and window focus - resolves #382
Mike Becker <universe@uap-core.de>
parents:
65
diff
changeset
|
126 | * Returns #ASC_MAX_WINDOWS if no window with the specified ID exists. |
823c03733e42
add mouse and window focus - resolves #382
Mike Becker <universe@uap-core.de>
parents:
65
diff
changeset
|
127 | * |
823c03733e42
add mouse and window focus - resolves #382
Mike Becker <universe@uap-core.de>
parents:
65
diff
changeset
|
128 | * @param id the SDL window ID |
823c03733e42
add mouse and window focus - resolves #382
Mike Becker <universe@uap-core.de>
parents:
65
diff
changeset
|
129 | * @return the window index |
823c03733e42
add mouse and window focus - resolves #382
Mike Becker <universe@uap-core.de>
parents:
65
diff
changeset
|
130 | */ |
823c03733e42
add mouse and window focus - resolves #382
Mike Becker <universe@uap-core.de>
parents:
65
diff
changeset
|
131 | unsigned int asc_window_index(Uint32 id); |
823c03733e42
add mouse and window focus - resolves #382
Mike Becker <universe@uap-core.de>
parents:
65
diff
changeset
|
132 | |
96
9e25f080a33e
add scenes, but they don't draw yet
Mike Becker <universe@uap-core.de>
parents:
95
diff
changeset
|
133 | /** |
9e25f080a33e
add scenes, but they don't draw yet
Mike Becker <universe@uap-core.de>
parents:
95
diff
changeset
|
134 | * Returns a pointer to the scene within the currently active window with the specified index. |
9e25f080a33e
add scenes, but they don't draw yet
Mike Becker <universe@uap-core.de>
parents:
95
diff
changeset
|
135 | * |
9e25f080a33e
add scenes, but they don't draw yet
Mike Becker <universe@uap-core.de>
parents:
95
diff
changeset
|
136 | * If you want to use a scene, you need to initialize it first. |
9e25f080a33e
add scenes, but they don't draw yet
Mike Becker <universe@uap-core.de>
parents:
95
diff
changeset
|
137 | * You can destroy the scene any time you want, but used scenes are also |
9e25f080a33e
add scenes, but they don't draw yet
Mike Becker <universe@uap-core.de>
parents:
95
diff
changeset
|
138 | * destroyed automatically when the window gets destroyed. |
9e25f080a33e
add scenes, but they don't draw yet
Mike Becker <universe@uap-core.de>
parents:
95
diff
changeset
|
139 | * |
9e25f080a33e
add scenes, but they don't draw yet
Mike Becker <universe@uap-core.de>
parents:
95
diff
changeset
|
140 | * @param index an index less than #ASC_MAX_SCENES |
9e25f080a33e
add scenes, but they don't draw yet
Mike Becker <universe@uap-core.de>
parents:
95
diff
changeset
|
141 | * @return a pointer to the scene |
9e25f080a33e
add scenes, but they don't draw yet
Mike Becker <universe@uap-core.de>
parents:
95
diff
changeset
|
142 | */ |
9e25f080a33e
add scenes, but they don't draw yet
Mike Becker <universe@uap-core.de>
parents:
95
diff
changeset
|
143 | AscScene *asc_window_scene(unsigned int index); |
9e25f080a33e
add scenes, but they don't draw yet
Mike Becker <universe@uap-core.de>
parents:
95
diff
changeset
|
144 | |
154
4dff9cc488fe
add auto-scaling of UI depending on screen resolution - resolves #682
Mike Becker <universe@uap-core.de>
parents:
149
diff
changeset
|
145 | /** |
4dff9cc488fe
add auto-scaling of UI depending on screen resolution - resolves #682
Mike Becker <universe@uap-core.de>
parents:
149
diff
changeset
|
146 | * The desktop display resolution related to the active window. |
4dff9cc488fe
add auto-scaling of UI depending on screen resolution - resolves #682
Mike Becker <universe@uap-core.de>
parents:
149
diff
changeset
|
147 | * |
4dff9cc488fe
add auto-scaling of UI depending on screen resolution - resolves #682
Mike Becker <universe@uap-core.de>
parents:
149
diff
changeset
|
148 | * @return the desktop display resolution of the display the active window is associated with |
4dff9cc488fe
add auto-scaling of UI depending on screen resolution - resolves #682
Mike Becker <universe@uap-core.de>
parents:
149
diff
changeset
|
149 | */ |
4dff9cc488fe
add auto-scaling of UI depending on screen resolution - resolves #682
Mike Becker <universe@uap-core.de>
parents:
149
diff
changeset
|
150 | asc_vec2u asc_window_display_resolution(void); |
4dff9cc488fe
add auto-scaling of UI depending on screen resolution - resolves #682
Mike Becker <universe@uap-core.de>
parents:
149
diff
changeset
|
151 | |
231
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
152 | /** |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
153 | * Returns the window's UI scaling factor. |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
154 | * |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
155 | * @param index the window index |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
156 | * @return the current UI scale of the window |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
157 | */ |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
158 | float asc_window_ui_scale(unsigned int index); |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
159 | |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
160 | /** |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
161 | * Sets the UI scaling factor for a window. |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
162 | * |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
163 | * Use asc_ui_scale() to change the scaling factor for the active window. |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
164 | * |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
165 | * @param index the window index |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
166 | * @param scale the new UI scale |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
167 | */ |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
168 | void asc_window_set_ui_scale(unsigned int index, float scale); |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
169 | |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
170 | /** |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
171 | * Sets the window title. |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
172 | * |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
173 | * @param index the window index |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
174 | * @param title the new title |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
175 | */ |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
176 | void asc_window_set_title(unsigned int index, const char *title); |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
177 | |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
178 | /** |
237
2ea35c5f4760
add functions to change the window position
Mike Becker <universe@uap-core.de>
parents:
231
diff
changeset
|
179 | * Sets the window position. |
2ea35c5f4760
add functions to change the window position
Mike Becker <universe@uap-core.de>
parents:
231
diff
changeset
|
180 | * |
2ea35c5f4760
add functions to change the window position
Mike Becker <universe@uap-core.de>
parents:
231
diff
changeset
|
181 | * @param index the window index |
2ea35c5f4760
add functions to change the window position
Mike Becker <universe@uap-core.de>
parents:
231
diff
changeset
|
182 | * @param pos the new position |
2ea35c5f4760
add functions to change the window position
Mike Becker <universe@uap-core.de>
parents:
231
diff
changeset
|
183 | */ |
2ea35c5f4760
add functions to change the window position
Mike Becker <universe@uap-core.de>
parents:
231
diff
changeset
|
184 | void asc_window_set_position(unsigned index, asc_vec2i pos); |
2ea35c5f4760
add functions to change the window position
Mike Becker <universe@uap-core.de>
parents:
231
diff
changeset
|
185 | |
2ea35c5f4760
add functions to change the window position
Mike Becker <universe@uap-core.de>
parents:
231
diff
changeset
|
186 | /** |
2ea35c5f4760
add functions to change the window position
Mike Becker <universe@uap-core.de>
parents:
231
diff
changeset
|
187 | * Centers the window on screen. |
2ea35c5f4760
add functions to change the window position
Mike Becker <universe@uap-core.de>
parents:
231
diff
changeset
|
188 | * |
2ea35c5f4760
add functions to change the window position
Mike Becker <universe@uap-core.de>
parents:
231
diff
changeset
|
189 | * @param index the window index |
2ea35c5f4760
add functions to change the window position
Mike Becker <universe@uap-core.de>
parents:
231
diff
changeset
|
190 | */ |
2ea35c5f4760
add functions to change the window position
Mike Becker <universe@uap-core.de>
parents:
231
diff
changeset
|
191 | void asc_window_center(unsigned index); |
2ea35c5f4760
add functions to change the window position
Mike Becker <universe@uap-core.de>
parents:
231
diff
changeset
|
192 | |
2ea35c5f4760
add functions to change the window position
Mike Becker <universe@uap-core.de>
parents:
231
diff
changeset
|
193 | /** |
231
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
194 | * Sets the window size. |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
195 | * |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
196 | * @param index the window index |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
197 | * @param size the new size of the window |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
198 | */ |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
199 | void asc_window_set_size(unsigned int index, asc_vec2u size); |
0da563c4e39c
make initial window size depend on UI scaling factor
Mike Becker <universe@uap-core.de>
parents:
213
diff
changeset
|
200 | |
6
302971e8599b
move window related stuff to its own unit
Mike Becker <universe@uap-core.de>
parents:
3
diff
changeset
|
201 | #endif /* ASCENSION_WINDOW_H */ |
0 | 202 |