Always link the win32 binary against OpenAL

Just as with OSX and Linux.
This commit is contained in:
dhewg 2011-12-14 02:08:54 +01:00
parent b6bcd0a9cb
commit 3e25cc751a
5 changed files with 0 additions and 352 deletions

View file

@ -33,7 +33,6 @@ If you have questions concerning this license or the applicable additional terms
#ifdef _WIN32
#include <al.h>
#include <alc.h>
#include "../sys/win32/idal.h"
// broken OpenAL SDK ?
#define ID_ALCHAR (ALubyte *)
#elif defined( MACOS_X )

View file

@ -1,158 +0,0 @@
// generated header. do not edit
// C:\Python23\Lib\idlelib\idle.pyw
// Mon Mar 28 12:31:26 2005
ALenum ( ALAPIENTRY * idalGetError )( ALvoid ) = NULL;
ALvoid ( ALAPIENTRY * idalGenBuffers )( ALsizei, ALuint * ) = NULL;
ALboolean ( ALAPIENTRY * idalIsSource )( ALuint ) = NULL;
ALvoid ( ALAPIENTRY * idalSourceStop )( ALuint ) = NULL;
ALvoid ( ALAPIENTRY * idalGetSourcei )( ALuint, ALenum, ALint * ) = NULL;
ALint ( ALAPIENTRY * idalGetInteger )( ALenum ) = NULL;
ALCvoid ( ALAPIENTRY * idalcSuspendContext )( ALCcontext * ) = NULL;
ALCboolean ( ALAPIENTRY * idalcMakeContextCurrent )( ALCcontext * ) = NULL;
ALCvoid ( ALAPIENTRY * idalcProcessContext )( ALCcontext * ) = NULL;
ALCvoid ( ALAPIENTRY * idalcDestroyContext )( ALCcontext * ) = NULL;
ALCubyte * ( ALAPIENTRY * idalcGetString )( ALCdevice *, ALCenum ) = NULL;
ALvoid ( ALAPIENTRY * idalBufferData )( ALuint, ALenum, ALvoid *, ALsizei, ALsizei ) = NULL;
ALvoid ( ALAPIENTRY * idalDeleteBuffers )( ALsizei, ALuint * ) = NULL;
ALboolean ( ALAPIENTRY * idalIsExtensionPresent )( ALubyte * ) = NULL;
ALvoid ( ALAPIENTRY * idalDeleteSources )( ALsizei, ALuint * ) = NULL;
ALenum ( ALAPIENTRY * idalGetEnumValue )( ALubyte * ) = NULL;
ALvoid * ( ALAPIENTRY * idalGetProcAddress )( ALubyte * ) = NULL;
ALCcontext * ( ALAPIENTRY * idalcCreateContext )( ALCdevice *, ALCint * ) = NULL;
ALCdevice * ( ALAPIENTRY * idalcOpenDevice )( ALubyte * ) = NULL;
ALvoid ( ALAPIENTRY * idalListenerfv )( ALenum, ALfloat* ) = NULL;
ALvoid ( ALAPIENTRY * idalSourceQueueBuffers )( ALuint, ALsizei, ALuint * ) = NULL;
ALvoid ( ALAPIENTRY * idalSourcei )( ALuint, ALenum, ALint ) = NULL;
ALvoid ( ALAPIENTRY * idalListenerf )( ALenum, ALfloat ) = NULL;
ALCvoid ( ALAPIENTRY * idalcCloseDevice )( ALCdevice * ) = NULL;
ALboolean ( ALAPIENTRY * idalIsBuffer )( ALuint ) = NULL;
ALvoid ( ALAPIENTRY * idalSource3f )( ALuint, ALenum, ALfloat, ALfloat, ALfloat ) = NULL;
ALvoid ( ALAPIENTRY * idalGenSources )( ALsizei, ALuint * ) = NULL;
ALvoid ( ALAPIENTRY * idalSourcef )( ALuint, ALenum, ALfloat ) = NULL;
ALvoid ( ALAPIENTRY * idalSourceUnqueueBuffers )( ALuint, ALsizei, ALuint * ) = NULL;
ALvoid ( ALAPIENTRY * idalSourcePlay )( ALuint ) = NULL;
const char* InitializeIDAL( HMODULE h ) {
idalGetError = ( ALenum ( ALAPIENTRY * ) ( ALvoid ) )GetProcAddress( h, "alGetError" );
if ( !idalGetError) {
return "alGetError";
}
idalGenBuffers = ( ALvoid ( ALAPIENTRY * ) ( ALsizei, ALuint * ) )GetProcAddress( h, "alGenBuffers" );
if ( !idalGenBuffers) {
return "alGenBuffers";
}
idalIsSource = ( ALboolean ( ALAPIENTRY * ) ( ALuint ) )GetProcAddress( h, "alIsSource" );
if ( !idalIsSource) {
return "alIsSource";
}
idalSourceStop = ( ALvoid ( ALAPIENTRY * ) ( ALuint ) )GetProcAddress( h, "alSourceStop" );
if ( !idalSourceStop) {
return "alSourceStop";
}
idalGetSourcei = ( ALvoid ( ALAPIENTRY * ) ( ALuint, ALenum, ALint * ) )GetProcAddress( h, "alGetSourcei" );
if ( !idalGetSourcei) {
return "alGetSourcei";
}
idalGetInteger = ( ALint ( ALAPIENTRY * ) ( ALenum ) )GetProcAddress( h, "alGetInteger" );
if ( !idalGetInteger) {
return "alGetInteger";
}
idalcSuspendContext = ( ALCvoid ( ALAPIENTRY * ) ( ALCcontext * ) )GetProcAddress( h, "alcSuspendContext" );
if ( !idalcSuspendContext) {
return "alcSuspendContext";
}
idalcMakeContextCurrent = ( ALCboolean ( ALAPIENTRY * ) ( ALCcontext * ) )GetProcAddress( h, "alcMakeContextCurrent" );
if ( !idalcMakeContextCurrent) {
return "alcMakeContextCurrent";
}
idalcProcessContext = ( ALCvoid ( ALAPIENTRY * ) ( ALCcontext * ) )GetProcAddress( h, "alcProcessContext" );
if ( !idalcProcessContext) {
return "alcProcessContext";
}
idalcDestroyContext = ( ALCvoid ( ALAPIENTRY * ) ( ALCcontext * ) )GetProcAddress( h, "alcDestroyContext" );
if ( !idalcDestroyContext) {
return "alcDestroyContext";
}
idalcGetString = ( ALCubyte * ( ALAPIENTRY * ) ( ALCdevice *, ALCenum ) )GetProcAddress( h, "alcGetString" );
if ( !idalcGetString) {
return "alcGetString";
}
idalBufferData = ( ALvoid ( ALAPIENTRY * ) ( ALuint, ALenum, ALvoid *, ALsizei, ALsizei ) )GetProcAddress( h, "alBufferData" );
if ( !idalBufferData) {
return "alBufferData";
}
idalDeleteBuffers = ( ALvoid ( ALAPIENTRY * ) ( ALsizei, ALuint * ) )GetProcAddress( h, "alDeleteBuffers" );
if ( !idalDeleteBuffers) {
return "alDeleteBuffers";
}
idalIsExtensionPresent = ( ALboolean ( ALAPIENTRY * ) ( ALubyte * ) )GetProcAddress( h, "alIsExtensionPresent" );
if ( !idalIsExtensionPresent) {
return "alIsExtensionPresent";
}
idalDeleteSources = ( ALvoid ( ALAPIENTRY * ) ( ALsizei, ALuint * ) )GetProcAddress( h, "alDeleteSources" );
if ( !idalDeleteSources) {
return "alDeleteSources";
}
idalGetEnumValue = ( ALenum ( ALAPIENTRY * ) ( ALubyte * ) )GetProcAddress( h, "alGetEnumValue" );
if ( !idalGetEnumValue) {
return "alGetEnumValue";
}
idalGetProcAddress = ( ALvoid * ( ALAPIENTRY * ) ( ALubyte * ) )GetProcAddress( h, "alGetProcAddress" );
if ( !idalGetProcAddress) {
return "alGetProcAddress";
}
idalcCreateContext = ( ALCcontext * ( ALAPIENTRY * ) ( ALCdevice *, ALCint * ) )GetProcAddress( h, "alcCreateContext" );
if ( !idalcCreateContext) {
return "alcCreateContext";
}
idalcOpenDevice = ( ALCdevice * ( ALAPIENTRY * ) ( ALubyte * ) )GetProcAddress( h, "alcOpenDevice" );
if ( !idalcOpenDevice) {
return "alcOpenDevice";
}
idalListenerfv = ( ALvoid ( ALAPIENTRY * ) ( ALenum, ALfloat* ) )GetProcAddress( h, "alListenerfv" );
if ( !idalListenerfv) {
return "alListenerfv";
}
idalSourceQueueBuffers = ( ALvoid ( ALAPIENTRY * ) ( ALuint, ALsizei, ALuint * ) )GetProcAddress( h, "alSourceQueueBuffers" );
if ( !idalSourceQueueBuffers) {
return "alSourceQueueBuffers";
}
idalSourcei = ( ALvoid ( ALAPIENTRY * ) ( ALuint, ALenum, ALint ) )GetProcAddress( h, "alSourcei" );
if ( !idalSourcei) {
return "alSourcei";
}
idalListenerf = ( ALvoid ( ALAPIENTRY * ) ( ALenum, ALfloat ) )GetProcAddress( h, "alListenerf" );
if ( !idalListenerf) {
return "alListenerf";
}
idalcCloseDevice = ( ALCvoid ( ALAPIENTRY * ) ( ALCdevice * ) )GetProcAddress( h, "alcCloseDevice" );
if ( !idalcCloseDevice) {
return "alcCloseDevice";
}
idalIsBuffer = ( ALboolean ( ALAPIENTRY * ) ( ALuint ) )GetProcAddress( h, "alIsBuffer" );
if ( !idalIsBuffer) {
return "alIsBuffer";
}
idalSource3f = ( ALvoid ( ALAPIENTRY * ) ( ALuint, ALenum, ALfloat, ALfloat, ALfloat ) )GetProcAddress( h, "alSource3f" );
if ( !idalSource3f) {
return "alSource3f";
}
idalGenSources = ( ALvoid ( ALAPIENTRY * ) ( ALsizei, ALuint * ) )GetProcAddress( h, "alGenSources" );
if ( !idalGenSources) {
return "alGenSources";
}
idalSourcef = ( ALvoid ( ALAPIENTRY * ) ( ALuint, ALenum, ALfloat ) )GetProcAddress( h, "alSourcef" );
if ( !idalSourcef) {
return "alSourcef";
}
idalSourceUnqueueBuffers = ( ALvoid ( ALAPIENTRY * ) ( ALuint, ALsizei, ALuint * ) )GetProcAddress( h, "alSourceUnqueueBuffers" );
if ( !idalSourceUnqueueBuffers) {
return "alSourceUnqueueBuffers";
}
idalSourcePlay = ( ALvoid ( ALAPIENTRY * ) ( ALuint ) )GetProcAddress( h, "alSourcePlay" );
if ( !idalSourcePlay) {
return "alSourcePlay";
}
return NULL;
};

