Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: put SDL_WndProc behind _WIN32 ifdef #423

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

briaguya-ai
Copy link
Collaborator

This was added in #365

It is only used in _WIN32 #ifdef blocks

#ifdef _WIN32
static LRESULT CALLBACK gfx_sdl_wnd_proc(HWND h_wnd, UINT message, WPARAM w_param, LPARAM l_param) {
switch (message) {
case WM_GETDPISCALEDSIZE:
// Something is wrong with SDLs original implementation of WM_GETDPISCALEDSIZE, so pass it to the default
// system window procedure instead.
return DefWindowProc(h_wnd, message, w_param, l_param);
default:
// Pass anything else to SDLs original window procedure.
return CallWindowProc((WNDPROC)SDL_WndProc, h_wnd, message, w_param, l_param);
}
return 0;
};
#endif

#ifdef _WIN32
// Get Windows window handle and use it to subclass the window procedure.
// Needed to circumvent SDLs DPI scaling problems under windows (original does only scale *sometimes*).
SDL_SysWMinfo wmInfo;
SDL_VERSION(&wmInfo.version);
SDL_GetWindowWMInfo(wnd, &wmInfo);
HWND hwnd = wmInfo.info.win.window;
SDL_WndProc = SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)gfx_sdl_wnd_proc);
#endif

@Kenix3 Kenix3 merged commit bce05ad into Kenix3:o2r_support_merged Feb 6, 2024
4 checks passed
Kenix3 added a commit that referenced this pull request Feb 8, 2024
* Removes Pulse Audio. Config values will be migrated to sdl audio backend.

#311

* Removes PulseAudio.h from classes.h

* Refactors archives to have a separate manager class.

* Run clang-format

* Includes string in ResourceType.h

* Only include tchar.h in Context.cpp when building for Windows.

* Includes vector in ArchiveManager.h

* fix: put `SDL_WndProc` behind `_WIN32` ifdef (#423)

* Fix issues with Archive refactor (#424)

* get in game

* clang format

* windows build

* pr comments

* return false

* uncomment

* fix fonts

* pr comment

* init dadon't

* raw

* Fixes issue where ArchiveManager never unloads Archives.

* Fixes builds for StormLib issues. (#425)

* this is a stupid hack but i'm too tired to keep trying to figure out how we're linking everything

* link?

* ports...

* windows?

---------

Co-authored-by: briaguya <[email protected]>
@briaguya-ai briaguya-ai deleted the build-o2r-linux branch April 29, 2024 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants