Windows support for fullscreen borderless window mode
This commit is contained in:
@@ -20,6 +20,8 @@ public:
|
|||||||
virtual bool SupportsRenderToTexture() const { return true; }
|
virtual bool SupportsRenderToTexture() const { return true; }
|
||||||
virtual RenderTarget *CreateRenderTarget();
|
virtual RenderTarget *CreateRenderTarget();
|
||||||
|
|
||||||
|
bool SupportsFullscreenBorderlessWindow() const { return true; }
|
||||||
|
|
||||||
const ActualVideoModeParams GetActualVideoModeParams() const;
|
const ActualVideoModeParams GetActualVideoModeParams() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -261,12 +261,12 @@ RString GraphicsWindow::SetScreenMode( const VideoModeParams &p )
|
|||||||
return RString();
|
return RString();
|
||||||
}
|
}
|
||||||
|
|
||||||
static int GetWindowStyle( bool bWindowed )
|
static int GetWindowStyle( bool bWindowed , bool bWindowIsFullscreenBorderless)
|
||||||
{
|
{
|
||||||
if( bWindowed )
|
if( bWindowed && !bWindowIsFullscreenBorderless )
|
||||||
return WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
|
return WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
|
||||||
else
|
else
|
||||||
return WS_POPUP;
|
return WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the final window size, set the window text and icon, and then unhide the
|
/* Set the final window size, set the window text and icon, and then unhide the
|
||||||
@@ -280,7 +280,7 @@ void GraphicsWindow::CreateGraphicsWindow( const VideoModeParams &p, bool bForce
|
|||||||
|
|
||||||
if( g_hWndMain == nullptr || bForceRecreateWindow )
|
if( g_hWndMain == nullptr || bForceRecreateWindow )
|
||||||
{
|
{
|
||||||
int iWindowStyle = GetWindowStyle( p.windowed );
|
int iWindowStyle = GetWindowStyle( p.windowed , p.bWindowIsFullscreenBorderless );
|
||||||
|
|
||||||
AppInstance inst;
|
AppInstance inst;
|
||||||
HWND hWnd = CreateWindow( g_sClassName, "app", iWindowStyle,
|
HWND hWnd = CreateWindow( g_sClassName, "app", iWindowStyle,
|
||||||
@@ -331,7 +331,7 @@ void GraphicsWindow::CreateGraphicsWindow( const VideoModeParams &p, bool bForce
|
|||||||
|
|
||||||
/* The window style may change as a result of switching to or from fullscreen;
|
/* The window style may change as a result of switching to or from fullscreen;
|
||||||
* apply it. Don't change the WS_VISIBLE bit. */
|
* apply it. Don't change the WS_VISIBLE bit. */
|
||||||
int iWindowStyle = GetWindowStyle( p.windowed );
|
int iWindowStyle = GetWindowStyle(p.windowed, p.bWindowIsFullscreenBorderless);
|
||||||
if( GetWindowLong( g_hWndMain, GWL_STYLE ) & WS_VISIBLE )
|
if( GetWindowLong( g_hWndMain, GWL_STYLE ) & WS_VISIBLE )
|
||||||
iWindowStyle |= WS_VISIBLE;
|
iWindowStyle |= WS_VISIBLE;
|
||||||
SetWindowLong( g_hWndMain, GWL_STYLE, iWindowStyle );
|
SetWindowLong( g_hWndMain, GWL_STYLE, iWindowStyle );
|
||||||
|
|||||||
Reference in New Issue
Block a user