View file

@ -1,65 +0,0 @@
// generated header. do not edit
// C:\Python23\Lib\idlelib\idle.pyw
// Mon Mar 28 12:31:26 2005
extern ALenum ( ALAPIENTRY * idalGetError )( ALvoid );
extern ALvoid ( ALAPIENTRY * idalGenBuffers )( ALsizei, ALuint * );
extern ALboolean ( ALAPIENTRY * idalIsSource )( ALuint );
extern ALvoid ( ALAPIENTRY * idalSourceStop )( ALuint );
extern ALvoid ( ALAPIENTRY * idalGetSourcei )( ALuint, ALenum, ALint * );
extern ALint ( ALAPIENTRY * idalGetInteger )( ALenum );
extern ALCvoid ( ALAPIENTRY * idalcSuspendContext )( ALCcontext * );
extern ALCboolean ( ALAPIENTRY * idalcMakeContextCurrent )( ALCcontext * );
extern ALCvoid ( ALAPIENTRY * idalcProcessContext )( ALCcontext * );
extern ALCvoid ( ALAPIENTRY * idalcDestroyContext )( ALCcontext * );
extern ALCubyte * ( ALAPIENTRY * idalcGetString )( ALCdevice *, ALCenum );
extern ALvoid ( ALAPIENTRY * idalBufferData )( ALuint, ALenum, ALvoid *, ALsizei, ALsizei );
extern ALvoid ( ALAPIENTRY * idalDeleteBuffers )( ALsizei, ALuint * );
extern ALboolean ( ALAPIENTRY * idalIsExtensionPresent )( ALubyte * );
extern ALvoid ( ALAPIENTRY * idalDeleteSources )( ALsizei, ALuint * );
extern ALenum ( ALAPIENTRY * idalGetEnumValue )( ALubyte * );
extern ALvoid * ( ALAPIENTRY * idalGetProcAddress )( ALubyte * );
extern ALCcontext * ( ALAPIENTRY * idalcCreateContext )( ALCdevice *, ALCint * );
extern ALCdevice * ( ALAPIENTRY * idalcOpenDevice )( ALubyte * );
extern ALvoid ( ALAPIENTRY * idalListenerfv )( ALenum, ALfloat* );
extern ALvoid ( ALAPIENTRY * idalSourceQueueBuffers )( ALuint, ALsizei, ALuint * );
extern ALvoid ( ALAPIENTRY * idalSourcei )( ALuint, ALenum, ALint );
extern ALvoid ( ALAPIENTRY * idalListenerf )( ALenum, ALfloat );
extern ALCvoid ( ALAPIENTRY * idalcCloseDevice )( ALCdevice * );
extern ALboolean ( ALAPIENTRY * idalIsBuffer )( ALuint );
extern ALvoid ( ALAPIENTRY * idalSource3f )( ALuint, ALenum, ALfloat, ALfloat, ALfloat );
extern ALvoid ( ALAPIENTRY * idalGenSources )( ALsizei, ALuint * );
extern ALvoid ( ALAPIENTRY * idalSourcef )( ALuint, ALenum, ALfloat );
extern ALvoid ( ALAPIENTRY * idalSourceUnqueueBuffers )( ALuint, ALsizei, ALuint * );
extern ALvoid ( ALAPIENTRY * idalSourcePlay )( ALuint );
#define alGetError idalGetError
#define alGenBuffers idalGenBuffers
#define alIsSource idalIsSource
#define alSourceStop idalSourceStop
#define alGetSourcei idalGetSourcei
#define alGetInteger idalGetInteger
#define alcSuspendContext idalcSuspendContext
#define alcMakeContextCurrent idalcMakeContextCurrent
#define alcProcessContext idalcProcessContext
#define alcDestroyContext idalcDestroyContext
#define alcGetString idalcGetString
#define alBufferData idalBufferData
#define alDeleteBuffers idalDeleteBuffers
#define alIsExtensionPresent idalIsExtensionPresent
#define alDeleteSources idalDeleteSources
#define alGetEnumValue idalGetEnumValue
#define alGetProcAddress idalGetProcAddress
#define alcCreateContext idalcCreateContext
#define alcOpenDevice idalcOpenDevice
#define alListenerfv idalListenerfv
#define alSourceQueueBuffers idalSourceQueueBuffers
#define alSourcei idalSourcei
#define alListenerf idalListenerf
#define alcCloseDevice idalcCloseDevice
#define alIsBuffer idalIsBuffer
#define alSource3f idalSource3f
#define alGenSources idalGenSources
#define alSourcef idalSourcef
#define alSourceUnqueueBuffers idalSourceUnqueueBuffers
#define alSourcePlay idalSourcePlay

