diff 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
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/OpenAL32/alError.c	Tue Oct 25 13:02:31 2011 -0700
     1.3 @@ -0,0 +1,47 @@
     1.4 +/**
     1.5 + * OpenAL cross platform audio library
     1.6 + * Copyright (C) 1999-2000 by authors.
     1.7 + * This library is free software; you can redistribute it and/or
     1.8 + *  modify it under the terms of the GNU Library General Public
     1.9 + *  License as published by the Free Software Foundation; either
    1.10 + *  version 2 of the License, or (at your option) any later version.
    1.11 + *
    1.12 + * This library is distributed in the hope that it will be useful,
    1.13 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.14 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.15 + *  Library General Public License for more details.
    1.16 + *
    1.17 + * You should have received a copy of the GNU Library General Public
    1.18 + *  License along with this library; if not, write to the
    1.19 + *  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    1.20 + *  Boston, MA  02111-1307, USA.
    1.21 + * Or go to http://www.gnu.org/copyleft/lgpl.html
    1.22 + */
    1.23 +
    1.24 +#include "config.h"
    1.25 +
    1.26 +#include "alMain.h"
    1.27 +#include "AL/alc.h"
    1.28 +#include "alError.h"
    1.29 +
    1.30 +AL_API ALenum AL_APIENTRY alGetError(ALvoid)
    1.31 +{
    1.32 +    ALCcontext *Context;
    1.33 +    ALenum errorCode;
    1.34 +
    1.35 +    Context = GetLockedContext();
    1.36 +    if(!Context) return AL_INVALID_OPERATION;
    1.37 +
    1.38 +    errorCode = Context->LastError;
    1.39 +    Context->LastError = AL_NO_ERROR;
    1.40 +
    1.41 +    UnlockContext(Context);
    1.42 +
    1.43 +    return errorCode;
    1.44 +}
    1.45 +
    1.46 +ALvoid alSetError(ALCcontext *Context, ALenum errorCode)
    1.47 +{
    1.48 +    if(Context->LastError == AL_NO_ERROR)
    1.49 +        Context->LastError = errorCode;
    1.50 +}