File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,11 @@ import sokol.sgl
12
12
import sokol.gfx
13
13
import math
14
14
15
+ $if windows {
16
+ #flag -lgdi32
17
+ #include "windows.h"
18
+ }
19
+
15
20
pub type TouchPoint = C.sapp_touchpoint
16
21
17
22
pub struct Event {
@@ -300,11 +305,20 @@ pub fn high_dpi() bool {
300
305
return C.sapp_high_dpi ()
301
306
}
302
307
308
+ // call Windows API to get screen size
309
+ fn C.GetSystemMetrics (int ) int
310
+
303
311
pub fn screen_size () Size {
304
312
$if macos {
305
313
return C.gg_get_screen_size ()
306
314
}
307
- // TODO windows, linux, etc
315
+ $if windows {
316
+ return Size{
317
+ width: int (C.GetSystemMetrics (C.SM_CXSCREEN))
318
+ height: int (C.GetSystemMetrics (C.SM_CYSCREEN))
319
+ }
320
+ }
321
+ // TODO linux, etc
308
322
return Size{}
309
323
}
310
324
You can’t perform that action at this time.
0 commit comments