Fixed win32 building

This commit is contained in:
Elias Naur 2004-03-10 08:42:40 +00:00
parent f5bf5b590b
commit 062057d3d9
7 changed files with 36 additions and 19 deletions

View File

@ -56,7 +56,7 @@ public abstract class BasicTest {
try {
AL.create();
} catch (Exception e) {
System.out.println("Unable to create OpenAL.\nPlease make sure that OpenAL is available on this system.");
System.out.println("Unable to create OpenAL.\nPlease make sure that OpenAL is available on this system. Exception: " + e);
return;
}
}

View File

@ -68,6 +68,8 @@ void* handleOAL;
const struct mach_header* handleOAL;
#endif
alGetProcAddressPROC alGetProcAddress;
/* Loads OpenAL */
static bool LoadOpenAL(JNIEnv *env, jobjectArray oalPaths);
@ -230,21 +232,29 @@ void InitializeOpenAL(JNIEnv *env, jobjectArray oalPaths) {
if (!LoadOpenAL(env, oalPaths)) {
return;
}
alGetProcAddress = (alGetProcAddressPROC)extal_GetProcAddress("alGetProcAddress");
if (alGetProcAddress == NULL) {
DeInitializeOpenAL();
throwOpenALException(env, "Could not load alGetProcAddress function pointer.");
return;
}
//load basic OpenAL functions
if(!LoadAL(env)) {
DeInitializeOpenAL();
throwOpenALException(env, "Could not load OpenAL function pointers.");
return;
}
//load OpenAL context functions
if(!LoadALC(env)) {
DeInitializeOpenAL();
throwOpenALException(env, "Could not load ALC function pointers.");
return;
}
//load OpenAL extensions
if(!LoadALExtensions()) {
DeInitializeOpenAL();
throwOpenALException(env, "Could not load AL extension function pointers.");
return;
}

View File

@ -154,7 +154,20 @@ extern EAXGet eaxGet;
#endif
typedef ALvoid (ALAPIENTRY *alEnablePROC)( ALenum capability );
typedef ALboolean (ALAPIENTRY *alIsExtensionPresentPROC)( ALubyte* fname );
typedef ALvoid* (ALAPIENTRY *alGetProcAddressPROC)( ALubyte* fname );
typedef ALubyte* (ALAPIENTRY *alGetStringPROC)( ALenum param );
typedef ALenum (ALAPIENTRY *alGetErrorPROC)( ALvoid );
extern alEnablePROC alEnable;
extern alIsExtensionPresentPROC alIsExtensionPresent;
extern alGetProcAddressPROC alGetProcAddress;
extern alGetStringPROC alGetString;
extern alGetErrorPROC alGetError;
typedef ALCcontext* (ALCAPIENTRY *alcGetCurrentContextPROC)(ALCvoid);
extern alcGetCurrentContextPROC alcGetCurrentContext;
#ifdef __cplusplus
}
#endif

View File

@ -140,11 +140,11 @@ wglGetExtensionsStringEXTPROC wglGetExtensionsStringEXT = NULL;
/* WGL_ARB_buffer_region */
wglCreateBufferRegionARBPROC wglCreateBufferRegionARB = NULL;
/*wglCreateBufferRegionARBPROC wglCreateBufferRegionARB = NULL;
wglDeleteBufferRegionARBPROC wglDeleteBufferRegionARB = NULL;
wglSaveBufferRegionARBPROC wglSaveBufferRegionARB = NULL;
wglRestoreBufferRegionARBPROC wglRestoreBufferRegionARB = NULL;
*/
/* WGL_ARB_extension_string */
@ -393,7 +393,7 @@ static bool WGLQueryExtension(JNIEnv *env, const char *name)
return QueryExtension(env, NULL, extensions, name);
}
static void extgl_InitWGLARBBufferRegion(JNIEnv *env)
/*static void extgl_InitWGLARBBufferRegion(JNIEnv *env)
{
if (!extgl_Extensions.WGL_ARB_buffer_region)
return;
@ -404,7 +404,7 @@ static void extgl_InitWGLARBBufferRegion(JNIEnv *env)
EXTGL_SANITY_CHECK(env, WGL_ARB_buffer_region);
}
*/
static void extgl_InitWGLARBPbuffer(JNIEnv *env)
{
if (!extgl_Extensions.WGL_ARB_pbuffer)
@ -488,7 +488,7 @@ void extgl_InitWGL(JNIEnv *env)
extgl_InitWGLARBRenderTexture(env);
extgl_InitWGLARBPixelFormat(env);
extgl_InitWGLARBPbuffer(env);
extgl_InitWGLARBBufferRegion(env);
//extgl_InitWGLARBBufferRegion(env);
}
#endif /* WIN32 */

