Skip to content

Commit

Permalink
[dxgi] Remove obsolete global monitor helper functions
Browse files Browse the repository at this point in the history
  • Loading branch information
doitsujin committed Mar 14, 2019
1 parent 5b72e84 commit 1656860
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 76 deletions.
43 changes: 0 additions & 43 deletions src/dxgi/dxgi_monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

namespace dxvk {

std::mutex g_monitorMutex;
std::unordered_map<HMONITOR, DXGI_VK_MONITOR_DATA> g_monitorData;


DxgiMonitorInfo::DxgiMonitorInfo(IUnknown* pParent)
: m_parent(pParent) {

Expand Down Expand Up @@ -94,45 +90,6 @@ namespace dxvk {
}


HRESULT InitMonitorData(
HMONITOR hMonitor,
const DXGI_VK_MONITOR_DATA* pData) {
if (!hMonitor || !pData)
return E_INVALIDARG;

std::lock_guard<std::mutex> lock(g_monitorMutex);
auto result = g_monitorData.insert({ hMonitor, *pData });

return result.second ? S_OK : E_INVALIDARG;
}


HRESULT AcquireMonitorData(
HMONITOR hMonitor,
DXGI_VK_MONITOR_DATA** ppData) {
InitReturnPtr(ppData);

if (!hMonitor || !ppData)
return E_INVALIDARG;

g_monitorMutex.lock();

auto entry = g_monitorData.find(hMonitor);
if (entry == g_monitorData.end()) {
g_monitorMutex.unlock();
return DXGI_ERROR_NOT_FOUND;
}

*ppData = &entry->second;
return S_OK;
}


void ReleaseMonitorData() {
g_monitorMutex.unlock();
}


HRESULT GetMonitorDisplayMode(
HMONITOR hMonitor,
DWORD ModeNum,
Expand Down
33 changes: 0 additions & 33 deletions src/dxgi/dxgi_monitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,39 +55,6 @@ namespace dxvk {
uint32_t GetMonitorFormatBpp(
DXGI_FORMAT Format);

/**
* \brief Initializes monitor data
*
* Fails if data for the given monitor already exists.
* \param [in] hMonitor The monitor handle
* \param [in] pData Initial data
*/
HRESULT InitMonitorData(
HMONITOR hMonitor,
const DXGI_VK_MONITOR_DATA* pData);

/**
* \brief Retrieves and locks monitor data
*
* Fails if no data for the given monitor exists.
* \param [in] hMonitor The monitor handle
* \param [out] Pointer to monitor data
* \returns S_OK on success
*/
HRESULT AcquireMonitorData(
HMONITOR hMonitor,
DXGI_VK_MONITOR_DATA** ppData);

/**
* \brief Unlocks monitor data
*
* Must be called after each successful
* call to \ref AcquireMonitorData.
* \param [in] hMonitor The monitor handle
*/
void ReleaseMonitorData();


/**
* \brief Retrieves monitor display mode
*
Expand Down

0 comments on commit 1656860

Please sign in to comment.