MCPcopy Create free account
hub / github.com/axmolengine/axmol / alDebugMessageInsertDirectEXT

Function alDebugMessageInsertDirectEXT

3rdparty/openal/al/debug.cpp:241–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239
240FORCE_ALIGN DECL_FUNCEXT6(void, alDebugMessageInsert,EXT, ALenum, ALenum, ALuint, ALenum, ALsizei, const ALchar*)
241FORCE_ALIGN void AL_APIENTRY alDebugMessageInsertDirectEXT(ALCcontext *context, ALenum source,
242 ALenum type, ALuint id, ALenum severity, ALsizei length, const ALchar *message) noexcept
243{
244 if(!context->mContextFlags.test(ContextFlags::DebugBit))
245 return;
246
247 if(!message) UNLIKELY
248 return context->setError(AL_INVALID_VALUE, "Null message pointer");
249
250 auto msgview = (length < 0) ? std::string_view{message}
251 : std::string_view{message, static_cast<uint>(length)};
252 if(msgview.length() >= MaxDebugMessageLength) UNLIKELY
253 return context->setError(AL_INVALID_VALUE, "Debug message too long (%zu >= %d)",
254 msgview.length(), MaxDebugMessageLength);
255
256 auto dsource = GetDebugSource(source);
257 if(!dsource)
258 return context->setError(AL_INVALID_ENUM, "Invalid debug source 0x%04x", source);
259 if(*dsource != DebugSource::ThirdParty && *dsource != DebugSource::Application)
260 return context->setError(AL_INVALID_ENUM, "Debug source 0x%04x not allowed", source);
261
262 auto dtype = GetDebugType(type);
263 if(!dtype)
264 return context->setError(AL_INVALID_ENUM, "Invalid debug type 0x%04x", type);
265
266 auto dseverity = GetDebugSeverity(severity);
267 if(!dseverity)
268 return context->setError(AL_INVALID_ENUM, "Invalid debug severity 0x%04x", severity);
269
270 context->debugMessage(*dsource, *dtype, id, *dseverity, msgview);
271}
272
273
274FORCE_ALIGN DECL_FUNCEXT6(void, alDebugMessageControl,EXT, ALenum, ALenum, ALenum, ALsizei, const ALuint*, ALboolean)

Callers

nothing calls this directly

Calls 7

GetDebugSourceFunction · 0.85
GetDebugTypeFunction · 0.85
GetDebugSeverityFunction · 0.85
debugMessageMethod · 0.80
testMethod · 0.45
setErrorMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected