Browse Source

Add "monitor" parameter to Graphics::GetDisplayDPI method.

Rokas Kupstys 8 years ago
parent
commit
9b5d759c60
2 changed files with 3 additions and 3 deletions
  1. 2 2
      Source/Urho3D/Graphics/Graphics.cpp
  2. 1 1
      Source/Urho3D/Graphics/Graphics.h

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

@@ -243,10 +243,10 @@ bool Graphics::GetMaximized() const
     return SDL_GetWindowFlags(window_) & SDL_WINDOW_MAXIMIZED;
 }
 
-Vector3 Graphics::GetDisplayDPI() const
+Vector3 Graphics::GetDisplayDPI(int monitor) const
 {
     Vector3 result;
-    SDL_GetDisplayDPI(0, &result.z_, &result.x_, &result.y_);
+    SDL_GetDisplayDPI(monitor, &result.z_, &result.x_, &result.y_);
     return result;
 }
 

+ 1 - 1
Source/Urho3D/Graphics/Graphics.h

@@ -379,7 +379,7 @@ public:
     /// Returns true if window is maximized or runs in full screen mode.
     bool GetMaximized() const;
     /// Return display dpi information: (hdpi, vdpi, ddpi). On failure returns zero vector.
-    Vector3 GetDisplayDPI() const;
+    Vector3 GetDisplayDPI(int monitor=0) const;
 
     /// Return hardware format for a compressed image format, or 0 if unsupported.
     unsigned GetFormat(CompressedFormat format) const;