Update miniwin/miniwin/src/miniwin_ddraw.cpp

Co-authored-by: Anders Jenbo <anders@jenbo.dk>
This commit is contained in:
Anonymous Maarten 2025-05-16 18:33:29 +00:00 committed by GitHub
parent 9f78627646
commit 21a8eac003
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -253,6 +253,18 @@ HRESULT DirectDrawImpl::RestoreDisplayMode()
HRESULT DirectDrawImpl::SetCooperativeLevel(HWND hWnd, DDSCLFlags dwFlags)
{
if (hWnd) {
bool fullscreen;
if ((dwFlags & DDSCL_NORMAL) == DDSCL_NORMAL) {
fullscreen = false;
} else if ((dwFlags & DDSCL_FULLSCREEN) == DDSCL_FULLSCREEN) {
fullscreen = true;
} else {
return DDERR_INVALIDPARAMS;
}
if (!SDL_SetWindowFullscreen(hWnd, fullscreen)) {
return DDERR_GENERIC;
}
renderer = SDL_CreateRenderer(hWnd, NULL);
}
return DD_OK;