diff options
author | kbr <[email protected]> | 2004-02-28 01:31:06 +0000 |
---|---|---|
committer | kbr <[email protected]> | 2004-02-28 01:31:06 +0000 |
commit | db347e8cb651a73b7609fbf98eefd1b0c8efc6c6 (patch) | |
tree | d6496809063b70ed7a6e9e3f1949ae7318e56559 | |
parent | b2463271828cdceda306a933d5adb281850a6caa (diff) |
Removed handwritten native code for OpenAL binding and reenabled
handwritten EAX binding in the build.
git-svn-id: file:///home/mbien/NetBeansProjects/JOGAMP/joal-sync/git-svn/../svn-server-sync/joal/branches/gluegen-branch-1-0@93 03bf7f67-59de-4072-a415-9a990d468a3f
-rwxr-xr-x | make/build.xml | 22 | ||||
-rw-r--r-- | make/stub_includes/openal/eax.h | 32 | ||||
-rw-r--r-- | src/native/albind.c | 720 | ||||
-rw-r--r-- | src/native/albind.h | 703 | ||||
-rw-r--r-- | src/native/alcbind.c | 235 | ||||
-rw-r--r-- | src/native/alcbind.h | 160 | ||||
-rw-r--r-- | src/native/alfactory.c | 50 | ||||
-rw-r--r-- | src/native/alfactory.h | 66 | ||||
-rw-r--r-- | src/native/build.xml | 113 | ||||
-rw-r--r-- | src/native/common_tools.c | 106 | ||||
-rw-r--r-- | src/native/common_tools.h | 64 | ||||
-rw-r--r-- | src/native/eaxbind.c | 2 | ||||
-rw-r--r-- | src/native/eaxfactory.c | 8 | ||||
-rw-r--r-- | src/native/extal.c | 451 | ||||
-rw-r--r-- | src/native/extal.h | 313 |
15 files changed, 57 insertions, 2988 deletions
diff --git a/make/build.xml b/make/build.xml index 35a09a0..3d2eea3 100755 --- a/make/build.xml +++ b/make/build.xml @@ -261,7 +261,7 @@ <property name="c.compiler.flags" value="${c.compiler.optflags} /nologo /TC /c" /> <property name="c.compiler.obj.suffix" value="obj" /> <property name="c.compiler.joal.outputfile.expr" value="/Fo${rootrel.obj.joal}/*.${c.compiler.obj.suffix}" /> - <property name="c.compiler.includes" value="/I"make/stub_includes/openal" /I"${c.compiler.include.root}/PlatformSDK/Include" /I"${c.compiler.include.root}/include" /I"${java.includes.dir}" /I"${java.includes.dir.platform}"" /> + <property name="c.compiler.includes" value="/I"make/stub_includes/openal" /I"${rootrel.src.c}" /I"${c.compiler.include.root}/PlatformSDK/Include" /I"${c.compiler.include.root}/include" /I"${java.includes.dir}" /I"${java.includes.dir.platform}"" /> <property name="c.linker" value="link.exe" /> <property name="c.linker.flags" value="/DLL /LIBPATH:"${c.linker.lib.root}/PlatformSDK/lib" /LIBPATH:"${c.linker.lib.root}/lib" /LIBPATH:"${java.lib.dir.platform}" /LIBPATH:"${joal.lib.dir}" /INCREMENTAL:NO /NOLOGO /MACHINE:IX86 /OPT:REF /OPT:ICF /SUBSYSTEM:WINDOWS" /> <property name="c.linker.joal.libs" value="openal32.lib" /> @@ -306,7 +306,7 @@ <property name="c.compiler.flags" value="${c.compiler.optflags} -c -DBUILD_DLL -D_WINGDI_ -D_STRICT_ANSI -D_JNI_IMPLEMENTATION_ -o" /> <property name="c.compiler.obj.suffix" value="o" /> <property name="c.compiler.joal.outputfile.expr" value="${rootrel.obj.joal}/*.${c.compiler.obj.suffix}" /> - <property name="c.compiler.includes" value="-I"make/stub_includes/openal" -I"${java.includes.dir}" -I"${java.includes.dir.platform}"" /> + <property name="c.compiler.includes" value="-I"make/stub_includes/openal" -I"${rootrel.src.c}" -I"${java.includes.dir}" -I"${java.includes.dir.platform}"" /> <property name="c.linker" value="gcc.exe" /> <property name="c.linker.flags" value="-shared" /> <property name="c.linker.joal.libs" value="-Wl,--kill-at -L"${java.lib.dir.platform}" -L"${joal.lib.dir}" -lopenal32" /> @@ -336,7 +336,7 @@ <property name="c.compiler.flags" value="${c.compiler.optflags} -c -o" /> <property name="c.compiler.obj.suffix" value="o" /> <property name="c.compiler.joal.outputfile.expr" value="${rootrel.obj.joal}/*.${c.compiler.obj.suffix}" /> - <property name="c.compiler.includes" value="-I"make/stub_includes/openal" -I"${java.includes.dir}" -I"${java.includes.dir.platform}"" /> + <property name="c.compiler.includes" value="-I"make/stub_includes/openal" -I"${rootrel.src.c}" -I"${java.includes.dir}" -I"${java.includes.dir.platform}"" /> <property name="c.linker" value="gcc" /> <property name="c.linker.flags" value="-shared" /> <property name="c.linker.joal.libs" value="-L"${java.lib.dir.platform}" -L"${joal.lib.dir}" -lopenal" /> @@ -355,7 +355,7 @@ <property name="c.compiler.flags" value="${c.compiler.optflags} -c -o" /> <property name="c.compiler.obj.suffix" value="o" /> <property name="c.compiler.joal.outputfile.expr" value="${rootrel.obj.joal}/*.${c.compiler.obj.suffix}" /> - <property name="c.compiler.includes" value="-I"make/stub_includes/openal" -I"${java.includes.dir}" -I"${java.includes.dir.platform}"" /> + <property name="c.compiler.includes" value="-I"make/stub_includes/openal" -I"${rootrel.src.c}" -I"${java.includes.dir}" -I"${java.includes.dir.platform}"" /> <property name="c.linker" value="cc" /> <property name="c.linker.flags" value="-G" /> <property name="c.linker.joal.libs" value="-L"${java.lib.dir.platform}" -L"${joal.lib.dir}" -lopenal" /> @@ -383,7 +383,7 @@ <property name="c.compiler.flags" value="${c.compiler.optflags} -fno-common -fpascal-strings -Wmost -ObjC -c -o" /> <property name="c.compiler.obj.suffix" value="o" /> <property name="c.compiler.joal.outputfile.expr" value="${rootrel.obj.joal}/*.${c.compiler.obj.suffix}" /> - <property name="c.compiler.includes" value="-I"make/stub_includes/openal" -I"${java.includes.dir}" -I"${java.includes.dir.platform}"" /> + <property name="c.compiler.includes" value="-I"make/stub_includes/openal" -I"${rootrel.src.c}" -I"${java.includes.dir}" -I"${java.includes.dir.platform}"" /> <property name="c.linker" value="gcc" /> <property name="c.linker.flags" value="-arch ppc -prebind -Wl,-single_module -dynamiclib -compatibility_version 1 -current_version 1 -prebind_all_twolevel_modules" /> <property name="c.linker.joal.libs" value="-framework OpenAL" /> @@ -593,6 +593,18 @@ <srcfile /> <mapper type="glob" from="${rootrel.generated.c.joal}${sep}*.c" to="${c.compiler.joal.outputfile.expr}" /> </apply> + + <apply executable="${c.compiler}" dest="${rootrel.obj.joal}" dir="${project.root}" relative="true" failonerror="true"> + <arg line="${c.compiler.includes}" /> + <arg line="${c.compiler.flags}" /> + <fileset dir="${project.root}"> + <include name="${rootrel.src.c}/*.c"/> + </fileset> + <targetfile /> + <srcfile /> + <mapper type="glob" from="${rootrel.src.c}${sep}*.c" to="${c.compiler.joal.outputfile.expr}" /> + </apply> + <antcall target="c.compile.joal.macosx.objs" inheritRefs="true" /> </target> diff --git a/make/stub_includes/openal/eax.h b/make/stub_includes/openal/eax.h new file mode 100644 index 0000000..bf6f5cd --- /dev/null +++ b/make/stub_includes/openal/eax.h @@ -0,0 +1,32 @@ +#ifndef _EAX_H +#define _EAX_H + +#ifdef _WIN32 +#include "windows.h" +#endif + +#include "altypes.h" + +#ifdef _WIN32 +DEFINE_GUID(DSPROPSETID_EAX20_ListenerProperties, + 0x306a6a8, + 0xb224, + 0x11d2, + 0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22); + +DEFINE_GUID(DSPROPSETID_EAX20_BufferProperties, + 0x306a6a7, + 0xb224, + 0x11d2, + 0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22); +#endif + +#ifdef _WIN32 +typedef ALenum (*EAXSet)(const GUID*, ALuint, ALuint, ALvoid*, ALuint); +typedef ALenum (*EAXGet)(const GUID*, ALuint, ALuint, ALvoid*, ALuint); + +extern EAXSet eaxSet; +extern EAXGet eaxGet; +#endif + +#endif /* _EAX_H */ diff --git a/src/native/albind.c b/src/native/albind.c deleted file mode 100644 index 023f235..0000000 --- a/src/native/albind.c +++ /dev/null @@ -1,720 +0,0 @@ -/** -* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* -* -Redistribution of source code must retain the above copyright notice, -* this list of conditions and the following disclaimer. -* -* -Redistribution 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. -* -* Neither the name of Sun Microsystems, Inc. or the names of contributors may -* be used to endorse or promote products derived from this software without -* specific prior written permission. -* -* This software is provided "AS IS," without a warranty of any kind. -* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING -* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR -* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") AND ITS -* LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A -* RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. -* IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT -* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR -* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, -* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS -* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -* -* You acknowledge that this software is not designed or intended for use in the -* design, construction, operation or maintenance of any nuclear facility. -*/ - - -#include "albind.h" -#include "extal.h" - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGenBuffersNative__ILjava_nio_IntBuffer_2 - (JNIEnv *env, jobject obj, jint numBuffers, jobject buffers) { - if(buffers == 0) { - - } - ALuint *p = (ALuint*)(*env)->GetDirectBufferAddress(env,buffers); - alGenBuffers((ALsizei)numBuffers,p); -} -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGenBuffersNative__I_3I - (JNIEnv *env, jobject obj, jint numBuffers, jintArray buffers) { - ALuint *p = (ALuint*)(*env)->GetPrimitiveArrayCritical(env,buffers,0); - if(p) { - alGenBuffers((ALsizei)numBuffers,p); - } - (*env)->ReleasePrimitiveArrayCritical(env,buffers,p,0); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDeleteBuffersNative__ILjava_nio_IntBuffer_2 - (JNIEnv *env, jobject obj, jint numBuffers, jobject buffers) { - ALuint *p = (ALuint*)(*env)->GetDirectBufferAddress(env,buffers); - if(p) { - alDeleteBuffers((ALsizei)numBuffers,p); - } -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDeleteBuffersNative__I_3I - (JNIEnv *env, jobject obj, jint numBuffers, jintArray buffers) { - ALuint *p = (ALuint*)(*env)->GetPrimitiveArrayCritical(env,buffers,0); - if(p) { - alDeleteBuffers((ALsizei)numBuffers,p); - } - (*env)->ReleasePrimitiveArrayCritical(env,buffers,p,0); -} - -JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALImpl_alIsBuffer - (JNIEnv *env, jobject obj, jint bufferName) { - jboolean result; - result = alIsBuffer((ALuint)bufferName); - return result; -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alBufferDataNative__IILjava_nio_ByteBuffer_2II - (JNIEnv *env, - jobject obj, - jint bufferName, - jint format, - jobject data, - jint size, - jint frequency) { - ALvoid *p = (ALvoid*)(*env)->GetDirectBufferAddress(env,data); - if(p) { - alBufferData((ALuint)bufferName, - (ALenum)format, - p, - (ALsizei)size, - (ALsizei)frequency); - } -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alBufferDataNative__II_3BII - (JNIEnv *env, - jobject obj, - jint bufferName, - jint format, - jbyteArray data, - jint size, - jint frequency) { - ALvoid *p = (ALvoid*)(*env)->GetPrimitiveArrayCritical(env,data,0); - if(p) { - alBufferData((ALuint)bufferName, - (ALenum)format, - p, - (ALsizei)size, - (ALsizei)frequency); - } - (*env)->ReleasePrimitiveArrayCritical(env,data,p,0); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetBufferfNative__II_3F - (JNIEnv *env, jobject obj, jint buffer, jint pname, jfloatArray rv) { - ALfloat *result = (ALfloat*)(*env)->GetPrimitiveArrayCritical(env,rv,0); - alGetBufferf((ALuint)buffer, (ALenum)pname, result); - (*env)->ReleasePrimitiveArrayCritical(env,rv,result,0); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetBufferfNative__IILjava_nio_FloatBuffer_2 - (JNIEnv *env, jobject obj, jint buffer, jint pname, jobject rv) { - ALfloat *p = (ALfloat*)(*env)->GetDirectBufferAddress(env,rv); - if(p) { - alGetBufferf((ALuint)buffer, (ALenum)pname, p); - } -} - -JNIEXPORT jfloat JNICALL Java_net_java_games_joal_ALImpl_alGetBufferf__II - (JNIEnv *env, jobject obj, jint buffer, jint pname) { - jfloat result; - alGetBufferf((ALuint)buffer, (ALenum)pname, &result); - return result; -} - - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetBufferiNative__II_3I - (JNIEnv *env, jobject obj, jint buffer, jint pname, jintArray rv) { - ALint *p = (ALint*)(*env)->GetPrimitiveArrayCritical(env,rv,0); - if(p) { - alGetBufferi((ALuint)buffer, (ALenum)pname, p); - } - (*env)->ReleasePrimitiveArrayCritical(env,rv,p,0); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetBufferiNative__IILjava_nio_IntBuffer_2 - (JNIEnv *env, jobject obj, jint buffer, jint pname, jobject rv) { - ALint *p = (ALint*)(*env)->GetDirectBufferAddress(env,rv); - if(p) { - alGetBufferi((ALuint)buffer, (ALenum)pname, p); - } - (*env)->ReleasePrimitiveArrayCritical(env,rv,p,0); -} - -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALImpl_alGetBufferi__II - (JNIEnv *env, jobject obj, jint buffer, jint pname) { - ALint result; - alGetBufferi((ALuint)buffer, (ALenum)pname, &result); - return (jint)result; -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGenSourcesNative__I_3I - (JNIEnv *env, jobject obj, jint numSources, jintArray sources) { - ALuint *p = (ALuint*)(*env)->GetPrimitiveArrayCritical(env,sources,0); - if(p) { - alGenSources((ALsizei)numSources,p); - } - (*env)->ReleasePrimitiveArrayCritical(env,sources,p,0); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGenSourcesNative__ILjava_nio_IntBuffer_2 - (JNIEnv *env, jobject obj, jint numSources, jobject sources) { - ALuint *p = (ALuint*)(*env)->GetDirectBufferAddress(env,sources); - if(p) { - alGenSources((ALsizei)numSources,p); - } -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDeleteSourcesNative__I_3I - (JNIEnv *env, jobject obj, jint numSources, jintArray sources) { - ALuint *p = (ALuint*)(*env)->GetPrimitiveArrayCritical(env,sources,0); - if(p) { - alDeleteSources((ALsizei)numSources, p); - } - (*env)->ReleasePrimitiveArrayCritical(env,sources,p,0); -} - -/* - * Class: net_java_games_joal_AL - * Method: alDeleteSources - * Signature: (ILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDeleteSourcesNative__ILjava_nio_IntBuffer_2 - (JNIEnv *env, jobject obj, jint numSources, jobject sources) { - ALuint *p = (ALuint*)(*env)->GetDirectBufferAddress(env,sources); - if(p) { - alDeleteSources((ALsizei)numSources, p); - } -} - -JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALImpl_alIsSource - (JNIEnv *env, jobject obj, jint sourceName) { - alIsSource((ALuint)sourceName); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcei - (JNIEnv *env, jobject obj, jint source, jint pname, jint value) { - alSourcei((ALuint)source,(ALenum)pname, (ALint)value); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcef - (JNIEnv *env, jobject obj, jint source, jint pname, jfloat value) { - alSourcef((ALuint)source,(ALenum)pname, (ALfloat)value); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcefvNative__II_3F - (JNIEnv *env, jobject obj, jint source, jint pname, jfloatArray value) { - ALfloat *p = (ALfloat*)(*env)->GetPrimitiveArrayCritical(env,value,0); - if(p) { - alSourcefv((ALuint)source, (ALenum)pname, p); - } - (*env)->ReleasePrimitiveArrayCritical(env,value,p,0); -} - -/* - * Class: net_java_games_joal_AL - * Method: alSourcefv - * Signature: (IILjava/nio/FloatBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcefvNative__IILjava_nio_FloatBuffer_2 - (JNIEnv *env, jobject obj, jint source, jint pname, jobject value) { - ALfloat *p = (ALfloat*)(*env)->GetDirectBufferAddress(env,value); - alSourcefv((ALuint)source, (ALenum)pname, p); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSource3f - (JNIEnv *env, - jobject obj, - jint source, - jint pname, - jfloat v1, - jfloat v2, - jfloat v3) { - alSource3f((ALuint)source, - (ALenum)pname, - (ALfloat)v1, - (ALfloat)v2, - (ALfloat)v3); -} - - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetSourcefNative__II_3F - (JNIEnv *env, jobject obj, jint source, jint pname, jfloatArray rv) { - ALfloat *p = (*env)->GetPrimitiveArrayCritical(env,rv,0); - if(p) { - alGetSourcef((ALuint)source, (ALenum)pname, p); - } - (*env)->ReleasePrimitiveArrayCritical(env,rv,p,0); -} - -/* - * Class: net_java_games_joal_AL - * Method: alGetSourcef - * Signature: (IILjava/nio/FloatBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetSourcefNative__IILjava_nio_FloatBuffer_2 - (JNIEnv *env, jobject obj, jint source, jint pname, jobject rv) { - ALfloat *p = (*env)->GetDirectBufferAddress(env,rv); - if(p) { - alGetSourcef((ALuint)source, (ALenum)pname, p); - } -} - -/* - * Class: net_java_games_joal_AL - * Method: alGetSourcef - * Signature: (II)F - */ -JNIEXPORT jfloat JNICALL Java_net_java_games_joal_ALImpl_alGetSourcef__II - (JNIEnv *env, jobject obj, jint source, jint pname) { - jfloat result; - alGetSourcef((ALuint)source, (ALenum)pname, &result); - return result; -} - - - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetSourcefvNative__IILjava_nio_FloatBuffer_2 - (JNIEnv *env, jobject obj, jint source, jint pname, jobject value) { - ALfloat *p = (ALfloat*)(*env)->GetDirectBufferAddress(env,value); - if(p) { - alGetSourcefv((ALuint)source, (ALenum)pname, p); - } -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetSourcefvNative__II_3F - (JNIEnv *env, jobject obj, jint source, jint pname, jfloatArray value) { - ALfloat *p = (ALfloat*)(*env)->GetPrimitiveArrayCritical(env,value,0); - if(p) { - alGetSourcefv((ALuint)source, (ALenum)pname, p); - } - (*env)->ReleasePrimitiveArrayCritical(env,value,p,0); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetSourceiNative__II_3I - (JNIEnv *env, jobject obj, jint source, jint pname, jintArray rv) { - ALint *p = (ALint*)(*env)->GetPrimitiveArrayCritical(env,rv,0); - if(p) { - alGetSourcei((ALuint)source, (ALenum)pname, p); - } - (*env)->ReleasePrimitiveArrayCritical(env,rv,p,0); -} - -/* - * Class: net_java_games_joal_AL - * Method: alGetSourcei - * Signature: (IILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetSourceiNative__IILjava_nio_IntBuffer_2 - (JNIEnv *env, jobject obj, jint source, jint pname, jobject rv) { - ALint *p = (ALint*)(*env)->GetDirectBufferAddress(env,rv); - if(p) { - alGetSourcei((ALuint)source, (ALenum)pname, p); - } -} - -/* - * Class: net_java_games_joal_AL - * Method: alGetSourcei - * Signature: (II)I - */ -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALImpl_alGetSourcei__II - (JNIEnv *env, jobject obj, jint source, jint pname) { - ALint result; - alGetSourcei((ALuint)source, (ALenum)pname, &result); - return (jint)result; -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcePlay - (JNIEnv *env, jobject obj, jint source) { - alSourcePlay((ALuint)source); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcePlayvNative__I_3I - (JNIEnv *env, jobject obj, jint numSources, jintArray sources) { - ALuint *p = (ALuint*)(*env)->GetPrimitiveArrayCritical(env,sources,0); - if(p) { - alSourcePlayv((ALsizei)numSources,p); - } - (*env)->ReleasePrimitiveArrayCritical(env,sources,p,0); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcePlayvNative__ILjava_nio_IntBuffer_2 - (JNIEnv *env, jobject obj, jint numSources, jobject sources) { - ALuint *p = (ALuint*)(*env)->GetDirectBufferAddress(env,sources); - if(p) { - alSourcePlayv((ALsizei)numSources,p); - } -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcePause - (JNIEnv *env, jobject obj, jint source) { - alSourcePause((ALuint)source); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcePausevNative__I_3I - (JNIEnv *env, jobject obj, jint numSources, jintArray sources) { - ALuint *p = (ALuint*)(*env)->GetPrimitiveArrayCritical(env,sources,0); - if(p) { - alSourcePausev((ALsizei)numSources,p); - } - (*env)->ReleasePrimitiveArrayCritical(env,sources,p,0); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcePausevNative__ILjava_nio_IntBuffer_2 - (JNIEnv *env, jobject obj, jint numSources, jobject sources) { - ALuint *p = (ALuint*)(*env)->GetDirectBufferAddress(env,sources); - if(p) { - alSourcePausev((ALsizei)numSources,p); - } -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceStop - (JNIEnv *env, jobject obj, jint source) { - alSourceStop((ALuint)source); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceStopvNative__I_3I - (JNIEnv *env, jobject obj, jint numSources, jintArray sources) { - ALuint *p = (ALuint*)(*env)->GetPrimitiveArrayCritical(env,sources,0); - if(p) { - alSourceStopv((ALsizei)numSources,p); - } - (*env)->ReleasePrimitiveArrayCritical(env,sources,p,0); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceStopvNative__ILjava_nio_IntBuffer_2 - (JNIEnv *env, jobject obj, jint numSources, jobject sources) { - ALuint *p = (ALuint*)(*env)->GetDirectBufferAddress(env,sources); - if(p) { - alSourceStopv((ALsizei)numSources,p); - } -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceRewind - (JNIEnv *env, jobject obj, jint source) { - alSourceRewind((ALuint)source); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceRewindvNative__I_3I - (JNIEnv *env, jobject obj, jint numSources, jintArray sources) { - ALuint *p = (ALuint*)(*env)->GetPrimitiveArrayCritical(env,sources,0); - if(p) { - alSourceRewindv((ALsizei)numSources,p); - } - (*env)->ReleasePrimitiveArrayCritical(env,sources,p,0); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceRewindvNative__ILjava_nio_IntBuffer_2 - (JNIEnv *env, jobject obj, jint numSources, jobject sources) { - ALuint *p = (ALuint*)(*env)->GetDirectBufferAddress(env,sources); - if(p) { - alSourceRewindv((ALsizei)numSources,p); - } -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceQueueBuffersNative__IILjava_nio_IntBuffer_2 - (JNIEnv *env, jobject obj, jint source, jint numBuffers, jobject buffers) { - ALuint *p = (ALuint*)(*env)->GetDirectBufferAddress(env,buffers); - if(p) { - alSourceQueueBuffers((ALuint)source, (ALsizei)numBuffers, p); - } -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceQueueBuffersNative__II_3I - (JNIEnv *env, jobject obj, jint source, jint numBuffers, jintArray buffers) { - ALuint *p = (ALuint*)(*env)->GetPrimitiveArrayCritical(env,buffers,0); - if(p) { - alSourceQueueBuffers((ALuint)source, (ALsizei)numBuffers, p); - } - (*env)->ReleasePrimitiveArrayCritical(env,buffers,p,0); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceUnqueueBuffersNative__II_3I - (JNIEnv *env, jobject obj, jint source, jint numBuffers, jintArray buffers) { - ALuint *p = (ALuint*)(*env)->GetPrimitiveArrayCritical(env,buffers,0); - if(p) { - alSourceUnqueueBuffers((ALuint)source, (ALsizei)numBuffers, p); - } - (*env)->ReleasePrimitiveArrayCritical(env,buffers,p,0); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceUnqueueBuffersNative__IILjava_nio_IntBuffer_2 - (JNIEnv *env, jobject obj, jint source, jint numBuffers, jobject buffers) { - ALuint *p = (ALuint*)(*env)->GetDirectBufferAddress(env,buffers); - if(p) { - alSourceUnqueueBuffers((ALuint)source, (ALsizei)numBuffers, p); - } -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alListenerf - (JNIEnv *env, jobject obj, jint pname, jfloat value) { - alListenerf((ALenum)pname,(ALfloat)value); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alListener3f - (JNIEnv *env, jobject obj, jint pname, jfloat v1, jfloat v2, jfloat v3) { - alListener3f((ALenum)pname, (ALfloat)v1, (ALfloat)v2, (ALfloat)v3); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alListenerfvNative__I_3F - (JNIEnv *env, jobject obj, jint pname, jfloatArray rv) { - ALfloat *p = (ALfloat*)(*env)->GetPrimitiveArrayCritical(env,rv,0); - alListenerfv((ALenum)pname, p); - (*env)->ReleasePrimitiveArrayCritical(env,rv,p,0); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alListenerfvNative__ILjava_nio_FloatBuffer_2 - (JNIEnv *env, jobject obj, jint pname, jobject value) { - ALfloat *p = (ALfloat*)(*env)->GetDirectBufferAddress(env,value); - alListenerfv((ALenum)pname, p); -} - - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListenerfNative__I_3F - (JNIEnv *env, jobject obj, jint pname, jfloatArray rv) { - ALfloat *p = (ALfloat*)(*env)->GetPrimitiveArrayCritical(env,rv,0); - if(p) { - alGetListenerf((ALenum)pname, p); - } - (*env)->ReleasePrimitiveArrayCritical(env,rv,p,0); -} - -/* - * Class: net_java_games_joal_AL - * Method: alGetListenerf - * Signature: (ILjava/nio/FloatBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListenerfNative__ILjava_nio_FloatBuffer_2 - (JNIEnv *env, jobject obj, jint pname, jobject rv) { - ALfloat *p = (ALfloat*)(*env)->GetDirectBufferAddress(env,rv); - if(p) { - alGetListenerf((ALenum)pname, p); - } -} - -/* - * Class: net_java_games_joal_AL - * Method: alGetListenerf - * Signature: (I)F - */ -JNIEXPORT jfloat JNICALL Java_net_java_games_joal_ALImpl_alGetListenerf__I - (JNIEnv *env, jobject object, jint pname) { - jfloat result; - alGetListenerf((ALenum)pname, &result); - return result; -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListener3fNative__I_3F_3F_3F - (JNIEnv *env, jobject obj, jint pname, jfloatArray v1, jfloatArray v2, jfloatArray v3) { - ALfloat *p1 = (ALfloat*)(*env)->GetPrimitiveArrayCritical(env,v1,0); - ALfloat *p2 = (ALfloat*)(*env)->GetPrimitiveArrayCritical(env,v2,0); - ALfloat *p3 = (ALfloat*)(*env)->GetPrimitiveArrayCritical(env,v3,0); - if(p1 && p2 && p3) { - alGetListener3f((ALenum)pname, p1, p2, p3); - } - (*env)->ReleasePrimitiveArrayCritical(env,v3,p3,0); - (*env)->ReleasePrimitiveArrayCritical(env,v2,p2,0); - (*env)->ReleasePrimitiveArrayCritical(env,v1,p1,0); -} - - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListener3fNative__ILjava_nio_FloatBuffer_2Ljava_nio_FloatBuffer_2Ljava_nio_FloatBuffer_2 - (JNIEnv *env, jobject obj, jint pname, jobject v1, jobject v2, jobject v3) { - ALfloat *p1 = (ALfloat*)(*env)->GetDirectBufferAddress(env,v1); - ALfloat *p2 = (ALfloat*)(*env)->GetDirectBufferAddress(env,v2); - ALfloat *p3 = (ALfloat*)(*env)->GetDirectBufferAddress(env,v3); - if(p1 && p2 && p3) { - alGetListener3f((ALenum)pname, p1, p2, p3); - } -} - - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListenerfvNative__I_3F - (JNIEnv *env, jobject obj, jint pname, jfloatArray value) { - ALfloat *p = (ALfloat*)(*env)->GetPrimitiveArrayCritical(env,value,0); - if(p) { - alGetListenerfv((ALenum)pname, p); - } - (*env)->ReleasePrimitiveArrayCritical(env,value,p,0); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListenerfvNative__ILjava_nio_FloatBuffer_2 - (JNIEnv *env, jobject obj, jint pname, jobject value) { - ALfloat *p = (ALfloat*)(*env)->GetDirectBufferAddress(env,value); - if(p) { - alGetListenerfv((ALenum)pname, p); - } -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListeneriNative__I_3I - (JNIEnv *env, jobject obj, jint pname, jintArray value) { - ALint *p = (ALint*)(*env)->GetPrimitiveArrayCritical(env,value,0); - if(p) { - alGetListeneri((ALenum)pname, p); - } - (*env)->ReleasePrimitiveArrayCritical(env,value,p,0); - -} - -/* - * Class: net_java_games_joal_AL - * Method: alGetListeneri - * Signature: (ILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListeneriNative__ILjava_nio_IntBuffer_2 - (JNIEnv *env, jobject obj, jint pname, jobject value) { - ALint *p = (ALint*)(*env)->GetDirectBufferAddress(env,value); - if(p) { - alGetListeneri((ALenum)pname, p); - } -} - -/* - * Class: net_java_games_joal_AL - * Method: alGetListeneri - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALImpl_alGetListeneri__I - (JNIEnv *env, jobject obj, jint pname) { - ALint result; - alGetListeneri((ALenum)pname, &result); - return (jint)result; -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alEnable - (JNIEnv *env, jobject obj, jint capability) { - alEnable((ALenum)capability); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDisable - (JNIEnv *env, jobject obj, jint capability) { - alDisable((ALenum)capability); -} - -JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALImpl_alIsEnabled - (JNIEnv *env, jobject obj, jint pname) { - return alIsEnabled((ALenum)pname); -} - -JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALImpl_alGetBoolean - (JNIEnv *env, jobject obj, jint pname) { - return alGetBoolean((ALenum)pname); -} - -JNIEXPORT jdouble JNICALL Java_net_java_games_joal_ALImpl_alGetDouble - (JNIEnv *env, jobject obj, jint pname) { - return alGetDouble((ALenum)pname); -} - -JNIEXPORT jfloat JNICALL Java_net_java_games_joal_ALImpl_alGetFloat - (JNIEnv *env, jobject obj, jint pname) { - return alGetFloat((ALenum)pname); -} - -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALImpl_alGetInteger - (JNIEnv *env, jobject obj, jint pname) { - return alGetInteger((ALenum)pname); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetDoublevNative__I_3D - (JNIEnv *env, jobject obj, jint pname, jdoubleArray value) { - ALdouble *p = (ALdouble*)(*env)->GetPrimitiveArrayCritical(env,value,0); - if(p) { - alGetDoublev((ALenum)pname,p); - } - (*env)->ReleasePrimitiveArrayCritical(env,value,p,0); - -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetDoublevNative__ILjava_nio_DoubleBuffer_2 - (JNIEnv *env, jobject obj, jint pname, jobject value) { - ALdouble *p = (ALdouble*)(*env)->GetDirectBufferAddress(env,value); - if(p) { - alGetDoublev((ALenum)pname,p); - } -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetFloatvNative__I_3F - (JNIEnv *env, jobject obj, jint pname, jfloatArray value) { - ALfloat *p = (ALfloat*)(*env)->GetPrimitiveArrayCritical(env,value,0); - if(p) { - alGetFloatv((ALenum)pname,p); - } - (*env)->ReleasePrimitiveArrayCritical(env,value,p,0); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetFloatvNative__ILjava_nio_FloatBuffer_2 - (JNIEnv *env, jobject obj, jint pname, jobject value) { - ALfloat *p = (ALfloat*)(*env)->GetDirectBufferAddress(env,value); - if(p) { - alGetFloatv((ALenum)pname,p); - } -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetIntegervNative__I_3I - (JNIEnv *env, jobject obj, jint pname, jintArray value) { - ALint *p = (ALint*)(*env)->GetPrimitiveArrayCritical(env,value,0); - if(p) { - alGetIntegerv((ALenum)pname,p); - } - (*env)->ReleasePrimitiveArrayCritical(env,value,p,0); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetIntegervNative__ILjava_nio_IntBuffer_2 - (JNIEnv *env, jobject obj, jint pname, jobject value) { - ALint *p = (ALint*)(*env)->GetDirectBufferAddress(env,value); - if(p) { - alGetIntegerv((ALenum)pname,p); - } -} - - -JNIEXPORT jstring JNICALL Java_net_java_games_joal_ALImpl_alGetString - (JNIEnv *env, jobject obj, jint pname) { - ALubyte* p = alGetString((ALenum)pname); - return (*env)->NewStringUTF(env, p); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDistanceModel - (JNIEnv *env, jobject obj, jint value) { - alDistanceModel((ALenum)value); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDopplerFactor - (JNIEnv *env, jobject obj, jfloat value) { - alDopplerFactor((ALfloat)value); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDopplerVelocity - (JNIEnv *env, jobject obj, jfloat value) { - alDopplerVelocity((ALfloat)value); -} - -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALImpl_alGetError - (JNIEnv *env, jobject obj) { - return alGetError(); -} - -JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALImpl_alIsExtensionPresent - (JNIEnv *env, jobject obj, jstring extName) { - ALubyte *str; - str = (ALubyte*)(*env)->GetStringUTFChars(env, extName, NULL); - if(!str) { - return 0; - } - return alIsExtensionPresent(str); -} diff --git a/src/native/albind.h b/src/native/albind.h deleted file mode 100644 index fd64846..0000000 --- a/src/native/albind.h +++ /dev/null @@ -1,703 +0,0 @@ -/** -* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* -* -Redistribution of source code must retain the above copyright notice, -* this list of conditions and the following disclaimer. -* -* -Redistribution 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. -* -* Neither the name of Sun Microsystems, Inc. or the names of contributors may -* be used to endorse or promote products derived from this software without -* specific prior written permission. -* -* This software is provided "AS IS," without a warranty of any kind. -* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING -* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR -* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") AND ITS -* LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A -* RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. -* IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT -* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR -* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, -* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS -* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -* -* You acknowledge that this software is not designed or intended for use in the -* design, construction, operation or maintenance of any nuclear facility. -*/ - - -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class net_java_games_joal_ALImpl */ - -#ifndef _Included_net_java_games_joal_ALImpl -#define _Included_net_java_games_joal_ALImpl -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: net_java_games_joal_ALImpl - * Method: alGenBuffersNative - * Signature: (ILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGenBuffersNative__ILjava_nio_IntBuffer_2 - (JNIEnv *, jobject, jint, jobject); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGenBuffersNative - * Signature: (I[I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGenBuffersNative__I_3I - (JNIEnv *, jobject, jint, jintArray); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alDeleteBuffersNative - * Signature: (ILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDeleteBuffersNative__ILjava_nio_IntBuffer_2 - (JNIEnv *, jobject, jint, jobject); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alDeleteBuffersNative - * Signature: (I[I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDeleteBuffersNative__I_3I - (JNIEnv *, jobject, jint, jintArray); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alIsBuffer - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALImpl_alIsBuffer - (JNIEnv *, jobject, jint); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alBufferDataNative - * Signature: (II[BII)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alBufferDataNative__II_3BII - (JNIEnv *, jobject, jint, jint, jbyteArray, jint, jint); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alBufferDataNative - * Signature: (IILjava/nio/ByteBuffer;II)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alBufferDataNative__IILjava_nio_ByteBuffer_2II - (JNIEnv *, jobject, jint, jint, jobject, jint, jint); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetBufferfNative - * Signature: (II[F)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetBufferfNative__II_3F - (JNIEnv *, jobject, jint, jint, jfloatArray); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetBufferfNative - * Signature: (IILjava/nio/FloatBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetBufferfNative__IILjava_nio_FloatBuffer_2 - (JNIEnv *, jobject, jint, jint, jobject); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetBufferf - * Signature: (II)F - */ -JNIEXPORT jfloat JNICALL Java_net_java_games_joal_ALImpl_alGetBufferf - (JNIEnv *, jobject, jint, jint); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetBufferiNative - * Signature: (II[I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetBufferiNative__II_3I - (JNIEnv *, jobject, jint, jint, jintArray); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetBufferiNative - * Signature: (IILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetBufferiNative__IILjava_nio_IntBuffer_2 - (JNIEnv *, jobject, jint, jint, jobject); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetBufferi - * Signature: (II)I - */ -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALImpl_alGetBufferi - (JNIEnv *, jobject, jint, jint); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGenSourcesNative - * Signature: (I[I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGenSourcesNative__I_3I - (JNIEnv *, jobject, jint, jintArray); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGenSourcesNative - * Signature: (ILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGenSourcesNative__ILjava_nio_IntBuffer_2 - (JNIEnv *, jobject, jint, jobject); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alDeleteSourcesNative - * Signature: (I[I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDeleteSourcesNative__I_3I - (JNIEnv *, jobject, jint, jintArray); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alDeleteSourcesNative - * Signature: (ILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDeleteSourcesNative__ILjava_nio_IntBuffer_2 - (JNIEnv *, jobject, jint, jobject); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alIsSource - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALImpl_alIsSource - (JNIEnv *, jobject, jint); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alSourcei - * Signature: (III)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcei - (JNIEnv *, jobject, jint, jint, jint); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alSourcef - * Signature: (IIF)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcef - (JNIEnv *, jobject, jint, jint, jfloat); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alSourcefv - * Signature: (II[F)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcefv - (JNIEnv *, jobject, jint, jint, jfloatArray); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alSourcefvNative - * Signature: (IILjava/nio/FloatBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcefvNative - (JNIEnv *, jobject, jint, jint, jobject); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alSource3f - * Signature: (IIFFF)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSource3f - (JNIEnv *, jobject, jint, jint, jfloat, jfloat, jfloat); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetSourcefNative - * Signature: (II[F)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetSourcefNative__II_3F - (JNIEnv *, jobject, jint, jint, jfloatArray); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetSourcefNative - * Signature: (IILjava/nio/FloatBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetSourcefNative__IILjava_nio_FloatBuffer_2 - (JNIEnv *, jobject, jint, jint, jobject); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetSourcef - * Signature: (II)F - */ -JNIEXPORT jfloat JNICALL Java_net_java_games_joal_ALImpl_alGetSourcef - (JNIEnv *, jobject, jint, jint); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetSourcefvNative - * Signature: (IILjava/nio/FloatBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetSourcefvNative__IILjava_nio_FloatBuffer_2 - (JNIEnv *, jobject, jint, jint, jobject); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetSourcefvNative - * Signature: (II[F)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetSourcefvNative__II_3F - (JNIEnv *, jobject, jint, jint, jfloatArray); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetSourceiNative - * Signature: (II[I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetSourceiNative__II_3I - (JNIEnv *, jobject, jint, jint, jintArray); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetSourceiNative - * Signature: (IILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetSourceiNative__IILjava_nio_IntBuffer_2 - (JNIEnv *, jobject, jint, jint, jobject); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetSourcei - * Signature: (II)I - */ -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALImpl_alGetSourcei - (JNIEnv *, jobject, jint, jint); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alSourcePlay - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcePlay - (JNIEnv *, jobject, jint); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alSourcePlayvNative - * Signature: (I[I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcePlayvNative__I_3I - (JNIEnv *, jobject, jint, jintArray); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alSourcePlayvNative - * Signature: (ILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcePlayvNative__ILjava_nio_IntBuffer_2 - (JNIEnv *, jobject, jint, jobject); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alSourcePause - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcePause - (JNIEnv *, jobject, jint); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alSourcePausevNative - * Signature: (I[I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcePausevNative__I_3I - (JNIEnv *, jobject, jint, jintArray); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alSourcePausevNative - * Signature: (ILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcePausevNative__ILjava_nio_IntBuffer_2 - (JNIEnv *, jobject, jint, jobject); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alSourceStop - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceStop - (JNIEnv *, jobject, jint); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alSourceStopvNative - * Signature: (I[I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceStopvNative__I_3I - (JNIEnv *, jobject, jint, jintArray); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alSourceStopvNative - * Signature: (ILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceStopvNative__ILjava_nio_IntBuffer_2 - (JNIEnv *, jobject, jint, jobject); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alSourceRewind - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceRewind - (JNIEnv *, jobject, jint); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alSourceRewindvNative - * Signature: (I[I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceRewindvNative__I_3I - (JNIEnv *, jobject, jint, jintArray); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alSourceRewindvNative - * Signature: (ILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceRewindvNative__ILjava_nio_IntBuffer_2 - (JNIEnv *, jobject, jint, jobject); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alSourceQueueBuffersNative - * Signature: (II[I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceQueueBuffersNative__II_3I - (JNIEnv *, jobject, jint, jint, jintArray); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alSourceQueueBuffersNative - * Signature: (IILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceQueueBuffersNative__IILjava_nio_IntBuffer_2 - (JNIEnv *, jobject, jint, jint, jobject); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alSourceUnqueueBuffersNative - * Signature: (II[I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceUnqueueBuffersNative__II_3I - (JNIEnv *, jobject, jint, jint, jintArray); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alSourceUnqueueBuffersNative - * Signature: (IILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceUnqueueBuffersNative__IILjava_nio_IntBuffer_2 - (JNIEnv *, jobject, jint, jint, jobject); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alListenerf - * Signature: (IF)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alListenerf - (JNIEnv *, jobject, jint, jfloat); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alListener3f - * Signature: (IFFF)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alListener3f - (JNIEnv *, jobject, jint, jfloat, jfloat, jfloat); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alListenerfv - * Signature: (I[F)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alListenerfv__I_3F - (JNIEnv *, jobject, jint, jfloatArray); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alListenerfv - * Signature: (ILjava/nio/FloatBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alListenerfv__ILjava_nio_FloatBuffer_2 - (JNIEnv *, jobject, jint, jobject); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alListeneri - * Signature: (II)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alListeneri - (JNIEnv *, jobject, jint, jint); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetListenerfNative - * Signature: (I[F)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListenerfNative__I_3F - (JNIEnv *, jobject, jint, jfloatArray); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetListenerfNative - * Signature: (ILjava/nio/FloatBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListenerfNative__ILjava_nio_FloatBuffer_2 - (JNIEnv *, jobject, jint, jobject); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetListenerf - * Signature: (I)F - */ -JNIEXPORT jfloat JNICALL Java_net_java_games_joal_ALImpl_alGetListenerf - (JNIEnv *, jobject, jint); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetListener3fNative - * Signature: (ILjava/nio/FloatBuffer;Ljava/nio/FloatBuffer;Ljava/nio/FloatBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListener3fNative__ILjava_nio_FloatBuffer_2Ljava_nio_FloatBuffer_2Ljava_nio_FloatBuffer_2 - (JNIEnv *, jobject, jint, jobject, jobject, jobject); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetListener3fNative - * Signature: (I[F[F[F)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListener3fNative__I_3F_3F_3F - (JNIEnv *, jobject, jint, jfloatArray, jfloatArray, jfloatArray); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetListenerfvNative - * Signature: (I[F)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListenerfvNative__I_3F - (JNIEnv *, jobject, jint, jfloatArray); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetListenerfvNative - * Signature: (ILjava/nio/FloatBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListenerfvNative__ILjava_nio_FloatBuffer_2 - (JNIEnv *, jobject, jint, jobject); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetListeneriNative - * Signature: (I[I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListeneriNative__I_3I - (JNIEnv *, jobject, jint, jintArray); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetListeneriNative - * Signature: (ILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListeneriNative__ILjava_nio_IntBuffer_2 - (JNIEnv *, jobject, jint, jobject); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetListeneri - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALImpl_alGetListeneri - (JNIEnv *, jobject, jint); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alEnable - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alEnable - (JNIEnv *, jobject, jint); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alDisable - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDisable - (JNIEnv *, jobject, jint); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alIsEnabled - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALImpl_alIsEnabled - (JNIEnv *, jobject, jint); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetBoolean - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALImpl_alGetBoolean - (JNIEnv *, jobject, jint); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetDouble - * Signature: (I)D - */ -JNIEXPORT jdouble JNICALL Java_net_java_games_joal_ALImpl_alGetDouble - (JNIEnv *, jobject, jint); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetFloat - * Signature: (I)F - */ -JNIEXPORT jfloat JNICALL Java_net_java_games_joal_ALImpl_alGetFloat - (JNIEnv *, jobject, jint); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetInteger - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALImpl_alGetInteger - (JNIEnv *, jobject, jint); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetDoublevNative - * Signature: (I[D)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetDoublevNative__I_3D - (JNIEnv *, jobject, jint, jdoubleArray); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetDoublevNative - * Signature: (ILjava/nio/DoubleBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetDoublevNative__ILjava_nio_DoubleBuffer_2 - (JNIEnv *, jobject, jint, jobject); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetFloatvNative - * Signature: (I[F)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetFloatvNative__I_3F - (JNIEnv *, jobject, jint, jfloatArray); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetFloatvNative - * Signature: (ILjava/nio/FloatBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetFloatvNative__ILjava_nio_FloatBuffer_2 - (JNIEnv *, jobject, jint, jobject); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetIntegervNative - * Signature: (I[I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetIntegervNative__I_3I - (JNIEnv *, jobject, jint, jintArray); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetIntegervNative - * Signature: (ILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetIntegervNative__ILjava_nio_IntBuffer_2 - (JNIEnv *, jobject, jint, jobject); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetString - * Signature: (I)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_net_java_games_joal_ALImpl_alGetString - (JNIEnv *, jobject, jint); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alDistanceModel - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDistanceModel - (JNIEnv *, jobject, jint); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alDopplerFactor - * Signature: (F)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDopplerFactor - (JNIEnv *, jobject, jfloat); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alDopplerVelocity - * Signature: (F)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDopplerVelocity - (JNIEnv *, jobject, jfloat); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetError - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALImpl_alGetError - (JNIEnv *, jobject); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alIsExtensionPresent - * Signature: (Ljava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALImpl_alIsExtensionPresent - (JNIEnv *, jobject, jstring); - -/* - * Class: net_java_games_joal_ALImpl - * Method: alGetEnumValue - * Signature: (Ljava/lang/String;)I - */ -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALImpl_alGetEnumValue - (JNIEnv *, jobject, jstring); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/src/native/alcbind.c b/src/native/alcbind.c deleted file mode 100644 index af5b2af..0000000 --- a/src/native/alcbind.c +++ /dev/null @@ -1,235 +0,0 @@ -/** -* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* -* -Redistribution of source code must retain the above copyright notice, -* this list of conditions and the following disclaimer. -* -* -Redistribution 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. -* -* Neither the name of Sun Microsystems, Inc. or the names of contributors may -* be used to endorse or promote products derived from this software without -* specific prior written permission. -* -* This software is provided "AS IS," without a warranty of any kind. -* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING -* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR -* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") AND ITS -* LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A -* RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. -* IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT -* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR -* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, -* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS -* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -* -* You acknowledge that this software is not designed or intended for use in the -* design, construction, operation or maintenance of any nuclear facility. -*/ - - -#include "alcbind.h" -#include "extal.h" - -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_alcGetErrorNative - (JNIEnv *env, jobject obj, jint pointer) { - return alcGetError((ALCdevice*)pointer); -} - -/* -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_openDeviceNative - (JNIEnv *env, jobject obj, jstring deviceName) { - printf("Entering openDeviceNative()\n"); - printf("In openDeviceNative() test 1\n"); - jint result; - ALubyte *str; - ALCdevice *device; - if(deviceName != NULL) { - printf("In openDeviceNative() test 2a.1\n"); - str = (ALubyte*)(*env)->GetStringUTFChars(env,deviceName,NULL); - printf("In openDeviceNative() test 2a.2 -- %i\n", *alcOpenDevice); - device = alcOpenDevice(str); - printf("In openDeviceNative() test 2a.3 -- %s - %i\n", str, (jint)device); - (*env)->ReleaseStringUTFChars(env,deviceName,str); - } else { - printf("In openDeviceNative() test 2b.1\n"); - device = alcOpenDevice(NULL); - printf("In openDeviceNative() test 2b.2 -- NULL - %i\n", (jint)device); - } - result = (jint)device; - printf("In openDeviceNative() test 3\n"); - printf("Exiting openDeviceNative()\n"); - return result; -} -*/ -JNIEXPORT jobject JNICALL Java_net_java_games_joal_ALCImpl_openDeviceNative - (JNIEnv *env, jobject obj, jstring deviceName) { - const char * tokenstring; - - jboolean isCopy = JNI_FALSE; - if(deviceName != NULL) { - tokenstring = ((*env)->GetStringUTFChars(env, deviceName, &isCopy)); - } else { - tokenstring = NULL; - } - - /* get device */ - ALCdevice* device = alcOpenDevice((ALubyte *) tokenstring); - - /* if error - cleanup and get out */ - if(device == NULL) { - if(tokenstring != NULL) { - // (*env)->ReleaseStringUTFChars(env, deviceName, tokenstring); - } - return NULL; - } - - /* 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(env, "net/java/games/joal/ALC$Device"); - alcDevice_method = (*env)->GetMethodID(env, alcDevice_class, "<init>", "(I)V"); - - /* create instance */ - alcDevice_object = (*env)->NewObject(env, alcDevice_class, alcDevice_method, (int) device); - - /* clean up */ - if (tokenstring != NULL) - // (*env)->ReleaseStringUTFChars(env, deviceName, tokenstring); - - return alcDevice_object; -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALCImpl_closeDeviceNative - (JNIEnv *env, jobject obj, jint pointer) { - ALCdevice* device = (ALCdevice*)pointer; - alcCloseDevice(device); -} -/* -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_createContextNative - (JNIEnv *env, jobject obj, jint pointer, jintArray attrs) { - ALCdevice* device = (ALCdevice*)pointer; - ALint* attrList = NULL; - if(attrs != NULL) { - attrList = (ALint*)(*env)->GetPrimitiveArrayCritical(env,attrs,0); - jint ctxPtr = (jint)alcCreateContext(device,attrList); - (*env)->ReleasePrimitiveArrayCritical(env,attrs,attrList,0); - return ctxPtr; - } else { - jint ctxPtr = (jint)alcCreateContext(device,NULL); - return ctxPtr; - } -} -*/ - -JNIEXPORT jobject JNICALL Java_net_java_games_joal_ALCImpl_createContextNative - (JNIEnv *env, jobject obj, jint deviceAddress, jintArray attrs) { - ALint* address = NULL; - - if(attrs != NULL) { - address = (ALint*)(*env)->GetPrimitiveArrayCritical(env,attrs,0); - } - ALCcontext* context = alcCreateContext((ALCdevice*)deviceAddress, address); - if(address != NULL) { - (*env)->ReleasePrimitiveArrayCritical(env,attrs,address,0); - } - /* if error - get out */ - if(context == NULL) { - return NULL; - } - - /* 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(env, "net/java/games/joal/ALC$Context"); - alcContext_method = (*env)->GetMethodID(env, alcContext_class, "<init>", "(Lnet/java/games/joal/ALC;I)V"); - - /* create instance */ - alcContext_object = (*env)->NewObject(env, alcContext_class, alcContext_method, obj, (int) context); - - return alcContext_object; -} - - -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_makeContextCurrentNative - (JNIEnv *env, jobject obj, jint pointer) { - ALvoid* alcHandle = (ALvoid*)pointer; - alcMakeContextCurrent(alcHandle); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALCImpl_processContextNative - (JNIEnv *env, jobject obj, jint pointer) { - ALvoid* alcHandle = (ALvoid*)pointer; - alcProcessContext(alcHandle); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALCImpl_suspendContextNative - (JNIEnv *env, jobject obj, jint pointer) { - ALvoid* alcHandle = (ALvoid*)pointer; - alcSuspendContext(alcHandle); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALCImpl_destroyContextNative - (JNIEnv *env, jobject obj, jint pointer) { - ALvoid* alcHandle = (ALvoid*)pointer; - alcDestroyContext(alcHandle); -} -/* -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_getError - (JNIEnv *env, jobject obj) { - jint result = 0; -// result = alcGetError(); - return result; -} -*/ -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_getCurrentContextNative - (JNIEnv *env, jobject obj) { - jint result; - result = (jint)alcGetCurrentContext(); - return result; -} - -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_getEnumValueNative - (JNIEnv *env, jobject obj, jint pointer, jstring enumName) { - jint result; - ALCdevice* device = (ALCdevice*)pointer; - ALubyte* str; - str = (ALubyte*)(*env)->GetStringUTFChars(env,enumName,NULL); - result = alcGetEnumValue(device, str); - (*env)->ReleaseStringUTFChars(env,enumName,str); - return result; -} - -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_getContextsDeviceNative - (JNIEnv *env, jobject obj, jint ptr) { - jint result; - ALvoid* alcHandle = (ALvoid*)ptr; - result = (jint)alcGetContextsDevice(alcHandle); - return result; -} -JNIEXPORT jstring JNICALL Java_net_java_games_joal_ALCImpl_alcGetStringNative - (JNIEnv *env, jobject obj, jint ptr, jint pname) { - ALCdevice *device = (ALCdevice*)ptr; - ALubyte* p = alcGetString(device,(ALenum)pname); - return (*env)->NewStringUTF(env, p); -} - -JNIEXPORT void JNICALL Java_net_java_games_joal_ALCImpl_alcGetIntegervNative - (JNIEnv *env, jobject obj, jint ptr, jint pname, jint size, jintArray data) { - ALint *p = (ALint*)(*env)->GetPrimitiveArrayCritical(env,data,0); - ALCdevice *device = (ALCdevice*)ptr; - if(p) { - alcGetIntegerv(device,(ALenum)pname,(ALsizei)size,p); - } - (*env)->ReleasePrimitiveArrayCritical(env,data,p,0); -} diff --git a/src/native/alcbind.h b/src/native/alcbind.h deleted file mode 100644 index 911940b..0000000 --- a/src/native/alcbind.h +++ /dev/null @@ -1,160 +0,0 @@ -/** -* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* -* -Redistribution of source code must retain the above copyright notice, -* this list of conditions and the following disclaimer. -* -* -Redistribution 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. -* -* Neither the name of Sun Microsystems, Inc. or the names of contributors may -* be used to endorse or promote products derived from this software without -* specific prior written permission. -* -* This software is provided "AS IS," without a warranty of any kind. -* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING -* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR -* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") AND ITS -* LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A -* RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. -* IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT -* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR -* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, -* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS -* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -* -* You acknowledge that this software is not designed or intended for use in the -* design, construction, operation or maintenance of any nuclear facility. -*/ -#include <jni.h> -/* Header for class net_java_games_joal_ALCImpl */ - -#ifndef _Included_net_java_games_joal_ALCImpl -#define _Included_net_java_games_joal_ALCImpl -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: net_java_games_joal_ALCImpl - * Method: openDeviceNative - * Signature: (Ljava/lang/String;)I - */ - /* -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_openDeviceNative - (JNIEnv *, jobject, jstring); -*/ -/* - * Class: net_java_games_joal_ALCImpl - * Method: openDeviceNative - * Signature: (Ljava/lang/String;)I - */ -JNIEXPORT jobject JNICALL Java_net_java_games_joal_ALCImpl_openDeviceNative - (JNIEnv *, jobject, jstring); - -/* - * Class: net_java_games_joal_ALCImpl - * Method: closeDeviceNative - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALCImpl_closeDeviceNative - (JNIEnv *, jobject, jint); - -/* - * Class: net_java_games_joal_ALCImpl - * Method: createContextNative - * Signature: (I[I)I - */ -/* -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_createContextNative - (JNIEnv *, jobject, jint, jintArray); -*/ -JNIEXPORT jobject JNICALL Java_net_java_games_joal_ALCImpl_createContextNative - (JNIEnv *, jobject, jint, jintArray); -/* - * Class: net_java_games_joal_ALCImpl - * Method: makeContextCurrentNative - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_makeContextCurrentNative - (JNIEnv *, jobject, jint); - -/* - * Class: net_java_games_joal_ALCImpl - * Method: processContextNative - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALCImpl_processContextNative - (JNIEnv *, jobject, jint); - -/* - * Class: net_java_games_joal_ALCImpl - * Method: suspendContextNative - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALCImpl_suspendContextNative - (JNIEnv *, jobject, jint); - -/* - * Class: net_java_games_joal_ALCImpl - * Method: destroyContextNative - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALCImpl_destroyContextNative - (JNIEnv *, jobject, jint); - -/* - * Class: net_java_games_joal_ALCImpl - * Method: alcGetError - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_alcGetErrorNative - (JNIEnv *, jobject, jint pointer); - -/* - * Class: net_java_games_joal_ALCImpl - * Method: getCurrentContextNative - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_getCurrentContextNative - (JNIEnv *, jobject); - -/* - * Class: net_java_games_joal_ALCImpl - * Method: getEnumValueNative - * Signature: (ILjava/lang/String;)I - */ -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_getEnumValueNative - (JNIEnv *, jobject, jint, jstring); - -/* - * Class: net_java_games_joal_ALCImpl - * Method: alcGetStringNative - * Signature: (II)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_net_java_games_joal_ALCImpl_alcGetStringNative - (JNIEnv *, jobject, jint, jint); - -/* - * Class: net_java_games_joal_ALCImpl - * Method: alcGetIntegervNative - * Signature: (III[I)V - */ -JNIEXPORT void JNICALL Java_net_java_games_joal_ALCImpl_alcGetIntegervNative - (JNIEnv *, jobject, jint, jint, jint, jintArray); - -/* - * Class: net_java_games_joal_ALCImpl - * Method: getContextDeviceNative - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_getContextDeviceNative - (JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/src/native/alfactory.c b/src/native/alfactory.c deleted file mode 100644 index a497c0c..0000000 --- a/src/native/alfactory.c +++ /dev/null @@ -1,50 +0,0 @@ -/** -* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* -* -Redistribution of source code must retain the above copyright notice, -* this list of conditions and the following disclaimer. -* -* -Redistribution 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. -* -* Neither the name of Sun Microsystems, Inc. or the names of contributors may -* be used to endorse or promote products derived from this software without -* specific prior written permission. -* -* This software is provided "AS IS," without a warranty of any kind. -* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING -* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR -* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") AND ITS -* LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A -* RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. -* IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT -* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR -* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, -* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS -* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -* -* You acknowledge that this software is not designed or intended for use in the -* design, construction, operation or maintenance of any nuclear facility. -*/ - -#include "alfactory.h" -#include "extal.h" -#include "jni.h" - -JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALFactory_init - (JNIEnv *env , jclass clazz, jobjectArray oalPaths) { - printf("ALFactory.init - Native: Enter\n"); - InitializeOpenAL(env,oalPaths); - printf("ALFactory.init - Native: Exit\n"); - return 1; -} - -JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALFactory_deinitialize - (JNIEnv *env, jclass clazz) { - DeInitializeOpenAL(); - return 1; -} diff --git a/src/native/alfactory.h b/src/native/alfactory.h deleted file mode 100644 index 48c301c..0000000 --- a/src/native/alfactory.h +++ /dev/null @@ -1,66 +0,0 @@ -/** -* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* -* -Redistribution of source code must retain the above copyright notice, -* this list of conditions and the following disclaimer. -* -* -Redistribution 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. -* -* Neither the name of Sun Microsystems, Inc. or the names of contributors may -* be used to endorse or promote products derived from this software without -* specific prior written permission. -* -* This software is provided "AS IS," without a warranty of any kind. -* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING -* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR -* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") AND ITS -* LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A -* RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. -* IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT -* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR -* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, -* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS -* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -* -* You acknowledge that this software is not designed or intended for use in the -* design, construction, operation or maintenance of any nuclear facility. -*/ - - -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class net_java_games_joal_ALFactory */ - -#ifndef _Included_net_java_games_joal_ALFactory -#define _Included_net_java_games_joal_ALFactory -#ifdef __cplusplus -extern "C" { -#endif -/* Inaccessible static: isInitialized */ -/* Inaccessible static: al */ -/* Inaccessible static: alc */ -/* - * Class: net_java_games_joal_ALFactory - * Method: initialize - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALFactory_init - (JNIEnv *, jclass, jobjectArray); - -/* - * Class: net_java_games_joal_ALFactory - * Method: deinitialize - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALFactory_deinitialize - (JNIEnv *, jclass); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/src/native/build.xml b/src/native/build.xml deleted file mode 100644 index 0d26f42..0000000 --- a/src/native/build.xml +++ /dev/null @@ -1,113 +0,0 @@ -<?xml version="1.0" encoding="iso-8859-1"?> - -<!-- -* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* -* -Redistribution of source code must retain the above copyright notice, -* this list of conditions and the following disclaimer. -* -* -Redistribution 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. -* -* Neither the name of Sun Microsystems, Inc. or the names of contributors may -* be used to endorse or promote products derived from this software without -* specific prior written permission. -* -* This software is provided "AS IS," without a warranty of any kind. -* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING -* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR -* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") AND ITS -* LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A -* RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. -* IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT -* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR -* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, -* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS -* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -* -* You acknowledge that this software is not designed or intended for use in the -* design, construction, operation or maintenance of any nuclear facility. ---> - -<project name="Sun Games Initiative Client Technologies" basedir="." default="all"> - - <target name="init"> - <property name="cc" value ="gcc"/> - <property name="no_cygwin" value="-mno-cygwin"/> - <property name="sources" value="common_tools.c extal.c eaxfactory.c eaxbind.c alfactory.c alcbind.c albind.c"/> - <property name="specs" value="-specs='./specs.new'"/> - <condition property="isOSX"> - <and> - <os family="mac"/> - <os family="unix"/> - </and> - </condition> - <condition property="isUnix"> - <and> - <os family="unix" /> - <not> - <os family="mac" /> - </not> - </and> - </condition> - <condition property="isWindows"> - <os family="windows" /> - </condition> - </target> - - <target name="compile-dll" depends="init" if="isWindows"> - <echo message="Compiling DLL for Windows." /> - <antcall target="compile-native-lib"> - <param name="include" value="-I${jdk.home}/include -I${jdk.home}/include/win32 -I'${openal.home}'/include" /> - <param name="compilerflags" value ="${no_cygwin} -O3 -Wl,--add-stdcall-alias -shared"/> - <param name="output" value="../../lib/joal.dll"/> - </antcall> - </target> - - <target name="compile-so" depends="init" if="isUnix"> - <echo message="Compiling shared library for Unix." /> - <antcall target="compile-native-lib"> - <param name="include" value="-I${jdk.home}/include -I${jdk.home}/include/linux -I'${openal.home}'/include -I'${openal.home}'/include/AL" /> - <param name="compilerflags" value ="-O3 -D_X11 -shared -Wl,-soname -Wl,libjoal.so -Wl,-export-dynamic "/> - <param name="output" value="../../lib/libjoal.so"/> - </antcall> - </target> - - <target name="compile-jnilib" depends="init" if="isOSX"> - <echo message="Compiling shared library for OSX"/> - <antcall target="compile-native-lib"> - <param name="include" value="-I${jdk.home}/include -I${openal.home}/Headers"/> - <param name="compilerflags" value="-O3 -D_AGL -bundle "/> - <param name="output" value="../../lib/libjoal.jnilib"/> - </antcall> - </target> - - <target name="compile-native-lib"> - <echo message="${cc} ${include} ${compilerflags} -o ${output} ${sources}" /> - <exec executable="${cc}"> - <arg line=" ${include} ${compilerflags} -o ${output} ${sources}"/> - </exec> - </target> - - <target name="compile" depends="compile-so, compile-dll, compile-jnilib"> - </target> - - <target name="javadoc" depends="init"> - <ant dir="src/java" target="javadoc"/> - </target> - - - <target name="all" depends="init,compile" description="Build everything."> - <echo message="Application built."/> - </target> - - <target name="clean" description="Clean all build products."> - <delete file="../../lib/joal.dll" /> - <delete file="../../lib/libjoal.so" /> - <delete file="../../lib/libjoal.jnilib"/> - </target> -</project> diff --git a/src/native/common_tools.c b/src/native/common_tools.c deleted file mode 100644 index c38b4b3..0000000 --- a/src/native/common_tools.c +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2002 Light Weight Java Game Library Project - * 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. - * - * * Neither the name of 'Light Weight Java Game Library' nor the names of - * 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$ - * - * @author elias_naur <[email protected]> - * @version $Revision$ - */ - -#include "common_tools.h" - -static void incListStart(event_queue_t *queue) { - queue->list_start = (queue->list_start + 1)%EVENT_BUFFER_SIZE; -} - -void initEventQueue(event_queue_t *event_queue) { - event_queue->list_start = 0; - event_queue->list_end = 0; -} - -void putEventElement(event_queue_t *queue, unsigned char byte) { - int next_index = (queue->list_end + 1)%EVENT_BUFFER_SIZE; - if (next_index == queue->list_start) { -#ifdef _DEBUG - printf("Event buffer overflow!\n"); -#endif - return; - } - queue->input_event_buffer[queue->list_end] = byte; - queue->list_end = next_index; -} - -static int hasMoreEvents(event_queue_t *queue) { - return queue->list_start != queue->list_end; -} - -static void copyEvent(event_queue_t *queue, int event_size, int event_index) { - int output_index = event_index*event_size; - int i; - for (i = 0; i < event_size; i++) { - queue->output_event_buffer[output_index] = queue->input_event_buffer[queue->list_start]; - incListStart(queue); - output_index++; - } -} - -int copyEvents(event_queue_t *event_queue, int event_size) { - int num_events = 0; - while (hasMoreEvents(event_queue)) { - copyEvent(event_queue, event_size, num_events); - num_events++; - } - return num_events; -} - -unsigned char *getOutputList(event_queue_t *queue) { - return queue->output_event_buffer; -} - -int getEventBufferSize(event_queue_t *event_queue) { - return EVENT_BUFFER_SIZE; -} - -static void throwGeneralException(JNIEnv * env, const char *exception_name, const char * err) { - jclass cls = (*env)->FindClass(env,exception_name); - (*env)->ThrowNew(env,cls, err); - (*env)->DeleteLocalRef(env,cls); -} - -void throwOpenALException(JNIEnv * env, const char * err) { - throwGeneralException(env, "net/java/games/joal/OpenALException", err); -} - -void throwException(JNIEnv * env, const char * err) { - throwGeneralException(env, "java/lang/Exception", err); -} diff --git a/src/native/common_tools.h b/src/native/common_tools.h deleted file mode 100644 index 2298728..0000000 --- a/src/native/common_tools.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2002 Light Weight Java Game Library Project - * 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. - * - * * Neither the name of 'Light Weight Java Game Library' nor the names of - * 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$ - * - * @author elias_naur <[email protected]> - * @version $Revision$ - */ - -#ifndef _COMMON_TOOLS_H -#define _COMMON_TOOLS_H - -#include <jni.h> - -// Must be x * max_event_size + 1 -#define EVENT_BUFFER_SIZE (25 * 4 + 1) - -typedef struct { - unsigned char input_event_buffer[EVENT_BUFFER_SIZE]; - unsigned char output_event_buffer[EVENT_BUFFER_SIZE]; - - int list_start; - int list_end; -} event_queue_t; - -extern void initEventQueue(event_queue_t *event_queue); -extern int copyEvents(event_queue_t *event_queue, int event_size); -extern void putEventElement(event_queue_t *queue, unsigned char byte); -extern unsigned char *getOutputList(event_queue_t *queue); -extern int getEventBufferSize(event_queue_t *event_queue); -extern void throwException(JNIEnv *env, const char *msg); -extern void throwOpenALException(JNIEnv * env, const char * err); - -#endif diff --git a/src/native/eaxbind.c b/src/native/eaxbind.c index da1b285..5d58fe3 100644 --- a/src/native/eaxbind.c +++ b/src/native/eaxbind.c @@ -33,7 +33,7 @@ #include "eaxbind.h" -#include "extal.h" +#include "eax.h" #ifdef _WIN32 const GUID DSPROPSETID_EAX20_ListenerProperties = { 0x306a6a8, 0xb224, 0x11d2, { 0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22 } }; diff --git a/src/native/eaxfactory.c b/src/native/eaxfactory.c index 708ddda..d0e3e9d 100644 --- a/src/native/eaxfactory.c +++ b/src/native/eaxfactory.c @@ -33,7 +33,13 @@ #include "eaxfactory.h" -#include "extal.h" +#include "al.h" +#include "eax.h" + +#ifdef _WIN32 +EAXSet eaxSet; // EAXSet function, ret$ +EAXGet eaxGet; // EAXGet function, ret$ +#endif /* * had some problems getting this from extal.h diff --git a/src/native/extal.c b/src/native/extal.c deleted file mode 100644 index 45947dc..0000000 --- a/src/native/extal.c +++ /dev/null @@ -1,451 +0,0 @@ -/* - * Copyright (c) 2002 Light Weight Java Game Library Project - * 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. - * - * * Neither the name of 'Light Weight Java Game Library' nor the names of - * 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. - */ - -#include "stdio.h" -#include "extal.h" -#include "common_tools.h" - -#ifdef _X11 -#include "dlfcn.h" -#endif - -/** - * $Id$ - * - * This file contains the AL extension assigning mechanism - * - * @author Brian Matzon <[email protected]> - * @version $Revision$ - */ -alEnablePROC alEnable = NULL; -alDisablePROC alDisable = NULL; -alIsEnabledPROC alIsEnabled = NULL; -alHintPROC alHint = NULL; -alGetBooleanPROC alGetBoolean = NULL; -alGetIntegerPROC alGetInteger = NULL; -alGetFloatPROC alGetFloat = NULL; -alGetDoublePROC alGetDouble = NULL; -alGetBooleanvPROC alGetBooleanv = NULL; -alGetIntegervPROC alGetIntegerv = NULL; -alGetFloatvPROC alGetFloatv = NULL; -alGetDoublevPROC alGetDoublev = NULL; -alGetStringPROC alGetString = NULL; -alGetErrorPROC alGetError = NULL; -alIsExtensionPresentPROC alIsExtensionPresent = NULL; -alGetProcAddressPROC alGetProcAddress = NULL; -alGetEnumValuePROC alGetEnumValue = NULL; -alListeneriPROC alListeneri = NULL; -alListenerfPROC alListenerf = NULL; -alListener3fPROC alListener3f = NULL; -alListenerfvPROC alListenerfv = NULL; -alGetListeneriPROC alGetListeneri = NULL; -alGetListenerfPROC alGetListenerf = NULL; -alGetListener3fPROC alGetListener3f = NULL; -alGetListenerfvPROC alGetListenerfv = NULL; -alGenSourcesPROC alGenSources = NULL; -alDeleteSourcesPROC alDeleteSources = NULL; -alIsSourcePROC alIsSource = NULL; -alSourceiPROC alSourcei = NULL; -alSourcefPROC alSourcef = NULL; -alSource3fPROC alSource3f = NULL; -alSourcefvPROC alSourcefv = NULL; -alGetSourceiPROC alGetSourcei = NULL; -alGetSourcefPROC alGetSourcef = NULL; -alGetSource3fPROC alGetSource3f = NULL; -alGetSourcefvPROC alGetSourcefv = NULL; -alSourcePlayvPROC alSourcePlayv = NULL; -alSourcePausevPROC alSourcePausev = NULL; -alSourceStopvPROC alSourceStopv = NULL; -alSourceRewindvPROC alSourceRewindv = NULL; -alSourcePlayPROC alSourcePlay = NULL; -alSourcePausePROC alSourcePause = NULL; -alSourceStopPROC alSourceStop = NULL; -alSourceRewindPROC alSourceRewind = NULL; -alGenBuffersPROC alGenBuffers = NULL; -alDeleteBuffersPROC alDeleteBuffers = NULL; -alIsBufferPROC alIsBuffer = NULL; -alBufferDataPROC alBufferData = NULL; -alGetBufferiPROC alGetBufferi = NULL; -alGetBufferfPROC alGetBufferf = NULL; -alSourceQueueBuffersPROC alSourceQueueBuffers = NULL; -alSourceUnqueueBuffersPROC alSourceUnqueueBuffers = NULL; -alDistanceModelPROC alDistanceModel = NULL; -alDopplerFactorPROC alDopplerFactor = NULL; -alDopplerVelocityPROC alDopplerVelocity = NULL; -alcGetStringPROC alcGetString = NULL; -alcGetIntegervPROC alcGetIntegerv = NULL; -alcOpenDevicePROC alcOpenDevice = NULL; -alcCloseDevicePROC alcCloseDevice = NULL; -alcCreateContextPROC alcCreateContext = NULL; -alcMakeContextCurrentPROC alcMakeContextCurrent = NULL; -alcProcessContextPROC alcProcessContext = NULL; -alcGetCurrentContextPROC alcGetCurrentContext = NULL; -alcGetContextsDevicePROC alcGetContextsDevice = NULL; -alcSuspendContextPROC alcSuspendContext = NULL; -alcDestroyContextPROC alcDestroyContext = NULL; -alcGetErrorPROC alcGetError = NULL; -alcIsExtensionPresentPROC alcIsExtensionPresent = NULL; -alcGetProcAddressPROC alcGetProcAddress = NULL; -alcGetEnumValuePROC alcGetEnumValue = NULL; - -#ifdef _WIN32 -EAXSet eaxSet; // EAXSet function, ret$ -EAXGet eaxGet; // EAXGet function, ret$ - -/* Handle to OpenAL Library */ -HMODULE handleOAL; -#endif -#ifdef _X11 -void* handleOAL; -#endif -#ifdef _AGL -#include "mach-o/dyld.h" -#include "stdlib.h" -#include "string.h" -const struct mach_header* handleOAL; -#endif - -/* Loads OpenAL */ -static int LoadOpenAL(JNIEnv *env, jobjectArray oalPaths); - -/* Unloads OpenAL */ -static void UnLoadOpenAL(void); - -/* Gets a pointer to the named function */ -static void* GetFunctionPointer(const char* function); - -/* Loads OpenAL basic functions */ -static int LoadAL(void); - -/* Loads OpenAL ALC functions */ -static int LoadALC(void); - -/* Loads any extensions to OpenAL */ -static int LoadALExtensions(void); - -static void *NativeGetFunctionPointer(const char *function) { -#ifdef _WIN32 - return GetProcAddress(handleOAL, function); -#endif -#ifdef _X11 - return dlsym(handleOAL, function); -#endif -#ifdef _AGL - char *mac_symbol_name = (char *)malloc((strlen(function) + 2)*sizeof(char)); - if (mac_symbol_name == NULL) - return NULL; - mac_symbol_name[0] = '_'; - strcpy(&(mac_symbol_name[1]), function); - NSSymbol symbol = NSLookupSymbolInImage(handleOAL, mac_symbol_name, NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); - free(mac_symbol_name); - if (symbol == NULL) - return NULL; - return NSAddressOfSymbol(symbol); -#endif -} - -/** - * Retrieves a pointer to the named function - * - * @param function Name of function - * @return pointer to named function, or NULL if not found - */ -static void* GetFunctionPointer(const char* function) { - void *p = NativeGetFunctionPointer(function); - if (p == NULL) { -#ifdef _DEBUG - printf("Could not locate symbol %s\n", function); -#endif - } - return p; -} - -/** - * Loads the OpenAL Library - */ -static int LoadOpenAL(JNIEnv *env, jobjectArray oalPaths) { - - jsize pathcount = (*env)->GetArrayLength(env,oalPaths); -#ifdef _DEBUG - printf("Found %d OpenAL paths\n", (int)pathcount); -#endif - int i; - for(i=0;i<pathcount;i++) { - jstring path = (jstring) (*env)->GetObjectArrayElement(env,oalPaths, i); - const char *path_str = (*env)->GetStringUTFChars(env,path, NULL); -#ifdef _DEBUG - printf("Testing '%s'\n", path_str); -#endif -#ifdef _WIN32 - handleOAL = LoadLibrary(path_str); -#endif -#ifdef _X11 - handleOAL = dlopen(path_str, RTLD_LAZY); -#endif -#ifdef _AGL - handleOAL = NSAddImage(path_str, NSADDIMAGE_OPTION_RETURN_ON_ERROR); -#endif - if (handleOAL != NULL) { -#ifdef _DEBUG - printf("Found OpenAL at '%s'\n", path_str); -#endif - return 1; - } - (*env)->ReleaseStringUTFChars(env,path, path_str); - } - throwOpenALException(env, "Could not load openal library."); - return 0; -} - -/** - * Unloads the OpenAL Library - */ -static void UnLoadOpenAL() { -#ifdef _WIN32 - FreeLibrary(handleOAL); -#endif -#ifdef _X11 - dlclose(handleOAL); -#endif -#ifdef _AGL - // Cannot remove the image -#endif -} - -/** - * Initializes OpenAL by loading the library - */ -void InitializeOpenAL(JNIEnv *env, jobjectArray oalPaths) { - if(handleOAL != NULL) { - return; - } - - //load our library - if (!LoadOpenAL(env, oalPaths)) { - return; - } - - //load basic OpenAL functions - if(!LoadAL()) { - throwOpenALException(env, "Could not load OpenAL function pointers."); - return; - } - - //load OpenAL context functions - if(!LoadALC()) { - throwOpenALException(env, "Could not load ALC function pointers."); - return; - } - - //load OpenAL extensions - if(!LoadALExtensions()) { - throwOpenALException(env, "Could not load AL extension function pointers."); - return; - } -} - -/** - * Called to deinitialize OpenAL - */ -void DeInitializeOpenAL() { - UnLoadOpenAL(); - handleOAL = 0; -} - -/** - * Loads the basic OpenAL functions - * - * @return true if all methods were loaded, false if one of the methods could not be loaded - */ -static int LoadAL() { - alEnable = (alEnablePROC) GetFunctionPointer("alEnable"); - alDisable = (alDisablePROC) GetFunctionPointer("alDisable"); - alIsEnabled = (alIsEnabledPROC) GetFunctionPointer("alIsEnabled"); - //alHint = (alHintPROC) GetFunctionPointer("alHint"); - //alGetintean = (alGetinteanPROC) GetFunctionPointer("alGetintean"); - alGetInteger = (alGetIntegerPROC) GetFunctionPointer("alGetInteger"); - alGetFloat = (alGetFloatPROC) GetFunctionPointer("alGetFloat"); - alGetDouble = (alGetDoublePROC) GetFunctionPointer("alGetDouble"); - //alGetinteanv = (alGetinteanvPROC) GetFunctionPointer("alGetinteanv"); - alGetIntegerv = (alGetIntegervPROC) GetFunctionPointer("alGetIntegerv"); - alGetFloatv = (alGetFloatvPROC) GetFunctionPointer("alGetFloatv"); - alGetDoublev = (alGetDoublevPROC) GetFunctionPointer("alGetDoublev"); - alGetString = (alGetStringPROC) GetFunctionPointer("alGetString"); - alGetError = (alGetErrorPROC) GetFunctionPointer("alGetError"); - alIsExtensionPresent = (alIsExtensionPresentPROC) GetFunctionPointer("alIsExtensionPresent"); - alGetProcAddress = (alGetProcAddressPROC) GetFunctionPointer("alGetProcAddress"); - alGetEnumValue = (alGetEnumValuePROC) GetFunctionPointer("alGetEnumValue"); - alListeneri = (alListeneriPROC) GetFunctionPointer("alListeneri"); - alListenerf = (alListenerfPROC) GetFunctionPointer("alListenerf"); - alListener3f = (alListener3fPROC) GetFunctionPointer("alListener3f"); - alListenerfv = (alListenerfvPROC) GetFunctionPointer("alListenerfv"); - alGetListeneri = (alGetListeneriPROC) GetFunctionPointer("alGetListeneri"); - alGetListenerf = (alGetListenerfPROC) GetFunctionPointer("alGetListenerf"); - alGetListener3f = (alGetListener3fPROC) GetFunctionPointer("alGetListener3f"); - alGetListenerfv = (alGetListenerfvPROC) GetFunctionPointer("alGetListenerfv"); - alGenSources = (alGenSourcesPROC) GetFunctionPointer("alGenSources"); - alDeleteSources = (alDeleteSourcesPROC) GetFunctionPointer("alDeleteSources"); - alIsSource = (alIsSourcePROC) GetFunctionPointer("alIsSource"); - alSourcei = (alSourceiPROC) GetFunctionPointer("alSourcei"); - alSourcef = (alSourcefPROC) GetFunctionPointer("alSourcef"); - alSource3f = (alSource3fPROC) GetFunctionPointer("alSource3f"); - alSourcefv = (alSourcefvPROC) GetFunctionPointer("alSourcefv"); - alGetSourcei = (alGetSourceiPROC) GetFunctionPointer("alGetSourcei"); - alGetSourcef = (alGetSourcefPROC) GetFunctionPointer("alGetSourcef"); - alGetSource3f = (alGetSource3fPROC) GetFunctionPointer("alGetSource3f"); - alGetSourcefv = (alGetSourcefvPROC) GetFunctionPointer("alGetSourcefv"); - alSourcePlayv = (alSourcePlayvPROC) GetFunctionPointer("alSourcePlayv"); - alSourcePausev = (alSourcePausevPROC) GetFunctionPointer("alSourcePausev"); - alSourceStopv = (alSourceStopvPROC) GetFunctionPointer("alSourceStopv"); - alSourceRewindv = (alSourceRewindvPROC) GetFunctionPointer("alSourceRewindv"); - alSourcePlay = (alSourcePlayPROC) GetFunctionPointer("alSourcePlay"); - alSourcePause = (alSourcePausePROC) GetFunctionPointer("alSourcePause"); - alSourceStop = (alSourceStopPROC) GetFunctionPointer("alSourceStop"); - alSourceRewind = (alSourceRewindPROC) GetFunctionPointer("alSourceRewind"); - alGenBuffers = (alGenBuffersPROC) GetFunctionPointer("alGenBuffers"); - alDeleteBuffers = (alDeleteBuffersPROC) GetFunctionPointer("alDeleteBuffers"); - alIsBuffer = (alIsBufferPROC) GetFunctionPointer("alIsBuffer"); - alBufferData = (alBufferDataPROC) GetFunctionPointer("alBufferData"); - alGetBufferi = (alGetBufferiPROC) GetFunctionPointer("alGetBufferi"); - alGetBufferf = (alGetBufferfPROC) GetFunctionPointer("alGetBufferf"); - alSourceQueueBuffers = (alSourceQueueBuffersPROC) GetFunctionPointer("alSourceQueueBuffers"); - alSourceUnqueueBuffers = (alSourceUnqueueBuffersPROC) GetFunctionPointer("alSourceUnqueueBuffers"); - alDistanceModel = (alDistanceModelPROC) GetFunctionPointer("alDistanceModel"); - alDopplerFactor = (alDopplerFactorPROC) GetFunctionPointer("alDopplerFactor"); - alDopplerVelocity = (alDopplerVelocityPROC) GetFunctionPointer("alDopplerVelocity"); - - return - alEnable != NULL && - alDisable != NULL && - alIsEnabled != NULL && - //alHint != NULL && - //alGetintean != NULL && - alGetInteger != NULL && - alGetFloat != NULL && - alGetDouble != NULL && - //alGetinteanv != NULL && - alGetIntegerv != NULL && - alGetFloatv != NULL && - alGetDoublev != NULL && - alGetString != NULL && - alGetError != NULL && - alIsExtensionPresent != NULL && - alGetProcAddress != NULL && - alGetEnumValue != NULL && - alListeneri != NULL && - alListenerf != NULL && - alListener3f != NULL && - alListenerfv != NULL && - alGetListeneri != NULL && - alGetListenerf != NULL && - alGetListener3f != NULL && - alGetListenerfv != NULL && - alGenSources != NULL && - alDeleteSources != NULL && - alIsSource != NULL && - alSourcei != NULL && - alSourcef != NULL && - alSource3f != NULL && - alSourcefv != NULL && - alGetSourcei != NULL && - alGetSourcef != NULL && - alGetSource3f != NULL && - alGetSourcefv != NULL && - alSourcePlayv != NULL && - alSourcePausev != NULL && - alSourceStopv != NULL && - alSourceRewindv != NULL && - alSourcePlay != NULL && - alSourcePause != NULL && - alSourceStop != NULL && - alSourceRewind != NULL && - alGenBuffers != NULL && - alDeleteBuffers != NULL && - alIsBuffer != NULL && - alBufferData != NULL && - alGetBufferi != NULL && - alGetBufferf != NULL && - alSourceQueueBuffers != NULL && - alSourceUnqueueBuffers != NULL && - alDistanceModel != NULL && - alDopplerFactor != NULL && - alDopplerVelocity != NULL; -} - -/** - * Loads the context OpenAL functions - * - * @return true if all methods were loaded, false if one of the methods could not be loaded - */ -static int LoadALC() { - alcGetString = (alcGetStringPROC) GetFunctionPointer("alcGetString"); - alcGetIntegerv = (alcGetIntegervPROC) GetFunctionPointer("alcGetIntegerv"); - alcOpenDevice = (alcOpenDevicePROC) GetFunctionPointer("alcOpenDevice"); - alcCloseDevice = (alcCloseDevicePROC) GetFunctionPointer("alcCloseDevice"); - alcCreateContext = (alcCreateContextPROC) GetFunctionPointer("alcCreateContext"); - alcMakeContextCurrent = (alcMakeContextCurrentPROC) GetFunctionPointer("alcMakeContextCurrent"); - alcProcessContext = (alcProcessContextPROC) GetFunctionPointer("alcProcessContext"); - alcGetCurrentContext = (alcGetCurrentContextPROC) GetFunctionPointer("alcGetCurrentContext"); - alcGetContextsDevice = (alcGetContextsDevicePROC) GetFunctionPointer("alcGetContextsDevice"); - alcSuspendContext = (alcSuspendContextPROC) GetFunctionPointer("alcSuspendContext"); - alcDestroyContext = (alcDestroyContextPROC) GetFunctionPointer("alcDestroyContext"); - alcGetError = (alcGetErrorPROC) GetFunctionPointer("alcGetError"); - alcIsExtensionPresent = (alcIsExtensionPresentPROC) GetFunctionPointer("alcIsExtensionPresent"); - alcGetProcAddress = (alcGetProcAddressPROC) GetFunctionPointer("alcGetProcAddress"); - alcGetEnumValue = (alcGetEnumValuePROC) GetFunctionPointer("alcGetEnumValue"); - - return - alcGetString != NULL && - alcGetIntegerv != NULL && - alcOpenDevice != NULL && - alcCloseDevice != NULL && - alcCreateContext != NULL && - alcMakeContextCurrent != NULL && - alcProcessContext != NULL && - alcGetCurrentContext != NULL && - alcGetContextsDevice != NULL && - alcSuspendContext != NULL && - alcDestroyContext != NULL && - alcGetError != NULL && - alcIsExtensionPresent != NULL && - alcGetProcAddress != NULL && - alcGetEnumValue != NULL; -} - -/** - * Loads the OpenAL extensions functions - * - * @return true if all methods were loaded, false if one of the methods could not be loaded - */ -static int LoadALExtensions() { - return 1; -} diff --git a/src/native/extal.h b/src/native/extal.h deleted file mode 100644 index 361c2d7..0000000 --- a/src/native/extal.h +++ /dev/null @@ -1,313 +0,0 @@ -/* - * Copyright (c) 2002 Light Weight Java Game Library Project - * 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. - * - * * Neither the name of 'Light Weight Java Game Library' nor the names of - * 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. - */ - -#ifndef _AL_TEST_H -#define _AL_TEST_H - -#ifdef _WIN32 -#include "windows.h" -#endif - -#ifdef _X11 -#include "AL/altypes.h" -#include "AL/alctypes.h" -#endif -#ifdef _WIN32 -#include "altypes.h" -#include "alctypes.h" -#endif -#ifdef _AGL -#include "OpenAL/alctypes.h" -#include "OpenAL/altypes.h" -#endif - -#include <jni.h> - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef _WIN32 - #ifdef _OPENAL32LIB - #define ALCAPI __declspec(dllexport) - #else - #define ALCAPI __declspec(dllimport) - #endif - - typedef struct ALCdevice_struct ALCdevice; - typedef struct ALCcontext_struct ALCcontext; - - #define ALCAPIENTRY __cdecl -#else - #ifdef _AGL - #if _AGL - typedef struct ALCdevice_struct ALCdevice; - typedef struct ALCcontext_struct ALCcontext; - - #endif - #endif - #define ALCAPI - #define ALCAPIENTRY - -/** ALC boolean type. */ -typedef char ALCboolean; - -/** ALC 8bit signed byte. */ -typedef char ALCbyte; - -/** ALC 8bit unsigned byte. */ -typedef unsigned char ALCubyte; - -/** ALC 16bit signed short integer type. */ -typedef short ALCshort; - -/** ALC 16bit unsigned short integer type. */ -typedef unsigned short ALCushort; - -/** ALC 32bit unsigned integer type. */ -typedef unsigned ALCuint; - -/** ALC 32bit signed integer type. */ -typedef int ALCint; - -/** ALC 32bit floating point type. */ -typedef float ALCfloat; - -/** ALC 64bit double point type. */ -typedef double ALCdouble; - -/** ALC 32bit type. */ -typedef unsigned int ALCsizei; - -/** ALC void type */ -typedef void ALCvoid; - -#endif - -#ifdef _WIN32 - #ifdef _OPENAL32LIB - #define ALAPI __declspec(dllexport) - #else - #define ALAPI __declspec(dllimport) - #endif - #define ALAPIENTRY __cdecl - #define AL_CALLBACK -#else - #define ALAPI - #define ALAPIENTRY - #define AL_CALLBACK -#endif - -#ifdef _WIN32 -DEFINE_GUID(DSPROPSETID_EAX20_ListenerProperties, - 0x306a6a8, - 0xb224, - 0x11d2, - 0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22); - -DEFINE_GUID(DSPROPSETID_EAX20_BufferProperties, - 0x306a6a7, - 0xb224, - 0x11d2, - 0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22); -#endif - -#define INITGUID -#define OPENAL - -void InitializeOpenAL(JNIEnv *env, jobjectArray oalPaths); -void DeInitializeOpenAL(); - -//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 ALCcontext* (ALCAPIENTRY *alcGetCurrentContextPROC)(ALCvoid); -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); - -//al -typedef ALvoid (ALAPIENTRY *alEnablePROC)( ALenum capability ); -typedef ALvoid (ALAPIENTRY *alDisablePROC)( ALenum capability ); -typedef ALboolean (ALAPIENTRY *alIsEnabledPROC)( ALenum capability ); -typedef ALvoid (ALAPIENTRY *alHintPROC)( ALenum target, ALenum mode ); -typedef ALboolean (ALAPIENTRY *alGetBooleanPROC)( ALenum param ); -typedef ALint (ALAPIENTRY *alGetIntegerPROC)( ALenum param ); -typedef ALfloat (ALAPIENTRY *alGetFloatPROC)( ALenum param ); -typedef ALdouble (ALAPIENTRY *alGetDoublePROC)( ALenum param ); -typedef ALvoid (ALAPIENTRY *alGetBooleanvPROC)( ALenum param, ALboolean* data ); -typedef ALvoid (ALAPIENTRY *alGetIntegervPROC)( ALenum param, ALint* data ); -typedef ALvoid (ALAPIENTRY *alGetFloatvPROC)( ALenum param, ALfloat* data ); -typedef ALvoid (ALAPIENTRY *alGetDoublevPROC)( ALenum param, ALdouble* data ); -typedef ALubyte* (ALAPIENTRY *alGetStringPROC)( ALenum param ); -typedef ALenum (ALAPIENTRY *alGetErrorPROC)( ALvoid ); -typedef ALboolean (ALAPIENTRY *alIsExtensionPresentPROC)( ALubyte* fname ); -typedef ALvoid* (ALAPIENTRY *alGetProcAddressPROC)( ALubyte* fname ); -typedef ALenum (ALAPIENTRY *alGetEnumValuePROC)( ALubyte* ename ); -typedef ALvoid (ALAPIENTRY *alListeneriPROC)( ALenum param, ALint value ); -typedef ALvoid (ALAPIENTRY *alListenerfPROC)( ALenum param, ALfloat value ); -typedef ALvoid (ALAPIENTRY *alListener3fPROC)( ALenum param, ALfloat v1, ALfloat v2, ALfloat v3 ); -typedef ALvoid (ALAPIENTRY *alListenerfvPROC)( ALenum param, ALfloat* values ); -typedef ALvoid (ALAPIENTRY *alGetListeneriPROC)( ALenum param, ALint* value ); -typedef ALvoid (ALAPIENTRY *alGetListenerfPROC)( ALenum param, ALfloat* value ); -typedef ALvoid (ALAPIENTRY *alGetListener3fPROC)( ALenum param, ALfloat* v1, ALfloat* v2, ALfloat* v3 ); -typedef ALvoid (ALAPIENTRY *alGetListenerfvPROC)( ALenum param, ALfloat* values ); -typedef ALvoid (ALAPIENTRY *alGenSourcesPROC)( ALsizei n, ALuint* sources ); -typedef ALvoid (ALAPIENTRY *alDeleteSourcesPROC)( ALsizei n, ALuint* sources ); -typedef ALboolean (ALAPIENTRY *alIsSourcePROC)( ALuint id ); -typedef ALvoid (ALAPIENTRY *alSourceiPROC)( ALuint source, ALenum param, ALint value ); -typedef ALvoid (ALAPIENTRY *alSourcefPROC)( ALuint source, ALenum param, ALfloat value ); -typedef ALvoid (ALAPIENTRY *alSource3fPROC)( ALuint source, ALenum param, ALfloat v1, ALfloat v2, ALfloat v3 ); -typedef ALvoid (ALAPIENTRY *alSourcefvPROC)( ALuint source, ALenum param, ALfloat* values ); -typedef ALvoid (ALAPIENTRY *alGetSourceiPROC)( ALuint source, ALenum param, ALint* value ); -typedef ALvoid (ALAPIENTRY *alGetSourcefPROC)( ALuint source, ALenum param, ALfloat* value ); -typedef ALvoid (ALAPIENTRY *alGetSource3fPROC)( ALuint source, ALenum param, ALfloat* v1, ALfloat* v2, ALfloat* v3 ); -typedef ALvoid (ALAPIENTRY *alGetSourcefvPROC)( ALuint source, ALenum param, ALfloat* values ); -typedef ALvoid (ALAPIENTRY *alSourcePlayvPROC)( ALsizei n, ALuint *sources ); -typedef ALvoid (ALAPIENTRY *alSourcePausevPROC)( ALsizei n, ALuint *sources ); -typedef ALvoid (ALAPIENTRY *alSourceStopvPROC)( ALsizei n, ALuint *sources ); -typedef ALvoid (ALAPIENTRY *alSourceRewindvPROC)(ALsizei n,ALuint *sources); -typedef ALvoid (ALAPIENTRY *alSourcePlayPROC)( ALuint source ); -typedef ALvoid (ALAPIENTRY *alSourcePausePROC)( ALuint source ); -typedef ALvoid (ALAPIENTRY *alSourceStopPROC)( ALuint source ); -typedef ALvoid (ALAPIENTRY *alSourceRewindPROC)( ALuint source ); -typedef ALvoid (ALAPIENTRY *alGenBuffersPROC)( ALsizei n, ALuint* buffers ); -typedef ALvoid (ALAPIENTRY *alDeleteBuffersPROC)( ALsizei n, ALuint* buffers ); -typedef ALboolean (ALAPIENTRY *alIsBufferPROC)( ALuint buffer ); -typedef ALvoid (ALAPIENTRY *alBufferDataPROC)( ALuint buffer, - ALenum format, - ALvoid* data, - ALsizei size, - ALsizei freq ); -typedef ALvoid (ALAPIENTRY *alGetBufferiPROC)( ALuint buffer, ALenum param, ALint* value ); -typedef ALvoid (ALAPIENTRY *alGetBufferfPROC)( ALuint buffer, ALenum param, ALfloat* value ); -typedef ALvoid (ALAPIENTRY *alSourceQueueBuffersPROC)( ALuint source, ALsizei n, ALuint* buffers ); -typedef ALvoid (ALAPIENTRY *alSourceUnqueueBuffersPROC)( ALuint source, ALsizei n, ALuint* buffers ); -typedef ALvoid (ALAPIENTRY *alDistanceModelPROC)( ALenum value ); -typedef ALvoid (ALAPIENTRY *alDopplerFactorPROC)( ALfloat value ); -typedef ALvoid (ALAPIENTRY *alDopplerVelocityPROC)( ALfloat value ); - -extern alcGetStringPROC alcGetString; -extern alcGetIntegervPROC alcGetIntegerv; -extern alcOpenDevicePROC alcOpenDevice; -extern alcCloseDevicePROC alcCloseDevice; -extern alcCreateContextPROC alcCreateContext; -extern alcMakeContextCurrentPROC alcMakeContextCurrent; -extern alcProcessContextPROC alcProcessContext; -extern alcGetCurrentContextPROC alcGetCurrentContext; -extern alcGetContextsDevicePROC alcGetContextsDevice; -extern alcSuspendContextPROC alcSuspendContext; -extern alcDestroyContextPROC alcDestroyContext; -extern alcGetErrorPROC alcGetError; -extern alcIsExtensionPresentPROC alcIsExtensionPresent; -extern alcGetProcAddressPROC alcGetProcAddress; -extern alcGetEnumValuePROC alcGetEnumValue; - -extern alEnablePROC alEnable; -extern alDisablePROC alDisable; -extern alIsEnabledPROC alIsEnabled; -extern alHintPROC alHint; -extern alGetBooleanPROC alGetBoolean; -extern alGetIntegerPROC alGetInteger; -extern alGetFloatPROC alGetFloat; -extern alGetDoublePROC alGetDouble; -extern alGetBooleanvPROC alGetBooleanv; -extern alGetIntegervPROC alGetIntegerv; -extern alGetFloatvPROC alGetFloatv; -extern alGetDoublevPROC alGetDoublev; -extern alGetStringPROC alGetString; -extern alGetErrorPROC alGetError; -extern alIsExtensionPresentPROC alIsExtensionPresent; -extern alGetProcAddressPROC alGetProcAddress; -extern alGetEnumValuePROC alGetEnumValue; -extern alListeneriPROC alListeneri; -extern alListenerfPROC alListenerf; -extern alListener3fPROC alListener3f; -extern alListenerfvPROC alListenerfv; -extern alGetListeneriPROC alGetListeneri; -extern alGetListenerfPROC alGetListenerf; -extern alGetListener3fPROC alGetListener3f; -extern alGetListenerfvPROC alGetListenerfv; -extern alGenSourcesPROC alGenSources; -extern alDeleteSourcesPROC alDeleteSources; -extern alIsSourcePROC alIsSource; -extern alSourceiPROC alSourcei; -extern alSourcefPROC alSourcef; -extern alSource3fPROC alSource3f; -extern alSourcefvPROC alSourcefv; -extern alGetSourceiPROC alGetSourcei; -extern alGetSourcefPROC alGetSourcef; -extern alGetSource3fPROC alGetSource3f; -extern alGetSourcefvPROC alGetSourcefv; -extern alSourcePlayvPROC alSourcePlayv; -extern alSourcePausevPROC alSourcePausev; -extern alSourceStopvPROC alSourceStopv; -extern alSourceRewindvPROC alSourceRewindv; -extern alSourcePlayPROC alSourcePlay; -extern alSourcePausePROC alSourcePause; -extern alSourceStopPROC alSourceStop; -extern alSourceRewindPROC alSourceRewind; -extern alGenBuffersPROC alGenBuffers; -extern alDeleteBuffersPROC alDeleteBuffers; -extern alIsBufferPROC alIsBuffer; -extern alBufferDataPROC alBufferData; -extern alGetBufferiPROC alGetBufferi; -extern alGetBufferfPROC alGetBufferf; -extern alSourceQueueBuffersPROC alSourceQueueBuffers; -extern alSourceUnqueueBuffersPROC alSourceUnqueueBuffers; -extern alDistanceModelPROC alDistanceModel; -extern alDopplerFactorPROC alDopplerFactor; -extern alDopplerVelocityPROC alDopplerVelocity; - -#ifdef _WIN32 -typedef ALenum (*EAXSet)(const GUID*, ALuint, ALuint, ALvoid*, ALuint); -typedef ALenum (*EAXGet)(const GUID*, ALuint, ALuint, ALvoid*, ALuint); - -extern EAXSet eaxSet; -extern EAXGet eaxGet; -#endif - -#ifdef __cplusplus -} -#endif - -#endif - |