From: Brian M. <ma...@us...> - 2002-09-12 01:42:53
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory usw-pr-cvs1:/tmp/cvs-serv23777 Modified Files: org_lwjgl_opengl_eax_CoreEAX.cpp Log Message: fix: don't do the whole initializing thingy - just assume that OpenAL is initialized fix:: wrong comment fix: changed ifndef to ifdef DOH! Index: org_lwjgl_opengl_eax_CoreEAX.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_eax_CoreEAX.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_eax_CoreEAX.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_opengl_eax_CoreEAX.cpp 2 Sep 2002 13:22:09 -0000 1.1 +++ org_lwjgl_opengl_eax_CoreEAX.cpp 12 Sep 2002 01:42:49 -0000 1.2 @@ -57,30 +57,10 @@ JNIEXPORT void JNICALL Java_org_lwjgl_openal_eax_CoreEAX_determineAvailableExtensions (JNIEnv *env, jobject obj) { #ifdef _WIN32 bool EAXSupported = false; - ALCcontext *Context; - ALCdevice *Device; - - //open device - Device = alcOpenDevice(NULL); - if(Device == NULL) { - ThrowException(env, "Unable to determine EAX Extensions"); - return; - } - //create a context - Context = alcCreateContext(Device, NULL); - if(Context == NULL) { - alcCloseDevice(Device); - ThrowException(env, "Unable to determine EAX Extensions"); - return; - } - - //make current - alcMakeContextCurrent(Context); - if(alGetError() != AL_NO_ERROR) { - alcCloseDevice(Device); - ThrowException(env, "Unable to determine EAX Extensions"); - return; + //check that we have a current context + if(alcGetCurrentContext() == NULL) { + ThrowException(env, "Unable to determine EAX Extensions: No current context"); } //check for extension, and assign if available @@ -90,11 +70,6 @@ EAXSupported = (eaxSet != NULL && eaxGet != NULL); } - //clean up - alcMakeContextCurrent(NULL); - alcDestroyContext(Context); - alcCloseDevice(Device); - //throw exception if no EAX support if(EAXSupported != true) { ThrowException(env, "Unable to determine EAX Extensions"); @@ -130,7 +105,7 @@ #ifdef _WIN32 jint result = (jint) eaxGet((const struct _GUID*)propertySetID, (ALuint) property, (ALuint) source, (ALvoid*) value, (ALuint) size); CHECK_AL_ERROR - + return result; #else return AL_INVALID_OPERATION; @@ -141,11 +116,11 @@ * This function sets an EAX value. * * C Specification: - * ALenum EAXGet(const struct _GUID *propertySetID,ALuint property,ALuint source,ALvoid + * ALenum EAXSet(const struct _GUID *propertySetID,ALuint property,ALuint source,ALvoid * *value,ALuint size); */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_CoreEAX_eaxSet (JNIEnv *env, jobject obj, jint propertySetID, jint property, jint source, jint value, jint size) { -#ifndef _WIN32 +#ifdef _WIN32 jint result = (jint) eaxSet((const struct _GUID*)propertySetID, (ALuint) property, (ALuint) source, (ALvoid*) value, (ALuint) size); CHECK_AL_ERROR |