[Openal] [openAl Soft] alGetString returning NULL pointer?
Andre Krause
post at andre-krause.net
Sat May 17 03:09:24 PDT 2008
currently, alGetString returns a null pointer if there is no valid context.
wouldnt it be a better idea to always return a valid string, so for example an
error message string that says something like "no valid context" or such?
that way one could easily write cerr << alGetString(alGetError());
here is the current implementation:
ALAPI const ALchar* ALAPIENTRY alGetString(ALenum pname)
{
const ALchar *value;
ALCcontext *pContext;
pContext = alcGetCurrentContext();
if(!pContext)
{
alSetError(AL_INVALID_OPERATION);
return NULL; <-- is this a good idea ?
}
More information about the Openal
mailing list