Explorar el Código

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

Rokas Kupstys hace 8 años
padre
commit
5cd0e558a9
Se han modificado 1 ficheros con 6 adiciones y 2 borrados
  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
 {
     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