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 | 167 | // On Windows PC, NVidia Optimus laptop, we want to enable NVIDIA GPU |
| 168 | 168 | // FIXME seems to be broken. |
| 169 | 169 | #if defined(Q_OS_WIN) |
| 170 | +#include <VersionHelpers.h> | |
| 171 | + | |
| 170 | 172 | extern "C" { |
| 171 | 173 | _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; |
| 172 | 174 | } |
| @@ -417,6 +419,16 @@ bool setupEssentials(int& argc, char** argv) { · 244 unmodified lines | ||
| 417 | 419 | |
| 418 | 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 | 433 | static const auto SUPPRESS_SETTINGS_RESET = "--suppress-settings-reset"; |
| 422 | 434 | bool suppressPrompt = cmdOptionExists(argc, const_cast<const char**>(argv), SUPPRESS_SETTINGS_RESET); |