More oal linux fixes

This commit is contained in:
Elias Naur 2002-12-14 13:44:55 +00:00
parent 3a8e2b59f1
commit 102757c802
2 changed files with 7 additions and 3 deletions

View File

@ -33,6 +33,10 @@
#include <stdio.h> #include <stdio.h>
#include "extal.h" #include "extal.h"
#ifndef _WIN32
#include <dlfcn.h>
#endif
/** /**
* $Id$ * $Id$
* *
@ -150,7 +154,7 @@ void* GetFunctionPointer(const char* function) {
#ifdef _WIN32 #ifdef _WIN32
return GetProcAddress(handleOAL, function); return GetProcAddress(handleOAL, function);
#else #else
return NULL; return dlsym(handleOAL, function);
#endif #endif
} }
@ -161,7 +165,7 @@ void LoadOpenAL() {
#ifdef _WIN32 #ifdef _WIN32
handleOAL = LoadLibrary("OpenAL32.dll"); handleOAL = LoadLibrary("OpenAL32.dll");
#else #else
handleOAL = NULL; handleOAL = dlopen("libopenal.so", RTLD_LAZY);
#endif #endif
} }

View File

@ -107,7 +107,7 @@ int InitializeOpenAL();
void DeInitializeOpenAL(); void DeInitializeOpenAL();
//alc //alc
typedef ALCubyte* (/*ALCAPIENTRY*/ *alcGetStringPROC)(ALCdevice *device,ALCenum param); typedef ALCubyte* (ALCAPIENTRY *alcGetStringPROC)(ALCdevice *device,ALCenum param);
typedef ALCvoid (ALCAPIENTRY *alcGetIntegervPROC)(ALCdevice *device,ALCenum param,ALCsizei size,ALCint *data); typedef ALCvoid (ALCAPIENTRY *alcGetIntegervPROC)(ALCdevice *device,ALCenum param,ALCsizei size,ALCint *data);
typedef ALCdevice* (ALCAPIENTRY *alcOpenDevicePROC)(ALCubyte *deviceName); typedef ALCdevice* (ALCAPIENTRY *alcOpenDevicePROC)(ALCubyte *deviceName);
typedef ALCvoid (ALCAPIENTRY *alcCloseDevicePROC)(ALCdevice *device); typedef ALCvoid (ALCAPIENTRY *alcCloseDevicePROC)(ALCdevice *device);