mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-03-20 12:14:45 +01:00
Added linux specific checkALerror.h
This commit is contained in:
parent
04dcec3686
commit
f2b0cf2e6a
45
src/native/linux/checkALerror.h
Normal file
45
src/native/linux/checkALerror.h
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
checkGLerror.h
|
||||
|
||||
Author: C. Prince
|
||||
Created: 8 November 2001
|
||||
|
||||
Error checking for OpenGL bindings
|
||||
*/
|
||||
|
||||
#ifndef _CHECKGLERROR_H_INCLUDED_
|
||||
#define _CHECKGLERROR_H_INCLUDED_
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
#include <jni.h>
|
||||
#include <AL/al.h>
|
||||
|
||||
#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
|
||||
|
||||
#define CHECK_AL_ERROR
|
||||
#define CHECK_ALC_ERROR
|
||||
|
||||
#endif /* _DEBUG */
|
||||
|
||||
#endif /* _CHECKGLERROR_H_INCLUDED_ */
|
||||
Loading…
Reference in a new issue