Skip to content

Commit 09c728c

Browse files
committed
add vsync control to test app
1 parent eebaf5c commit 09c728c

2 files changed

Lines changed: 14 additions & 9 deletions

File tree

tests/app/src/window0.cpp

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ utki::shared_ref<ruis::window> make_window0(
4848
ruis::vec2_length pos
4949
)
5050
{
51+
auto check_box = m::check_box(c, {
52+
.button_params{
53+
.pressed = true
54+
}
55+
});
56+
c.get().window().set_vsync_enabled(true);
57+
58+
check_box.get().pressed_change_handler = [](ruis::button& b){
59+
b.context.get().window().set_vsync_enabled(b.is_pressed());
60+
};
61+
5162
// clang-format off
5263
return m::window(c,
5364
{
@@ -96,13 +107,7 @@ utki::shared_ref<ruis::window> make_window0(
96107
}
97108
},
98109
{
99-
m::check_box(c,
100-
{
101-
.button_params{
102-
.pressed = true
103-
}
104-
}
105-
)
110+
check_box
106111
}
107112
),
108113
m::text(c,
@@ -112,7 +117,7 @@ utki::shared_ref<ruis::window> make_window0(
112117
.font_face = c.get().loader().load<ruis::res::font>("fnt_monospace")
113118
}
114119
},
115-
U"some checkbox"s
120+
U"VSYNC enabled"s
116121
)
117122
}
118123
),

0 commit comments

Comments
 (0)