Tech ENABLE_LEGACY_OPENGL_REMOVAL - Refactoring of Camera::apply_viewport()

This commit is contained in:
enricoturri1966 2022-03-23 11:11:13 +01:00
parent 9337e3814c
commit 3cecd07011

View File

@ -106,7 +106,11 @@ double Camera::get_fov() const
void Camera::apply_viewport(int x, int y, unsigned int w, unsigned int h) void Camera::apply_viewport(int x, int y, unsigned int w, unsigned int h)
{ {
glsafe(::glViewport(0, 0, w, 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())); glsafe(::glGetIntegerv(GL_VIEWPORT, m_viewport.data()));
#endif // ENABLE_LEGACY_OPENGL_REMOVAL
} }
#if !ENABLE_LEGACY_OPENGL_REMOVAL #if !ENABLE_LEGACY_OPENGL_REMOVAL