View file

@ -1,103 +0,0 @@
#!/usr/bin/env python
# create win32 source for OpenAL on-demand loading from AL API definitions
# a set of defines al* -> idal*
# typedefs and code pointer functions definition
# 1: get linking with no OpenAL DLL link in anymore
# i.e. have the defines and the code pointer working
# 2: do the load code
import time
funcs = [
[ 'ALenum', 'alGetError', 'ALvoid' ],
[ 'ALvoid', 'alGenBuffers', 'ALsizei', 'ALuint *' ],
[ 'ALboolean', 'alIsSource', 'ALuint' ],
[ 'ALvoid', 'alSourceStop', 'ALuint' ],
[ 'ALvoid', 'alGetSourcei', 'ALuint', 'ALenum', 'ALint *' ],
[ 'ALint', 'alGetInteger', 'ALenum' ],
[ 'ALCvoid', 'alcSuspendContext', 'ALCcontext *' ],
[ 'ALCboolean', 'alcMakeContextCurrent', 'ALCcontext *' ],
[ 'ALCvoid', 'alcProcessContext', 'ALCcontext *' ],
[ 'ALCvoid', 'alcDestroyContext', 'ALCcontext *' ],
[ 'ALCubyte *', 'alcGetString', 'ALCdevice *', 'ALCenum' ],
[ 'ALvoid', 'alBufferData', 'ALuint', 'ALenum', 'ALvoid *', 'ALsizei', 'ALsizei' ],
[ 'ALvoid', 'alDeleteBuffers', 'ALsizei', 'ALuint *' ],
[ 'ALboolean', 'alIsExtensionPresent', 'ALubyte *' ],
[ 'ALvoid', 'alDeleteSources', 'ALsizei', 'ALuint *' ],
[ 'ALenum', 'alGetEnumValue', 'ALubyte *' ],
[ 'ALvoid *', 'alGetProcAddress', 'ALubyte *' ],
[ 'ALCcontext *', 'alcCreateContext', 'ALCdevice *', 'ALCint *' ],
[ 'ALCdevice *', 'alcOpenDevice', 'ALubyte *' ],
[ 'ALvoid', 'alListenerfv', 'ALenum', 'ALfloat*' ],
[ 'ALvoid', 'alSourceQueueBuffers', 'ALuint', 'ALsizei', 'ALuint *' ],
[ 'ALvoid', 'alSourcei', 'ALuint', 'ALenum', 'ALint' ],
[ 'ALvoid', 'alListenerf', 'ALenum', 'ALfloat' ],
[ 'ALCvoid', 'alcCloseDevice', 'ALCdevice *' ],
[ 'ALboolean', 'alIsBuffer', 'ALuint' ],
[ 'ALvoid', 'alSource3f', 'ALuint', 'ALenum', 'ALfloat', 'ALfloat', 'ALfloat' ],
[ 'ALvoid', 'alGenSources', 'ALsizei', 'ALuint *' ],
[ 'ALvoid', 'alSourcef', 'ALuint', 'ALenum', 'ALfloat' ],
[ 'ALvoid', 'alSourceUnqueueBuffers', 'ALuint', 'ALsizei', 'ALuint *' ],
[ 'ALvoid', 'alSourcePlay', 'ALuint' ],
]
def warningHeader( f ):
f.write( '// generated header. do not edit\n' )
f.write( '// ' + __file__ + '\n' )
f.write( '// ' + time.asctime() + '\n\n' )
def genIDALFunc( f, declare ):
if ( declare ):
extern = 'extern '
else:
extern = ''
for func in funcs:
f.write( extern + func[0] + ' ( ALAPIENTRY * id' + func[1] + ' )( ' )
i = 2
while ( i < len( func ) ):
if ( i != 2 ):
f.write( ', ' )
f.write( func[i] )
i += 1
if ( declare ):
f.write( ' );\n' )
else:
f.write( ' ) = NULL;\n' )
def genDefineMapping( f ):
for func in funcs:
fname = func[1]
f.write( '#define %s id%s\n' % ( fname, fname ) )
def genIDALInit( f ):
for func in funcs:
# annoying casting
cast = func[0] + ' ( ALAPIENTRY * ) ( '
i = 2
while ( i < len( func ) ):
if ( i != 2 ):
cast += ', '
cast += func[i]
i += 1
cast += ' )'
# function
f.write( 'id' + func[1] + ' = ( ' + cast + ' )GetProcAddress( h, "' + func[1] + '" );\n' )
f.write( 'if ( !id' + func[1] + ') {\n return "' + func[1] + '";\n}\n' )
if __name__ == '__main__':
f = open( 'idal.h', 'w' )
warningHeader( f )
genIDALFunc( f, True )
f.write( '\n' )
genDefineMapping( f )
f.close()
f = open( 'idal.cpp', 'w' )
warningHeader( f )
genIDALFunc( f, False )
f.write( '\n' );
f.write( 'const char* InitializeIDAL( HMODULE h ) {\n' )
genIDALInit( f )
f.write( 'return NULL;\n' );
f.write( '};\n' )
f.close()

