diff options
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: |
