window module wip

This commit is contained in:
2018-09-20 05:27:30 +07:00
parent 291e264df4
commit 231864b587
4 changed files with 89 additions and 27 deletions

View File

@@ -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();
}