Browse Source

Merge pull request #1943 from PredatorMF/master

Add missing monitor/refresh rate members initialization
Lasse Öörni 8 years ago
parent
commit
2af2ec66a2

+ 3 - 0
Source/Urho3D/Graphics/Direct3D11/D3D11Graphics.cpp

@@ -210,6 +210,8 @@ Graphics::Graphics(Context* context) :
     resizable_(false),
     highDPI_(false),
     vsync_(false),
+    monitor_(0),
+    refreshRate_(0),
     tripleBuffer_(false),
     flushGPU_(false),
     forceGL2_(false),
@@ -380,6 +382,7 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool borderless,
 
     AdjustWindow(width, height, fullscreen, borderless, monitor);
     monitor_ = monitor;
+    refreshRate_ = refreshRate;
 
     if (maximize)
     {

+ 4 - 0
Source/Urho3D/Graphics/OpenGL/OGLGraphics.cpp

@@ -234,6 +234,8 @@ Graphics::Graphics(Context* context_) :
     resizable_(false),
     highDPI_(false),
     vsync_(false),
+    monitor_(0),
+    refreshRate_(0),
     tripleBuffer_(false),
     sRGB_(false),
     forceGL2_(false),
@@ -506,6 +508,8 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool borderless,
     vsync_ = vsync;
     tripleBuffer_ = tripleBuffer;
     multiSample_ = multiSample;
+    monitor_ = monitor;
+    refreshRate_ = refreshRate;
 
     SDL_GL_GetDrawableSize(window_, &width_, &height_);
     if (!fullscreen)