mirror of
https://github.com/enduro2d/enduro2d.git
synced 2025-12-15 08:15:38 +07:00
window module wip
This commit is contained in:
@@ -8,11 +8,21 @@
|
||||
using namespace e2d;
|
||||
|
||||
int main() {
|
||||
modules::initialize<debug>();
|
||||
the<debug>().add_sink<debug_console_sink>();
|
||||
modules::initialize<debug>()
|
||||
.add_sink<debug_console_sink>();
|
||||
|
||||
window w{{640, 480}, "Enduro2D", false, false};
|
||||
while ( !w.should_close() ) {
|
||||
window& w = modules::initialize<window>(
|
||||
v2u{640, 480}, "Enduro2D", false, false);
|
||||
|
||||
for ( std::size_t i = 0; i < 2; ++i ) {
|
||||
w.swap_buffers();
|
||||
window::poll_events();
|
||||
std::this_thread::sleep_for(time::to_chrono(make_seconds(2)));
|
||||
w.toggle_fullscreen(!w.fullscreen());
|
||||
}
|
||||
|
||||
auto current_time = time::now_s();
|
||||
while ( !w.should_close() && current_time + make_seconds(5ll) < time::now_s() ) {
|
||||
w.swap_buffers();
|
||||
window::poll_events();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user