summaryrefslogtreecommitdiffhomepage
path: root/main
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-06 19:26:28 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-06 19:26:28 +0200
commit5d0b65de8f9e95fe813037ab5435fe547d406adc (patch)
tree7db954b0e425ef9a170c65aa921804d4e4691867 /main
parentf60d07f5d5d8e08be409e1ba2c11d2a936c2af99 (diff)
a
Diffstat (limited to 'main')
-rw-r--r--main/main.cpp54
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;