mirror of
https://github.com/enduro2d/enduro2d.git
synced 2025-12-16 22:16:53 +07:00
window events and listeners
This commit is contained in:
@@ -1,7 +1,27 @@
|
||||
/*******************************************************************************
|
||||
* This file is part of the "Enduro2D"
|
||||
* For conditions of distribution and use, see copyright notice in enduro2d.hpp
|
||||
* For conditions of distribution and use, see copyright notice in LICENSE.md
|
||||
* Copyright (C) 2018 Matvey Cherevko
|
||||
******************************************************************************/
|
||||
|
||||
#include "../common.hpp"
|
||||
using namespace e2d;
|
||||
|
||||
int main() {
|
||||
debug& d = modules::initialize<debug>();
|
||||
window& w = modules::initialize<window>(
|
||||
v2u{640, 480}, "Enduro2D", false, false);
|
||||
|
||||
d.add_sink<debug_console_sink>();
|
||||
w.register_event_listener<window_trace_event_listener>(d);
|
||||
|
||||
the<debug>()
|
||||
.trace("SAMPLE: window real size: %0", w.real_size())
|
||||
.trace("SAMPLE: window virtual size: %0", w.virtual_size())
|
||||
.trace("SAMPLE: window framebuffer size: %0", w.framebuffer_size());
|
||||
|
||||
while ( !w.should_close() ) {
|
||||
w.swap_buffers();
|
||||
window::poll_events();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user