2002-08-26 20:23:11 +02:00
|
|
|
/*
|
2002-11-27 00:31:14 +01:00
|
|
|
checkALerror.h
|
2002-08-26 20:23:11 +02:00
|
|
|
|
|
|
|
|
Author: C. Prince
|
|
|
|
|
Created: 8 November 2001
|
|
|
|
|
|
2002-11-27 00:31:14 +01:00
|
|
|
Error checking for OpenAL bindings
|
2002-08-26 20:23:11 +02:00
|
|
|
*/
|
|
|
|
|
|
2002-11-27 00:31:14 +01:00
|
|
|
#ifndef _CHECKALERROR_H_INCLUDED_
|
|
|
|
|
#define _CHECKALERROR_H_INCLUDED_
|
2002-08-26 20:23:11 +02:00
|
|
|
|
|
|
|
|
#ifdef _DEBUG
|
|
|
|
|
|
|
|
|
|
#include <jni.h>
|
2002-11-28 23:06:37 +01:00
|
|
|
#include <AL/al.h>
|
2002-08-26 20:23:11 +02:00
|
|
|
|
|
|
|
|
#define CHECK_AL_ERROR \
|
|
|
|
|
{ \
|
|
|
|
|
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); \
|
|
|
|
|
} \
|
|
|
|
|
}
|
|
|
|
|
/* only available if deviceaddress is specified in method */
|
|
|
|
|
#define CHECK_ALC_ERROR \
|
|
|
|
|
{ \
|
|
|
|
|
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); \
|
|
|
|
|
} \
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
2002-08-27 22:44:19 +02:00
|
|
|
#define CHECK_AL_ERROR
|
|
|
|
|
#define CHECK_ALC_ERROR
|
2002-08-26 20:23:11 +02:00
|
|
|
|
|
|
|
|
#endif /* _DEBUG */
|
|
|
|
|
|
2002-11-27 00:31:14 +01:00
|
|
|
#endif /* _CHECKALERROR_H_INCLUDED_ */
|