fix code after engine update

This commit is contained in:
2018-11-09 16:48:22 +07:00
parent 077f669211
commit a949e80328

View File

@@ -7,27 +7,28 @@
#include <enduro2d/enduro2d.hpp> #include <enduro2d/enduro2d.hpp>
using namespace e2d; using namespace e2d;
int e2d_main() { namespace
{ {
modules::initialize<vfs>() class game final : public application {
.register_scheme<filesystem_file_source>("file"); public:
modules::initialize<debug>() bool frame_tick() final {
.register_sink<debug_console_sink>(); const keyboard& k = the<input>().keyboard();
modules::initialize<input>(); while ( the<window>().should_close() || k.is_key_just_released(keyboard_key::escape) ) {
modules::initialize<window>(v2u{640, 480}, "Enduro2D", false) return 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>() the<render>().execute(render::command_block<64>()
.add_command(render::clear_command() .add_command(render::clear_command()
.color_value({1.f, 0.4f, 0.f, 1.f})) .color_value({1.f, 0.4f, 0.f, 1.f}))
.add_command(render::swap_command(true))); .add_command(render::swap_command(true)));
the<input>().frame_tick(); return true;
window::poll_events();
} }
} };
}
int e2d_main(int argc, char *argv[]) {
auto params = engine::parameters("bootstrap", "enduro2d")
.timer_params(engine::timer_parameters()
.maximal_framerate(100));
modules::initialize<engine>(argc, argv, params).start<game>();
return 0; return 0;
} }