From 0daf18f0ec3189a0e5e3de44fa8054e5e2b51689 Mon Sep 17 00:00:00 2001 From: rti Date: Wed, 3 Nov 2010 20:10:22 +0100 Subject: [PATCH] Fixed: #1154 glViewport size wrong when switching from native fullscreen resolution to maximized window --- code/nel/src/3d/driver/opengl/driver_opengl_window.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp index 865cd221a..e340520ca 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -955,6 +955,10 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re if(!format) nlerror("cannot create NSOpenGLPixelFormat"); + // intially set height/width, further updates through CocoaOpenGLView + _WindowHeight = mode.Height; + _WindowWidth = mode.Width; + // create a opengl view with the created format _glView = [[CocoaOpenGLView alloc] initWithFrame:NSMakeRect(0, 0, mode.Width, mode.Height) @@ -2423,9 +2427,6 @@ void CDriverGL::setWindowSize(uint32 width, uint32 height) } } - _WindowWidth = width; - _WindowHeight = height; - #elif defined(NL_OS_UNIX) if (width != _WindowWidth || height != _WindowHeight)