View file

@ -36,8 +36,6 @@ If you have questions concerning this license or the applicable additional terms
#include "../../sound/snd_local.h"
#include "win_local.h"
#include "idal.cpp"
#define SAFE_DELETE(p) { if(p) { delete (p); (p)=NULL; } }
#define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p)=NULL; } }
#define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } }
@ -502,8 +500,6 @@ bool idAudioHardwareWIN32::GetCurrentPosition( ulong *pdwCurrentWriteCursor ) {
return false;
}
static HMODULE hOpenAL = NULL;
/*
===============
Sys_LoadOpenAL
@ -511,23 +507,6 @@ Sys_LoadOpenAL
*/
bool Sys_LoadOpenAL( void ) {
#if ID_OPENAL
const char *sym;
if ( hOpenAL ) {
return true;
}
hOpenAL = LoadLibrary( idSoundSystemLocal::s_libOpenAL.GetString() );
if ( !hOpenAL ) {
common->Warning( "LoadLibrary %s failed.", idSoundSystemLocal::s_libOpenAL.GetString() );
return false;
}
if ( ( sym = InitializeIDAL( hOpenAL ) ) ) {
common->Warning( "GetProcAddress %s failed.", sym );
FreeLibrary( hOpenAL );
hOpenAL = NULL;
return false;
}
return true;
#else
return false;
@ -540,10 +519,6 @@ Sys_FreeOpenAL
===============
*/
void Sys_FreeOpenAL( void ) {
if ( hOpenAL ) {
FreeLibrary( hOpenAL );
hOpenAL = NULL;
}
}
/*