@@ -36,11 +36,6 @@ pub fn main() !void {
36
36
37
37
try gl .loadCoreProfile (glfw .getProcAddress , gl_major , gl_minor );
38
38
39
- const scale_factor = scale_factor : {
40
- const scale = window .getContentScale ();
41
- break :scale_factor @max (scale [0 ], scale [1 ]);
42
- };
43
-
44
39
var gpa_state = std .heap .GeneralPurposeAllocator (.{}){};
45
40
defer _ = gpa_state .deinit ();
46
41
const gpa = gpa_state .allocator ();
@@ -50,19 +45,19 @@ pub fn main() !void {
50
45
51
46
_ = zgui .io .addFontFromFile (
52
47
content_dir ++ "Roboto-Medium.ttf" ,
53
- std .math .floor (16.0 * scale_factor ),
48
+ std .math .floor (16.0 ),
54
49
);
55
50
56
51
zgui .backend .init (window );
57
52
defer zgui .backend .deinit ();
58
53
59
- zgui .getStyle ().scaleAllSizes (scale_factor );
60
-
61
54
while (! window .shouldClose () and window .getKey (.escape ) != .press ) {
62
55
glfw .pollEvents ();
63
56
64
57
gl .clearBufferfv (gl .COLOR , 0 , &[_ ]f32 { 0 , 0 , 0 , 1.0 });
65
58
59
+ zgui .backend .newFrame ();
60
+
66
61
// Set the starting window position and size to custom values
67
62
zgui .setNextWindowPos (.{ .x = 20.0 , .y = 20.0 , .cond = .first_use_ever });
68
63
zgui .setNextWindowSize (.{ .w = -1.0 , .h = -1.0 , .cond = .first_use_ever });
@@ -74,6 +69,8 @@ pub fn main() !void {
74
69
}
75
70
zgui .end ();
76
71
72
+ zgui .backend .draw ();
73
+
77
74
window .swapBuffers ();
78
75
}
79
76
}
0 commit comments