-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workaround to fix fullscreen working incorrectly on modern windows
- Loading branch information
1 parent
7fe8c4f
commit 1d7cd83
Showing
5 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2024 jeonghun | ||
|
||
#include "fullscreen_fix.h" | ||
#include <ddraw.h> | ||
#include "dll_loader.h" | ||
|
||
namespace fullscreen { | ||
|
||
bool fix(HWND hwnd) { | ||
static dll_loader ddraw(L"ddraw.dll", true); | ||
|
||
IDirectDraw* ddraw_ptr = nullptr; | ||
if (SUCCEEDED(ddraw.call<decltype(&DirectDrawCreate)>( | ||
"DirectDrawCreate", nullptr, &ddraw_ptr, nullptr))) { | ||
HRESULT hr = ddraw_ptr->SetCooperativeLevel( | ||
hwnd, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE | DDSCL_NOWINDOWCHANGES); | ||
if (FAILED(hr)) | ||
return false; | ||
|
||
hr = ddraw_ptr->SetDisplayMode(1024, 768, 32); | ||
return SUCCEEDED(hr); | ||
} | ||
|
||
return true; | ||
} | ||
|
||
} // namespace fullscreen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright 2024 jeonghun | ||
|
||
#ifndef SAN9PK_WIN10_VERSION_FULLSCREEN_FIX_H_ | ||
#define SAN9PK_WIN10_VERSION_FULLSCREEN_FIX_H_ | ||
|
||
namespace fullscreen { | ||
|
||
bool fix(HWND hwnd); | ||
|
||
} // namespace fullscreen | ||
|
||
#endif // SAN9PK_WIN10_VERSION_FULLSCREEN_FIX_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters