diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-08 22:14:29 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-08 22:14:29 +0200 |
commit | caacf24af8a51807105cd35407201d525a4e59f4 (patch) | |
tree | 640fa38bbb09dcf2ca2eaed14d4acd2dba10b3e3 /main/main.cpp | |
parent | df73742cdd427e68057603746864abd3d2b545c2 (diff) |
a
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/main/main.cpp b/main/main.cpp index 5a555c97..34a7ae4a 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -5,21 +5,6 @@ namespace Magnum::Examples { -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() { constexpr auto N = TILE_MAX_DIM; @@ -60,12 +45,6 @@ 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); @@ -96,51 +75,7 @@ void app::reset_camera_offset() //camera_offset = {}; } -void app::update(float dt) -{ - do_camera(dt); - if (keys[key::quit]) - Platform::Sdl2Application::exit(0); -} -void app::do_key(KeyEvent::Key k, KeyEvent::Modifiers m, bool pressed, bool repeated) -{ - //using Mods = KeyEvent::Modifiers; - - (void)m; - (void)repeated; - - const key x = progn(switch (k) { - using enum KeyEvent::Key; - using enum key; - - case W: return camera_up; - case A: return camera_left; - case S: return camera_down; - case D: return camera_right; - case Home: return camera_reset; - case Esc: return quit; - default: return MAX; - }); - - if (x != key::MAX) - keys[x] = pressed; -} - -app::~app() -{ - loader_::destroy(); -} - -void app::keyPressEvent(Platform::Sdl2Application::KeyEvent& event) -{ - do_key(event.key(), event.modifiers(), true, event.isRepeated()); -} - -void app::keyReleaseEvent(Platform::Sdl2Application::KeyEvent& event) -{ - do_key(event.key(), event.modifiers(), false, false); -} } // namespace Magnum::Examples |