Track whether a context is suspended or not

This commit is contained in:
Chris Robinson 2009-12-09 12:14:53 -08:00
parent 368ef1cea9
commit 2b7953c472
2 changed files with 11 additions and 4 deletions

View File

@ -596,6 +596,7 @@ static ALvoid InitContext(ALCcontext *pContext)
//Validate pContext
pContext->LastError = AL_NO_ERROR;
pContext->InUse = AL_FALSE;
pContext->Suspended = AL_FALSE;
//Set globals
pContext->DistanceModel = AL_INVERSE_DISTANCE_CLAMPED;
@ -772,8 +773,10 @@ ALCAPI ALCenum ALCAPIENTRY alcGetError(ALCdevice *device)
*/
ALCAPI ALCvoid ALCAPIENTRY alcSuspendContext(ALCcontext *pContext)
{
// Not a lot happens here !
(void)pContext;
SuspendContext(NULL);
if(IsContext(pContext))
pContext->Suspended = AL_TRUE;
ProcessContext(NULL);
}
@ -784,8 +787,10 @@ ALCAPI ALCvoid ALCAPIENTRY alcSuspendContext(ALCcontext *pContext)
*/
ALCAPI ALCvoid ALCAPIENTRY alcProcessContext(ALCcontext *pContext)
{
// Not a lot happens here !
(void)pContext;
SuspendContext(NULL);
if(IsContext(pContext))
pContext->Suspended = AL_FALSE;
ProcessContext(NULL);
}

View File

@ -316,6 +316,8 @@ struct ALCcontext_struct
ALenum LastError;
ALboolean InUse;
ALboolean Suspended;
ALenum DistanceModel;
ALboolean SourceDistanceModel;