diff options
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 54 |
1 files changed, 26 insertions, 28 deletions
diff --git a/main/main.cpp b/main/main.cpp index 22cec94f..4476e1ef 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -66,7 +66,20 @@ struct app final : Platform::Application Magnum::Timeline timeline; }; -using namespace Math::Literals; +app::app(const Arguments& arguments): + Platform::Application{ + arguments, + Configuration{} + .setTitle("Test") + .setSize({1024, 768}, dpi_policy::Physical), + GLConfiguration{} + .setSampleCount(4) + .setFlags(GLConfiguration::Flag::GpuValidation) + } +{ + reset_camera_offset(); + timeline.start(); +} chunk app::make_test_chunk() { @@ -84,33 +97,6 @@ chunk app::make_test_chunk() return c; } -void app::update_window_scale() -{ - auto sz = windowSize(); - _shader.set_scale({ (float)sz[0], (float)sz[1] }); -} - -void app::draw_chunk(chunk& c) -{ - _floor_mesh.draw(_shader, c); - _wall_mesh.draw(_shader, c); -} - -app::app(const Arguments& arguments): - Platform::Application{ - arguments, - Configuration{} - .setTitle("Test") - .setSize({1024, 768}, dpi_policy::Physical), - GLConfiguration{} - .setSampleCount(4) - .setFlags(Platform::Sdl2Application::GLConfiguration::Flag::Debug) - } -{ - reset_camera_offset(); - timeline.start(); -} - void app::drawEvent() { #if 0 GL::defaultFramebuffer.clear(GL::FramebufferClear::Color | GL::FramebufferClear::Depth); @@ -135,6 +121,18 @@ void app::drawEvent() { timeline.nextFrame(); } +void app::update_window_scale() +{ + auto sz = windowSize(); + _shader.set_scale({ (float)sz[0], (float)sz[1] }); +} + +void app::draw_chunk(chunk& c) +{ + _floor_mesh.draw(_shader, c); + _wall_mesh.draw(_shader, c); +} + void app::do_camera(float dt) { constexpr float pixels_per_second = 512; |