mirror of
https://github.com/enduro2d/enduro2d-bootstrap.git
synced 2025-12-13 03:31:18 +07:00
Merge pull request #5 from enduro2d/hotfix/update_modules
Hotfix/update modules
This commit is contained in:
Submodule modules/enduro2d updated: e2247efbc4...1efe30ec16
@@ -8,19 +8,26 @@
|
||||
using namespace e2d;
|
||||
|
||||
int e2d_main() {
|
||||
input& i = modules::initialize<input>();
|
||||
debug& d = modules::initialize<debug>();
|
||||
window& w = modules::initialize<window>(
|
||||
v2u{640, 480}, "Enduro2D", true, false);
|
||||
|
||||
d.register_sink<debug_console_sink>();
|
||||
w.register_event_listener<window_input_source>(i);
|
||||
|
||||
const keyboard& k = i.keyboard();
|
||||
while ( !w.should_close() && !k.is_key_just_released(keyboard_key::escape) ) {
|
||||
i.frame_tick();
|
||||
w.swap_buffers();
|
||||
window::frame_tick();
|
||||
{
|
||||
modules::initialize<vfs>()
|
||||
.register_scheme<filesystem_file_source>("file");
|
||||
modules::initialize<debug>()
|
||||
.register_sink<debug_console_sink>();
|
||||
modules::initialize<input>();
|
||||
modules::initialize<window>(v2u{640, 480}, "Enduro2D", false)
|
||||
.register_event_listener<window_input_source>(the<input>());
|
||||
modules::initialize<render>(the<debug>(), the<window>());
|
||||
}
|
||||
{
|
||||
const keyboard& k = the<input>().keyboard();
|
||||
while ( !the<window>().should_close() && !k.is_key_just_released(keyboard_key::escape) ) {
|
||||
the<render>().execute(render::command_block<64>()
|
||||
.add_command(render::clear_command()
|
||||
.color_value({1.f, 0.4f, 0.f, 1.f}))
|
||||
.add_command(render::swap_command(true)));
|
||||
the<input>().frame_tick();
|
||||
window::poll_events();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user