Audio: Fix loading of OpenAL

This commit is contained in:
Lynix 2022-05-08 15:44:59 +02:00
parent 17b1c2407d
commit 3c8b4c2587
1 changed files with 5 additions and 5 deletions

View File

@ -26,8 +26,8 @@ namespace Nz
#if defined(NAZARA_PLATFORM_WINDOWS) #if defined(NAZARA_PLATFORM_WINDOWS)
std::array libs{ std::array libs{
"soft_oal.dll", "soft_oal.dll",
"wrap_oal.dll", "openal32.dll",
"openal32.dll" "wrap_oal.dll"
}; };
#elif defined(NAZARA_PLATFORM_LINUX) #elif defined(NAZARA_PLATFORM_LINUX)
std::array libs { std::array libs {
@ -53,7 +53,7 @@ namespace Nz
auto LoadSymbol = [this](const char* name, bool optional) auto LoadSymbol = [this](const char* name, bool optional)
{ {
DynLibFunc funcPtr = m_library.GetSymbol(name); DynLibFunc funcPtr = m_library.GetSymbol(name);
if (!funcPtr) if (!funcPtr && !optional)
throw std::runtime_error(std::string("failed to load ") + name); throw std::runtime_error(std::string("failed to load ") + name);
return funcPtr; return funcPtr;
@ -74,12 +74,12 @@ namespace Nz
continue; continue;
} }
m_hasCaptureSupport = alcIsExtensionPresent(nullptr, "ALC_EXT_CAPTURE");
unloadOnFailure.Reset(); unloadOnFailure.Reset();
return true; return true;
} }
m_hasCaptureSupport = alcIsExtensionPresent(nullptr, "ALC_EXT_CAPTURE");
NazaraError("failed to load OpenAL library"); NazaraError("failed to load OpenAL library");
return false; return false;
} }