summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowwin32.cpp
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2020-07-17 20:28:02 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2020-07-17 20:28:02 +0300
commit44906ac0d44d3c3d1dc6dbf0d5e90926529e108d (patch)
tree49a40bcb81815f22c21f2e90858ffefd05401e25 /indra/llwindow/llwindowwin32.cpp
parent2c93c14c9d6cf6940169d33b806dede90e60033f (diff)
SL-13507 Viewer should log resolution of all associated displays
Diffstat (limited to 'indra/llwindow/llwindowwin32.cpp')
-rw-r--r--indra/llwindow/llwindowwin32.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 0b3936f8a5..3cbba59ed7 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -400,6 +400,39 @@ LLWinImm::~LLWinImm()
}
+class LLMonitorInfo
+{
+public:
+
+ std::vector<std::string> getResolutionsList() { return mResList; }
+
+ LLMonitorInfo()
+ {
+ EnumDisplayMonitors(0, 0, MonitorEnum, (LPARAM)this);
+ }
+
+private:
+
+ static BOOL CALLBACK MonitorEnum(HMONITOR hMon, HDC hdc, LPRECT lprcMonitor, LPARAM pData)
+ {
+ int monitor_width = lprcMonitor->right - lprcMonitor->left;
+ int monitor_height = lprcMonitor->bottom - lprcMonitor->top;
+
+ std::ostringstream sstream;
+ sstream << monitor_width << "x" << monitor_height;;
+ std::string res = sstream.str();
+
+ LLMonitorInfo* pThis = reinterpret_cast<LLMonitorInfo*>(pData);
+ pThis->mResList.push_back(res);
+
+ return TRUE;
+ }
+
+ std::vector<std::string> mResList;
+};
+
+static LLMonitorInfo sMonitorInfo;
+
LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,
const std::string& title, const std::string& name, S32 x, S32 y, S32 width,
S32 height, U32 flags,
@@ -4219,6 +4252,12 @@ F32 LLWindowWin32::getSystemUISize()
}
//static
+std::vector<std::string> LLWindowWin32::getDisplaysResolutionList()
+{
+ return sMonitorInfo.getResolutionsList();
+}
+
+//static
std::vector<std::string> LLWindowWin32::getDynamicFallbackFontList()
{
// Fonts previously in getFontListSans() have moved to fonts.xml.