diff options
author | Chris Robinson <[email protected]> | 2012-02-15 20:52:49 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-02-15 20:52:49 -0800 |
commit | 6b272ff585ee5e4563348e115d3c2b5fe689d2e7 (patch) | |
tree | bd21cabd573789e39b5125e716615c1ee26c1106 | |
parent | fecd679f33f32280192398e2881f12359b980a8c (diff) |
Add a device parameter to alcLoopbackOpenDeviceSOFT
-rw-r--r-- | Alc/ALc.c | 12 | ||||
-rw-r--r-- | OpenAL32/Include/alMain.h | 4 |
2 files changed, 11 insertions, 5 deletions
@@ -2658,12 +2658,18 @@ ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *pDevice) * * Open a loopback device, for manual rendering. */ -ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(void) +ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(ALCdevice *device) { - ALCdevice *device; - DO_INITCONFIG(); + /* Make sure the device, if specified, belongs to us. */ + if(device && !(device=VerifyDevice(device))) + { + alcSetError(device, ALC_INVALID_DEVICE); + return NULL; + } + if(device) ALCdevice_DecRef(device); + device = calloc(1, sizeof(ALCdevice)); if(!device) { diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 3deaad56..22220dff 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -39,11 +39,11 @@ #define ALC_6POINT1_SOFT 0x1505 /* (WFX order) */ #define ALC_7POINT1_SOFT 0x1506 /* (WFX order) */ -typedef ALCdevice* (ALC_APIENTRY*LPALCLOOPBACKOPENDEVICESOFT)(void); +typedef ALCdevice* (ALC_APIENTRY*LPALCLOOPBACKOPENDEVICESOFT)(ALCdevice*); typedef ALCboolean (ALC_APIENTRY*LPALCISRENDERFORMATSUPPORTEDSOFT)(ALCdevice*,ALCsizei,ALCenum,ALCenum); typedef void (ALC_APIENTRY*LPALCRENDERSAMPLESSOFT)(ALCdevice*,ALCvoid*,ALCsizei); #ifdef AL_ALEXT_PROTOTYPES -ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(void); +ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(ALCdevice *device); ALC_API ALCboolean ALC_APIENTRY alcIsRenderFormatSupportedSOFT(ALCdevice *device, ALCsizei freq, ALCenum channels, ALCenum type); ALC_API void ALC_APIENTRY alcRenderSamplesSOFT(ALCdevice *device, ALCvoid *buffer, ALCsizei samples); #endif |