From ce588ea5a3c3ee6c7fce64ec501a03ebaca373d4 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 3 May 2023 10:42:32 -0700 Subject: 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. --- alc/context.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'alc/context.h') diff --git a/alc/context.h b/alc/context.h index 9381db04..402794eb 100644 --- a/alc/context.h +++ b/alc/context.h @@ -43,6 +43,12 @@ enum class DebugSeverity : uint8_t; using uint = unsigned int; +enum ContextFlags { + DebugBit = 0, /* ALC_CONTEXT_DEBUG_BIT_EXT */ +}; +using ContextFlagBitset = std::bitset; + + struct DebugLogEntry { const DebugSource mSource; const DebugType mType; @@ -103,6 +109,7 @@ struct ALCcontext : public al::intrusive_ref, ContextBase { std::atomic mLastError{AL_NO_ERROR}; + const ContextFlagBitset mContextFlags; std::atomic mDebugEnabled{false}; DistanceModel mDistanceModel{DistanceModel::Default}; @@ -141,7 +148,7 @@ struct ALCcontext : public al::intrusive_ref, ContextBase { std::string mExtensionListOverride{}; - ALCcontext(al::intrusive_ptr device); + ALCcontext(al::intrusive_ptr device, ContextFlagBitset flags); ALCcontext(const ALCcontext&) = delete; ALCcontext& operator=(const ALCcontext&) = delete; ~ALCcontext(); -- cgit v1.2.3