[nostalgia/scene/studio] Simplify check for framebuffer resizing
This commit is contained in:
parent
4a9f035014
commit
e923c73c91
@ -21,9 +21,8 @@ ox::Error SceneEditorView::setupScene() noexcept {
|
|||||||
|
|
||||||
void SceneEditorView::draw(ox::Size const&targetSz) noexcept {
|
void SceneEditorView::draw(ox::Size const&targetSz) noexcept {
|
||||||
auto const scaleSz = targetSz / core::gl::drawSize(1);
|
auto const scaleSz = targetSz / core::gl::drawSize(1);
|
||||||
auto const scale = ox::max(1, ox::max(scaleSz.width, scaleSz.height));
|
if (m_scaleSz != scaleSz) [[unlikely]] {
|
||||||
if (m_scale != scale) {
|
m_scale = ox::max(1, ox::max(scaleSz.width, scaleSz.height));
|
||||||
m_scale = scale;
|
|
||||||
glutils::resizeInitFrameBuffer(m_frameBuffer, core::gl::drawSize(m_scale));
|
glutils::resizeInitFrameBuffer(m_frameBuffer, core::gl::drawSize(m_scale));
|
||||||
}
|
}
|
||||||
glutils::FrameBufferBind const frameBufferBind(m_frameBuffer);
|
glutils::FrameBufferBind const frameBufferBind(m_frameBuffer);
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include <glutils/glutils.hpp>
|
#include <glutils/glutils.hpp>
|
||||||
|
|
||||||
#include <nostalgia/core/context.hpp>
|
#include <nostalgia/core/context.hpp>
|
||||||
|
#include <nostalgia/core/gfx.hpp>
|
||||||
#include <nostalgia/scene/scene.hpp>
|
#include <nostalgia/scene/scene.hpp>
|
||||||
|
|
||||||
namespace nostalgia::scene {
|
namespace nostalgia::scene {
|
||||||
@ -19,6 +20,7 @@ class SceneEditorView {
|
|||||||
Scene m_scene;
|
Scene m_scene;
|
||||||
glutils::FrameBuffer m_frameBuffer;
|
glutils::FrameBuffer m_frameBuffer;
|
||||||
int m_scale = 1;
|
int m_scale = 1;
|
||||||
|
ox::Size m_scaleSz = core::gl::drawSize(m_scale);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SceneEditorView(turbine::Context &ctx, SceneStatic const&sceneStatic);
|
SceneEditorView(turbine::Context &ctx, SceneStatic const&sceneStatic);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user