summaryrefslogtreecommitdiffstats
path: root/src/libs/dxvk-native-1.9.2a/src/util/util_monitor.cpp
blob: 7e1b7c6d962e01d072ec0f5a228e238a60e8a176 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "util_monitor.h"
#include "util_string.h"

#include "../wsi/wsi_mode.h"
#include "../wsi/wsi_monitor.h"
#include "../wsi/wsi_window.h"

#include "./log/log.h"

namespace dxvk {
  
  HMONITOR GetDefaultMonitor() {
    return wsi::getDefaultMonitor();
  }


  void GetWindowClientSize(
          HWND                    hWnd,
          UINT*                   pWidth,
          UINT*                   pHeight) {
    wsi::getWindowSize(hWnd, pWidth, pHeight);
  }


  void GetMonitorClientSize(
          HMONITOR                hMonitor,
          UINT*                   pWidth,
          UINT*                   pHeight) {
    RECT rect;

    if (!wsi::getDesktopCoordinates(hMonitor, &rect)) {
      Logger::err("D3D9: Failed to query monitor info");
      return;
    }

    if (pWidth)
      *pWidth = rect.right - rect.left;
    
    if (pHeight)
      *pHeight = rect.bottom - rect.top;
  }


  void GetMonitorRect(
          HMONITOR                hMonitor,
          RECT*                   pRect) {
    if (!wsi::getDesktopCoordinates(hMonitor, pRect))
      Logger::err("D3D9: Failed to query monitor info");
  }

}