diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-20 21:25:28 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-20 21:25:28 +0200 |
commit | e81cf8b328c537bc74e57dc285371c266402087f (patch) | |
tree | df7d10bd050110857294cb2cdf1fe4b2c07e5784 /main/app.cpp | |
parent | d88a203787c6ff2af5d6405a07aed968cc1dc5c3 (diff) |
reduce window resize event boilerplate
Diffstat (limited to 'main/app.cpp')
-rw-r--r-- | main/app.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/main/app.cpp b/main/app.cpp index b1e616e4..a5062a82 100644 --- a/main/app.cpp +++ b/main/app.cpp @@ -65,8 +65,6 @@ app::app(const Arguments& arguments, app_settings opts): #endif //_framebuffer.attachRenderbuffer(GL::Framebuffer::BufferAttachment::DepthStencil, depthStencil); - update_window_scale(windowSize()); - setMinimalLoopPeriod(5); { auto c = _world[chunk_coords{0, 0}]; @@ -77,7 +75,8 @@ app::app(const Arguments& arguments, app_settings opts): void app::recalc_viewport(Vector2i size) { - update_window_scale(size); + _shader.set_scale(Vector2(size)); + _imgui.relayout(Vector2{ size }, size, size); GL::defaultFramebuffer.setViewport({{}, size }); _framebuffer.detach(GL::Framebuffer::ColorAttachment{0}); @@ -85,8 +84,6 @@ void app::recalc_viewport(Vector2i size) _msaa_color_texture.setStorage(1, GL::TextureFormat::RGBA8, size); _framebuffer.setViewport({{}, size }); _framebuffer.attachTexture(GL::Framebuffer::ColorAttachment{0}, _msaa_color_texture); - - _imgui.relayout(Vector2{ size }, size, size); } void app::viewportEvent(Platform::Sdl2Application::ViewportEvent& event) |