Browse Source

Fix Graphics::GetWindowPosition() to return actual window position when it is created. Position is queried from SDL

Rokas Kupstys 8 years ago
parent
commit
5cd0e558a9
1 changed files with 6 additions and 2 deletions
  1. 6 2
      Source/Urho3D/Graphics/Graphics.cpp

+ 6 - 2
Source/Urho3D/Graphics/Graphics.cpp

@@ -168,8 +168,12 @@ void Graphics::SetShaderParameter(StringHash param, const Variant& value)
 IntVector2 Graphics::GetWindowPosition() const
 IntVector2 Graphics::GetWindowPosition() const
 {
 {
     if (window_)
     if (window_)
-        return position_;
-    return IntVector2::ZERO;
+    {
+        IntVector2 position;
+        SDL_GetWindowPosition(window_, &position.x_, &position.y_);
+        return position;
+    }
+    return position_;
 }
 }
 
 
 PODVector<IntVector3> Graphics::GetResolutions(int monitor) const
 PODVector<IntVector3> Graphics::GetResolutions(int monitor) const