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"
|
2003-12-15 06:49:17 -05:00
|
|
|
#include "common_tools.h"
|
2002-08-26 14:23:11 -04:00
|
|
|
|
|
|
|
#define CHECK_AL_ERROR \
|
|
|
|
{ \
|
2003-12-20 17:03:25 -05:00
|
|
|
if (ISDEBUGENABLED()) { \
|
2003-12-15 06:49:17 -05:00
|
|
|
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 17:03:25 -05:00
|
|
|
if (ISDEBUGENABLED()) { \
|
2003-12-15 06:49:17 -05:00
|
|
|
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_ */
|