From 05a0931d2d4b0d86921a2126c74155b787e7d59e Mon Sep 17 00:00:00 2001 From: sonninnos <45124675+sonninnos@users.noreply.github.com> Date: Thu, 16 Nov 2023 16:04:48 +0200 Subject: [PATCH] (WIN32) Prefer D3D11 and WASAPI (#15913) --- Makefile.msvc | 4 ++-- configuration.c | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile.msvc b/Makefile.msvc index cb5d17e65b..306440d1ad 100644 --- a/Makefile.msvc +++ b/Makefile.msvc @@ -25,11 +25,11 @@ HAVE_D3D12 := 1 HAVE_CG := 1 HAVE_OPENGL := 1 HAVE_OPENGL1 := 1 -HAVE_GFX_WIDGETS := 1 +HAVE_GFX_WIDGETS := 1 HAVE_VULKAN := 1 HAVE_XAUDIO := 1 HAVE_XINPUT := 1 -HAVE_WASAPI := 0 +HAVE_WASAPI := 1 HAVE_THREAD_STORAGE := 1 HAVE_WINMM := 1 diff --git a/configuration.c b/configuration.c index fd5d063806..ead27b4f2a 100644 --- a/configuration.c +++ b/configuration.c @@ -415,6 +415,9 @@ static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_METAL; #elif defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP /* Lets default to D3D11 in UWP, even when its compiled with ANGLE, since ANGLE is just calling D3D anyway.*/ static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_D3D11; +#elif defined(HAVE_D3D11) && defined(_WIN32_WINNT) && _WIN32_WINNT >= _WIN32_WINNT_WIN7 +/* Prefer D3D11 with Windows 7 and above. */ +static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_D3D11; #elif defined(HAVE_OPENGL1) && defined(_MSC_VER) && (_MSC_VER <= 1600) /* On Windows XP and earlier, use gl1 by default * (regular opengl has compatibility issues with @@ -522,12 +525,12 @@ static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_JACK; static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_COREAUDIO3; #elif defined(HAVE_COREAUDIO) static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_COREAUDIO; +#elif defined(HAVE_WASAPI) +static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_WASAPI; #elif defined(HAVE_XAUDIO) static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_XAUDIO; #elif defined(HAVE_DSOUND) static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_DSOUND; -#elif defined(HAVE_WASAPI) -static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_WASAPI; #elif defined(HAVE_AL) static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_AL; #elif defined(HAVE_SL)