From 3cecd0701173d881c7782b03af076c589292d55a Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Wed, 23 Mar 2022 11:11:13 +0100 Subject: [PATCH] Tech ENABLE_LEGACY_OPENGL_REMOVAL - Refactoring of Camera::apply_viewport() --- src/slic3r/GUI/Camera.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/slic3r/GUI/Camera.cpp b/src/slic3r/GUI/Camera.cpp index 77ce27a79..1370484c3 100644 --- a/src/slic3r/GUI/Camera.cpp +++ b/src/slic3r/GUI/Camera.cpp @@ -106,7 +106,11 @@ double Camera::get_fov() const void Camera::apply_viewport(int x, int y, unsigned int w, unsigned int h) { glsafe(::glViewport(0, 0, w, h)); +#if ENABLE_LEGACY_OPENGL_REMOVAL + m_viewport = { 0, 0, int(w), int(h) }; +#else glsafe(::glGetIntegerv(GL_VIEWPORT, m_viewport.data())); +#endif // ENABLE_LEGACY_OPENGL_REMOVAL } #if !ENABLE_LEGACY_OPENGL_REMOVAL