Skip to content
Browse files

Merge pull request #17 from svenstaro/master

alure bindings
  • Loading branch information...
2 parents 971f47f + ab70dfe commit 31e1579187a7f6a3d582f54f6ae1bdcbbab4549e @aldacron committed
Showing with 310 additions and 0 deletions.
  1. +3 −0 build/derelict.d
  2. +119 −0 import/derelict/alure/alure.d
  3. +150 −0 import/derelict/alure/functions.d
  4. +38 −0 import/derelict/alure/types.d
View
3 build/derelict.d
@@ -64,6 +64,7 @@ enum packGL3 = "DerelictGL3";
enum packGLFW3 = "DerelictGLFW3";
enum packIL = "DerelictIL";
enum packAL = "DerelictAL";
+enum packALURE = "DerelictALURE";
enum packFT = "DerelictFT";
enum packSDL2 = "DerelictSDL2";
enum packODE = "DerelictODE";
@@ -75,6 +76,7 @@ enum srcGL3 = srcDerelict ~ "opengl3/";
enum srcGLFW3 = srcDerelict ~ "glfw3/";
enum srcIL = srcDerelict ~ "devil/";
enum srcAL = srcDerelict ~ "openal/";
+enum srcALURE = srcDerelict ~ "alure/";
enum srcFT = srcDerelict ~ "freetype/";
enum srcSDL2 = srcDerelict ~ "sdl2/";
enum srcODE = srcDerelict ~ "ode/";
@@ -92,6 +94,7 @@ static this()
packGLFW3 : srcGLFW3,
packIL : srcIL,
packAL : srcAL,
+ packALURE : srcALURE,
packFT : srcFT,
packSDL2 : srcSDL2,
packODE : srcODE,
View
119 import/derelict/alure/alure.d
@@ -0,0 +1,119 @@
+/*
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+*/
+module derelict.alure.alure;
+
+public
+{
+ import derelict.alure.types;
+ import derelict.alure.functions;
+}
+
+private
+{
+ import derelict.util.loader;
+ import derelict.util.system;
+
+ static if(Derelict_OS_Windows)
+ enum libNames = "ALURE32.dll";
+ else static if(Derelict_OS_Mac)
+ enum libNames = "libalure.dylib";
+ else static if(Derelict_OS_Posix)
+ enum libNames = "libalure.so, libalure.so.1";
+ else
+ static assert(0, "Need to implement ALURE libNames for this operating system.");
+}
+
+class DerelictALURELoader : SharedLibLoader
+{
+
+ protected
+ {
+ override void loadSymbols()
+ {
+ bindFunc(cast(void**)&alureGetVersion, "alureGetVersion");
+ bindFunc(cast(void**)&alureGetErrorString, "alureGetErrorString");
+ bindFunc(cast(void**)&alureGetDeviceNames, "alureGetDeviceNames");
+ bindFunc(cast(void**)&alureFreeDeviceNames, "alureFreeDeviceNames");
+ bindFunc(cast(void**)&alureInitDevice, "alureInitDevice");
+ bindFunc(cast(void**)&alureShutdownDevice, "alureShutdownDevice");
+ bindFunc(cast(void**)&alureGetSampleFormat, "alureGetSampleFormat");
+ bindFunc(cast(void**)&alureInstallDecodeCallbacks, "alureInstallDecodeCallbacks");
+ bindFunc(cast(void**)&alureSleep, "alureSleep");
+ bindFunc(cast(void**)&alureGetProcAddress, "alureGetProcAddress");
+
+ bindFunc(cast(void**)&alureCreateBufferFromFile, "alureCreateBufferFromFile");
+ bindFunc(cast(void**)&alureCreateBufferFromMemory, "alureCreateBufferFromMemory");
+ bindFunc(cast(void**)&alureBufferDataFromFile, "alureBufferDataFromFile");
+ bindFunc(cast(void**)&alureBufferDataFromMemory, "alureBufferDataFromMemory");
+
+ bindFunc(cast(void**)&alureStreamSizeIsMicroSec, "alureStreamSizeIsMicroSec");
+ bindFunc(cast(void**)&alureCreateStreamFromFile, "alureCreateStreamFromFile");
+ bindFunc(cast(void**)&alureCreateStreamFromMemory, "alureCreateStreamFromMemory");
+ bindFunc(cast(void**)&alureCreateStreamFromStaticMemory, "alureCreateStreamFromStaticMemory");
+ bindFunc(cast(void**)&alureCreateStreamFromCallback, "alureCreateStreamFromCallback");
+ bindFunc(cast(void**)&alureGetStreamFrequency, "alureGetStreamFrequency");
+ bindFunc(cast(void**)&alureBufferDataFromStream, "alureBufferDataFromStream");
+ bindFunc(cast(void**)&alureRewindStream, "alureRewindStream");
+ bindFunc(cast(void**)&alureSetStreamOrder, "alureSetStreamOrder");
+ bindFunc(cast(void**)&alureSetStreamPatchset, "alureSetStreamPatchset");
+ bindFunc(cast(void**)&alureGetStreamLength, "alureGetStreamLength");
+ bindFunc(cast(void**)&alureDestroyStream, "alureDestroyStream");
+
+ bindFunc(cast(void**)&alureSetIOCallbacks, "alureSetIOCallbacks");
+
+ bindFunc(cast(void**)&alurePlaySourceStream, "alurePlaySourceStream");
+ bindFunc(cast(void**)&alurePlaySource, "alurePlaySource");
+ bindFunc(cast(void**)&alureStopSource, "alureStopSource");
+ bindFunc(cast(void**)&alurePauseSource, "alurePauseSource");
+ bindFunc(cast(void**)&alureResumeSource, "alureResumeSource");
+ bindFunc(cast(void**)&alureUpdate, "alureUpdate");
+ bindFunc(cast(void**)&alureUpdateInterval, "alureUpdateInterval");
+ }
+ }
+
+ public
+ {
+ this()
+ {
+ super(libNames);
+ }
+ }
+}
+
+__gshared DerelictALURELoader DerelictALURE;
+
+shared static this()
+{
+ DerelictALURE = new DerelictALURELoader();
+}
+
+shared static ~this()
+{
+ if(SharedLibLoader.isAutoUnloadEnabled())
+ DerelictALURE.unload();
+}
View
150 import/derelict/alure/functions.d
@@ -0,0 +1,150 @@
+/*
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+*/
+module derelict.alure.functions;
+
+private
+{
+ import derelict.openal.types;
+ import derelict.alure.types;
+}
+
+extern(C) nothrow
+{
+ alias void* function(ALchar*) alureInstallDecodeCallbacks_open_file;
+ alias void* function(ALubyte*, ALuint) alureInstallDecodeCallbacks_open_memory;
+ alias ALboolean function(void*, ALenum*, ALuint*, ALuint*) alureInstallDecodeCallbacks_get_format;
+ alias ALuint function(void*, ALubyte*, ALuint) alureInstallDecodeCallbacks_decode;
+ alias ALboolean function(void*) alureInstallDecodeCallbacks_rewind;
+ alias void function(void*) alureInstallDecodeCallbacks_close;
+
+ alias ALuint function(void*, ALubyte*, ALuint) alureCreateStreamFromCallback_callback;
+
+ alias void* function(char*, ALuint) alureSetIOCallbacks_open_callback;
+ alias void function(char*) alureSetIOCallbacks_close_callback;
+ alias ALsizei function(void*, ALubyte*, ALuint) alureSetIOCallbacks_read_callback;
+ alias ALsizei function(void*, ALubyte*, ALuint) alureSetIOCallbacks_write_callback;
+ alias alureInt64 function(void*, alureInt64, int) alureSetIOCallbacks_seek_callback;
+
+ alias void function(void*, ALuint) alurePlaySourceStream_eos_callback;
+ alias void function(void*, ALuint) alurePlaySource_callback;
+}
+
+extern(C)
+{
+ alias nothrow void function(ALuint*, ALuint*) da_alureGetVersion;
+ alias nothrow ALchar* function() da_alureGetErrorString;
+ alias nothrow ALCchar** function(ALCboolean all, ALCsizei*) da_alureGetDeviceNames;
+ alias nothrow void function(ALCchar**) da_alureFreeDeviceNames;
+ alias nothrow ALCboolean function(ALCchar*, ALCint*) da_alureInitDevice;
+ alias nothrow ALCboolean function() da_alureShutdownDevice;
+ alias nothrow ALenum function(ALuint, ALuint, ALuint) da_alureGetSampleFormat;
+ alias nothrow ALboolean function(ALint,
+ alureInstallDecodeCallbacks_open_file,
+ alureInstallDecodeCallbacks_open_memory,
+ alureInstallDecodeCallbacks_get_format,
+ alureInstallDecodeCallbacks_decode,
+ alureInstallDecodeCallbacks_rewind,
+ alureInstallDecodeCallbacks_close) da_alureInstallDecodeCallbacks;
+ alias nothrow ALboolean function(ALfloat) da_alureSleep;
+ alias nothrow void* function(ALchar*) da_alureGetProcAddress;
+
+ alias nothrow ALuint function(ALchar*) da_alureCreateBufferFromFile;
+ alias nothrow ALuint function(ALubyte*, ALsizei) da_alureCreateBufferFromMemory;
+ alias nothrow ALboolean function(ALchar*, ALuint) da_alureBufferDataFromFile;
+ alias nothrow ALboolean function(ALubyte*, ALsizei, ALuint) da_alureBufferDataFromMemory;
+
+ alias nothrow ALboolean function(ALboolean) da_alureStreamSizeIsMicroSec;
+ alias nothrow alureStream* function(ALchar*, ALsizei, ALsizei, ALuint*) da_alureCreateStreamFromFile;
+ alias nothrow alureStream* function(ALubyte*, ALuint, ALsizei, ALsizei, ALuint*) da_alureCreateStreamFromMemory;
+ alias nothrow alureStream* function(ALubyte*, ALuint, ALsizei, ALsizei, ALuint*) da_alureCreateStreamFromStaticMemory;
+ alias nothrow alureStream* function(alureCreateStreamFromCallback_callback,
+ void*, ALenum, ALuint, ALsizei, ALsizei, ALuint*) da_alureCreateStreamFromCallback;
+ alias nothrow ALsizei function(alureStream*) da_alureGetStreamFrequency;
+ alias nothrow ALsizei function(alureStream*, ALsizei, ALuint*) da_alureBufferDataFromStream;
+ alias nothrow ALboolean function(alureStream*, ALsizei) da_alureRewindStream;
+ alias nothrow ALboolean function(alureStream*, ALuint) da_alureSetStreamOrder;
+ alias nothrow ALboolean function(alureStream*, ALchar*) da_alureSetStreamPatchset;
+ alias nothrow alureInt64 function(alureStream*) da_alureGetStreamLength;
+ alias nothrow ALboolean function(alureStream*, ALsizei, ALsizei, ALuint*) da_alureDestroyStream;
+
+ alias nothrow ALboolean function(alureSetIOCallbacks_open_callback,
+ alureSetIOCallbacks_close_callback,
+ alureSetIOCallbacks_read_callback,
+ alureSetIOCallbacks_write_callback,
+ alureSetIOCallbacks_seek_callback) da_alureSetIOCallbacks;
+
+ alias nothrow ALboolean function(ALuint, alureStream*, ALsizei, ALsizei, alurePlaySourceStream_eos_callback, void*) da_alurePlaySourceStream;
+ alias nothrow ALboolean function(ALuint, alurePlaySource_callback, void*) da_alurePlaySource;
+ alias nothrow ALboolean function(ALuint, ALboolean) da_alureStopSource;
+ alias nothrow ALboolean function(ALuint) da_alurePauseSource;
+ alias nothrow ALboolean function(ALuint) da_alureResumeSource;
+ alias nothrow void function() da_alureUpdate;
+ alias nothrow ALboolean function(ALfloat) da_alureUpdateInterval;
+}
+
+__gshared
+{
+ da_alureGetVersion alureGetVersion;
+ da_alureGetErrorString alureGetErrorString;
+ da_alureGetDeviceNames alureGetDeviceNames;
+ da_alureFreeDeviceNames alureFreeDeviceNames;
+ da_alureInitDevice alureInitDevice;
+ da_alureShutdownDevice alureShutdownDevice;
+ da_alureGetSampleFormat alureGetSampleFormat;
+ da_alureInstallDecodeCallbacks alureInstallDecodeCallbacks;
+ da_alureSleep alureSleep;
+ da_alureGetProcAddress alureGetProcAddress;
+
+ da_alureCreateBufferFromFile alureCreateBufferFromFile;
+ da_alureCreateBufferFromMemory alureCreateBufferFromMemory;
+ da_alureBufferDataFromFile alureBufferDataFromFile;
+ da_alureBufferDataFromMemory alureBufferDataFromMemory;
+
+ da_alureStreamSizeIsMicroSec alureStreamSizeIsMicroSec ;
+ da_alureCreateStreamFromFile alureCreateStreamFromFile;
+ da_alureCreateStreamFromMemory alureCreateStreamFromMemory;
+ da_alureCreateStreamFromStaticMemory alureCreateStreamFromStaticMemory;
+ da_alureCreateStreamFromCallback alureCreateStreamFromCallback;
+ da_alureGetStreamFrequency alureGetStreamFrequency;
+ da_alureBufferDataFromStream alureBufferDataFromStream;
+ da_alureRewindStream alureRewindStream;
+ da_alureSetStreamOrder alureSetStreamOrder;
+ da_alureSetStreamPatchset alureSetStreamPatchset;
+ da_alureGetStreamLength alureGetStreamLength;
+ da_alureDestroyStream alureDestroyStream;
+
+ da_alureSetIOCallbacks alureSetIOCallbacks;
+
+ da_alurePlaySourceStream alurePlaySourceStream;
+ da_alurePlaySource alurePlaySource;
+ da_alureStopSource alureStopSource;
+ da_alurePauseSource alurePauseSource;
+ da_alureResumeSource alureResumeSource;
+ da_alureUpdate alureUpdate;
+ da_alureUpdateInterval alureUpdateInterval;
+}
View
38 import/derelict/alure/types.d
@@ -0,0 +1,38 @@
+/*
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+*/
+module derelict.alure.types;
+
+// alure
+enum : bool
+{
+ ALURE_VERSION_1_2 = true,
+}
+
+alias long alureInt64;
+
+struct alureStream {}

0 comments on commit 31e1579

Please sign in to comment.
Something went wrong with that request. Please try again.