Allow creating multiple contexts on a device

This commit is contained in:
Chris Robinson
2009-10-20 12:58:19 -07:00
parent 9c0ae597cd
commit cd695d7f15
+4 -3
View File
@@ -1138,12 +1138,13 @@ ALCAPI ALCcontext* ALCAPIENTRY alcCreateContext(ALCdevice *device, const ALCint
// Reset Context Last Error code
g_eLastContextError = ALC_NO_ERROR;
// Current implementation only allows one Context per Device
// If a context is already running on the device, stop playback so the
// device attributes can be updated
if(device->NumContexts > 0)
{
alcSetError(ALC_INVALID_VALUE);
ProcessContext(NULL);
return NULL;
ALCdevice_StopPlayback(device);
SuspendContext(NULL);
}
// Check for attributes