annotate OpenAL32/alError.c @ 0:f9476ff7637e

initial forking of open-al to create multiple listeners
author Robert McIntyre <rlm@mit.edu>
date Tue, 25 Oct 2011 13:02:31 -0700
parents
children
rev   line source
rlm@0 1 /**
rlm@0 2 * OpenAL cross platform audio library
rlm@0 3 * Copyright (C) 1999-2000 by authors.
rlm@0 4 * This library is free software; you can redistribute it and/or
rlm@0 5 * modify it under the terms of the GNU Library General Public
rlm@0 6 * License as published by the Free Software Foundation; either
rlm@0 7 * version 2 of the License, or (at your option) any later version.
rlm@0 8 *
rlm@0 9 * This library is distributed in the hope that it will be useful,
rlm@0 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
rlm@0 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
rlm@0 12 * Library General Public License for more details.
rlm@0 13 *
rlm@0 14 * You should have received a copy of the GNU Library General Public
rlm@0 15 * License along with this library; if not, write to the
rlm@0 16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
rlm@0 17 * Boston, MA 02111-1307, USA.
rlm@0 18 * Or go to http://www.gnu.org/copyleft/lgpl.html
rlm@0 19 */
rlm@0 20
rlm@0 21 #include "config.h"
rlm@0 22
rlm@0 23 #include "alMain.h"
rlm@0 24 #include "AL/alc.h"
rlm@0 25 #include "alError.h"
rlm@0 26
rlm@0 27 AL_API ALenum AL_APIENTRY alGetError(ALvoid)
rlm@0 28 {
rlm@0 29 ALCcontext *Context;
rlm@0 30 ALenum errorCode;
rlm@0 31
rlm@0 32 Context = GetLockedContext();
rlm@0 33 if(!Context) return AL_INVALID_OPERATION;
rlm@0 34
rlm@0 35 errorCode = Context->LastError;
rlm@0 36 Context->LastError = AL_NO_ERROR;
rlm@0 37
rlm@0 38 UnlockContext(Context);
rlm@0 39
rlm@0 40 return errorCode;
rlm@0 41 }
rlm@0 42
rlm@0 43 ALvoid alSetError(ALCcontext *Context, ALenum errorCode)
rlm@0 44 {
rlm@0 45 if(Context->LastError == AL_NO_ERROR)
rlm@0 46 Context->LastError = errorCode;
rlm@0 47 }