mirror of
https://github.com/narzoul/DDrawCompat
synced 2024-12-30 08:55:36 +01:00
parent
c7702913db
commit
7ec4d076f6
@ -119,13 +119,13 @@ namespace
|
|||||||
HRESULT STDMETHODCALLTYPE SetCooperativeLevel(TDirectDraw* This, HWND hWnd, DWORD dwFlags)
|
HRESULT STDMETHODCALLTYPE SetCooperativeLevel(TDirectDraw* This, HWND hWnd, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
HRESULT result = getOrigVtable(This).SetCooperativeLevel(This, hWnd, dwFlags);
|
HRESULT result = getOrigVtable(This).SetCooperativeLevel(This, hWnd, dwFlags);
|
||||||
if (SUCCEEDED(result) && (dwFlags & (DDSCL_FULLSCREEN | DDSCL_NORMAL)))
|
const bool isFullscreen = (dwFlags & DDSCL_FULLSCREEN) && (dwFlags & DDSCL_EXCLUSIVE);
|
||||||
|
if (SUCCEEDED(result) && (isFullscreen || (dwFlags & DDSCL_NORMAL)))
|
||||||
{
|
{
|
||||||
auto tagSurface = DDraw::TagSurface::get(*CompatPtr<IDirectDraw>::from(This));
|
auto tagSurface = DDraw::TagSurface::get(*CompatPtr<IDirectDraw>::from(This));
|
||||||
if (tagSurface)
|
if (tagSurface)
|
||||||
{
|
{
|
||||||
const bool wasFullscreen = tagSurface->isFullscreen();
|
const bool wasFullscreen = tagSurface->isFullscreen();
|
||||||
const bool isFullscreen = dwFlags & DDSCL_FULLSCREEN;
|
|
||||||
if (wasFullscreen != isFullscreen)
|
if (wasFullscreen != isFullscreen)
|
||||||
{
|
{
|
||||||
tagSurface->setFullscreenWindow(isFullscreen ? hWnd : nullptr);
|
tagSurface->setFullscreenWindow(isFullscreen ? hWnd : nullptr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user