aboutsummaryrefslogtreecommitdiffstats
path: root/al/error.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-04-29 19:18:06 -0700
committerChris Robinson <[email protected]>2023-04-29 19:18:06 -0700
commita35211e2c1dc53e47c4a300366d22a27fb046a8c (patch)
treea0313f8d37a2193f1cdf07d37f8be4ba53ece8a1 /al/error.cpp
parent234174c62123c5d2f57d649722b5ca53b0de9d2d (diff)
Start a debug API extension
Diffstat (limited to 'al/error.cpp')
-rw-r--r--al/error.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/al/error.cpp b/al/error.cpp
index afa7019a..70081a2e 100644
--- a/al/error.cpp
+++ b/al/error.cpp
@@ -61,8 +61,13 @@ void ALCcontext::setError(ALenum errorCode, const char *msg, ...)
va_end(args2);
va_end(args);
- if(msglen >= 0) msg = message.data();
- else msg = "<internal error constructing message>";
+ if(msglen >= 0)
+ msg = message.data();
+ else
+ {
+ msg = "<internal error constructing message>";
+ msglen = static_cast<int>(strlen(msg));
+ }
WARN("Error generated on context %p, code 0x%04x, \"%s\"\n",
decltype(std::declval<void*>()){this}, errorCode, msg);
@@ -79,6 +84,8 @@ void ALCcontext::setError(ALenum errorCode, const char *msg, ...)
ALenum curerr{AL_NO_ERROR};
mLastError.compare_exchange_strong(curerr, errorCode);
+
+ debugMessage(DebugSource::API, DebugType::Error, 0, DebugSeverity::High, msglen, msg);
}
AL_API ALenum AL_APIENTRY alGetError(void)