diff options
| author | 2026-04-17 15:21:32 +0200 | |
|---|---|---|
| committer | 2026-04-17 15:21:32 +0200 | |
| commit | d3d82c776740320dc29eca249f8cd5b1ae4d1b40 (patch) | |
| tree | 96d2ab1e717f8fa20f73713a95c3f4ce3fecb4e8 /src/osd/modules/input/input_dinput.cpp | |
| parent | 0b24b4c2f6052cea7d612408f4baa58ed63ee290 (diff) | |
| parent | 0034dde186fa6f594125ac3dc2b5977f18e7a062 (diff) | |
Merge branch 'master' into floppysound
Diffstat (limited to 'src/osd/modules/input/input_dinput.cpp')
| -rw-r--r-- | src/osd/modules/input/input_dinput.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/osd/modules/input/input_dinput.cpp b/src/osd/modules/input/input_dinput.cpp index 900aa4b8eec..5b2f99e7b01 100644 --- a/src/osd/modules/input/input_dinput.cpp +++ b/src/osd/modules/input/input_dinput.cpp @@ -1276,12 +1276,18 @@ std::pair<Microsoft::WRL::ComPtr<IDirectInputDevice8>, LPCDIDATAFORMAT> dinput_a window_handle = window.platform_window(); #elif defined(SDLMAME_WIN32) auto const sdlwindow = window.platform_window(); +#if SDL_VERSION_ATLEAST(3, 0, 0) + window_handle = reinterpret_cast<HWND>(SDL_GetPointerProperty(SDL_GetWindowProperties(sdlwindow), SDL_PROP_WINDOW_WIN32_HWND_POINTER, nullptr)); + if (!window_handle) + return std::make_pair(nullptr, nullptr); +#else SDL_SysWMinfo info; SDL_VERSION(&info.version); if (!SDL_GetWindowWMInfo(sdlwindow, &info)) return std::make_pair(nullptr, nullptr); window_handle = info.info.win.window; #endif +#endif switch (cooperative_level) { case dinput_cooperative_level::BACKGROUND: |
