mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-05 13:30:34 +00:00
* BugFix: Fallback to ALC_ENUMERATION_EXT if ALC_ENUMERATE_ALL_EXT is not available.
This commit is contained in:
parent
43630c31c2
commit
6a94946e5b
1 changed files with 14 additions and 3 deletions
|
|
@ -55,9 +55,20 @@ ALDeviceList::ALDeviceList( const OPENALFNTABLE &oalft )
|
|||
defaultDeviceIndex = 0;
|
||||
|
||||
// grab function pointers for 1.0-API functions, and if successful proceed to enumerate all devices
|
||||
if (ALFunction.alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT")) {
|
||||
devices = (char *)ALFunction.alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER);
|
||||
defaultDeviceName = (char *)ALFunction.alcGetString(NULL, ALC_DEFAULT_ALL_DEVICES_SPECIFIER);
|
||||
const bool enumerationExtensionPresent = ALFunction.alcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT");
|
||||
const bool enumerateAllExtensionPresent = ALFunction.alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT");
|
||||
if (enumerateAllExtensionPresent || enumerationExtensionPresent) {
|
||||
if (enumerateAllExtensionPresent)
|
||||
{
|
||||
devices = (char *)ALFunction.alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER);
|
||||
defaultDeviceName = (char *)ALFunction.alcGetString(NULL, ALC_DEFAULT_ALL_DEVICES_SPECIFIER);
|
||||
}
|
||||
else
|
||||
{
|
||||
devices = (char *)ALFunction.alcGetString(NULL, ALC_DEVICE_SPECIFIER);
|
||||
defaultDeviceName = (char *)ALFunction.alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER);
|
||||
}
|
||||
|
||||
index = 0;
|
||||
// go through device list (each device terminated with a single NULL, list terminated with double NULL)
|
||||
while (*devices != 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue