mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:23:51 +00:00
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,7 +363,10 @@ std::vector<std::string> OpenAL_Output::enumerate()
|
||||||
std::vector<std::string> devlist;
|
std::vector<std::string> devlist;
|
||||||
const ALCchar *devnames;
|
const ALCchar *devnames;
|
||||||
|
|
||||||
devnames = alcGetString(NULL, ALC_DEVICE_SPECIFIER);
|
if(alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT"))
|
||||||
|
devnames = alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER);
|
||||||
|
else
|
||||||
|
devnames = alcGetString(NULL, ALC_DEVICE_SPECIFIER);
|
||||||
while(devnames && *devnames)
|
while(devnames && *devnames)
|
||||||
{
|
{
|
||||||
devlist.push_back(devnames);
|
devlist.push_back(devnames);
|
||||||
|
@ -380,7 +383,10 @@ void OpenAL_Output::init(const std::string &devname)
|
||||||
mDevice = alcOpenDevice(devname.c_str());
|
mDevice = alcOpenDevice(devname.c_str());
|
||||||
if(!mDevice)
|
if(!mDevice)
|
||||||
fail("Failed to open \""+devname+"\"");
|
fail("Failed to open \""+devname+"\"");
|
||||||
std::cout << "Opened \""<<alcGetString(mDevice, ALC_DEVICE_SPECIFIER)<<"\"" << std::endl;
|
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);
|
mContext = alcCreateContext(mDevice, NULL);
|
||||||
if(!mContext || alcMakeContextCurrent(mContext) == ALC_FALSE)
|
if(!mContext || alcMakeContextCurrent(mContext) == ALC_FALSE)
|
||||||
|
|
Loading…
Reference in a new issue