Changeset View
Changeset View
Standalone View
Standalone View
intern/ghost/intern/GHOST_SystemWin32.cpp
| Context not available. | |||||
| return t; | return t; | ||||
| } | } | ||||
| GHOST_TUns8 GHOST_SystemWin32::getNumDisplays() const | GHOST_TUns8 GHOST_SystemWin32::getNumDisplays() const | ||||
| { | { | ||||
| GHOST_ASSERT(m_displayManager, "GHOST_SystemWin32::getNumDisplays(): m_displayManager==0\n"); | GHOST_ASSERT(m_displayManager, "GHOST_SystemWin32::getNumDisplays(): m_displayManager==0\n"); | ||||
| Context not available. | |||||
| return numDisplays; | return numDisplays; | ||||
| } | } | ||||
| struct MonitorRects | |||||
| { | |||||
| std::vector<RECT> rects; | |||||
| static BOOL CALLBACK MonitorEnum(HMONITOR hMon, HDC hdc, LPRECT lprcMonitor, LPARAM pData) | |||||
| { | |||||
| MonitorRects* pThis = reinterpret_cast<MonitorRects*>(pData); | |||||
| pThis->rects.push_back(*lprcMonitor); | |||||
| return TRUE; | |||||
| } | |||||
| MonitorRects() | |||||
| { | |||||
| EnumDisplayMonitors(0, 0, MonitorEnum, (LPARAM)this); | |||||
| } | |||||
| }; | |||||
| void GHOST_SystemWin32::getDisplayDimensions( | |||||
| GHOST_TUns32 &x, GHOST_TUns32 &y, GHOST_TUns32 &width, | |||||
| GHOST_TUns32 &height, GHOST_TUns8 num) const | |||||
| { | |||||
| MonitorRects monitorRects = MonitorRects(); | |||||
| if (num < monitorRects.rects.size()) { | |||||
| RECT rect = monitorRects.rects[num]; | |||||
| x = rect.left; | |||||
| y = rect.top; | |||||
| width = rect.right - rect.left; | |||||
| height = rect.bottom - rect.top; | |||||
| } | |||||
| } | |||||
| void GHOST_SystemWin32::getMainDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const | void GHOST_SystemWin32::getMainDisplayDimensions( | ||||
| GHOST_TUns32 &x, GHOST_TUns32 &y, | |||||
| GHOST_TUns32 &width, GHOST_TUns32 &height) const | |||||
| { | { | ||||
| width = ::GetSystemMetrics(SM_CXSCREEN); | width = ::GetSystemMetrics(SM_CXSCREEN); | ||||
| height = ::GetSystemMetrics(SM_CYSCREEN); | height = ::GetSystemMetrics(SM_CYSCREEN); | ||||
| x = 0; | |||||
| y = 0; | |||||
| } | } | ||||
| void GHOST_SystemWin32::getAllDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const | void GHOST_SystemWin32::getAllDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const | ||||
| Context not available. | |||||