1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-20 17:52:11 +01:00

wsi: Pass window state to setWindowMode

This commit is contained in:
Philip Rebohle 2024-10-26 13:50:57 +02:00 committed by Philip Rebohle
parent 5ad84563dd
commit 0259f55285
11 changed files with 13 additions and 3 deletions

View File

@ -1331,7 +1331,7 @@ namespace dxvk {
HMONITOR monitor = wsi::getDefaultMonitor(); HMONITOR monitor = wsi::getDefaultMonitor();
if (!wsi::setWindowMode(monitor, m_window, wsiMode)) if (!wsi::setWindowMode(monitor, m_window, &m_windowState, wsiMode))
return D3DERR_NOTAVAILABLE; return D3DERR_NOTAVAILABLE;
if (wsi::getCurrentDisplayMode(monitor, &wsiMode)) if (wsi::getCurrentDisplayMode(monitor, &wsiMode))

View File

@ -813,7 +813,7 @@ namespace dxvk {
if (!selectedMode.RefreshRate.Denominator) if (!selectedMode.RefreshRate.Denominator)
selectedMode.RefreshRate.Denominator = 1; selectedMode.RefreshRate.Denominator = 1;
if (!wsi::setWindowMode(outputDesc.Monitor, m_window, ConvertDisplayMode(selectedMode))) if (!wsi::setWindowMode(outputDesc.Monitor, m_window, &m_windowState, ConvertDisplayMode(selectedMode)))
return DXGI_ERROR_NOT_CURRENTLY_AVAILABLE; return DXGI_ERROR_NOT_CURRENTLY_AVAILABLE;
DXGI_VK_MONITOR_DATA* monitorData = nullptr; DXGI_VK_MONITOR_DATA* monitorData = nullptr;

View File

@ -75,6 +75,7 @@ namespace dxvk::wsi {
virtual bool setWindowMode( virtual bool setWindowMode(
HMONITOR hMonitor, HMONITOR hMonitor,
HWND hWindow, HWND hWindow,
DxvkWindowState* pState,
const WsiMode& mode); const WsiMode& mode);
virtual bool enterFullscreenMode( virtual bool enterFullscreenMode(

View File

@ -45,6 +45,7 @@ namespace dxvk::wsi {
bool GlfwWsiDriver::setWindowMode( bool GlfwWsiDriver::setWindowMode(
HMONITOR hMonitor, HMONITOR hMonitor,
HWND hWindow, HWND hWindow,
DxvkWindowState* pState,
const WsiMode& pMode) { const WsiMode& pMode) {
const int32_t displayId = fromHmonitor(hMonitor); const int32_t displayId = fromHmonitor(hMonitor);
GLFWwindow* window = fromHwnd(hWindow); GLFWwindow* window = fromHwnd(hWindow);

View File

@ -73,6 +73,7 @@ namespace dxvk::wsi {
virtual bool setWindowMode( virtual bool setWindowMode(
HMONITOR hMonitor, HMONITOR hMonitor,
HWND hWindow, HWND hWindow,
DxvkWindowState* pState,
const WsiMode& mode); const WsiMode& mode);
virtual bool enterFullscreenMode( virtual bool enterFullscreenMode(

View File

@ -44,6 +44,7 @@ namespace dxvk::wsi {
bool Sdl2WsiDriver::setWindowMode( bool Sdl2WsiDriver::setWindowMode(
HMONITOR hMonitor, HMONITOR hMonitor,
HWND hWindow, HWND hWindow,
DxvkWindowState* pState,
const WsiMode& pMode) { const WsiMode& pMode) {
const int32_t displayId = fromHmonitor(hMonitor); const int32_t displayId = fromHmonitor(hMonitor);
SDL_Window* window = fromHwnd(hWindow); SDL_Window* window = fromHwnd(hWindow);

View File

@ -60,6 +60,7 @@ namespace dxvk::wsi {
virtual bool setWindowMode( virtual bool setWindowMode(
HMONITOR hMonitor, HMONITOR hMonitor,
HWND hWindow, HWND hWindow,
DxvkWindowState* pState,
const WsiMode& mode); const WsiMode& mode);
virtual bool enterFullscreenMode( virtual bool enterFullscreenMode(

View File

@ -134,6 +134,7 @@ namespace dxvk::wsi {
bool Win32WsiDriver::setWindowMode( bool Win32WsiDriver::setWindowMode(
HMONITOR hMonitor, HMONITOR hMonitor,
HWND hWindow, HWND hWindow,
DxvkWindowState* pState,
const WsiMode& mode) { const WsiMode& mode) {
::MONITORINFOEXW monInfo; ::MONITORINFOEXW monInfo;
monInfo.cbSize = sizeof(monInfo); monInfo.cbSize = sizeof(monInfo);

View File

@ -80,8 +80,9 @@ namespace dxvk::wsi {
bool setWindowMode( bool setWindowMode(
HMONITOR hMonitor, HMONITOR hMonitor,
HWND hWindow, HWND hWindow,
DxvkWindowState* pState,
const WsiMode& mode) { const WsiMode& mode) {
return s_driver->setWindowMode(hMonitor, hWindow, mode); return s_driver->setWindowMode(hMonitor, hWindow, pState, mode);
} }
bool enterFullscreenMode( bool enterFullscreenMode(

View File

@ -60,6 +60,7 @@ namespace dxvk::wsi {
virtual bool setWindowMode( virtual bool setWindowMode(
HMONITOR hMonitor, HMONITOR hMonitor,
HWND hWindow, HWND hWindow,
DxvkWindowState* pState,
const WsiMode& mode) = 0; const WsiMode& mode) = 0;
virtual bool enterFullscreenMode( virtual bool enterFullscreenMode(

View File

@ -58,12 +58,14 @@ namespace dxvk::wsi {
* *
* \param [in] hMonitor The monitor * \param [in] hMonitor The monitor
* \param [in] hWindow The window (may be unused on some platforms) * \param [in] hWindow The window (may be unused on some platforms)
* \param [in] pState The swapchain's window state
* \param [in] mode The mode * \param [in] mode The mode
* \returns \c true on success, \c false on failure * \returns \c true on success, \c false on failure
*/ */
bool setWindowMode( bool setWindowMode(
HMONITOR hMonitor, HMONITOR hMonitor,
HWND hWindow, HWND hWindow,
DxvkWindowState* pState,
const WsiMode& mode); const WsiMode& mode);
/** /**