├── .gitignore ├── README.md ├── dub.sdl └── source └── derelict └── openal ├── al.d ├── dynload.d ├── package.d ├── statfun.d └── types.d /.gitignore: -------------------------------------------------------------------------------- 1 | lib 2 | bin 3 | .dub 4 | update.txt -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | DerelictAL 2 | ========== 3 | 4 | A dynamic binding to [OpenAL][1] for the D Programming Language. 5 | 6 | Please see the sections on [Compiling and Linking][2] and [The Derelict Loader][3], in the Derelict documentation, for information on how to build DerelictAL and load OpenAL at run time. In the meantime, here's some sample code. 7 | 8 | ```D 9 | import derelict.openal.al; 10 | 11 | void main() { 12 | // Load the OpenAL library. 13 | DerelictAL.load(); 14 | 15 | // Now OpenAL functions can be called. 16 | ... 17 | } 18 | ``` 19 | 20 | [1]: http://www.openal.org/ 21 | [2]: http://derelictorg.github.io/building/overview/ 22 | [3]: http://derelictorg.github.io/loading/loader/ -------------------------------------------------------------------------------- /dub.sdl: -------------------------------------------------------------------------------- 1 | name "derelict-al" 2 | description "A dynamic binding to the OpenAL library." 3 | homepage "https://github.com/DerelictOrg/DerelictAL" 4 | license "Boost" 5 | authors "Mike Parker" 6 | targetType "library" 7 | targetPath "lib" 8 | targetName "DerelictAL" 9 | 10 | configuration "derelict-al-dynamic" { 11 | excludedSourceFiles "source/derelict/al/statfun.d" 12 | dependency "derelict-util" version="~>3.0.0-beta.1" 13 | } 14 | 15 | configuration "derelict-al-static" { 16 | excludedSourceFiles "source/derelict/al/dynload.d" 17 | versions "DerelictAL_Static" 18 | } -------------------------------------------------------------------------------- /source/derelict/openal/al.d: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Boost Software License - Version 1.0 - August 17th, 2003 4 | 5 | Permission is hereby granted, free of charge, to any person or organization 6 | obtaining a copy of the software and accompanying documentation covered by 7 | this license ( the "Software" ) to use, reproduce, display, distribute, 8 | execute, and transmit the Software, and to prepare derivative works of the 9 | Software, and to permit third-parties to whom the Software is furnished to 10 | do so, all subject to the following: 11 | 12 | The copyright notices in the Software and this entire statement, including 13 | the above license grant, this restriction and the following disclaimer, 14 | must be included in all copies of the Software, in whole or in part, and 15 | all derivative works of the Software, unless such copies or derivative 16 | works are solely in the form of machine-executable object code generated by 17 | a source language processor. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 22 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 23 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 24 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | 27 | */ 28 | module derelict.openal.al; 29 | 30 | version(Derelict_Static) version = DerelictAL_Static; 31 | 32 | public: 33 | version(DerelictAL_Static) 34 | import derelict.openal.statfun; 35 | else 36 | import derelict.openal.dynload; 37 | 38 | 39 | -------------------------------------------------------------------------------- /source/derelict/openal/dynload.d: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Boost Software License - Version 1.0 - August 17th, 2003 4 | 5 | Permission is hereby granted, free of charge, to any person or organization 6 | obtaining a copy of the software and accompanying documentation covered by 7 | this license (the "Software") to use, reproduce, display, distribute, 8 | execute, and transmit the Software, and to prepare derivative works of the 9 | Software, and to permit third-parties to whom the Software is furnished to 10 | do so, all subject to the following: 11 | 12 | The copyright notices in the Software and this entire statement, including 13 | the above license grant, this restriction and the following disclaimer, 14 | must be included in all copies of the Software, in whole or in part, and 15 | all derivative works of the Software, unless such copies or derivative 16 | works are solely in the form of machine-executable object code generated by 17 | a source language processor. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 22 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 23 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 24 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | 27 | */ 28 | module derelict.openal.dynload; 29 | 30 | version(Derelict_Static) {} 31 | else version(DerelictAL_Static) {} 32 | else { version = DerelictAL_Dynamic; } 33 | 34 | version(DerelictAL_Dynamic): 35 | 36 | public import derelict.openal.types; 37 | import derelict.util.loader, 38 | derelict.util.system; 39 | 40 | extern(C) @nogc nothrow { 41 | alias da_alEnable = void function(ALenum); 42 | alias da_alDisable = void function(ALenum); 43 | alias da_alIsEnabled = ALboolean function(ALenum); 44 | 45 | alias da_alGetString = const(ALchar)* function(ALenum); 46 | alias da_alGetBooleanv = void function(ALenum, ALboolean*); 47 | alias da_alGetIntegerv = void function(ALenum, ALint*); 48 | alias da_alGetFloatv = void function(ALenum, ALfloat*); 49 | alias da_alGetDoublev = void function(ALenum, ALdouble*); 50 | alias da_alGetBoolean = ALboolean function(ALenum); 51 | alias da_alGetInteger = ALint function(ALenum); 52 | alias da_alGetFloat = ALfloat function(ALenum); 53 | alias da_alGetDouble = ALdouble function(ALenum); 54 | alias da_alGetError = ALenum function(); 55 | 56 | alias da_alIsExtensionPresent = ALboolean function(const(char)*); 57 | alias da_alGetProcAddress = ALvoid* function(const(char)*); 58 | alias da_alGetEnumValue = ALenum function(const(char)*); 59 | 60 | alias da_alListenerf = void function(ALenum, ALfloat); 61 | alias da_alListener3f = void function(ALenum, ALfloat, ALfloat, ALfloat); 62 | alias da_alListenerfv = void function(ALenum, const(ALfloat)*); 63 | alias da_alListeneri = void function(ALenum, ALint); 64 | alias da_alListener3i = void function(ALenum, ALint, ALint, ALint); 65 | alias da_alListeneriv = void function(ALenum, const(ALint)*); 66 | 67 | alias da_alGetListenerf = void function(ALenum, ALfloat*); 68 | alias da_alGetListener3f = void function(ALenum, ALfloat*, ALfloat*, ALfloat*); 69 | alias da_alGetListenerfv = void function(ALenum, ALfloat*); 70 | alias da_alGetListeneri = void function(ALenum, ALint*); 71 | alias da_alGetListener3i = void function(ALenum, ALint*, ALint*, ALint*); 72 | alias da_alGetListeneriv = void function(ALenum, ALint*); 73 | 74 | alias da_alGenSources = void function(ALsizei, ALuint*); 75 | alias da_alDeleteSources = void function(ALsizei, const(ALuint)*); 76 | alias da_alIsSource = ALboolean function(ALuint); 77 | 78 | alias da_alSourcef = void function(ALuint, ALenum, ALfloat); 79 | alias da_alSource3f = void function(ALuint, ALenum, ALfloat, ALfloat, ALfloat); 80 | alias da_alSourcefv = void function(ALuint, ALenum, const(ALfloat)*); 81 | alias da_alSourcei = void function(ALuint, ALenum, ALint); 82 | alias da_alSource3i = void function(ALuint, ALenum, ALint, ALint, ALint); 83 | alias da_alSourceiv = void function(ALuint, ALenum, const(ALint)*); 84 | 85 | alias da_alGetSourcef = void function(ALuint, ALenum, ALfloat*); 86 | alias da_alGetSource3f = void function(ALuint, ALenum, ALfloat*, ALfloat*, ALfloat*); 87 | alias da_alGetSourcefv = void function(ALuint, ALenum, ALfloat*); 88 | alias da_alGetSourcei = void function(ALuint, ALenum, ALint*); 89 | alias da_alGetSource3i = void function(ALuint, ALenum, ALint*, ALint*, ALint*); 90 | alias da_alGetSourceiv = void function(ALuint, ALenum, ALint*); 91 | 92 | alias da_alSourcePlayv = void function(ALsizei, const(ALuint)*); 93 | alias da_alSourceStopv = void function(ALsizei, const(ALuint)*); 94 | alias da_alSourceRewindv = void function(ALsizei, const(ALuint)*); 95 | alias da_alSourcePausev = void function(ALsizei, const(ALuint)*); 96 | alias da_alSourcePlay = void function(ALuint); 97 | alias da_alSourcePause = void function(ALuint); 98 | alias da_alSourceRewind = void function(ALuint); 99 | alias da_alSourceStop = void function(ALuint); 100 | 101 | alias da_alSourceQueueBuffers = void function(ALuint, ALsizei, ALuint*); 102 | alias da_alSourceUnqueueBuffers = void function(ALuint, ALsizei, ALuint*); 103 | 104 | alias da_alGenBuffers = void function(ALsizei, ALuint*); 105 | alias da_alDeleteBuffers = void function(ALsizei, const(ALuint)*); 106 | alias da_alIsBuffer = ALboolean function(ALuint); 107 | alias da_alBufferData = void function(ALuint, ALenum, const(ALvoid)*, ALsizei, ALsizei); 108 | 109 | alias da_alBufferf = void function(ALuint, ALenum, ALfloat); 110 | alias da_alBuffer3f = void function(ALuint, ALenum, ALfloat, ALfloat, ALfloat); 111 | alias da_alBufferfv = void function(ALuint, ALenum, const(ALfloat)*); 112 | alias da_alBufferi = void function(ALuint, ALenum, ALint); 113 | alias da_alBuffer3i = void function(ALuint, ALenum, ALint, ALint, ALint); 114 | alias da_alBufferiv = void function(ALuint, ALenum, const(ALint)*); 115 | 116 | alias da_alGetBufferf = void function(ALuint, ALenum, ALfloat*); 117 | alias da_alGetBuffer3f = void function(ALuint, ALenum, ALfloat*, ALfloat*, ALfloat*); 118 | alias da_alGetBufferfv = void function(ALuint, ALenum, ALfloat*); 119 | alias da_alGetBufferi = void function(ALuint, ALenum, ALint*); 120 | alias da_alGetBuffer3i = void function(ALuint, ALenum, ALint*, ALint*, ALint*); 121 | alias da_alGetBufferiv = void function(ALuint, ALenum, ALint*); 122 | 123 | alias da_alDopplerFactor = void function(ALfloat); 124 | alias da_alDopplerVelocity = void function(ALfloat); 125 | alias da_alSpeedOfSound = void function(ALfloat); 126 | alias da_alDistanceModel = void function(ALenum); 127 | 128 | alias da_alcCreateContext = ALCcontext* function(ALCdevice*, const(ALCint)*); 129 | alias da_alcMakeContextCurrent = ALCboolean function(ALCcontext*); 130 | alias da_alcProcessContext = void function(ALCcontext*); 131 | alias da_alcSuspendContext = void function(ALCcontext*); 132 | alias da_alcDestroyContext = void function(ALCcontext*); 133 | alias da_alcGetCurrentContext = ALCcontext* function(); 134 | alias da_alcGetContextsDevice = ALCdevice* function(ALCcontext*); 135 | alias da_alcOpenDevice = ALCdevice* function(const(char)*); 136 | alias da_alcCloseDevice = ALCboolean function(ALCdevice*); 137 | alias da_alcGetError = ALCenum function(ALCdevice*); 138 | alias da_alcIsExtensionPresent = ALCboolean function(ALCdevice*, const(char)*); 139 | alias da_alcGetProcAddress = void* function(ALCdevice*, const(char)*); 140 | alias da_alcGetEnumValue = ALCenum function(ALCdevice*, const(char)*); 141 | alias da_alcGetString = const(char)* function(ALCdevice*, ALCenum); 142 | alias da_alcGetIntegerv = void function(ALCdevice*, ALCenum, ALCsizei, ALCint*); 143 | alias da_alcCaptureOpenDevice = ALCdevice* function(const(char)*, ALCuint, ALCenum, ALCsizei); 144 | alias da_alcCaptureCloseDevice = ALCboolean function(ALCdevice*); 145 | alias da_alcCaptureStart = void function(ALCdevice*); 146 | alias da_alcCaptureStop = void function(ALCdevice*); 147 | alias da_alcCaptureSamples = void function(ALCdevice*, ALCvoid*, ALCsizei); 148 | } 149 | 150 | __gshared { 151 | da_alEnable alEnable; 152 | da_alDisable alDisable; 153 | da_alIsEnabled alIsEnabled; 154 | 155 | da_alGetString alGetString; 156 | da_alGetBooleanv alGetBooleanv; 157 | da_alGetIntegerv alGetIntegerv; 158 | da_alGetFloatv alGetFloatv; 159 | da_alGetDoublev alGetDoublev; 160 | da_alGetBoolean alGetBoolean; 161 | da_alGetInteger alGetInteger; 162 | da_alGetFloat alGetFloat; 163 | da_alGetDouble alGetDouble; 164 | da_alGetError alGetError; 165 | 166 | da_alIsExtensionPresent alIsExtensionPresent; 167 | da_alGetProcAddress alGetProcAddress; 168 | da_alGetEnumValue alGetEnumValue; 169 | 170 | da_alListenerf alListenerf; 171 | da_alListener3f alListener3f; 172 | da_alListenerfv alListenerfv; 173 | da_alListeneri alListeneri; 174 | da_alListener3i alListener3i; 175 | da_alListeneriv alListeneriv; 176 | 177 | da_alGetListenerf alGetListenerf; 178 | da_alGetListener3f alGetListener3f; 179 | da_alGetListenerfv alGetListenerfv; 180 | da_alGetListeneri alGetListeneri; 181 | da_alGetListener3i alGetListener3i; 182 | da_alGetListeneriv alGetListeneriv; 183 | 184 | da_alGenSources alGenSources; 185 | da_alDeleteSources alDeleteSources; 186 | da_alIsSource alIsSource; 187 | 188 | da_alSourcef alSourcef; 189 | da_alSource3f alSource3f; 190 | da_alSourcefv alSourcefv; 191 | da_alSourcei alSourcei; 192 | da_alSource3i alSource3i; 193 | da_alSourceiv alSourceiv; 194 | 195 | 196 | da_alGetSourcef alGetSourcef; 197 | da_alGetSource3f alGetSource3f; 198 | da_alGetSourcefv alGetSourcefv; 199 | da_alGetSourcei alGetSourcei; 200 | da_alGetSource3i alGetSource3i; 201 | da_alGetSourceiv alGetSourceiv; 202 | 203 | da_alSourcePlayv alSourcePlayv; 204 | da_alSourceStopv alSourceStopv; 205 | da_alSourceRewindv alSourceRewindv; 206 | da_alSourcePausev alSourcePausev; 207 | da_alSourcePlay alSourcePlay; 208 | da_alSourcePause alSourcePause; 209 | da_alSourceRewind alSourceRewind; 210 | da_alSourceStop alSourceStop; 211 | 212 | da_alSourceQueueBuffers alSourceQueueBuffers; 213 | da_alSourceUnqueueBuffers alSourceUnqueueBuffers; 214 | 215 | da_alGenBuffers alGenBuffers; 216 | da_alDeleteBuffers alDeleteBuffers; 217 | da_alIsBuffer alIsBuffer; 218 | da_alBufferData alBufferData; 219 | 220 | da_alBufferf alBufferf; 221 | da_alBuffer3f alBuffer3f; 222 | da_alBufferfv alBufferfv; 223 | da_alBufferi alBufferi; 224 | da_alBuffer3i alBuffer3i; 225 | da_alBufferiv alBufferiv; 226 | da_alGetBufferf alGetBufferf; 227 | da_alGetBuffer3f alGetBuffer3f; 228 | da_alGetBufferfv alGetBufferfv; 229 | da_alGetBufferi alGetBufferi; 230 | da_alGetBuffer3i alGetBuffer3i; 231 | da_alGetBufferiv alGetBufferiv; 232 | 233 | da_alDopplerFactor alDopplerFactor; 234 | da_alDopplerVelocity alDopplerVelocity; 235 | da_alSpeedOfSound alSpeedOfSound; 236 | da_alDistanceModel alDistanceModel; 237 | 238 | da_alcCreateContext alcCreateContext; 239 | da_alcMakeContextCurrent alcMakeContextCurrent; 240 | da_alcProcessContext alcProcessContext; 241 | da_alcSuspendContext alcSuspendContext; 242 | da_alcDestroyContext alcDestroyContext; 243 | da_alcGetCurrentContext alcGetCurrentContext; 244 | da_alcGetContextsDevice alcGetContextsDevice; 245 | da_alcOpenDevice alcOpenDevice; 246 | da_alcCloseDevice alcCloseDevice; 247 | da_alcGetError alcGetError; 248 | da_alcIsExtensionPresent alcIsExtensionPresent; 249 | da_alcGetProcAddress alcGetProcAddress; 250 | da_alcGetEnumValue alcGetEnumValue; 251 | da_alcGetString alcGetString; 252 | da_alcGetIntegerv alcGetIntegerv; 253 | da_alcCaptureOpenDevice alcCaptureOpenDevice; 254 | da_alcCaptureCloseDevice alcCaptureCloseDevice; 255 | da_alcCaptureStart alcCaptureStart; 256 | da_alcCaptureStop alcCaptureStop; 257 | da_alcCaptureSamples alcCaptureSamples; 258 | } 259 | 260 | 261 | class DerelictALLoader : SharedLibLoader { 262 | this() 263 | { 264 | super(libNames); 265 | } 266 | 267 | protected override void loadSymbols() 268 | { 269 | bindFunc(cast(void**)&alEnable, "alEnable"); 270 | bindFunc(cast(void**)&alDisable, "alDisable"); 271 | bindFunc(cast(void**)&alIsEnabled, "alIsEnabled"); 272 | bindFunc(cast(void**)&alGetString, "alGetString"); 273 | bindFunc(cast(void**)&alGetBooleanv, "alGetBooleanv"); 274 | bindFunc(cast(void**)&alGetIntegerv, "alGetIntegerv"); 275 | bindFunc(cast(void**)&alGetFloatv, "alGetFloatv"); 276 | bindFunc(cast(void**)&alGetDoublev, "alGetDoublev"); 277 | bindFunc(cast(void**)&alGetInteger, "alGetInteger"); 278 | bindFunc(cast(void**)&alGetFloat, "alGetFloat"); 279 | bindFunc(cast(void**)&alGetDouble, "alGetDouble"); 280 | bindFunc(cast(void**)&alGetError, "alGetError"); 281 | bindFunc(cast(void**)&alIsExtensionPresent, "alIsExtensionPresent"); 282 | bindFunc(cast(void**)&alGetProcAddress, "alGetProcAddress"); 283 | bindFunc(cast(void**)&alGetEnumValue, "alGetEnumValue"); 284 | bindFunc(cast(void**)&alListenerf, "alListenerf"); 285 | bindFunc(cast(void**)&alListener3f, "alListener3f"); 286 | bindFunc(cast(void**)&alListenerfv, "alListenerfv"); 287 | bindFunc(cast(void**)&alListeneri, "alListeneri"); 288 | bindFunc(cast(void**)&alListener3i, "alListener3i"); 289 | bindFunc(cast(void**)&alListeneriv, "alListeneriv"); 290 | bindFunc(cast(void**)&alGetListenerf, "alGetListenerf"); 291 | bindFunc(cast(void**)&alGetListener3f, "alGetListener3f"); 292 | bindFunc(cast(void**)&alGetListenerfv, "alGetListenerfv"); 293 | bindFunc(cast(void**)&alGetListeneri, "alGetListeneri"); 294 | bindFunc(cast(void**)&alGetListener3i, "alGetListener3i"); 295 | bindFunc(cast(void**)&alGetListeneriv, "alGetListeneriv"); 296 | bindFunc(cast(void**)&alGenSources, "alGenSources"); 297 | bindFunc(cast(void**)&alDeleteSources, "alDeleteSources"); 298 | bindFunc(cast(void**)&alIsSource, "alIsSource"); 299 | bindFunc(cast(void**)&alSourcef, "alSourcef"); 300 | bindFunc(cast(void**)&alSource3f, "alSource3f"); 301 | bindFunc(cast(void**)&alSourcefv, "alSourcefv"); 302 | bindFunc(cast(void**)&alSourcei, "alSourcei"); 303 | bindFunc(cast(void**)&alSource3i, "alSource3i"); 304 | bindFunc(cast(void**)&alSourceiv, "alSourceiv"); 305 | bindFunc(cast(void**)&alGetSourcef, "alGetSourcef"); 306 | bindFunc(cast(void**)&alGetSource3f, "alGetSource3f"); 307 | bindFunc(cast(void**)&alGetSourcefv, "alGetSourcefv"); 308 | bindFunc(cast(void**)&alGetSourcei, "alGetSourcei"); 309 | bindFunc(cast(void**)&alGetSource3i, "alGetSource3i"); 310 | bindFunc(cast(void**)&alGetSourceiv, "alGetSourceiv"); 311 | bindFunc(cast(void**)&alSourcePlayv, "alSourcePlayv"); 312 | bindFunc(cast(void**)&alSourceStopv, "alSourceStopv"); 313 | bindFunc(cast(void**)&alSourceRewindv, "alSourceRewindv"); 314 | bindFunc(cast(void**)&alSourcePausev, "alSourcePausev"); 315 | bindFunc(cast(void**)&alSourcePlay, "alSourcePlay"); 316 | bindFunc(cast(void**)&alSourcePause, "alSourcePause"); 317 | bindFunc(cast(void**)&alSourceRewind, "alSourceRewind"); 318 | bindFunc(cast(void**)&alSourceStop, "alSourceStop"); 319 | bindFunc(cast(void**)&alSourceQueueBuffers, "alSourceQueueBuffers"); 320 | bindFunc(cast(void**)&alSourceUnqueueBuffers, "alSourceUnqueueBuffers"); 321 | bindFunc(cast(void**)&alGenBuffers, "alGenBuffers"); 322 | bindFunc(cast(void**)&alDeleteBuffers, "alDeleteBuffers"); 323 | bindFunc(cast(void**)&alIsBuffer, "alIsBuffer"); 324 | bindFunc(cast(void**)&alBufferData, "alBufferData"); 325 | bindFunc(cast(void**)&alBufferf, "alBufferf"); 326 | bindFunc(cast(void**)&alBuffer3f, "alBuffer3f"); 327 | bindFunc(cast(void**)&alBufferfv, "alBufferfv"); 328 | bindFunc(cast(void**)&alBufferi, "alBufferi"); 329 | bindFunc(cast(void**)&alBuffer3i, "alBuffer3i"); 330 | bindFunc(cast(void**)&alBufferiv, "alBufferiv"); 331 | bindFunc(cast(void**)&alGetBufferf, "alGetBufferf"); 332 | bindFunc(cast(void**)&alGetBuffer3f, "alGetBuffer3f"); 333 | bindFunc(cast(void**)&alGetBufferfv, "alGetBufferfv"); 334 | bindFunc(cast(void**)&alGetBufferi, "alGetBufferi"); 335 | bindFunc(cast(void**)&alGetBuffer3i, "alGetBuffer3i"); 336 | bindFunc(cast(void**)&alGetBufferiv, "alGetBufferiv"); 337 | bindFunc(cast(void**)&alDopplerFactor, "alDopplerFactor"); 338 | bindFunc(cast(void**)&alDopplerVelocity, "alDopplerVelocity"); 339 | bindFunc(cast(void**)&alSpeedOfSound, "alSpeedOfSound"); 340 | bindFunc(cast(void**)&alDistanceModel, "alDistanceModel"); 341 | bindFunc(cast(void**)&alcCreateContext, "alcCreateContext"); 342 | bindFunc(cast(void**)&alcMakeContextCurrent, "alcMakeContextCurrent"); 343 | bindFunc(cast(void**)&alcProcessContext, "alcProcessContext"); 344 | bindFunc(cast(void**)&alcGetCurrentContext, "alcGetCurrentContext"); 345 | bindFunc(cast(void**)&alcGetContextsDevice, "alcGetContextsDevice"); 346 | bindFunc(cast(void**)&alcSuspendContext, "alcSuspendContext"); 347 | bindFunc(cast(void**)&alcDestroyContext, "alcDestroyContext"); 348 | bindFunc(cast(void**)&alcOpenDevice, "alcOpenDevice"); 349 | bindFunc(cast(void**)&alcCloseDevice, "alcCloseDevice"); 350 | bindFunc(cast(void**)&alcGetError, "alcGetError"); 351 | bindFunc(cast(void**)&alcIsExtensionPresent, "alcIsExtensionPresent"); 352 | bindFunc(cast(void**)&alcGetProcAddress, "alcGetProcAddress"); 353 | bindFunc(cast(void**)&alcGetEnumValue, "alcGetEnumValue"); 354 | bindFunc(cast(void**)&alcGetString, "alcGetString"); 355 | bindFunc(cast(void**)&alcGetIntegerv, "alcGetIntegerv"); 356 | bindFunc(cast(void**)&alcCaptureOpenDevice, "alcCaptureOpenDevice"); 357 | bindFunc(cast(void**)&alcCaptureCloseDevice, "alcCaptureCloseDevice"); 358 | bindFunc(cast(void**)&alcCaptureStart, "alcCaptureStart"); 359 | bindFunc(cast(void**)&alcCaptureStop, "alcCaptureStop"); 360 | bindFunc(cast(void**)&alcCaptureSamples, "alcCaptureSamples"); 361 | } 362 | } 363 | 364 | __gshared DerelictALLoader DerelictAL; 365 | 366 | shared static this() 367 | { 368 | DerelictAL = new DerelictALLoader(); 369 | } 370 | 371 | private: 372 | static if(Derelict_OS_Windows) 373 | enum libNames = "OpenAl32.dll"; 374 | else static if(Derelict_OS_Mac) 375 | enum libNames = "../Frameworks/OpenAL.framework/OpenAL, /Library/Frameworks/OpenAL.framework/OpenAL, /System/Library/Frameworks/OpenAL.framework/OpenAL"; 376 | else static if(Derelict_OS_Posix) 377 | enum libNames = "libal.so, libAL.so, libopenal.so, libopenal.so.1, libopenal.so.0"; 378 | else 379 | static assert(0, "Need to implement OpenAL libNames for this operating system."); 380 | 381 | -------------------------------------------------------------------------------- /source/derelict/openal/package.d: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Boost Software License - Version 1.0 - August 17th, 2003 4 | 5 | Permission is hereby granted, free of charge, to any person or organization 6 | obtaining a copy of the software and accompanying documentation covered by 7 | this license (the "Software") to use, reproduce, display, distribute, 8 | execute, and transmit the Software, and to prepare derivative works of the 9 | Software, and to permit third-parties to whom the Software is furnished to 10 | do so, all subject to the following: 11 | 12 | The copyright notices in the Software and this entire statement, including 13 | the above license grant, this restriction and the following disclaimer, 14 | must be included in all copies of the Software, in whole or in part, and 15 | all derivative works of the Software, unless such copies or derivative 16 | works are solely in the form of machine-executable object code generated by 17 | a source language processor. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 22 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 23 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 24 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | 27 | */ 28 | module derelict.openal; 29 | 30 | public import derelict.openal.al; -------------------------------------------------------------------------------- /source/derelict/openal/statfun.d: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Boost Software License - Version 1.0 - August 17th, 2003 4 | 5 | Permission is hereby granted, free of charge, to any person or organization 6 | obtaining a copy of the software and accompanying documentation covered by 7 | this license (the "Software") to use, reproduce, display, distribute, 8 | execute, and transmit the Software, and to prepare derivative works of the 9 | Software, and to permit third-parties to whom the Software is furnished to 10 | do so, all subject to the following: 11 | 12 | The copyright notices in the Software and this entire statement, including 13 | the above license grant, this restriction and the following disclaimer, 14 | must be included in all copies of the Software, in whole or in part, and 15 | all derivative works of the Software, unless such copies or derivative 16 | works are solely in the form of machine-executable object code generated by 17 | a source language processor. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 22 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 23 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 24 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | 27 | */ 28 | module derelict.openal.statfun; 29 | 30 | version(Derelict_Static) version = DerelictAL_Static; 31 | version(DerelictAL_Static): 32 | 33 | public import derelict.openal.types; 34 | 35 | extern(C) @nogc nothrow { 36 | void alEnable(ALenum); 37 | void alDisable(ALenum); 38 | ALboolean alIsEnabled(ALenum); 39 | const(ALchar)* alGetString(ALenum); 40 | void alGetBooleanv(ALenum, ALboolean*); 41 | void alGetIntegerv(ALenum, ALint*); 42 | void alGetFloatv(ALenum, ALfloat*); 43 | void alGetDoublev(ALenum, ALdouble*); 44 | ALboolean alGetBoolean(ALenum); 45 | ALint alGetInteger(ALenum); 46 | ALfloat alGetFloat(ALenum); 47 | ALdouble alGetDouble(ALenum); 48 | ALenum alGetError(); 49 | ALboolean alIsExtensionPresent(const(char)*); 50 | ALvoid* alGetProcAddress(const(char)*); 51 | ALenum alGetEnumValue(const(char)*); 52 | void alListenerf(ALenum, ALfloat); 53 | void alListener3f(ALenum, ALfloat, ALfloat, ALfloat); 54 | void alListenerfv(ALenum, const(ALfloat)*); 55 | void alListeneri(ALenum, ALint); 56 | void alListener3i(ALenum, ALint, ALint, ALint); 57 | void alListeneriv(ALenum, const(ALint)*); 58 | void alGetListenerf(ALenum, ALfloat*); 59 | void alGetListener3f(ALenum, ALfloat*, ALfloat*, ALfloat*); 60 | void alGetListenerfv(ALenum, ALfloat*); 61 | void alGetListeneri(ALenum, ALint*); 62 | void alGetListener3i(ALenum, ALint*, ALint*, ALint*); 63 | void alGetListeneriv(ALenum, ALint*); 64 | void alGenSources(ALsizei, ALuint*); 65 | void alDeleteSources(ALsizei, const(ALuint)*); 66 | ALboolean alIsSource(ALuint); 67 | void alSourcef(ALuint, ALenum, ALfloat); 68 | void alSource3f(ALuint, ALenum, ALfloat, ALfloat, ALfloat); 69 | void alSourcefv(ALuint, ALenum, const(ALfloat)*); 70 | void alSourcei(ALuint, ALenum, ALint); 71 | void alSource3i(ALuint, ALenum, ALint, ALint, ALint); 72 | void alSourceiv(ALuint, ALenum, const(ALint)*); 73 | void alGetSourcef(ALuint, ALenum, ALfloat*); 74 | void alGetSource3f(ALuint, ALenum, ALfloat*, ALfloat*, ALfloat*); 75 | void alGetSourcefv(ALuint, ALenum, ALfloat*); 76 | void alGetSourcei(ALuint, ALenum, ALint*); 77 | void alGetSource3i(ALuint, ALenum, ALint*, ALint*, ALint*); 78 | void alGetSourceiv(ALuint, ALenum, ALint*); 79 | void alSourcePlayv(ALsizei, const(ALuint)*); 80 | void alSourceStopv(ALsizei, const(ALuint)*); 81 | void alSourceRewindv(ALsizei, const(ALuint)*); 82 | void alSourcePausev(ALsizei, const(ALuint)*); 83 | void alSourcePlay(ALuint); 84 | void alSourcePause(ALuint); 85 | void alSourceRewind(ALuint); 86 | void alSourceStop(ALuint); 87 | void alSourceQueueBuffers(ALuint, ALsizei, ALuint*); 88 | void alSourceUnqueueBuffers(ALuint, ALsizei, ALuint*); 89 | void alGenBuffers(ALsizei, ALuint*); 90 | void alDeleteBuffers(ALsizei, const(ALuint)*); 91 | ALboolean alIsBuffer(ALuint); 92 | void alBufferData(ALuint, ALenum, const(ALvoid)*, ALsizei, ALsizei); 93 | void alBufferf(ALuint, ALenum, ALfloat); 94 | void alBuffer3f(ALuint, ALenum, ALfloat, ALfloat, ALfloat); 95 | void alBufferfv(ALuint, ALenum, const(ALfloat)*); 96 | void alBufferi(ALuint, ALenum, ALint); 97 | void alBuffer3i(ALuint, ALenum, ALint, ALint, ALint); 98 | void alBufferiv(ALuint, ALenum, const(ALint)*); 99 | void alGetBufferf(ALuint, ALenum, ALfloat*); 100 | void alGetBuffer3f(ALuint, ALenum, ALfloat*, ALfloat*, ALfloat*); 101 | void alGetBufferfv(ALuint, ALenum, ALfloat*); 102 | void alGetBufferi(ALuint, ALenum, ALint*); 103 | void alGetBuffer3i(ALuint, ALenum, ALint*, ALint*, ALint*); 104 | void alGetBufferiv(ALuint, ALenum, ALint*); 105 | void alDopplerFactor(ALfloat); 106 | void alDopplerVelocity(ALfloat); 107 | void alSpeedOfSound(ALfloat); 108 | void alDistanceModel(ALenum); 109 | ALCcontext* alcCreateContext(ALCdevice*, const(ALCint)*); 110 | ALCboolean alcMakeContextCurrent(ALCcontext*); 111 | void alcProcessContext(ALCcontext*); 112 | void alcSuspendContext(ALCcontext*); 113 | void alcDestroyContext(ALCcontext*); 114 | ALCcontext* alcGetCurrentContext(); 115 | ALCdevice* alcGetContextsDevice(ALCcontext*); 116 | ALCdevice* alcOpenDevice(const(char)*); 117 | ALCboolean alcCloseDevice(ALCdevice*); 118 | ALCenum alcGetError(ALCdevice*); 119 | ALCboolean alcIsExtensionPresent(ALCdevice*, const(char)*); 120 | void* alcGetProcAddress(ALCdevice*, const(char)*); 121 | ALCenum alcGetEnumValue(ALCdevice*, const(char)*); 122 | const(char)* alcGetString(ALCdevice*, ALCenum); 123 | void alcGetIntegerv(ALCdevice*, ALCenum, ALCsizei, ALCint*); 124 | ALCdevice* alcCaptureOpenDevice(const(char)*, ALCuint, ALCenum, ALCsizei); 125 | ALCboolean alcCaptureCloseDevice(ALCdevice*); 126 | void alcCaptureStart(ALCdevice*); 127 | void alcCaptureStop(ALCdevice*); 128 | void alcCaptureSamples(ALCdevice*, ALCvoid*, ALCsizei); 129 | } -------------------------------------------------------------------------------- /source/derelict/openal/types.d: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Boost Software License - Version 1.0 - August 17th, 2003 4 | 5 | Permission is hereby granted, free of charge, to any person or organization 6 | obtaining a copy of the software and accompanying documentation covered by 7 | this license ( the "Software" ) to use, reproduce, display, distribute, 8 | execute, and transmit the Software, and to prepare derivative works of the 9 | Software, and to permit third-parties to whom the Software is furnished to 10 | do so, all subject to the following: 11 | 12 | The copyright notices in the Software and this entire statement, including 13 | the above license grant, this restriction and the following disclaimer, 14 | must be included in all copies of the Software, in whole or in part, and 15 | all derivative works of the Software, unless such copies or derivative 16 | works are solely in the form of machine-executable object code generated by 17 | a source language processor. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 22 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 23 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 24 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | 27 | */ 28 | module derelict.openal.types; 29 | 30 | // al 31 | enum AL_VERSION_1_0 = true; 32 | enum AL_VERSION_1_1 = true; 33 | 34 | alias ALboolean = byte; 35 | alias ALchar = char; 36 | alias ALbyte = byte; 37 | alias ALubyte = ubyte; 38 | alias ALshort = short; 39 | alias ALushort = ushort; 40 | alias ALint = int; 41 | alias ALuint = uint; 42 | alias ALsizei = int; 43 | alias ALenum = int; 44 | alias ALfloat = float; 45 | alias ALdouble = double; 46 | alias ALvoid = void; 47 | 48 | enum : ALboolean { 49 | AL_FALSE = 0, 50 | AL_TRUE = 1, 51 | } 52 | 53 | enum : ALenum { 54 | AL_INVALID = -1, 55 | AL_NONE = 0, 56 | 57 | AL_SOURCE_RELATIVE = 0x202, 58 | 59 | AL_CONE_INNER_ANGLE = 0x1001, 60 | AL_CONE_OUTER_ANGLE = 0x1002, 61 | 62 | AL_PITCH = 0x1003, 63 | AL_POSITION = 0x1004, 64 | AL_DIRECTION = 0x1005, 65 | AL_VELOCITY = 0x1006, 66 | AL_LOOPING = 0x1007, 67 | AL_BUFFER = 0x1009, 68 | AL_GAIN = 0x100A, 69 | AL_MIN_GAIN = 0x100D, 70 | AL_MAX_GAIN = 0x100E, 71 | AL_ORIENTATION = 0x100F, 72 | 73 | AL_CHANNEL_MASK = 0x3000, 74 | 75 | AL_SOURCE_STATE = 0x1010, 76 | AL_INITIAL = 0x1011, 77 | AL_PLAYING = 0x1012, 78 | AL_PAUSED = 0x1013, 79 | AL_STOPPED = 0x1014, 80 | 81 | AL_BUFFERS_QUEUED = 0x1015, 82 | AL_BUFFERS_PROCESSED = 0x1016, 83 | 84 | AL_REFERENCE_DISTANCE = 0x1020, 85 | AL_ROLLOFF_FACTOR = 0x1021, 86 | AL_CONE_OUTER_GAIN = 0x1022, 87 | AL_MAX_DISTANCE = 0x1023, 88 | 89 | AL_SEC_OFFSET = 0x1024, 90 | AL_SAMPLE_OFFSET = 0x1025, 91 | AL_BYTE_OFFSET = 0x1026, 92 | 93 | AL_SOURCE_TYPE = 0x1027, 94 | AL_STATIC = 0x1028, 95 | AL_STREAMING = 0x1029, 96 | AL_UNDETERMINED = 0x1030, 97 | 98 | AL_FORMAT_MONO8 = 0x1100, 99 | AL_FORMAT_MONO16 = 0x1101, 100 | AL_FORMAT_STEREO8 = 0x1102, 101 | AL_FORMAT_STEREO16 = 0x1103, 102 | 103 | AL_FREQUENCY = 0x2001, 104 | AL_BITS = 0x2002, 105 | AL_CHANNELS = 0x2003, 106 | AL_SIZE = 0x2004, 107 | 108 | AL_UNUSED = 0x2010, 109 | AL_PENDING = 0x2011, 110 | AL_PROCESSED = 0x2012, 111 | 112 | AL_NO_ERROR = AL_FALSE, 113 | 114 | AL_INVALID_NAME = 0xA001, 115 | AL_INVALID_ENUM = 0xA002, 116 | AL_INVALID_VALUE = 0xA003, 117 | AL_INVALID_OPERATION = 0xA004, 118 | AL_OUT_OF_MEMORY = 0xA005, 119 | 120 | AL_VENDOR = 0xB001, 121 | AL_VERSION = 0xB002, 122 | AL_RENDERER = 0xB003, 123 | AL_EXTENSIONS = 0xB004, 124 | 125 | AL_DOPPLER_FACTOR = 0xC000, 126 | AL_DOPPLER_VELOCITY = 0xC001, 127 | AL_SPEED_OF_SOUND = 0xC003, 128 | 129 | AL_DISTANCE_MODEL = 0xD000, 130 | AL_INVERSE_DISTANCE = 0xD001, 131 | AL_INVERSE_DISTANCE_CLAMPED = 0xD002, 132 | AL_LINEAR_DISTANCE = 0xD003, 133 | AL_LINEAR_DISTANCE_CLAMPED = 0xD004, 134 | AL_EXPONENT_DISTANCE = 0xD005, 135 | AL_EXPONENT_DISTANCE_CLAMPED = 0xD006, 136 | } 137 | 138 | // alc 139 | enum ALC_VERSION_0_1 = true; 140 | 141 | alias ALCdevice = void; 142 | alias ALCcontext = void; 143 | 144 | alias ALCboolean = byte; 145 | alias ALCchar = char; 146 | alias ALCbyte = byte; 147 | alias ALCubyte = ubyte; 148 | alias ALCshort = short; 149 | alias ALCushort = ushort; 150 | alias ALCint = int; 151 | alias ALCuint = uint; 152 | alias ALCsizei = int; 153 | alias ALCenum = int; 154 | alias ALCfloat = float; 155 | alias ALCdouble = double; 156 | alias ALCvoid = void; 157 | 158 | enum : ALCboolean { 159 | ALC_FALSE = 0, 160 | ALC_TRUE = 1, 161 | } 162 | 163 | enum : ALCenum { 164 | ALC_FREQUENCY = 0x1007, 165 | ALC_REFRESH = 0x1008, 166 | ALC_SYNC = 0x1009, 167 | 168 | ALC_MONO_SOURCES = 0x1010, 169 | ALC_STEREO_SOURCES = 0x1011, 170 | 171 | ALC_NO_ERROR = ALC_FALSE, 172 | ALC_INVALID_DEVICE = 0xA001, 173 | ALC_INVALID_CONTEXT = 0xA002, 174 | ALC_INVALID_ENUM = 0xA003, 175 | ALC_INVALID_VALUE = 0xA004, 176 | ALC_OUT_OF_MEMORY = 0xA005, 177 | 178 | ALC_DEFAULT_DEVICE_SPECIFIER = 0x1004, 179 | ALC_DEVICE_SPECIFIER = 0x1005, 180 | ALC_EXTENSIONS = 0x1006, 181 | 182 | ALC_MAJOR_VERSION = 0x1000, 183 | ALC_MINOR_VERSION = 0x1001, 184 | 185 | ALC_ATTRIBUTES_SIZE = 0x1002, 186 | ALC_ALL_ATTRIBUTES = 0x1003, 187 | 188 | ALC_CAPTURE_DEVICE_SPECIFIER = 0x310, 189 | ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER = 0x311, 190 | ALC_CAPTURE_SAMPLES = 0x312, 191 | } 192 | 193 | // alext 194 | enum : ALenum { 195 | // AL_LOKI_IMA_ADPCM_format 196 | AL_FORMAT_IMA_ADPCM_MONO16_EXT = 0x10000, 197 | AL_FORMAT_IMA_ADPCM_STEREO16_EXT = 0x10001, 198 | 199 | // AL_LOKI_WAVE_format 200 | AL_FORMAT_WAVE_EXT = 0x10002, 201 | 202 | // AL_EXT_vorbis 203 | AL_FORMAT_VORBIS_EXT = 0x10003, 204 | 205 | // AL_LOKI_quadriphonic 206 | AL_FORMAT_QUAD8_LOKI = 0x10004, 207 | AL_FORMAT_QUAD16_LOKI = 0x10005, 208 | 209 | // AL_EXT_float32 210 | AL_FORMAT_MONO_FLOAT32 = 0x10010, 211 | AL_FORMAT_STEREO_FLOAT32 = 0x10011, 212 | 213 | // ALC_LOKI_audio_channel 214 | ALC_CHAN_MAIN_LOKI = 0x500001, 215 | ALC_CHAN_PCM_LOKI = 0x500002, 216 | ALC_CHAN_CD_LOKI = 0x500003, 217 | 218 | // ALC_ENUMERATE_ALL_EXT 219 | ALC_DEFAULT_ALL_DEVICES_SPECIFIER = 0x1012, 220 | ALC_ALL_DEVICES_SPECIFIER = 0x1013, 221 | 222 | // AL_EXT_MCFORMATS 223 | AL_FORMAT_QUAD8 = 0x1204, 224 | AL_FORMAT_QUAD16 = 0x1205, 225 | AL_FORMAT_QUAD32 = 0x1206, 226 | AL_FORMAT_REAR8 = 0x1207, 227 | AL_FORMAT_REAR16 = 0x1208, 228 | AL_FORMAT_REAR32 = 0x1209, 229 | AL_FORMAT_51CHN8 = 0x120A, 230 | AL_FORMAT_51CHN16 = 0x120B, 231 | AL_FORMAT_51CHN32 = 0x120C, 232 | AL_FORMAT_61CHN8 = 0x120D, 233 | AL_FORMAT_61CHN16 = 0x120E, 234 | AL_FORMAT_61CHN32 = 0x120F, 235 | AL_FORMAT_71CHN8 = 0x1210, 236 | AL_FORMAT_71CHN16 = 0x1211, 237 | AL_FORMAT_71CHN32 = 0x1212, 238 | 239 | // AL_EXT_IMA4 240 | AL_FORMAT_MONO_IMA4 = 0x1300, 241 | AL_FORMAT_STEREO_IMA4 = 0x1301, 242 | } --------------------------------------------------------------------------------