From 52d1f7883b9ff83ff1e3b7d7109e76003361b860 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 27 Feb 2017 20:56:34 -0800 Subject: Print WARNs when a device or context error is generated --- OpenAL32/alError.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenAL32/alError.c') diff --git a/OpenAL32/alError.c b/OpenAL32/alError.c index 6b7684ce..19fcaa6d 100644 --- a/OpenAL32/alError.c +++ b/OpenAL32/alError.c @@ -36,6 +36,8 @@ ALboolean TrapALError = AL_FALSE; ALvoid alSetError(ALCcontext *Context, ALenum errorCode) { ALenum curerr = AL_NO_ERROR; + + WARN("Error generated on context %p, code 0x%04x\n", Context, errorCode); if(TrapALError) { #ifdef _WIN32 @@ -46,6 +48,7 @@ ALvoid alSetError(ALCcontext *Context, ALenum errorCode) raise(SIGTRAP); #endif } + ATOMIC_COMPARE_EXCHANGE_STRONG_SEQ(ALenum, &Context->LastError, &curerr, errorCode); } @@ -57,6 +60,8 @@ AL_API ALenum AL_APIENTRY alGetError(void) Context = GetContextRef(); if(!Context) { + WARN("Querying error state on null context (implicitly 0x%04x)\n", + AL_INVALID_OPERATION); if(TrapALError) { #ifdef _WIN32 -- cgit v1.2.3