View File

@ -2135,12 +2135,12 @@ extern wglGetExtensionsStringEXTPROC wglGetExtensionsStringEXT;
/*------------WGL_ARB_BUFFER_REGION----------------------------------*/
/*-------------------------------------------------------------------*/
#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
/*#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
/*typedef HANDLE (APIENTRY * wglCreateBufferRegionARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
typedef HANDLE (APIENTRY * wglCreateBufferRegionARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
typedef VOID (APIENTRY * wglDeleteBufferRegionARBPROC) (HANDLE hRegion);
typedef BOOL (APIENTRY * wglSaveBufferRegionARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
typedef BOOL (APIENTRY * wglRestoreBufferRegionARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);

View File

@ -54,10 +54,6 @@ typedef ALfloat (ALAPIENTRY *alGetFloatPROC)( 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 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 );
@ -102,6 +98,9 @@ typedef ALvoid (ALAPIENTRY *alDistanceModelPROC)( ALenum value );
typedef ALvoid (ALAPIENTRY *alDopplerFactorPROC)( ALfloat value );
typedef ALvoid (ALAPIENTRY *alDopplerVelocityPROC)( ALfloat value );
alIsExtensionPresentPROC alIsExtensionPresent;
alGetStringPROC alGetString;
alGetErrorPROC alGetError;
alEnablePROC alEnable;
static alDisablePROC alDisable;
@ -113,10 +112,6 @@ static alGetFloatPROC alGetFloat;
//static alGetBooleanvPROC alGetBooleanv;
static alGetIntegervPROC alGetIntegerv;
static alGetFloatvPROC alGetFloatv;
static alGetStringPROC alGetString;
static alGetErrorPROC alGetError;
static alIsExtensionPresentPROC alIsExtensionPresent;
//static alGetProcAddressPROC alGetProcAddress;
static alGetEnumValuePROC alGetEnumValue;
static alListeneriPROC alListeneri;
static alListenerfPROC alListenerf;

View File

@ -51,7 +51,6 @@ 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);
@ -60,6 +59,7 @@ typedef ALCboolean (ALCAPIENTRY *alcIsExtensionPresentPROC)(ALCdevice *device,A
//typedef ALCvoid* (ALCAPIENTRY *alcGetProcAddressPROC)(ALCdevice *device,ALCubyte *funcName);
typedef ALCenum (ALCAPIENTRY *alcGetEnumValuePROC)(ALCdevice *device,ALCubyte *enumName);
alcGetCurrentContextPROC alcGetCurrentContext;
static alcGetStringPROC alcGetString;
static alcGetIntegervPROC alcGetIntegerv;
static alcOpenDevicePROC alcOpenDevice;
@ -67,7 +67,6 @@ static alcCloseDevicePROC alcCloseDevice;
static alcCreateContextPROC alcCreateContext;
static alcMakeContextCurrentPROC alcMakeContextCurrent;
static alcProcessContextPROC alcProcessContext;
static alcGetCurrentContextPROC alcGetCurrentContext;
static alcGetContextsDevicePROC alcGetContextsDevice;
static alcSuspendContextPROC alcSuspendContext;
static alcDestroyContextPROC alcDestroyContext;