Select Audio DLL at runtime
Showing the changes to interface/src/Application.cpp (1 of 3 files). Show all
Unified · Split
| @@ -167,6 +167,8 @@ · 166 unmodified lines | |||
| 167 | // On Windows PC, NVidia Optimus laptop, we want to enable NVIDIA GPU | 167 | // On Windows PC, NVidia Optimus laptop, we want to enable NVIDIA GPU |
| 168 | // FIXME seems to be broken. | 168 | // FIXME seems to be broken. |
| 169 | #if defined(Q_OS_WIN) | 169 | #if defined(Q_OS_WIN) |
| 170 | #include <VersionHelpers.h> | ||
| 171 | |||
| 170 | extern "C" { | 172 | extern "C" { |
| 171 | _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; | 173 | _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; |
| 172 | } | 174 | } |
| @@ -417,6 +419,16 @@ bool setupEssentials(int& argc, char** argv) { · 244 unmodified lines | |||
| 417 | 419 | ||
| 418 | Setting::preInit(); | 420 | Setting::preInit(); |
| 419 | 421 | ||
| 422 | #if defined(Q_OS_WIN) | ||
| 423 | // Select appropriate audio DLL | ||
| 424 | QString audioDLLPath = QCoreApplication::applicationDirPath(); | ||
| 425 | if (IsWindows8OrGreater()) { | ||
| 426 | audioDLLPath += "/audioWin8"; | ||
| 427 | } else { | ||
| 428 | audioDLLPath += "/audioWin7"; | ||
| 429 | } | ||
| 430 | QCoreApplication::addLibraryPath(audioDLLPath); | ||
| 431 | #endif | ||
| 420 | 432 | ||
| 421 | static const auto SUPPRESS_SETTINGS_RESET = "--suppress-settings-reset"; | 433 | static const auto SUPPRESS_SETTINGS_RESET = "--suppress-settings-reset"; |
| 422 | bool suppressPrompt = cmdOptionExists(argc, const_cast<const char**>(argv), SUPPRESS_SETTINGS_RESET); | 434 | bool suppressPrompt = cmdOptionExists(argc, const_cast<const char**>(argv), SUPPRESS_SETTINGS_RESET); |