2002-08-20 10:46:04 -04:00
|
|
|
/*
|
2003-07-02 18:42:41 -04:00
|
|
|
* Copyright (c) 2002 Lightweight Java Game Library Project
|
2002-08-20 10:46:04 -04:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are
|
|
|
|
* met:
|
|
|
|
*
|
|
|
|
* * Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
*
|
|
|
|
* * Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
2003-07-02 18:42:41 -04:00
|
|
|
* * Neither the name of 'Lightweight Java Game Library' nor the names of
|
2002-08-20 10:46:04 -04:00
|
|
|
* its contributors may be used to endorse or promote products derived
|
|
|
|
* from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
|
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
|
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
|
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
|
|
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
|
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* This is the actual JNI implementation of the OpenAL context/device library.
|
|
|
|
*
|
|
|
|
* @author Brian Matzon <brian@matzon.dk>
|
|
|
|
* @version $Revision$
|
|
|
|
*/
|
2002-11-28 15:25:10 -05:00
|
|
|
|
|
|
|
/* OpenAL includes */
|
2002-08-26 14:23:11 -04:00
|
|
|
#include "checkALerror.h"
|
2002-12-14 07:49:16 -05:00
|
|
|
#include "extal.h"
|
2002-08-20 10:46:04 -04:00
|
|
|
|
2004-03-09 06:03:10 -05:00
|
|
|
//alc
|
|
|
|
typedef ALCubyte* (ALCAPIENTRY *alcGetStringPROC)(ALCdevice *device,ALCenum param);
|
|
|
|
typedef ALCvoid (ALCAPIENTRY *alcGetIntegervPROC)(ALCdevice *device,ALCenum param,ALCsizei size,ALCint *data);
|
|
|
|
typedef ALCdevice* (ALCAPIENTRY *alcOpenDevicePROC)(ALCubyte *deviceName);
|
|
|
|
typedef ALCvoid (ALCAPIENTRY *alcCloseDevicePROC)(ALCdevice *device);
|
|
|
|
typedef ALCcontext* (ALCAPIENTRY *alcCreateContextPROC)(ALCdevice *device,ALCint *attrList);
|
|
|
|
typedef ALCboolean (ALCAPIENTRY *alcMakeContextCurrentPROC)(ALCcontext *context);
|
|
|
|
typedef ALCvoid (ALCAPIENTRY *alcProcessContextPROC)(ALCcontext *context);
|
|
|
|
typedef ALCdevice* (ALCAPIENTRY *alcGetContextsDevicePROC)(ALCcontext *context);
|
|
|
|
typedef ALCvoid (ALCAPIENTRY *alcSuspendContextPROC)(ALCcontext *context);
|
|
|
|
typedef ALCvoid (ALCAPIENTRY *alcDestroyContextPROC)(ALCcontext *context);
|
|
|
|
typedef ALCenum (ALCAPIENTRY *alcGetErrorPROC)(ALCdevice *device);
|
|
|
|
typedef ALCboolean (ALCAPIENTRY *alcIsExtensionPresentPROC)(ALCdevice *device,ALCubyte *extName);
|
|
|
|
//typedef ALCvoid* (ALCAPIENTRY *alcGetProcAddressPROC)(ALCdevice *device,ALCubyte *funcName);
|
|
|
|
typedef ALCenum (ALCAPIENTRY *alcGetEnumValuePROC)(ALCdevice *device,ALCubyte *enumName);
|
|
|
|
|
2004-03-10 03:42:40 -05:00
|
|
|
alcGetCurrentContextPROC alcGetCurrentContext;
|
2004-03-09 06:03:10 -05:00
|
|
|
static alcGetStringPROC alcGetString;
|
|
|
|
static alcGetIntegervPROC alcGetIntegerv;
|
|
|
|
static alcOpenDevicePROC alcOpenDevice;
|
|
|
|
static alcCloseDevicePROC alcCloseDevice;
|
|
|
|
static alcCreateContextPROC alcCreateContext;
|
|
|
|
static alcMakeContextCurrentPROC alcMakeContextCurrent;
|
|
|
|
static alcProcessContextPROC alcProcessContext;
|
|
|
|
static alcGetContextsDevicePROC alcGetContextsDevice;
|
|
|
|
static alcSuspendContextPROC alcSuspendContext;
|
|
|
|
static alcDestroyContextPROC alcDestroyContext;
|
|
|
|
static alcGetErrorPROC alcGetError;
|
|
|
|
static alcIsExtensionPresentPROC alcIsExtensionPresent;
|
|
|
|
//static alcGetProcAddressPROC alcGetProcAddress;
|
|
|
|
static alcGetEnumValuePROC alcGetEnumValue;
|
2002-09-03 15:24:57 -04:00
|
|
|
|
2002-08-20 10:46:04 -04:00
|
|
|
/**
|
|
|
|
* This function returns strings related to the context.
|
|
|
|
*
|
|
|
|
* C Specification:
|
|
|
|
* ALubyte * alcGetString(ALCdevice *device, ALenum token);
|
|
|
|
*/
|
2004-03-09 06:03:10 -05:00
|
|
|
static jstring JNICALL Java_org_lwjgl_openal_ALC_nalcGetString (JNIEnv *env, jclass clazz, jint deviceaddress, jint token) {
|
2002-08-26 18:16:25 -04:00
|
|
|
const char* alcString = (const char*) alcGetString((ALCdevice*) deviceaddress, (ALenum) token);
|
|
|
|
if(alcString == NULL) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
jstring string = env->NewStringUTF(alcString);
|
2002-08-26 14:23:11 -04:00
|
|
|
|
|
|
|
CHECK_ALC_ERROR
|
|
|
|
return string;
|
2002-08-20 10:46:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function returns integers related to the context.
|
|
|
|
*
|
|
|
|
* C Specification:
|
|
|
|
* ALvoid alcGetIntegerv(ALCdevice *device, ALenum token, ALsizei size, ALint *dest);
|
|
|
|
*/
|
2004-03-09 06:03:10 -05:00
|
|
|
static void JNICALL Java_org_lwjgl_openal_ALC_nalcGetIntegerv (JNIEnv *env, jclass clazz, jint deviceaddress, jint token, jint size, jobject dest, jint offset) {
|
2003-07-02 18:42:41 -04:00
|
|
|
ALint* address = NULL;
|
|
|
|
if (dest != NULL) {
|
2003-08-11 15:58:12 -04:00
|
|
|
address = offset + (ALint*) env->GetDirectBufferAddress(dest);
|
2003-07-02 18:42:41 -04:00
|
|
|
}
|
|
|
|
alcGetIntegerv((ALCdevice*) deviceaddress, (ALenum) token, (ALsizei) size, address);
|
2002-08-26 14:23:11 -04:00
|
|
|
CHECK_ALC_ERROR
|
2002-08-20 10:46:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function opens a device by name.
|
|
|
|
*
|
|
|
|
* C Specification:
|
|
|
|
* ALCdevice *alcOpenDevice( const ALubyte *tokstr );
|
|
|
|
*/
|
2004-03-09 06:03:10 -05:00
|
|
|
static jobject JNICALL Java_org_lwjgl_openal_ALC_alcOpenDevice (JNIEnv *env, jclass clazz, jstring tokstr) {
|
2003-03-17 13:34:43 -05:00
|
|
|
const char * tokenstring;
|
2002-08-26 17:28:30 -04:00
|
|
|
|
2003-03-17 13:34:43 -05:00
|
|
|
jboolean isCopy = JNI_FALSE;
|
2002-08-26 17:28:30 -04:00
|
|
|
if(tokstr != NULL) {
|
2003-03-17 13:34:43 -05:00
|
|
|
tokenstring = (env->GetStringUTFChars(tokstr, &isCopy));
|
2002-08-26 17:28:30 -04:00
|
|
|
} else {
|
|
|
|
tokenstring = NULL;
|
|
|
|
}
|
2002-08-20 10:46:04 -04:00
|
|
|
|
|
|
|
/* get device */
|
2003-03-17 13:34:43 -05:00
|
|
|
ALCdevice* device = alcOpenDevice((ALubyte *) tokenstring);
|
2002-08-20 10:46:04 -04:00
|
|
|
|
2002-08-25 07:02:21 -04:00
|
|
|
/* if error - cleanup and get out */
|
|
|
|
if(device == NULL) {
|
2002-08-26 17:28:30 -04:00
|
|
|
if(tokenstring != NULL) {
|
2003-03-17 13:34:43 -05:00
|
|
|
env->ReleaseStringUTFChars(tokstr, tokenstring);
|
2002-08-26 17:28:30 -04:00
|
|
|
}
|
2002-08-25 07:02:21 -04:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2002-08-20 10:46:04 -04:00
|
|
|
/* get ready to create ALCdevice instance */
|
|
|
|
jobject alcDevice_object = NULL;
|
|
|
|
jclass alcDevice_class = NULL;
|
|
|
|
jmethodID alcDevice_method = NULL;
|
|
|
|
|
|
|
|
/* find class and constructor */
|
|
|
|
alcDevice_class = env->FindClass("org/lwjgl/openal/ALCdevice");
|
|
|
|
alcDevice_method = env->GetMethodID(alcDevice_class, "<init>", "(I)V");
|
|
|
|
|
|
|
|
/* create instance */
|
|
|
|
alcDevice_object = env->NewObject(alcDevice_class, alcDevice_method, (int) device);
|
|
|
|
|
|
|
|
/* clean up */
|
2003-03-17 13:34:43 -05:00
|
|
|
if (tokenstring != NULL)
|
|
|
|
env->ReleaseStringUTFChars(tokstr, tokenstring);
|
2002-08-20 10:46:04 -04:00
|
|
|
|
|
|
|
return alcDevice_object;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function closes a device by name.
|
|
|
|
*
|
|
|
|
* C Specification:
|
|
|
|
* void alcCloseDevice( ALCdevice *dev );
|
|
|
|
*/
|
2004-03-09 06:03:10 -05:00
|
|
|
static void JNICALL Java_org_lwjgl_openal_ALC_alcCloseDevice (JNIEnv *env, jclass clazz, jint deviceaddress) {
|
2002-08-20 10:46:04 -04:00
|
|
|
alcCloseDevice((ALCdevice*) deviceaddress);
|
2002-08-26 14:23:11 -04:00
|
|
|
CHECK_ALC_ERROR
|
2002-08-20 10:46:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function creates a context using a specified device.
|
|
|
|
*
|
|
|
|
* C Specification:
|
|
|
|
* ALCcontext* alcCreateContext( ALCdevice *dev, ALint* attrlist );
|
|
|
|
*/
|
2004-03-09 06:03:10 -05:00
|
|
|
static jobject JNICALL Java_org_lwjgl_openal_ALC_alcCreateContext (JNIEnv *env, jclass clazz, jint deviceaddress, jobject attrlist) {
|
2003-07-02 18:42:41 -04:00
|
|
|
ALint* address = NULL;
|
|
|
|
if (attrlist != NULL) {
|
|
|
|
address = (ALint*) env->GetDirectBufferAddress(attrlist);
|
|
|
|
}
|
|
|
|
ALCcontext* context = alcCreateContext((ALCdevice*) deviceaddress, address);
|
2002-08-26 11:07:31 -04:00
|
|
|
|
2002-08-25 07:02:21 -04:00
|
|
|
/* if error - get out */
|
|
|
|
if(context == NULL) {
|
|
|
|
return NULL;
|
|
|
|
}
|
2002-08-20 10:46:04 -04:00
|
|
|
|
|
|
|
/* get ready to create ALCcontext instance */
|
|
|
|
jobject alcContext_object = NULL;
|
|
|
|
jclass alcContext_class = NULL;
|
|
|
|
jmethodID alcContext_method = NULL;
|
|
|
|
|
|
|
|
/* find class and constructor */
|
|
|
|
alcContext_class = env->FindClass("org/lwjgl/openal/ALCcontext");
|
|
|
|
alcContext_method = env->GetMethodID(alcContext_class, "<init>", "(I)V");
|
|
|
|
|
|
|
|
/* create instance */
|
|
|
|
alcContext_object = env->NewObject(alcContext_class, alcContext_method, (int) context);
|
|
|
|
|
2002-08-26 14:23:11 -04:00
|
|
|
CHECK_ALC_ERROR
|
2002-08-20 10:46:04 -04:00
|
|
|
return alcContext_object;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function makes a specified context the current context.
|
|
|
|
*
|
|
|
|
* C Specification:
|
|
|
|
* ALCboolean alcMakeContextCurrent(ALCcontext *context);
|
|
|
|
*/
|
2004-03-09 06:03:10 -05:00
|
|
|
static jboolean JNICALL Java_org_lwjgl_openal_ALC_alcMakeContextCurrent (JNIEnv *env, jclass clazz, jint contextaddress) {
|
2003-07-05 17:58:35 -04:00
|
|
|
ALCcontext* context = (ALCcontext*) contextaddress;
|
|
|
|
if(context == NULL) {
|
2002-08-27 13:45:40 -04:00
|
|
|
return alcMakeContextCurrent(NULL);
|
|
|
|
}
|
2003-07-05 17:58:35 -04:00
|
|
|
return alcMakeContextCurrent(context);
|
2002-08-20 10:46:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function tells a context to begin processing.
|
|
|
|
*
|
|
|
|
* C Specification:
|
|
|
|
* void alcProcessContext(ALCcontext *context);
|
|
|
|
*/
|
2004-03-09 06:03:10 -05:00
|
|
|
static void JNICALL Java_org_lwjgl_openal_ALC_nalcProcessContext (JNIEnv *env, jclass clazz, jint contextaddress) {
|
2002-08-20 10:46:04 -04:00
|
|
|
alcProcessContext((ALCcontext*) contextaddress);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function retrieves the current context.
|
|
|
|
*
|
|
|
|
* C Specification:
|
|
|
|
* ALCcontext* alcGetCurrentContext( ALvoid );
|
|
|
|
*/
|
2004-03-09 06:03:10 -05:00
|
|
|
static jobject JNICALL Java_org_lwjgl_openal_ALC_alcGetCurrentContext (JNIEnv *env, jclass clazz) {
|
2002-08-20 10:46:04 -04:00
|
|
|
|
2002-08-25 07:02:21 -04:00
|
|
|
ALCcontext* context = alcGetCurrentContext();
|
|
|
|
if(context == NULL) {
|
|
|
|
return NULL;
|
|
|
|
}
|
2002-08-20 10:46:04 -04:00
|
|
|
|
|
|
|
/* get ready to create ALCcontext instance */
|
|
|
|
jobject alcContext_object = NULL;
|
|
|
|
jclass alcContext_class = NULL;
|
|
|
|
jmethodID alcContext_method = NULL;
|
|
|
|
|
|
|
|
/* find class and constructor */
|
|
|
|
alcContext_class = env->FindClass("org/lwjgl/openal/ALCcontext");
|
|
|
|
alcContext_method = env->GetMethodID(alcContext_class, "<init>", "(I)V");
|
|
|
|
|
|
|
|
/* create instance */
|
|
|
|
alcContext_object = env->NewObject(alcContext_class, alcContext_method, (int) context);
|
|
|
|
|
|
|
|
return alcContext_object;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function retrieves the specified contexts device
|
|
|
|
*
|
|
|
|
* C Specification:
|
|
|
|
* ALCdevice* alcGetContextsDevice(ALCcontext *context);
|
|
|
|
*/
|
2004-03-09 06:03:10 -05:00
|
|
|
static jobject JNICALL Java_org_lwjgl_openal_ALC_alcGetContextsDevice (JNIEnv *env, jclass clazz, jint contextaddress) {
|
2002-08-20 10:46:04 -04:00
|
|
|
|
|
|
|
ALCdevice* device = alcGetContextsDevice((ALCcontext*) contextaddress);
|
2002-08-25 07:02:21 -04:00
|
|
|
if(device == NULL) {
|
|
|
|
return NULL;
|
|
|
|
}
|
2002-08-20 10:46:04 -04:00
|
|
|
|
2002-08-25 07:02:21 -04:00
|
|
|
/* get ready to create ALCdevice instance */
|
2002-08-20 10:46:04 -04:00
|
|
|
jobject alcDevice_object = NULL;
|
|
|
|
jclass alcDevice_class = NULL;
|
|
|
|
jmethodID alcDevice_method = NULL;
|
|
|
|
|
|
|
|
/* find class and constructor */
|
|
|
|
alcDevice_class = env->FindClass("org/lwjgl/openal/ALCdevice");
|
|
|
|
alcDevice_method = env->GetMethodID(alcDevice_class, "<init>", "(I)V");
|
|
|
|
|
|
|
|
/* create instance */
|
|
|
|
alcDevice_object = env->NewObject(alcDevice_class, alcDevice_method, (int) device);
|
|
|
|
|
|
|
|
return alcDevice_object;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function suspends processing on a specified context.
|
|
|
|
*
|
|
|
|
* C Specification:
|
|
|
|
* void alcSuspendContext(ALCcontext *context);
|
|
|
|
*/
|
2004-03-09 06:03:10 -05:00
|
|
|
static void JNICALL Java_org_lwjgl_openal_ALC_alcSuspendContext (JNIEnv *env, jclass clazz, jint contextaddress) {
|
2002-08-20 10:46:04 -04:00
|
|
|
alcSuspendContext((ALCcontext*) contextaddress);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function destroys a context.
|
|
|
|
*
|
|
|
|
* C Specification:
|
|
|
|
* void alcDestroyContext(ALCcontext *context);
|
|
|
|
*/
|
2004-03-09 06:03:10 -05:00
|
|
|
static void JNICALL Java_org_lwjgl_openal_ALC_alcDestroyContext (JNIEnv *env, jclass clazz, jint contextaddress) {
|
2002-08-20 10:46:04 -04:00
|
|
|
alcDestroyContext((ALCcontext*) contextaddress);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function retrieves the specified devices context error state.
|
|
|
|
*
|
|
|
|
* C Specification:
|
|
|
|
* ALCenum alcGetError(ALCdevice *device);
|
|
|
|
*/
|
2004-03-09 06:03:10 -05:00
|
|
|
static jint JNICALL Java_org_lwjgl_openal_ALC_nalcGetError (JNIEnv *env, jclass clazz, jint deviceaddress) {
|
2002-08-26 14:23:11 -04:00
|
|
|
jint result = alcGetError((ALCdevice*) deviceaddress);
|
|
|
|
CHECK_ALC_ERROR
|
|
|
|
return result;
|
2002-08-20 10:46:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function queries if a specified context extension is available.
|
|
|
|
*
|
|
|
|
* C Specification:
|
|
|
|
* ALboolean alcIsExtensionPresent(ALCdevice *device, ALubyte *extName);
|
|
|
|
*/
|
2004-03-09 06:03:10 -05:00
|
|
|
static jboolean JNICALL Java_org_lwjgl_openal_ALC_nalcIsExtensionPresent (JNIEnv *env, jclass clazz, jint deviceaddress, jstring extName) {
|
2002-08-20 10:46:04 -04:00
|
|
|
/* get extension */
|
|
|
|
ALubyte* functionname = (ALubyte*) (env->GetStringUTFChars(extName, 0));
|
|
|
|
|
|
|
|
jboolean result = (jboolean) alcIsExtensionPresent((ALCdevice*) deviceaddress, functionname);
|
|
|
|
|
2003-03-17 13:34:43 -05:00
|
|
|
env->ReleaseStringUTFChars(extName, (const char *)functionname);
|
2002-08-20 10:46:04 -04:00
|
|
|
|
2002-08-26 14:23:11 -04:00
|
|
|
CHECK_ALC_ERROR
|
2002-08-20 10:46:04 -04:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function retrieves the enum value for a specified enumeration name.
|
|
|
|
*
|
|
|
|
* C Specification:
|
|
|
|
* ALenum alcGetEnumValue(ALCdevice *device, ALubyte *enumName);
|
|
|
|
*/
|
2004-03-09 06:03:10 -05:00
|
|
|
static jint JNICALL Java_org_lwjgl_openal_ALC_nalcGetEnumValue (JNIEnv *env, jclass clazz, jint deviceaddress, jstring enumName) {
|
2002-08-20 10:46:04 -04:00
|
|
|
/* get extension */
|
|
|
|
ALubyte* enumerationname = (ALubyte*) (env->GetStringUTFChars(enumName, 0));
|
|
|
|
|
|
|
|
jint result = (jint) alcGetEnumValue((ALCdevice*) deviceaddress, enumerationname);
|
|
|
|
|
2003-03-17 13:34:43 -05:00
|
|
|
env->ReleaseStringUTFChars(enumName, (const char *)enumerationname);
|
2002-08-20 10:46:04 -04:00
|
|
|
|
2002-08-26 14:23:11 -04:00
|
|
|
CHECK_ALC_ERROR
|
2002-08-20 10:46:04 -04:00
|
|
|
return result;
|
2003-03-24 06:56:05 -05:00
|
|
|
}
|
2004-03-09 06:03:10 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Loads the context OpenAL functions
|
|
|
|
*
|
|
|
|
* @return true if all methods were loaded, false if one of the methods could not be loaded
|
|
|
|
*/
|
|
|
|
bool LoadALC(JNIEnv *env) {
|
|
|
|
JavaMethodAndExtFunction functions[] = {
|
|
|
|
{"nalcGetString", "(II)Ljava/lang/String;", (void*)&Java_org_lwjgl_openal_ALC_nalcGetString, "alcGetString", (void**)&alcGetString},
|
|
|
|
{"nalcGetIntegerv", "(IIILjava/nio/Buffer;I)V", (void*)&Java_org_lwjgl_openal_ALC_nalcGetIntegerv, "alcGetIntegerv", (void**)&alcGetIntegerv},
|
|
|
|
{"alcOpenDevice", "(Ljava/lang/String;)Lorg/lwjgl/openal/ALCdevice;", (void*)&Java_org_lwjgl_openal_ALC_alcOpenDevice, "alcOpenDevice", (void**)&alcOpenDevice},
|
|
|
|
{"alcCloseDevice", "(I)V", (void*)&Java_org_lwjgl_openal_ALC_alcCloseDevice, "alcCloseDevice", (void**)&alcCloseDevice},
|
|
|
|
{"alcCreateContext", "(ILjava/nio/IntBuffer;)Lorg/lwjgl/openal/ALCcontext;", (void*)&Java_org_lwjgl_openal_ALC_alcCreateContext, "alcCreateContext", (void**)&alcCreateContext},
|
|
|
|
{"alcMakeContextCurrent", "(I)Z", (void*)&Java_org_lwjgl_openal_ALC_alcMakeContextCurrent, "alcMakeContextCurrent", (void**)&alcMakeContextCurrent},
|
|
|
|
{"nalcProcessContext", "(I)V", (void*)&Java_org_lwjgl_openal_ALC_nalcProcessContext, "alcProcessContext", (void**)&alcProcessContext},
|
|
|
|
{"alcGetCurrentContext", "()Lorg/lwjgl/openal/ALCcontext;", (void*)&Java_org_lwjgl_openal_ALC_alcGetCurrentContext, "alcGetCurrentContext", (void**)&alcGetCurrentContext},
|
|
|
|
{"alcGetContextsDevice", "(I)Lorg/lwjgl/openal/ALCdevice;", (void*)&Java_org_lwjgl_openal_ALC_alcGetContextsDevice, "alcGetContextsDevice", (void**)&alcGetContextsDevice},
|
|
|
|
{"alcSuspendContext", "(I)V", (void*)&Java_org_lwjgl_openal_ALC_alcSuspendContext, "alcSuspendContext", (void**)&alcSuspendContext},
|
|
|
|
{"alcDestroyContext", "(I)V", (void*)&Java_org_lwjgl_openal_ALC_alcDestroyContext, "alcDestroyContext", (void**)&alcDestroyContext},
|
|
|
|
{"nalcGetError", "(I)I", (void*)&Java_org_lwjgl_openal_ALC_nalcGetError, "alcGetError", (void**)&alcGetError},
|
|
|
|
{"nalcIsExtensionPresent", "(ILjava/lang/String;)Z", (void*)&Java_org_lwjgl_openal_ALC_nalcIsExtensionPresent, "alcIsExtensionPresent", (void**)&alcIsExtensionPresent},
|
|
|
|
{"nalcGetEnumValue", "(ILjava/lang/String;)I", (void*)&Java_org_lwjgl_openal_ALC_nalcGetEnumValue, "alcGetEnumValue", (void**)&alcGetEnumValue}
|
|
|
|
};
|
|
|
|
int num_functions = NUMFUNCTIONS(functions);
|
|
|
|
jclass clazz = ext_ResetClass(env, "org/lwjgl/openal/ALC");
|
|
|
|
return extal_InitializeClass(env, clazz, NULL, NULL, num_functions, functions);
|
|
|
|
}
|