lwjgl/src/native/common/checkALerror.h

42 lines
1021 B
C
Raw Normal View History

2002-08-26 14:23:11 -04:00
/*
2002-11-26 18:31:14 -05:00
checkALerror.h
2002-08-26 14:23:11 -04:00
Author: C. Prince
Created: 8 November 2001
2002-11-26 18:31:14 -05:00
Error checking for OpenAL bindings
2002-08-26 14:23:11 -04:00
*/
2002-11-26 18:31:14 -05:00
#ifndef _CHECKALERROR_H_INCLUDED_
#define _CHECKALERROR_H_INCLUDED_
2002-08-26 14:23:11 -04:00
#include <jni.h>
2002-12-14 07:49:16 -05:00
#include "extal.h"
#include "common_tools.h"
2002-08-26 14:23:11 -04:00
#define CHECK_AL_ERROR \
{ \
2003-12-20 09:01:31 -05:00
if (ATDEBUGLEVEL(org_lwjgl_Sys_DEBUG)) { \
int err = alGetError(); \
if (err != AL_NO_ERROR) { \
jclass cls = env->FindClass("org/lwjgl/openal/OpenALException"); \
env->ThrowNew(cls, (const char*) alGetString(err)); \
env->DeleteLocalRef(cls); \
} \
2002-08-26 14:23:11 -04:00
} \
}
/* only available if deviceaddress is specified in method */
#define CHECK_ALC_ERROR \
{ \
2003-12-20 09:01:31 -05:00
if (ATDEBUGLEVEL(org_lwjgl_Sys_DEBUG)) { \
int err = alcGetError((ALCdevice*) deviceaddress); \
if (err != AL_NO_ERROR) { \
jclass cls = env->FindClass("org/lwjgl/openal/OpenALException"); \
env->ThrowNew(cls, (const char*) alcGetString((ALCdevice*) deviceaddress, err)); \
env->DeleteLocalRef(cls); \
} \
2002-08-26 14:23:11 -04:00
} \
}
2002-11-26 18:31:14 -05:00
#endif /* _CHECKALERROR_H_INCLUDED_ */