forked from mirror/openmw-tes3mp
Use the ALC_ENUMERATE_ALL_EXT extension with OpenAL when available
This commit is contained in:
parent
277597c567
commit
2f0af42261
1 changed files with 8 additions and 2 deletions
|
@ -363,6 +363,9 @@ std::vector<std::string> OpenAL_Output::enumerate()
|
|||
std::vector<std::string> devlist;
|
||||
const ALCchar *devnames;
|
||||
|
||||
if(alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT"))
|
||||
devnames = alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER);
|
||||
else
|
||||
devnames = alcGetString(NULL, ALC_DEVICE_SPECIFIER);
|
||||
while(devnames && *devnames)
|
||||
{
|
||||
|
@ -380,6 +383,9 @@ void OpenAL_Output::init(const std::string &devname)
|
|||
mDevice = alcOpenDevice(devname.c_str());
|
||||
if(!mDevice)
|
||||
fail("Failed to open \""+devname+"\"");
|
||||
if(alcIsExtensionPresent(mDevice, "ALC_ENUMERATE_ALL_EXT"))
|
||||
std::cout << "Opened \""<<alcGetString(mDevice, ALC_ALL_DEVICES_SPECIFIER)<<"\"" << std::endl;
|
||||
else
|
||||
std::cout << "Opened \""<<alcGetString(mDevice, ALC_DEVICE_SPECIFIER)<<"\"" << std::endl;
|
||||
|
||||
mContext = alcCreateContext(mDevice, NULL);
|
||||
|
|
Loading…
Reference in a new issue