aboutsummaryrefslogtreecommitdiffstats
path: root/alc/context.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-05-03 10:42:32 -0700
committerChris Robinson <[email protected]>2023-05-03 12:18:42 -0700
commitce588ea5a3c3ee6c7fce64ec501a03ebaca373d4 (patch)
tree56bdc75dc41cc4d59b88f086c974bd7a648dbc2a /alc/context.cpp
parent90b0840d62a123e946e81f514bbe331897da8838 (diff)
Implement a context debug flag
Setting the debug flag at context creation enables more debug messages for the created context, and enables debug messages by default.
Diffstat (limited to 'alc/context.cpp')
-rw-r--r--alc/context.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/alc/context.cpp b/alc/context.cpp
index 6a2f57ca..2fbf67af 100644
--- a/alc/context.cpp
+++ b/alc/context.cpp
@@ -51,7 +51,7 @@ using voidp = void*;
constexpr ALchar alExtList[] =
"AL_EXT_ALAW "
"AL_EXT_BFORMAT "
- "AL_EXTX_DEBUG "
+ "AL_EXTX_debug "
"AL_EXT_DOUBLE "
"AL_EXT_EXPONENT_DISTANCE "
"AL_EXT_FLOAT32 "
@@ -119,10 +119,11 @@ void ALCcontext::setThreadContext(ALCcontext *context) noexcept
{ sThreadContext.set(context); }
#endif
-ALCcontext::ALCcontext(al::intrusive_ptr<ALCdevice> device)
- : ContextBase{device.get()}, mALDevice{std::move(device)}
+ALCcontext::ALCcontext(al::intrusive_ptr<ALCdevice> device, ContextFlagBitset flags)
+ : ContextBase{device.get()}, mALDevice{std::move(device)}, mContextFlags{flags}
{
mDebugGroups.emplace_back(DebugSource::Other, 0, std::string{});
+ mDebugEnabled.store(mContextFlags.test(ContextFlags::DebugBit), std::memory_order_relaxed);
}
ALCcontext::~ALCcontext()