├── .gitignore ├── README.markdown ├── build └── build.d ├── import └── derelict │ ├── alure │ ├── alure.d │ ├── functions.d │ └── types.d │ ├── assimp │ ├── assimp.d │ ├── functions.d │ └── types.d │ ├── assimp3 │ ├── assimp.d │ ├── functions.d │ └── types.d │ ├── devil │ ├── functions.d │ ├── il.d │ ├── ilu.d │ ├── ilut.d │ └── types.d │ ├── freeglut │ ├── functions.d │ ├── glut.d │ └── types.d │ ├── freeimage │ ├── freeimage.d │ ├── functions.d │ └── types.d │ ├── freetype │ ├── ft.d │ ├── functions.d │ └── types.d │ ├── glfw3 │ ├── functions.d │ ├── glfw3.d │ └── types.d │ ├── lua │ ├── functions.d │ ├── lua.d │ ├── macros.d │ └── types.d │ ├── ode │ ├── functions.d │ ├── ode.d │ └── types.d │ ├── ogg │ ├── ogg.d │ ├── oggfunctions.d │ ├── oggtypes.d │ ├── vorbis.d │ ├── vorbisenc.d │ ├── vorbisencfunctions.d │ ├── vorbisenctypes.d │ ├── vorbisfile.d │ ├── vorbisfilefunctions.d │ ├── vorbisfiletypes.d │ ├── vorbisfunctions.d │ └── vorbistypes.d │ ├── openal │ ├── al.d │ ├── functions.d │ └── types.d │ ├── opengl3 │ ├── arb.d │ ├── cgl.d │ ├── constants.d │ ├── deprecatedConstants.d │ ├── deprecatedFunctions.d │ ├── ext.d │ ├── functions.d │ ├── gl.d │ ├── gl3.d │ ├── glx.d │ ├── glxext.d │ ├── internal.d │ ├── types.d │ ├── wgl.d │ └── wglext.d │ ├── physfs │ ├── api.d │ └── physfs.d │ ├── pq │ ├── functions.d │ ├── pq.d │ └── types.d │ ├── sdl2 │ ├── functions.d │ ├── image.d │ ├── mixer.d │ ├── net.d │ ├── sdl.d │ ├── ttf.d │ └── types.d │ ├── sfml2 │ ├── audio.d │ ├── audiofunctions.d │ ├── audiotypes.d │ ├── graphics.d │ ├── graphicsfunctions.d │ ├── graphicstypes.d │ ├── network.d │ ├── networkfunctions.d │ ├── networktypes.d │ ├── system.d │ ├── systemfunctions.d │ ├── systemtypes.d │ ├── window.d │ ├── windowfunctions.d │ └── windowtypes.d │ ├── tcod │ ├── functions.d │ ├── libtcod.d │ └── types.d │ └── util │ ├── exception.d │ ├── loader.d │ ├── sharedlib.d │ ├── system.d │ ├── wintypes.d │ └── xtypes.d ├── lib ├── .gitkeep ├── dmd │ └── .gitkeep ├── gdc │ └── .gitkeep └── ldc │ └── .gitkeep └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | *.exe 2 | *.dll 3 | *.lib 4 | *.obj 5 | *.a 6 | *.so 7 | lib/*.lib 8 | lib/*.a 9 | .DS_Store 10 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | ###THIS PROJECT IS NO LONGER MAINTAINED! 2 | 3 | It does't compile with the latest version of DMD and I will not be updating it. It only remains here for people with existing codebases they need to maintain. Please use [DerelictOrg](https://github.com/DerelictOrg) for new projects. Thank you! -------------------------------------------------------------------------------- /import/derelict/alure/alure.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.alure.alure; 29 | 30 | public 31 | { 32 | import derelict.alure.types; 33 | import derelict.alure.functions; 34 | } 35 | 36 | private 37 | { 38 | import derelict.util.loader; 39 | import derelict.util.system; 40 | 41 | static if(Derelict_OS_Windows) 42 | enum libNames = "ALURE32.dll"; 43 | else static if(Derelict_OS_Mac) 44 | enum libNames = "libalure.dylib"; 45 | else static if(Derelict_OS_Posix) 46 | enum libNames = "libalure.so, libalure.so.1"; 47 | else 48 | static assert(0, "Need to implement ALURE libNames for this operating system."); 49 | } 50 | 51 | class DerelictALURELoader : SharedLibLoader 52 | { 53 | 54 | protected 55 | { 56 | override void loadSymbols() 57 | { 58 | bindFunc(cast(void**)&alureGetVersion, "alureGetVersion"); 59 | bindFunc(cast(void**)&alureGetErrorString, "alureGetErrorString"); 60 | bindFunc(cast(void**)&alureGetDeviceNames, "alureGetDeviceNames"); 61 | bindFunc(cast(void**)&alureFreeDeviceNames, "alureFreeDeviceNames"); 62 | bindFunc(cast(void**)&alureInitDevice, "alureInitDevice"); 63 | bindFunc(cast(void**)&alureShutdownDevice, "alureShutdownDevice"); 64 | bindFunc(cast(void**)&alureGetSampleFormat, "alureGetSampleFormat"); 65 | bindFunc(cast(void**)&alureInstallDecodeCallbacks, "alureInstallDecodeCallbacks"); 66 | bindFunc(cast(void**)&alureSleep, "alureSleep"); 67 | bindFunc(cast(void**)&alureGetProcAddress, "alureGetProcAddress"); 68 | 69 | bindFunc(cast(void**)&alureCreateBufferFromFile, "alureCreateBufferFromFile"); 70 | bindFunc(cast(void**)&alureCreateBufferFromMemory, "alureCreateBufferFromMemory"); 71 | bindFunc(cast(void**)&alureBufferDataFromFile, "alureBufferDataFromFile"); 72 | bindFunc(cast(void**)&alureBufferDataFromMemory, "alureBufferDataFromMemory"); 73 | 74 | bindFunc(cast(void**)&alureStreamSizeIsMicroSec, "alureStreamSizeIsMicroSec"); 75 | bindFunc(cast(void**)&alureCreateStreamFromFile, "alureCreateStreamFromFile"); 76 | bindFunc(cast(void**)&alureCreateStreamFromMemory, "alureCreateStreamFromMemory"); 77 | bindFunc(cast(void**)&alureCreateStreamFromStaticMemory, "alureCreateStreamFromStaticMemory"); 78 | bindFunc(cast(void**)&alureCreateStreamFromCallback, "alureCreateStreamFromCallback"); 79 | bindFunc(cast(void**)&alureGetStreamFrequency, "alureGetStreamFrequency"); 80 | bindFunc(cast(void**)&alureBufferDataFromStream, "alureBufferDataFromStream"); 81 | bindFunc(cast(void**)&alureRewindStream, "alureRewindStream"); 82 | bindFunc(cast(void**)&alureSetStreamOrder, "alureSetStreamOrder"); 83 | bindFunc(cast(void**)&alureSetStreamPatchset, "alureSetStreamPatchset"); 84 | bindFunc(cast(void**)&alureGetStreamLength, "alureGetStreamLength"); 85 | bindFunc(cast(void**)&alureDestroyStream, "alureDestroyStream"); 86 | 87 | bindFunc(cast(void**)&alureSetIOCallbacks, "alureSetIOCallbacks"); 88 | 89 | bindFunc(cast(void**)&alurePlaySourceStream, "alurePlaySourceStream"); 90 | bindFunc(cast(void**)&alurePlaySource, "alurePlaySource"); 91 | bindFunc(cast(void**)&alureStopSource, "alureStopSource"); 92 | bindFunc(cast(void**)&alurePauseSource, "alurePauseSource"); 93 | bindFunc(cast(void**)&alureResumeSource, "alureResumeSource"); 94 | bindFunc(cast(void**)&alureUpdate, "alureUpdate"); 95 | bindFunc(cast(void**)&alureUpdateInterval, "alureUpdateInterval"); 96 | } 97 | } 98 | 99 | public 100 | { 101 | this() 102 | { 103 | super(libNames); 104 | } 105 | } 106 | } 107 | 108 | __gshared DerelictALURELoader DerelictALURE; 109 | 110 | shared static this() 111 | { 112 | DerelictALURE = new DerelictALURELoader(); 113 | } 114 | 115 | shared static ~this() 116 | { 117 | DerelictALURE.unload(); 118 | } 119 | -------------------------------------------------------------------------------- /import/derelict/alure/functions.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.alure.functions; 29 | 30 | private 31 | { 32 | import derelict.openal.types; 33 | import derelict.alure.types; 34 | } 35 | 36 | extern(C) nothrow 37 | { 38 | alias void* function(ALchar*) alureInstallDecodeCallbacks_open_file; 39 | alias void* function(ALubyte*, ALuint) alureInstallDecodeCallbacks_open_memory; 40 | alias ALboolean function(void*, ALenum*, ALuint*, ALuint*) alureInstallDecodeCallbacks_get_format; 41 | alias ALuint function(void*, ALubyte*, ALuint) alureInstallDecodeCallbacks_decode; 42 | alias ALboolean function(void*) alureInstallDecodeCallbacks_rewind; 43 | alias void function(void*) alureInstallDecodeCallbacks_close; 44 | 45 | alias ALuint function(void*, ALubyte*, ALuint) alureCreateStreamFromCallback_callback; 46 | 47 | alias void* function(char*, ALuint) alureSetIOCallbacks_open_callback; 48 | alias void function(char*) alureSetIOCallbacks_close_callback; 49 | alias ALsizei function(void*, ALubyte*, ALuint) alureSetIOCallbacks_read_callback; 50 | alias ALsizei function(void*, ALubyte*, ALuint) alureSetIOCallbacks_write_callback; 51 | alias alureInt64 function(void*, alureInt64, int) alureSetIOCallbacks_seek_callback; 52 | 53 | alias void function(void*, ALuint) alurePlaySourceStream_eos_callback; 54 | alias void function(void*, ALuint) alurePlaySource_callback; 55 | } 56 | 57 | extern(C) 58 | { 59 | alias nothrow void function(ALuint*, ALuint*) da_alureGetVersion; 60 | alias nothrow ALchar* function() da_alureGetErrorString; 61 | alias nothrow ALCchar** function(ALCboolean all, ALCsizei*) da_alureGetDeviceNames; 62 | alias nothrow void function(ALCchar**) da_alureFreeDeviceNames; 63 | alias nothrow ALCboolean function(ALCchar*, ALCint*) da_alureInitDevice; 64 | alias nothrow ALCboolean function() da_alureShutdownDevice; 65 | alias nothrow ALenum function(ALuint, ALuint, ALuint) da_alureGetSampleFormat; 66 | alias nothrow ALboolean function(ALint, 67 | alureInstallDecodeCallbacks_open_file, 68 | alureInstallDecodeCallbacks_open_memory, 69 | alureInstallDecodeCallbacks_get_format, 70 | alureInstallDecodeCallbacks_decode, 71 | alureInstallDecodeCallbacks_rewind, 72 | alureInstallDecodeCallbacks_close) da_alureInstallDecodeCallbacks; 73 | alias nothrow ALboolean function(ALfloat) da_alureSleep; 74 | alias nothrow void* function(ALchar*) da_alureGetProcAddress; 75 | 76 | alias nothrow ALuint function(ALchar*) da_alureCreateBufferFromFile; 77 | alias nothrow ALuint function(ALubyte*, ALsizei) da_alureCreateBufferFromMemory; 78 | alias nothrow ALboolean function(ALchar*, ALuint) da_alureBufferDataFromFile; 79 | alias nothrow ALboolean function(ALubyte*, ALsizei, ALuint) da_alureBufferDataFromMemory; 80 | 81 | alias nothrow ALboolean function(ALboolean) da_alureStreamSizeIsMicroSec; 82 | alias nothrow alureStream* function(ALchar*, ALsizei, ALsizei, ALuint*) da_alureCreateStreamFromFile; 83 | alias nothrow alureStream* function(ALubyte*, ALuint, ALsizei, ALsizei, ALuint*) da_alureCreateStreamFromMemory; 84 | alias nothrow alureStream* function(ALubyte*, ALuint, ALsizei, ALsizei, ALuint*) da_alureCreateStreamFromStaticMemory; 85 | alias nothrow alureStream* function(alureCreateStreamFromCallback_callback, 86 | void*, ALenum, ALuint, ALsizei, ALsizei, ALuint*) da_alureCreateStreamFromCallback; 87 | alias nothrow ALsizei function(alureStream*) da_alureGetStreamFrequency; 88 | alias nothrow ALsizei function(alureStream*, ALsizei, ALuint*) da_alureBufferDataFromStream; 89 | alias nothrow ALboolean function(alureStream*, ALsizei) da_alureRewindStream; 90 | alias nothrow ALboolean function(alureStream*, ALuint) da_alureSetStreamOrder; 91 | alias nothrow ALboolean function(alureStream*, ALchar*) da_alureSetStreamPatchset; 92 | alias nothrow alureInt64 function(alureStream*) da_alureGetStreamLength; 93 | alias nothrow ALboolean function(alureStream*, ALsizei, ALuint*) da_alureDestroyStream; 94 | 95 | alias nothrow ALboolean function(alureSetIOCallbacks_open_callback, 96 | alureSetIOCallbacks_close_callback, 97 | alureSetIOCallbacks_read_callback, 98 | alureSetIOCallbacks_write_callback, 99 | alureSetIOCallbacks_seek_callback) da_alureSetIOCallbacks; 100 | 101 | alias nothrow ALboolean function(ALuint, alureStream*, ALsizei, ALsizei, alurePlaySourceStream_eos_callback, void*) da_alurePlaySourceStream; 102 | alias nothrow ALboolean function(ALuint, alurePlaySource_callback, void*) da_alurePlaySource; 103 | alias nothrow ALboolean function(ALuint, ALboolean) da_alureStopSource; 104 | alias nothrow ALboolean function(ALuint) da_alurePauseSource; 105 | alias nothrow ALboolean function(ALuint) da_alureResumeSource; 106 | alias nothrow void function() da_alureUpdate; 107 | alias nothrow ALboolean function(ALfloat) da_alureUpdateInterval; 108 | } 109 | 110 | __gshared 111 | { 112 | da_alureGetVersion alureGetVersion; 113 | da_alureGetErrorString alureGetErrorString; 114 | da_alureGetDeviceNames alureGetDeviceNames; 115 | da_alureFreeDeviceNames alureFreeDeviceNames; 116 | da_alureInitDevice alureInitDevice; 117 | da_alureShutdownDevice alureShutdownDevice; 118 | da_alureGetSampleFormat alureGetSampleFormat; 119 | da_alureInstallDecodeCallbacks alureInstallDecodeCallbacks; 120 | da_alureSleep alureSleep; 121 | da_alureGetProcAddress alureGetProcAddress; 122 | 123 | da_alureCreateBufferFromFile alureCreateBufferFromFile; 124 | da_alureCreateBufferFromMemory alureCreateBufferFromMemory; 125 | da_alureBufferDataFromFile alureBufferDataFromFile; 126 | da_alureBufferDataFromMemory alureBufferDataFromMemory; 127 | 128 | da_alureStreamSizeIsMicroSec alureStreamSizeIsMicroSec ; 129 | da_alureCreateStreamFromFile alureCreateStreamFromFile; 130 | da_alureCreateStreamFromMemory alureCreateStreamFromMemory; 131 | da_alureCreateStreamFromStaticMemory alureCreateStreamFromStaticMemory; 132 | da_alureCreateStreamFromCallback alureCreateStreamFromCallback; 133 | da_alureGetStreamFrequency alureGetStreamFrequency; 134 | da_alureBufferDataFromStream alureBufferDataFromStream; 135 | da_alureRewindStream alureRewindStream; 136 | da_alureSetStreamOrder alureSetStreamOrder; 137 | da_alureSetStreamPatchset alureSetStreamPatchset; 138 | da_alureGetStreamLength alureGetStreamLength; 139 | da_alureDestroyStream alureDestroyStream; 140 | 141 | da_alureSetIOCallbacks alureSetIOCallbacks; 142 | 143 | da_alurePlaySourceStream alurePlaySourceStream; 144 | da_alurePlaySource alurePlaySource; 145 | da_alureStopSource alureStopSource; 146 | da_alurePauseSource alurePauseSource; 147 | da_alureResumeSource alureResumeSource; 148 | da_alureUpdate alureUpdate; 149 | da_alureUpdateInterval alureUpdateInterval; 150 | } 151 | -------------------------------------------------------------------------------- /import/derelict/alure/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.alure.types; 29 | 30 | // alure 31 | enum : bool 32 | { 33 | ALURE_VERSION_1_2 = true, 34 | } 35 | 36 | alias long alureInt64; 37 | 38 | struct alureStream {} 39 | -------------------------------------------------------------------------------- /import/derelict/assimp/assimp.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.assimp.assimp; 29 | 30 | public 31 | { 32 | import derelict.assimp.types; 33 | import derelict.assimp.functions; 34 | } 35 | 36 | private 37 | { 38 | import derelict.util.loader; 39 | import derelict.util.system; 40 | 41 | static if(Derelict_OS_Windows) 42 | { 43 | static if (size_t.sizeof == 4) 44 | enum libNames = "assimp.dll, Assimp32.dll"; 45 | else static if (size_t.sizeof == 8) 46 | enum libNames = "assimp.dll, Assimp64.dll"; 47 | else 48 | static assert(0); 49 | } 50 | else static if(Derelict_OS_Mac) 51 | enum libNames = "libassimp.dylib"; 52 | else static if(Derelict_OS_Posix) 53 | enum libNames = "libassimp.so, libassimp.so.2, libassimp.so.2.0.0"; 54 | else 55 | static assert(0, "Need to implement ASSIMP libNames for this operating system."); 56 | } 57 | 58 | class DerelictASSIMPLoader : SharedLibLoader 59 | { 60 | 61 | protected 62 | { 63 | override void loadSymbols() 64 | { 65 | bindFunc(cast(void**)&aiImportFile, "aiImportFile"); 66 | bindFunc(cast(void**)&aiImportFileEx, "aiImportFileEx"); 67 | bindFunc(cast(void**)&aiImportFileFromMemory, "aiImportFileFromMemory"); 68 | bindFunc(cast(void**)&aiApplyPostProcessing, "aiApplyPostProcessing"); 69 | bindFunc(cast(void**)&aiGetPredefinedLogStream, "aiGetPredefinedLogStream"); 70 | bindFunc(cast(void**)&aiAttachLogStream, "aiAttachLogStream"); 71 | bindFunc(cast(void**)&aiEnableVerboseLogging, "aiEnableVerboseLogging"); 72 | bindFunc(cast(void**)&aiDetachLogStream, "aiDetachLogStream"); 73 | bindFunc(cast(void**)&aiDetachAllLogStreams, "aiDetachAllLogStreams"); 74 | bindFunc(cast(void**)&aiReleaseImport, "aiReleaseImport"); 75 | bindFunc(cast(void**)&aiGetErrorString, "aiGetErrorString"); 76 | bindFunc(cast(void**)&aiIsExtensionSupported, "aiIsExtensionSupported"); 77 | bindFunc(cast(void**)&aiGetExtensionList, "aiGetExtensionList"); 78 | bindFunc(cast(void**)&aiGetMemoryRequirements, "aiGetMemoryRequirements"); 79 | bindFunc(cast(void**)&aiSetImportPropertyInteger, "aiSetImportPropertyInteger"); 80 | bindFunc(cast(void**)&aiSetImportPropertyFloat, "aiSetImportPropertyFloat"); 81 | bindFunc(cast(void**)&aiSetImportPropertyString, "aiSetImportPropertyString"); 82 | bindFunc(cast(void**)&aiCreateQuaternionFromMatrix, "aiCreateQuaternionFromMatrix"); 83 | bindFunc(cast(void**)&aiDecomposeMatrix, "aiDecomposeMatrix"); 84 | bindFunc(cast(void**)&aiTransposeMatrix4, "aiTransposeMatrix4"); 85 | bindFunc(cast(void**)&aiTransposeMatrix3, "aiTransposeMatrix3"); 86 | bindFunc(cast(void**)&aiTransformVecByMatrix3, "aiTransformVecByMatrix3"); 87 | bindFunc(cast(void**)&aiTransformVecByMatrix4, "aiTransformVecByMatrix4"); 88 | bindFunc(cast(void**)&aiMultiplyMatrix4, "aiMultiplyMatrix4"); 89 | bindFunc(cast(void**)&aiMultiplyMatrix3, "aiMultiplyMatrix3"); 90 | bindFunc(cast(void**)&aiIdentityMatrix3, "aiIdentityMatrix3"); 91 | bindFunc(cast(void**)&aiIdentityMatrix4, "aiIdentityMatrix4"); 92 | bindFunc(cast(void**)&aiGetLegalString, "aiGetLegalString"); 93 | bindFunc(cast(void**)&aiGetVersionMinor, "aiGetVersionMinor"); 94 | bindFunc(cast(void**)&aiGetVersionMajor, "aiGetVersionMajor"); 95 | bindFunc(cast(void**)&aiGetVersionRevision, "aiGetVersionRevision"); 96 | bindFunc(cast(void**)&aiGetCompileFlags, "aiGetCompileFlags"); 97 | } 98 | } 99 | 100 | public 101 | { 102 | this() 103 | { 104 | super(libNames); 105 | } 106 | } 107 | } 108 | 109 | __gshared DerelictASSIMPLoader DerelictASSIMP; 110 | 111 | shared static this() 112 | { 113 | DerelictASSIMP = new DerelictASSIMPLoader(); 114 | } 115 | 116 | shared static ~this() 117 | { 118 | DerelictASSIMP.unload(); 119 | } 120 | -------------------------------------------------------------------------------- /import/derelict/assimp/functions.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.assimp.functions; 29 | 30 | private 31 | { 32 | import derelict.assimp.types; 33 | } 34 | 35 | extern(C) 36 | { 37 | alias nothrow const(aiScene)* function(const(char)*, uint) da_aiImportFile; 38 | alias nothrow const(aiScene)* function(const(char)*, uint, aiFileIO*) da_aiImportFileEx; 39 | alias nothrow const(aiScene)* function(const(char)*, uint, uint, const(char)*) da_aiImportFileFromMemory; 40 | alias nothrow const(aiScene)* function(const(aiScene)*, uint) da_aiApplyPostProcessing; 41 | alias nothrow aiLogStream function(aiDefaultLogStream, const(char)*) da_aiGetPredefinedLogStream; 42 | alias nothrow void function(const(aiLogStream)*) da_aiAttachLogStream; 43 | alias nothrow void function(aiBool) da_aiEnableVerboseLogging; 44 | alias nothrow aiReturn function(const(aiLogStream)*) da_aiDetachLogStream; 45 | alias nothrow void function() da_aiDetachAllLogStreams; 46 | alias nothrow void function(const(aiScene)*) da_aiReleaseImport; 47 | alias nothrow const(char)* function() da_aiGetErrorString; 48 | alias nothrow aiBool function(const(char)*) da_aiIsExtensionSupported; 49 | alias nothrow void function(aiString*) da_aiGetExtensionList; 50 | alias nothrow void function(const(aiScene)*, aiMemoryInfo*) da_aiGetMemoryRequirements; 51 | alias nothrow void function(const(char)*, int) da_aiSetImportPropertyInteger; 52 | alias nothrow void function(const(char)*, float) da_aiSetImportPropertyFloat; 53 | alias nothrow void function(const(char)*, const(aiString)*) da_aiSetImportPropertyString; 54 | alias nothrow void function(aiQuaternion*, const(aiMatrix3x3)*) da_aiCreateQuaternionFromMatrix; 55 | alias nothrow void function(const aiMatrix4x4*, aiVector3D*, aiQuaternion*, aiVector3D*) da_aiDecomposeMatrix; 56 | alias nothrow void function(aiMatrix4x4*) da_aiTransposeMatrix4; 57 | alias nothrow void function(aiMatrix3x3*) da_aiTransposeMatrix3; 58 | alias nothrow void function(aiVector3D*, const(aiMatrix3x3)*) da_aiTransformVecByMatrix3; 59 | alias nothrow void function(aiVector3D*, const(aiMatrix4x4)*) da_aiTransformVecByMatrix4; 60 | alias nothrow void function(aiMatrix4x4*) da_aiMultiplyMatrix4; 61 | alias nothrow void function(aiMatrix3x3*) da_aiMultiplyMatrix3; 62 | alias nothrow void function(aiMatrix3x3*) da_aiIdentityMatrix3; 63 | alias nothrow void function(aiMatrix4x4*) da_aiIdentityMatrix4; 64 | alias nothrow const(char)* function() da_aiGetLegalString; 65 | alias nothrow uint function() da_aiGetVersionMinor; 66 | alias nothrow uint function() da_aiGetVersionMajor; 67 | alias nothrow uint function() da_aiGetVersionRevision; 68 | alias nothrow uint function() da_aiGetCompileFlags; 69 | } 70 | 71 | __gshared 72 | { 73 | da_aiImportFile aiImportFile; 74 | da_aiImportFileEx aiImportFileEx; 75 | da_aiImportFileFromMemory aiImportFileFromMemory; 76 | da_aiApplyPostProcessing aiApplyPostProcessing; 77 | da_aiGetPredefinedLogStream aiGetPredefinedLogStream; 78 | da_aiAttachLogStream aiAttachLogStream; 79 | da_aiEnableVerboseLogging aiEnableVerboseLogging; 80 | da_aiDetachLogStream aiDetachLogStream; 81 | da_aiDetachAllLogStreams aiDetachAllLogStreams; 82 | da_aiReleaseImport aiReleaseImport; 83 | da_aiGetErrorString aiGetErrorString; 84 | da_aiIsExtensionSupported aiIsExtensionSupported; 85 | da_aiGetExtensionList aiGetExtensionList; 86 | da_aiGetMemoryRequirements aiGetMemoryRequirements; 87 | da_aiSetImportPropertyInteger aiSetImportPropertyInteger; 88 | da_aiSetImportPropertyFloat aiSetImportPropertyFloat; 89 | da_aiSetImportPropertyString aiSetImportPropertyString; 90 | da_aiCreateQuaternionFromMatrix aiCreateQuaternionFromMatrix; 91 | da_aiDecomposeMatrix aiDecomposeMatrix; 92 | da_aiTransposeMatrix4 aiTransposeMatrix4; 93 | da_aiTransposeMatrix3 aiTransposeMatrix3; 94 | da_aiTransformVecByMatrix3 aiTransformVecByMatrix3; 95 | da_aiTransformVecByMatrix4 aiTransformVecByMatrix4; 96 | da_aiMultiplyMatrix4 aiMultiplyMatrix4; 97 | da_aiMultiplyMatrix3 aiMultiplyMatrix3; 98 | da_aiIdentityMatrix3 aiIdentityMatrix3; 99 | da_aiIdentityMatrix4 aiIdentityMatrix4; 100 | da_aiGetLegalString aiGetLegalString; 101 | da_aiGetVersionMinor aiGetVersionMinor; 102 | da_aiGetVersionMajor aiGetVersionMajor; 103 | da_aiGetVersionRevision aiGetVersionRevision; 104 | da_aiGetCompileFlags aiGetCompileFlags; 105 | } 106 | -------------------------------------------------------------------------------- /import/derelict/assimp3/assimp.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.assimp3.assimp; 29 | 30 | public { 31 | import derelict.assimp3.types; 32 | import derelict.assimp3.functions; 33 | } 34 | 35 | private { 36 | import derelict.util.loader; 37 | import derelict.util.system; 38 | 39 | static if(Derelict_OS_Windows) { 40 | static if (size_t.sizeof == 4) 41 | enum libNames = "assimp.dll, Assimp32.dll"; 42 | else static if (size_t.sizeof == 8) 43 | enum libNames = "assimp.dll, Assimp64.dll"; 44 | else 45 | static assert(0); 46 | } 47 | else static if(Derelict_OS_Mac) 48 | enum libNames = "libassimp.3.dylib"; 49 | else static if(Derelict_OS_Posix) 50 | enum libNames = "libassimp.so.3, libassimp.so.3.0.0"; 51 | else 52 | static assert(0, "Need to implement ASSIMP3 libNames for this operating system."); 53 | } 54 | 55 | class DerelictASSIMP3Loader : SharedLibLoader { 56 | protected override void loadSymbols() { 57 | bindFunc(cast(void**)&aiGetExportFormatCount, "aiGetExportFormatCount"); 58 | bindFunc(cast(void**)&aiGetExportFormatDescription, "aiGetExportFormatDescription"); 59 | bindFunc(cast(void**)&aiCopyScene, "aiCopyScene"); 60 | bindFunc(cast(void**)&aiExportScene, "aiExportScene"); 61 | bindFunc(cast(void**)&aiExportSceneEx, "aiExportSceneEx"); 62 | bindFunc(cast(void**)&aiExportSceneToBlob, "aiExportSceneToBlob"); 63 | bindFunc(cast(void**)&aiReleaseExportBlob, "aiReleaseExportBlob"); 64 | bindFunc(cast(void**)&aiImportFile, "aiImportFile"); 65 | bindFunc(cast(void**)&aiImportFileEx, "aiImportFileEx"); 66 | bindFunc(cast(void**)&aiImportFileExWithProperties, "aiImportFileExWithProperties"); 67 | bindFunc(cast(void**)&aiImportFileFromMemory, "aiImportFileFromMemory"); 68 | bindFunc(cast(void**)&aiImportFileFromMemoryWithProperties, "aiImportFileFromMemoryWithProperties"); 69 | bindFunc(cast(void**)&aiApplyPostProcessing, "aiApplyPostProcessing"); 70 | bindFunc(cast(void**)&aiGetPredefinedLogStream, "aiGetPredefinedLogStream"); 71 | bindFunc(cast(void**)&aiAttachLogStream, "aiAttachLogStream"); 72 | bindFunc(cast(void**)&aiEnableVerboseLogging, "aiEnableVerboseLogging"); 73 | bindFunc(cast(void**)&aiDetachLogStream, "aiDetachLogStream"); 74 | bindFunc(cast(void**)&aiDetachAllLogStreams, "aiDetachAllLogStreams"); 75 | bindFunc(cast(void**)&aiReleaseImport, "aiReleaseImport"); 76 | bindFunc(cast(void**)&aiGetErrorString, "aiGetErrorString"); 77 | bindFunc(cast(void**)&aiIsExtensionSupported, "aiIsExtensionSupported"); 78 | bindFunc(cast(void**)&aiGetExtensionList, "aiGetExtensionList"); 79 | bindFunc(cast(void**)&aiGetMemoryRequirements, "aiGetMemoryRequirements"); 80 | bindFunc(cast(void**)&aiCreatePropertyStore, "aiCreatePropertyStore"); 81 | bindFunc(cast(void**)&aiReleasePropertyStore, "aiReleasePropertyStore"); 82 | bindFunc(cast(void**)&aiSetImportPropertyInteger, "aiSetImportPropertyInteger"); 83 | bindFunc(cast(void**)&aiSetImportPropertyFloat, "aiSetImportPropertyFloat"); 84 | bindFunc(cast(void**)&aiSetImportPropertyString, "aiSetImportPropertyString"); 85 | bindFunc(cast(void**)&aiCreateQuaternionFromMatrix, "aiCreateQuaternionFromMatrix"); 86 | bindFunc(cast(void**)&aiDecomposeMatrix, "aiDecomposeMatrix"); 87 | bindFunc(cast(void**)&aiTransposeMatrix4, "aiTransposeMatrix4"); 88 | bindFunc(cast(void**)&aiTransposeMatrix3, "aiTransposeMatrix3"); 89 | bindFunc(cast(void**)&aiTransformVecByMatrix3, "aiTransformVecByMatrix3"); 90 | bindFunc(cast(void**)&aiTransformVecByMatrix4, "aiTransformVecByMatrix4"); 91 | bindFunc(cast(void**)&aiMultiplyMatrix4, "aiMultiplyMatrix4"); 92 | bindFunc(cast(void**)&aiMultiplyMatrix3, "aiMultiplyMatrix3"); 93 | bindFunc(cast(void**)&aiIdentityMatrix3, "aiIdentityMatrix3"); 94 | bindFunc(cast(void**)&aiIdentityMatrix4, "aiIdentityMatrix4"); 95 | bindFunc(cast(void**)&aiGetMaterialProperty, "aiGetMaterialProperty"); 96 | bindFunc(cast(void**)&aiGetMaterialFloatArray, "aiGetMaterialFloatArray"); 97 | bindFunc(cast(void**)&aiGetMaterialIntegerArray, "aiGetMaterialIntegerArray"); 98 | bindFunc(cast(void**)&aiGetMaterialColor, "aiGetMaterialColor"); 99 | bindFunc(cast(void**)&aiGetMaterialString, "aiGetMaterialString"); 100 | bindFunc(cast(void**)&aiGetMaterialTextureCount, "aiGetMaterialTextureCount"); 101 | bindFunc(cast(void**)&aiGetMaterialTexture, "aiGetMaterialTexture"); 102 | bindFunc(cast(void**)&aiGetLegalString, "aiGetLegalString"); 103 | bindFunc(cast(void**)&aiGetVersionMinor, "aiGetVersionMinor"); 104 | bindFunc(cast(void**)&aiGetVersionMajor, "aiGetVersionMajor"); 105 | bindFunc(cast(void**)&aiGetVersionRevision, "aiGetVersionRevision"); 106 | bindFunc(cast(void**)&aiGetCompileFlags, "aiGetCompileFlags"); 107 | } 108 | 109 | public this() { 110 | super( libNames ); 111 | } 112 | } 113 | 114 | __gshared DerelictASSIMP3Loader DerelictASSIMP3; 115 | 116 | shared static this() { 117 | DerelictASSIMP3 = new DerelictASSIMP3Loader; 118 | } 119 | 120 | shared static ~this() { 121 | DerelictASSIMP3.unload(); 122 | } 123 | -------------------------------------------------------------------------------- /import/derelict/devil/il.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.devil.il; 29 | 30 | public 31 | { 32 | import derelict.devil.types; 33 | import derelict.devil.functions; 34 | } 35 | 36 | private 37 | { 38 | import derelict.util.loader; 39 | import derelict.util.system; 40 | 41 | static if(Derelict_OS_Windows) 42 | enum libNames = "devil.dll"; 43 | else static if (Derelict_OS_Mac) 44 | enum libNames = "libIL.dylib"; 45 | else static if(Derelict_OS_Posix) 46 | enum libNames = "libIL.so"; 47 | else 48 | static assert(0, "Need to implement DevIL libNames for this operating system."); 49 | } 50 | 51 | class DerelictILLoader : SharedLibLoader 52 | { 53 | 54 | protected 55 | { 56 | override void loadSymbols() 57 | { 58 | bindFunc(cast(void**)&ilActiveImage, "ilActiveImage"); 59 | bindFunc(cast(void**)&ilActiveLayer, "ilActiveLayer"); 60 | bindFunc(cast(void**)&ilActiveMipmap, "ilActiveMipmap"); 61 | bindFunc(cast(void**)&ilApplyPal, "ilApplyPal"); 62 | bindFunc(cast(void**)&ilApplyProfile, "ilApplyProfile"); 63 | bindFunc(cast(void**)&ilBindImage, "ilBindImage"); 64 | bindFunc(cast(void**)&ilBlit, "ilBlit"); 65 | bindFunc(cast(void**)&ilClearColour, "ilClearColour"); 66 | bindFunc(cast(void**)&ilClearImage, "ilClearImage"); 67 | bindFunc(cast(void**)&ilCloneCurImage, "ilCloneCurImage"); 68 | bindFunc(cast(void**)&ilCompressFunc, "ilCompressFunc"); 69 | bindFunc(cast(void**)&ilConvertImage, "ilConvertImage"); 70 | bindFunc(cast(void**)&ilConvertPal, "ilConvertPal"); 71 | bindFunc(cast(void**)&ilCopyImage, "ilCopyImage"); 72 | bindFunc(cast(void**)&ilCopyPixels, "ilCopyPixels"); 73 | bindFunc(cast(void**)&ilCreateSubImage, "ilCreateSubImage"); 74 | bindFunc(cast(void**)&ilDefaultImage, "ilDefaultImage"); 75 | bindFunc(cast(void**)&ilDeleteImage, "ilDeleteImage"); 76 | bindFunc(cast(void**)&ilDeleteImages, "ilDeleteImages"); 77 | bindFunc(cast(void**)&ilDisable, "ilDisable"); 78 | bindFunc(cast(void**)&ilEnable, "ilEnable"); 79 | bindFunc(cast(void**)&ilFormatFunc, "ilFormatFunc"); 80 | bindFunc(cast(void**)&ilGenImages, "ilGenImages"); 81 | bindFunc(cast(void**)&ilGenImage, "ilGenImage"); 82 | bindFunc(cast(void**)&ilGetAlpha, "ilGetAlpha"); 83 | bindFunc(cast(void**)&ilGetBoolean, "ilGetBoolean"); 84 | bindFunc(cast(void**)&ilGetBooleanv, "ilGetBooleanv"); 85 | bindFunc(cast(void**)&ilGetData, "ilGetData"); 86 | bindFunc(cast(void**)&ilGetDXTCData, "ilGetDXTCData"); 87 | bindFunc(cast(void**)&ilGetError, "ilGetError"); 88 | bindFunc(cast(void**)&ilGetInteger, "ilGetInteger"); 89 | bindFunc(cast(void**)&ilGetIntegerv, "ilGetIntegerv"); 90 | bindFunc(cast(void**)&ilGetLumpPos, "ilGetLumpPos"); 91 | bindFunc(cast(void**)&ilGetPalette, "ilGetPalette"); 92 | bindFunc(cast(void**)&ilGetString, "ilGetString"); 93 | bindFunc(cast(void**)&ilHint, "ilHint"); 94 | bindFunc(cast(void**)&ilInit, "ilInit"); 95 | bindFunc(cast(void**)&ilIsDisabled, "ilIsDisabled"); 96 | bindFunc(cast(void**)&ilIsEnabled, "ilIsEnabled"); 97 | bindFunc(cast(void**)&ilDetermineTypeF, "ilDetermineTypeF"); 98 | bindFunc(cast(void**)&ilIsImage, "ilIsImage"); 99 | bindFunc(cast(void**)&ilIsValid, "ilIsValid"); 100 | bindFunc(cast(void**)&ilIsValidF, "ilIsValidF"); 101 | bindFunc(cast(void**)&ilIsValidL, "ilIsValidL"); 102 | bindFunc(cast(void**)&ilKeyColour, "ilKeyColour"); 103 | bindFunc(cast(void**)&ilLoad, "ilLoad"); 104 | bindFunc(cast(void**)&ilLoadF, "ilLoadF"); 105 | bindFunc(cast(void**)&ilLoadImage, "ilLoadImage"); 106 | bindFunc(cast(void**)&ilLoadL, "ilLoadL"); 107 | bindFunc(cast(void**)&ilLoadPal, "ilLoadPal"); 108 | bindFunc(cast(void**)&ilModAlpha, "ilModAlpha"); 109 | bindFunc(cast(void**)&ilOriginFunc, "ilOriginFunc"); 110 | bindFunc(cast(void**)&ilOverlayImage, "ilOverlayImage"); 111 | bindFunc(cast(void**)&ilPopAttrib, "ilPopAttrib"); 112 | bindFunc(cast(void**)&ilPushAttrib, "ilPushAttrib"); 113 | bindFunc(cast(void**)&ilRegisterFormat, "ilRegisterFormat"); 114 | bindFunc(cast(void**)&ilRegisterLoad, "ilRegisterLoad"); 115 | bindFunc(cast(void**)&ilRegisterMipNum, "ilRegisterMipNum"); 116 | bindFunc(cast(void**)&ilRegisterNumImages, "ilRegisterNumImages"); 117 | bindFunc(cast(void**)&ilRegisterOrigin, "ilRegisterOrigin"); 118 | bindFunc(cast(void**)&ilRegisterPal, "ilRegisterPal"); 119 | bindFunc(cast(void**)&ilRegisterSave, "ilRegisterSave"); 120 | bindFunc(cast(void**)&ilRegisterType, "ilRegisterType"); 121 | bindFunc(cast(void**)&ilRemoveLoad, "ilRemoveLoad"); 122 | bindFunc(cast(void**)&ilRemoveSave, "ilRemoveSave"); 123 | bindFunc(cast(void**)&ilResetRead, "ilResetRead"); 124 | bindFunc(cast(void**)&ilResetWrite, "ilResetWrite"); 125 | bindFunc(cast(void**)&ilSave, "ilSave"); 126 | bindFunc(cast(void**)&ilSaveF, "ilSaveF"); 127 | bindFunc(cast(void**)&ilSaveImage, "ilSaveImage"); 128 | bindFunc(cast(void**)&ilSaveL, "ilSaveL"); 129 | bindFunc(cast(void**)&ilSavePal, "ilSavePal"); 130 | bindFunc(cast(void**)&ilSetAlpha, "ilSetAlpha"); 131 | bindFunc(cast(void**)&ilSetData, "ilSetData"); 132 | bindFunc(cast(void**)&ilSetDuration, "ilSetDuration"); 133 | bindFunc(cast(void**)&ilSetInteger, "ilSetInteger"); 134 | bindFunc(cast(void**)&ilSetMemory, "ilSetMemory"); 135 | bindFunc(cast(void**)&ilSetPixels, "ilSetPixels"); 136 | bindFunc(cast(void**)&ilSetRead, "ilSetRead"); 137 | bindFunc(cast(void**)&ilSetString, "ilSetString"); 138 | bindFunc(cast(void**)&ilSetWrite, "ilSetWrite"); 139 | bindFunc(cast(void**)&ilShutDown, "ilShutDown"); 140 | bindFunc(cast(void**)&ilTexImage, "ilTexImage"); 141 | bindFunc(cast(void**)&ilTypeFromExt, "ilTypeFromExt"); 142 | bindFunc(cast(void**)&ilTypeFunc, "ilTypeFunc"); 143 | bindFunc(cast(void**)&ilLoadData, "ilLoadData"); 144 | bindFunc(cast(void**)&ilLoadDataF, "ilLoadDataF"); 145 | bindFunc(cast(void**)&ilLoadDataL, "ilLoadDataL"); 146 | bindFunc(cast(void**)&ilSaveData, "ilSaveData"); 147 | } 148 | } 149 | 150 | public 151 | { 152 | this() 153 | { 154 | super(libNames); 155 | } 156 | } 157 | } 158 | 159 | __gshared DerelictILLoader DerelictIL; 160 | 161 | shared static this() 162 | { 163 | DerelictIL = new DerelictILLoader(); 164 | } 165 | 166 | shared static ~this() 167 | { 168 | DerelictIL.unload(); 169 | } 170 | -------------------------------------------------------------------------------- /import/derelict/glfw3/glfw3.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.glfw3.glfw3; 29 | 30 | public 31 | { 32 | import derelict.glfw3.types; 33 | import derelict.glfw3.functions; 34 | } 35 | 36 | private 37 | { 38 | import derelict.util.loader; 39 | import derelict.util.system; 40 | 41 | static if(Derelict_OS_Windows) 42 | enum libNames = "glfw3.dll"; 43 | else static if(Derelict_OS_Mac) 44 | enum libNames = "libglfw.3.dylib"; 45 | else static if(Derelict_OS_Posix) 46 | enum libNames = "libglfw3.so,libglfw.so.3,/usr/local/lib/libglfw3.so,/usr/local/lib/libglfw.so.3"; 47 | else 48 | static assert(0, "Need to implement GLFW libNames for this operating system."); 49 | } 50 | 51 | class DerelictGLFW3Loader : SharedLibLoader 52 | { 53 | protected 54 | { 55 | override void loadSymbols() 56 | { 57 | bindFunc(cast(void**)&glfwInit, "glfwInit"); 58 | bindFunc(cast(void**)&glfwTerminate, "glfwTerminate"); 59 | bindFunc(cast(void**)&glfwGetVersion, "glfwGetVersion"); 60 | bindFunc(cast(void**)&glfwGetVersionString, "glfwGetVersionString"); 61 | bindFunc(cast(void**)&glfwSetErrorCallback, "glfwSetErrorCallback"); 62 | bindFunc(cast(void**)&glfwGetMonitors, "glfwGetMonitors"); 63 | bindFunc(cast(void**)&glfwGetPrimaryMonitor, "glfwGetPrimaryMonitor"); 64 | bindFunc(cast(void**)&glfwGetMonitorPos, "glfwGetMonitorPos"); 65 | bindFunc(cast(void**)&glfwGetMonitorPhysicalSize, "glfwGetMonitorPhysicalSize"); 66 | bindFunc(cast(void**)&glfwGetMonitorName, "glfwGetMonitorName"); 67 | bindFunc(cast(void**)&glfwSetMonitorCallback, "glfwSetMonitorCallback"); 68 | bindFunc(cast(void**)&glfwGetVideoModes, "glfwGetVideoModes"); 69 | bindFunc(cast(void**)&glfwGetVideoMode, "glfwGetVideoMode"); 70 | bindFunc(cast(void**)&glfwSetGamma, "glfwSetGamma"); 71 | bindFunc(cast(void**)&glfwGetGammaRamp, "glfwGetGammaRamp"); 72 | bindFunc(cast(void**)&glfwSetGammaRamp, "glfwSetGammaRamp"); 73 | bindFunc(cast(void**)&glfwDefaultWindowHints, "glfwDefaultWindowHints"); 74 | bindFunc(cast(void**)&glfwWindowHint, "glfwWindowHint"); 75 | bindFunc(cast(void**)&glfwCreateWindow, "glfwCreateWindow"); 76 | bindFunc(cast(void**)&glfwDestroyWindow, "glfwDestroyWindow"); 77 | bindFunc(cast(void**)&glfwWindowShouldClose, "glfwWindowShouldClose"); 78 | bindFunc(cast(void**)&glfwSetWindowShouldClose, "glfwSetWindowShouldClose"); 79 | bindFunc(cast(void**)&glfwSetWindowTitle, "glfwSetWindowTitle"); 80 | bindFunc(cast(void**)&glfwGetWindowPos, "glfwGetWindowPos"); 81 | bindFunc(cast(void**)&glfwSetWindowPos, "glfwSetWindowPos"); 82 | bindFunc(cast(void**)&glfwGetWindowSize, "glfwGetWindowSize"); 83 | bindFunc(cast(void**)&glfwSetWindowSize, "glfwSetWindowSize"); 84 | bindFunc(cast(void**)&glfwGetFramebufferSize, "glfwGetFramebufferSize"); 85 | bindFunc(cast(void**)&glfwIconifyWindow, "glfwIconifyWindow"); 86 | bindFunc(cast(void**)&glfwRestoreWindow, "glfwRestoreWindow"); 87 | bindFunc(cast(void**)&glfwShowWindow, "glfwShowWindow"); 88 | bindFunc(cast(void**)&glfwHideWindow, "glfwHideWindow"); 89 | bindFunc(cast(void**)&glfwGetWindowMonitor, "glfwGetWindowMonitor"); 90 | bindFunc(cast(void**)&glfwGetWindowAttrib, "glfwGetWindowAttrib"); 91 | bindFunc(cast(void**)&glfwSetWindowUserPointer, "glfwSetWindowUserPointer"); 92 | bindFunc(cast(void**)&glfwGetWindowUserPointer, "glfwGetWindowUserPointer"); 93 | bindFunc(cast(void**)&glfwSetWindowPosCallback, "glfwSetWindowPosCallback"); 94 | bindFunc(cast(void**)&glfwSetWindowSizeCallback, "glfwSetWindowSizeCallback"); 95 | bindFunc(cast(void**)&glfwSetWindowCloseCallback, "glfwSetWindowCloseCallback"); 96 | bindFunc(cast(void**)&glfwSetWindowRefreshCallback, "glfwSetWindowRefreshCallback"); 97 | bindFunc(cast(void**)&glfwSetWindowFocusCallback, "glfwSetWindowFocusCallback"); 98 | bindFunc(cast(void**)&glfwSetWindowIconifyCallback, "glfwSetWindowIconifyCallback"); 99 | bindFunc(cast(void**)&glfwSetFramebufferSizeCallback, "glfwSetFramebufferSizeCallback"); 100 | bindFunc(cast(void**)&glfwPollEvents, "glfwPollEvents"); 101 | bindFunc(cast(void**)&glfwWaitEvents, "glfwWaitEvents"); 102 | bindFunc(cast(void**)&glfwGetInputMode, "glfwGetInputMode"); 103 | bindFunc(cast(void**)&glfwSetInputMode, "glfwSetInputMode"); 104 | bindFunc(cast(void**)&glfwGetKey, "glfwGetKey"); 105 | bindFunc(cast(void**)&glfwGetMouseButton, "glfwGetMouseButton"); 106 | bindFunc(cast(void**)&glfwGetCursorPos, "glfwGetCursorPos"); 107 | bindFunc(cast(void**)&glfwSetCursorPos, "glfwSetCursorPos"); 108 | bindFunc(cast(void**)&glfwSetKeyCallback, "glfwSetKeyCallback"); 109 | bindFunc(cast(void**)&glfwSetCharCallback, "glfwSetCharCallback"); 110 | bindFunc(cast(void**)&glfwSetMouseButtonCallback, "glfwSetMouseButtonCallback"); 111 | bindFunc(cast(void**)&glfwSetCursorPosCallback, "glfwSetCursorPosCallback"); 112 | bindFunc(cast(void**)&glfwSetScrollCallback, "glfwSetScrollCallback"); 113 | bindFunc(cast(void**)&glfwSetCursorEnterCallback, "glfwSetCursorEnterCallback"); 114 | bindFunc(cast(void**)&glfwJoystickPresent, "glfwJoystickPresent"); 115 | bindFunc(cast(void**)&glfwGetJoystickAxes, "glfwGetJoystickAxes"); 116 | bindFunc(cast(void**)&glfwGetJoystickButtons, "glfwGetJoystickButtons"); 117 | bindFunc(cast(void**)&glfwGetJoystickName, "glfwGetJoystickName"); 118 | bindFunc(cast(void**)&glfwSetClipboardString, "glfwSetClipboardString"); 119 | bindFunc(cast(void**)&glfwGetClipboardString, "glfwGetClipboardString"); 120 | bindFunc(cast(void**)&glfwGetTime, "glfwGetTime"); 121 | bindFunc(cast(void**)&glfwSetTime, "glfwSetTime"); 122 | bindFunc(cast(void**)&glfwMakeContextCurrent, "glfwMakeContextCurrent"); 123 | bindFunc(cast(void**)&glfwGetCurrentContext, "glfwGetCurrentContext"); 124 | bindFunc(cast(void**)&glfwSwapBuffers, "glfwSwapBuffers"); 125 | bindFunc(cast(void**)&glfwSwapInterval, "glfwSwapInterval"); 126 | bindFunc(cast(void**)&glfwExtensionSupported, "glfwExtensionSupported"); 127 | bindFunc(cast(void**)&glfwGetProcAddress, "glfwGetProcAddress"); 128 | } 129 | } 130 | public 131 | { 132 | this() 133 | { 134 | super(libNames); 135 | } 136 | } 137 | } 138 | 139 | __gshared DerelictGLFW3Loader DerelictGLFW3; 140 | 141 | shared static this() 142 | { 143 | DerelictGLFW3 = new DerelictGLFW3Loader(); 144 | } 145 | 146 | shared static ~this() 147 | { 148 | DerelictGLFW3.unload(); 149 | } 150 | -------------------------------------------------------------------------------- /import/derelict/lua/macros.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.lua.macros; 29 | private { 30 | import derelict.lua.functions; 31 | import derelict.lua.types; 32 | } 33 | //lua.h 34 | void lua_call(lua_State* L, int nargs, int nresults) { 35 | lua_callk(L, nargs, nresults, 0, null); 36 | } 37 | int lua_pcall(lua_State* L, int nargs, int nresults, int errfunc) { 38 | return lua_pcallk(L, nargs, nresults, errfunc, 0, null); 39 | } 40 | int lua_yield(lua_State* L, int nresults) { 41 | return lua_yieldk(L, nresults, 0, null); 42 | } 43 | 44 | lua_Number lua_tonumber(lua_State* L, int i) { 45 | return lua_tonumberx(L, i, null); 46 | } 47 | lua_Integer lua_tointeger(lua_State* L, int i) { 48 | return lua_tointegerx(L, i, null); 49 | } 50 | lua_Unsigned lua_tounsigned(lua_State* L, int i) { 51 | return lua_tounsignedx(L, i, null); 52 | } 53 | 54 | void lua_pop(lua_State* L, int idx) { 55 | lua_settop(L, (-idx)-1); 56 | } 57 | void lua_newtable(lua_State* L) { 58 | lua_createtable(L, 0, 0); 59 | } 60 | 61 | void lua_register(lua_State* L, const(char)* n, lua_CFunction f) { 62 | lua_pushcfunction(L, f); 63 | lua_setglobal(L, n); 64 | } 65 | void lua_pushcfunction(lua_State* L, lua_CFunction f) { 66 | lua_pushcclosure(L, f, 0); 67 | } 68 | 69 | bool lua_isfunction(lua_State* L, int idx) { 70 | return lua_type(L, idx) == LUA_TFUNCTION; 71 | } 72 | bool lua_istable(lua_State* L, int idx) { 73 | return lua_type(L, idx) == LUA_TTABLE; 74 | } 75 | bool lua_islightuserdata(lua_State* L, int idx) { 76 | return lua_type(L, idx) == LUA_TLIGHTUSERDATA; 77 | } 78 | bool lua_isnil(lua_State* L, int idx) { 79 | return lua_type(L, idx) == LUA_TNIL; 80 | } 81 | bool lua_isboolean(lua_State* L, int idx) { 82 | return lua_type(L, idx) == LUA_TBOOLEAN; 83 | } 84 | bool lua_isthread(lua_State* L, int idx) { 85 | return lua_type(L, idx) == LUA_TTHREAD; 86 | } 87 | bool lua_isnone(lua_State* L, int idx) { 88 | return lua_type(L, idx) == LUA_TNONE; 89 | } 90 | bool lua_isnoneornil(lua_State* L, int idx) { 91 | return lua_type(L, idx) <= 0; 92 | } 93 | 94 | const(char)* lua_pushliteral(lua_State* L, string s) { 95 | return lua_pushlstring(L, s.ptr, s.length - 1); 96 | } 97 | void lua_pushglobaltable(lua_State* L) { 98 | lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_GLOBALS); 99 | } 100 | const(char)* lua_tostring(lua_State* L, int idx) { 101 | return lua_tolstring(L, idx, null); 102 | } 103 | //lauxlib.h 104 | void luaL_checkversion(lua_State* L) { 105 | luaL_checkversion_(L, LUA_VERSION_NUM); 106 | } 107 | int luaL_loadfile(lua_State* L, const(char)* f) { 108 | return luaL_loadfilex(L, f, null); 109 | } 110 | 111 | void luaL_newlibtable(lua_State* L, const(luaL_Reg)[] l) { 112 | lua_createtable(L, 0, cast(int)(l.length) - 1); 113 | } 114 | void luaL_newlib(lua_State* L, luaL_Reg[] l) { 115 | luaL_newlibtable(L, l); 116 | luaL_setfuncs(L, l.ptr, 0); 117 | } 118 | /*int luaL_argcheck(lua_State* L, cond, int numarg, const(char)*extramsg) { 119 | ((void)((cond) || luaL_argerror(L, (numarg), (extramsg)))) 120 | }*/ 121 | const(char)* luaL_checkstring(lua_State* L, int n) { 122 | return luaL_checklstring(L, n, null); 123 | } 124 | const(char)* luaL_optstring(lua_State* L, int n, const(char)* d) { 125 | return luaL_optlstring(L, n, d, null); 126 | } 127 | int luaL_checkint(lua_State* L, int n){ 128 | return cast(int)luaL_checkinteger(L, n); 129 | } 130 | int luaL_optint(lua_State* L, int n, lua_Integer d) { 131 | return cast(int)luaL_optinteger(L, n, d); 132 | } 133 | long luaL_checklong(lua_State* L, int n) { 134 | return luaL_checkinteger(L, n); 135 | } 136 | long luaL_optlong(lua_State* L, int n, lua_Integer d) { 137 | return luaL_optinteger(L, (n), (d)); 138 | } 139 | const(char)* luaL_typename(lua_State* L, int i) { 140 | return lua_typename(L, lua_type(L,i)); 141 | } 142 | int luaL_dofile(lua_State* L, const(char)* fn) { 143 | luaL_loadfile(L, fn); 144 | return lua_pcall(L, 0, LUA_MULTRET, 0); 145 | } 146 | int luaL_dostring(lua_State* L, const(char)* s) { 147 | luaL_loadstring(L, s); 148 | return lua_pcall(L, 0, LUA_MULTRET, 0); 149 | } 150 | void luaL_getmetatable(lua_State* L, const(char)* n) { 151 | lua_getfield(L, LUA_REGISTRYINDEX, n); 152 | } 153 | /*#define luaL_opt(lua_State* L,f, int n,d) { 154 | return lua_isnoneornil(L, n) ? d : f(L,n); 155 | }*/ 156 | int luaL_loadbuffer(lua_State* L, const(char)* s, size_t sz, const(char)* n) { 157 | return luaL_loadbufferx(L, s, sz, n, null); 158 | } 159 | 160 | /*#define luaL_addchar(B,c) \ 161 | ((void)((B)->n < (B)->size || luaL_prepbuffsize((B), 1)), \ 162 | ((B)->b[(B)->n++] = (c))) 163 | #define luaL_addsize(B,s) ((B)->n += (s))*/ 164 | void luaL_register(lua_State* L, const(char)* n, const(luaL_Reg)* l) { 165 | luaL_openlib(L, n, l, 0); 166 | } 167 | //luaconf.h 168 | /*#define luai_writestring(s,l) fwrite((s), sizeof(char), (l), stdout) 169 | #define luai_writeline() (luai_writestring("\n", 1), fflush(stdout)) 170 | #define luai_writestringerror(s,p) \ 171 | (fprintf(stderr, (s), (p)), fflush(stderr)) 172 | #define lua_cpcall(L,f,u) \ 173 | (lua_pushcfunction(L, (f)), \ 174 | lua_pushlightuserdata(L,(u)), \ 175 | lua_pcall(L,1,0,0)) 176 | #define lua_strlen(L,i) lua_rawlen(L, (i)) 177 | 178 | #define lua_objlen(L,i) lua_rawlen(L, (i)) 179 | 180 | #define lua_equal(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPEQ) 181 | #define lua_lessthan(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPLT) 182 | #define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n)) 183 | #define lua_strx2number(s,p) strtod((s), (p)) 184 | #define luai_nummod(L,a,b) ((a) - floor((a)/(b))*(b)) 185 | #define luai_numpow(L,a,b) (pow(a,b)) 186 | #define luai_numadd(L,a,b) ((a)+(b)) 187 | #define luai_numsub(L,a,b) ((a)-(b)) 188 | #define luai_nummul(L,a,b) ((a)*(b)) 189 | #define luai_numdiv(L,a,b) ((a)/(b)) 190 | #define luai_numunm(L,a) (-(a)) 191 | #define luai_numeq(a,b) ((a)==(b)) 192 | #define luai_numlt(L,a,b) ((a)<(b)) 193 | #define luai_numle(L,a,b) ((a)<=(b)) 194 | #define luai_numisnan(L,a) (!luai_numeq((a), (a)))*/ 195 | //lualib.h 196 | -------------------------------------------------------------------------------- /import/derelict/lua/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.lua.types; 29 | 30 | //lua.h 31 | enum LUA_VERSION_MAJOR ="5"; 32 | enum LUA_VERSION_MINOR ="2"; 33 | enum LUA_VERSION_NUM = 502; 34 | enum LUA_VERSION_RELEASE = "1"; 35 | 36 | enum LUA_VERSION = "Lua " ~ LUA_VERSION_MAJOR ~ "." ~ LUA_VERSION_MINOR; 37 | enum LUA_RELEASE = LUA_VERSION ~ "." ~ LUA_VERSION_RELEASE; 38 | enum LUA_COPYRIGHT = LUA_RELEASE ~ " Copyright (C) 1994-2012 Lua.org, PUC-Rio"; 39 | enum LUA_AUTHORS = "R. Ierusalimschy, L. H. de Figueiredo, W. Celes"; 40 | 41 | enum LUA_SIGNATURE = "\033Lua"; 42 | enum LUA_MULTRET = -1; 43 | 44 | enum LUA_REGISTRYINDEX = LUAI_FIRSTPSEUDOIDX; 45 | 46 | int lua_upvalueindex(int i) { 47 | return LUA_REGISTRYINDEX - i; 48 | } 49 | 50 | enum 51 | { 52 | LUA_OK = 0, 53 | LUA_YIELD = 1, 54 | LUA_ERRRUN = 2, 55 | LUA_ERRSYNTAX = 3, 56 | LUA_ERRMEM = 4, 57 | LUA_ERRGCMM = 5, 58 | LUA_ERRERR = 6, 59 | } 60 | 61 | struct lua_State; 62 | 63 | alias extern(C) int function(lua_State* L) lua_CFunction; 64 | alias extern(C) const(char)* function(lua_State* L, void* ud, size_t* sz) lua_Reader; 65 | alias extern(C) int function(lua_State* L, const(void)* p, size_t sz, void* ud) lua_Writer; 66 | alias extern(C) void* function(void* ud, void* ptr, size_t osize, size_t nsize) lua_Alloc; 67 | 68 | enum 69 | { 70 | LUA_TNONE = -1, 71 | LUA_TNIL = 0, 72 | LUA_TBOOLEAN = 1, 73 | LUA_TLIGHTUSERDATA = 2, 74 | LUA_TNUMBER = 3, 75 | LUA_TSTRING = 4, 76 | LUA_TTABLE = 5, 77 | LUA_TFUNCTION = 6, 78 | LUA_TUSERDATA = 7, 79 | LUA_TTHREAD = 8, 80 | LUA_NUMTAGS = 9, 81 | 82 | LUA_MINSTACK = 20, 83 | 84 | LUA_RIDX_MAINTHREAD = 1, 85 | LUA_RIDX_GLOBALS = 2, 86 | LUA_RIDX_LAST = LUA_RIDX_GLOBALS, 87 | } 88 | 89 | alias double lua_Number; 90 | alias ptrdiff_t lua_Integer; 91 | alias uint lua_Unsigned; 92 | 93 | enum 94 | { 95 | LUA_OPADD = 0, 96 | LUA_OPSUB = 1, 97 | LUA_OPMUL = 2, 98 | LUA_OPDIV = 3, 99 | LUA_OPMOD = 4, 100 | LUA_OPPOW = 5, 101 | LUA_OPUNM = 6, 102 | 103 | LUA_OPWQ = 0, 104 | LUA_OPLT = 1, 105 | LUA_OPLE = 2, 106 | 107 | LUA_GCSTOP = 0, 108 | LUA_GCRESTART = 1, 109 | LUA_GCCOLLECT = 2, 110 | LUA_GCCOUNT = 3, 111 | LUA_GCCOUNTB = 4, 112 | LUA_GCSTEP = 5, 113 | LUA_GCSETPAUSE = 6, 114 | LUA_GCSETSTEPMUL = 7, 115 | LUA_GCSETMAJORINC = 8, 116 | LUA_GCISRUNNING = 9, 117 | LUA_GCGEN = 10, 118 | LUA_GCINC = 11, 119 | 120 | LUA_HOOKCALL = 0, 121 | LUA_HOOKRET = 1, 122 | LUA_HOOKLINE = 2, 123 | LUA_HOOKCOUNT = 3, 124 | LUA_HOOKTAILCALL = 4, 125 | 126 | LUA_MASKCALL = 1 << LUA_HOOKCALL, 127 | LUA_MASKRET = 1 << LUA_HOOKRET, 128 | LUA_MASKLINE = 1 << LUA_HOOKLINE, 129 | LUA_MASKCOUNT = 1 << LUA_HOOKCOUNT, 130 | } 131 | 132 | struct lua_Debug; 133 | 134 | extern(C) alias void function(lua_State *L, lua_Debug *ar) lua_Hook; 135 | 136 | //lauxlib.h 137 | struct luaL_Reg { 138 | const(char)* name; 139 | lua_CFunction func; 140 | } 141 | 142 | enum LUA_NOREF = -2; 143 | enum int LUA_REFNIL = -1; 144 | 145 | struct luaL_Buffer { 146 | char* b; 147 | size_t size; 148 | size_t n; 149 | lua_State* L; 150 | char initb[]; 151 | } 152 | 153 | struct luaL_Stream; 154 | 155 | //lualib.h 156 | enum : string 157 | { 158 | LUA_COLIBNAME = "coroutine", 159 | LUA_TABLIBNAME = "table", 160 | LUA_IOLIBNAME = "io", 161 | LUA_OSLIBNAME = "os", 162 | LUA_STRLIBNAME = "string", 163 | LUA_BITLIBNAME = "bit32", 164 | LUA_MATHLIBNAME = "math", 165 | LUA_DBLIBNAME = "debug", 166 | LUA_LOADLIBNAME = "package", 167 | } 168 | 169 | //luaconf.h 170 | alias int LUA_INT32; 171 | alias size_t LUAI_UMEM; 172 | alias ptrdiff_t LUAI_MEM; 173 | alias double LUA_NUMBER; 174 | alias double LUAI_UACNUMBER; 175 | alias ptrdiff_t LUA_INTEGER; 176 | alias uint LUA_UNSIGNED; 177 | 178 | enum LUA_NUMBER_SCAN = "%lf"; 179 | enum LUA_NUMBER_FMT = "%.14g"; 180 | enum LUAI_MAXSTACK = 1000000; 181 | enum LUAI_FIRSTPSEUDOIDX = -LUAI_MAXSTACK - 1000; -------------------------------------------------------------------------------- /import/derelict/ogg/ogg.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.ogg.ogg; 29 | 30 | public 31 | { 32 | import derelict.ogg.oggtypes; 33 | import derelict.ogg.oggfunctions; 34 | } 35 | 36 | private 37 | { 38 | import derelict.util.loader; 39 | import derelict.util.system; 40 | 41 | static if(Derelict_OS_Windows) 42 | enum libNames = "ogg.dll, libogg-0.dll, libogg.dll"; 43 | else static if(Derelict_OS_Mac) 44 | enum libNames = "libogg.dylib, libogg.0.dylib"; 45 | else static if(Derelict_OS_Posix) 46 | enum libNames = "libogg.so, libogg.so.0"; 47 | else 48 | static assert(0, "Need to implement libogg libnames for this operating system."); 49 | } 50 | 51 | class DerelictOggLoader : SharedLibLoader 52 | { 53 | 54 | protected: 55 | override void loadSymbols() 56 | { 57 | bindFunc(cast(void**)&oggpack_writeinit, "oggpack_writeinit"); 58 | bindFunc(cast(void**)&oggpack_writecheck, "oggpack_writecheck"); 59 | bindFunc(cast(void**)&oggpack_writetrunc, "oggpack_writetrunc"); 60 | bindFunc(cast(void**)&oggpack_writealign, "oggpack_writealign"); 61 | bindFunc(cast(void**)&oggpack_writecopy, "oggpack_writecopy"); 62 | bindFunc(cast(void**)&oggpack_reset, "oggpack_reset"); 63 | bindFunc(cast(void**)&oggpack_writeclear, "oggpack_writeclear"); 64 | bindFunc(cast(void**)&oggpack_readinit, "oggpack_readinit"); 65 | bindFunc(cast(void**)&oggpack_write, "oggpack_write"); 66 | bindFunc(cast(void**)&oggpack_look, "oggpack_look"); 67 | bindFunc(cast(void**)&oggpack_look1, "oggpack_look1"); 68 | bindFunc(cast(void**)&oggpack_adv, "oggpack_adv"); 69 | bindFunc(cast(void**)&oggpack_adv1, "oggpack_adv1"); 70 | bindFunc(cast(void**)&oggpack_read, "oggpack_read"); 71 | bindFunc(cast(void**)&oggpack_read1, "oggpack_read1"); 72 | bindFunc(cast(void**)&oggpack_bytes, "oggpack_bytes"); 73 | bindFunc(cast(void**)&oggpack_bits, "oggpack_bits"); 74 | bindFunc(cast(void**)&oggpack_get_buffer, "oggpack_get_buffer"); 75 | 76 | bindFunc(cast(void**)&oggpackB_writeinit, "oggpackB_writeinit"); 77 | bindFunc(cast(void**)&oggpackB_writecheck, "oggpackB_writecheck"); 78 | bindFunc(cast(void**)&oggpackB_writetrunc, "oggpackB_writetrunc"); 79 | bindFunc(cast(void**)&oggpackB_writealign, "oggpackB_writealign"); 80 | bindFunc(cast(void**)&oggpackB_writecopy, "oggpackB_writecopy"); 81 | bindFunc(cast(void**)&oggpackB_reset, "oggpackB_reset"); 82 | bindFunc(cast(void**)&oggpackB_writeclear, "oggpackB_writeclear"); 83 | bindFunc(cast(void**)&oggpackB_readinit, "oggpackB_readinit"); 84 | bindFunc(cast(void**)&oggpackB_write, "oggpackB_write"); 85 | bindFunc(cast(void**)&oggpackB_look, "oggpackB_look"); 86 | bindFunc(cast(void**)&oggpackB_look1, "oggpackB_look1"); 87 | bindFunc(cast(void**)&oggpackB_adv, "oggpackB_adv"); 88 | bindFunc(cast(void**)&oggpackB_adv1, "oggpackB_adv1"); 89 | bindFunc(cast(void**)&oggpackB_read, "oggpackB_read"); 90 | bindFunc(cast(void**)&oggpackB_read1, "oggpackB_read1"); 91 | bindFunc(cast(void**)&oggpackB_bytes, "oggpackB_bytes"); 92 | bindFunc(cast(void**)&oggpackB_bits, "oggpackB_bits"); 93 | bindFunc(cast(void**)&oggpackB_get_buffer, "oggpackB_get_buffer"); 94 | 95 | bindFunc(cast(void**)&ogg_stream_packetin, "ogg_stream_packetin"); 96 | bindFunc(cast(void**)&ogg_stream_iovecin, "ogg_stream_iovecin"); 97 | bindFunc(cast(void**)&ogg_stream_pageout, "ogg_stream_pageout"); 98 | bindFunc(cast(void**)&ogg_stream_pageout_fill, "ogg_stream_pageout_fill"); 99 | bindFunc(cast(void**)&ogg_stream_flush, "ogg_stream_flush"); 100 | bindFunc(cast(void**)&ogg_stream_flush_fill, "ogg_stream_flush_fill"); 101 | 102 | bindFunc(cast(void**)&ogg_sync_init, "ogg_sync_init"); 103 | bindFunc(cast(void**)&ogg_sync_clear, "ogg_sync_clear"); 104 | bindFunc(cast(void**)&ogg_sync_reset, "ogg_sync_reset"); 105 | bindFunc(cast(void**)&ogg_sync_destroy, "ogg_sync_destroy"); 106 | bindFunc(cast(void**)&ogg_sync_check, "ogg_sync_check"); 107 | 108 | bindFunc(cast(void**)&ogg_sync_buffer, "ogg_sync_buffer"); 109 | bindFunc(cast(void**)&ogg_sync_wrote, "ogg_sync_wrote"); 110 | bindFunc(cast(void**)&ogg_sync_pageseek, "ogg_sync_pageseek"); 111 | bindFunc(cast(void**)&ogg_sync_pageout, "ogg_sync_pageout"); 112 | bindFunc(cast(void**)&ogg_stream_pagein, "ogg_stream_pagein"); 113 | bindFunc(cast(void**)&ogg_stream_packetout, "ogg_stream_packetout"); 114 | bindFunc(cast(void**)&ogg_stream_packetpeek, "ogg_stream_packetpeek"); 115 | 116 | bindFunc(cast(void**)&ogg_stream_init, "ogg_stream_init"); 117 | bindFunc(cast(void**)&ogg_stream_clear, "ogg_stream_clear"); 118 | bindFunc(cast(void**)&ogg_stream_reset, "ogg_stream_reset"); 119 | bindFunc(cast(void**)&ogg_stream_reset_serialno, "ogg_stream_reset_serialno"); 120 | bindFunc(cast(void**)&ogg_stream_destroy, "ogg_stream_destroy"); 121 | bindFunc(cast(void**)&ogg_stream_check, "ogg_stream_check"); 122 | bindFunc(cast(void**)&ogg_stream_eos, "ogg_stream_eos"); 123 | 124 | bindFunc(cast(void**)&ogg_page_checksum_set, "ogg_page_checksum_set"); 125 | bindFunc(cast(void**)&ogg_page_version, "ogg_page_version"); 126 | bindFunc(cast(void**)&ogg_page_continued, "ogg_page_continued"); 127 | bindFunc(cast(void**)&ogg_page_bos, "ogg_page_bos"); 128 | bindFunc(cast(void**)&ogg_page_eos, "ogg_page_eos"); 129 | bindFunc(cast(void**)&ogg_page_granulepos, "ogg_page_granulepos"); 130 | bindFunc(cast(void**)&ogg_page_serialno, "ogg_page_serialno"); 131 | bindFunc(cast(void**)&ogg_page_pageno, "ogg_page_pageno"); 132 | bindFunc(cast(void**)&ogg_page_packets, "ogg_page_packets"); 133 | bindFunc(cast(void**)&ogg_packet_clear, "ogg_packet_clear"); 134 | } 135 | 136 | public 137 | { 138 | this() 139 | { 140 | super(libNames); 141 | } 142 | } 143 | } 144 | 145 | __gshared DerelictOggLoader DerelictOgg; 146 | 147 | static this() 148 | { 149 | DerelictOgg = new DerelictOggLoader(); 150 | } 151 | 152 | static ~this() 153 | { 154 | DerelictOgg.unload(); 155 | } -------------------------------------------------------------------------------- /import/derelict/ogg/oggtypes.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.ogg.oggtypes; 29 | 30 | private 31 | { 32 | import core.stdc.config; 33 | } 34 | 35 | alias long ogg_int64_t; 36 | alias ulong ogg_uint64_t; 37 | alias int ogg_int32_t; 38 | alias uint ogg_uint32_t; 39 | alias short ogg_int16_t; 40 | alias ushort ogg_uint16_t; 41 | 42 | struct ogg_iovec_t 43 | { 44 | void* iov_base; 45 | size_t iov_len; 46 | } 47 | 48 | struct oggpack_buffer 49 | { 50 | c_long endbyte; 51 | int endbit; 52 | ubyte* buffer; 53 | ubyte* ptr; 54 | c_long storage; 55 | } 56 | 57 | struct ogg_page 58 | { 59 | ubyte *header; 60 | c_long header_len; 61 | ubyte *_body; // originally named "body", but that's a keyword in D. 62 | c_long body_len; 63 | } 64 | 65 | struct ogg_stream_state 66 | { 67 | ubyte *body_data; 68 | c_long body_storage; 69 | c_long body_fill; 70 | c_long body_returned; 71 | int *lacing_vals; 72 | ogg_int64_t *granule_vals; 73 | c_long lacing_storage; 74 | c_long lacing_fill; 75 | c_long lacing_packet; 76 | c_long lacing_returned; 77 | ubyte header[282]; 78 | int header_fill; 79 | int e_o_s; 80 | int b_o_s; 81 | c_long serialno; 82 | c_long pageno; 83 | ogg_int64_t packetno; 84 | ogg_int64_t granulepos; 85 | } 86 | 87 | struct ogg_packet 88 | { 89 | ubyte *packet; 90 | c_long bytes; 91 | c_long b_o_s; 92 | c_long e_o_s; 93 | ogg_int64_t granulepos; 94 | ogg_int64_t packetno; 95 | } 96 | 97 | struct ogg_sync_state 98 | { 99 | ubyte *data; 100 | int storage; 101 | int fill; 102 | int returned; 103 | 104 | int unsynced; 105 | int headerbytes; 106 | int bodybytes; 107 | } -------------------------------------------------------------------------------- /import/derelict/ogg/vorbis.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.ogg.vorbis; 29 | 30 | public 31 | { 32 | import derelict.ogg.vorbistypes; 33 | import derelict.ogg.vorbisfunctions; 34 | } 35 | 36 | private 37 | { 38 | import derelict.util.loader; 39 | import derelict.util.system; 40 | 41 | static if(Derelict_OS_Windows) 42 | enum libNames = "vorbis.dll, libvorbis-0.dll, libvorbis.dll"; 43 | else static if(Derelict_OS_Mac) 44 | enum libNames = "libvorbis.dylib, libvorbis.0.dylib"; 45 | else static if(Derelict_OS_Posix) 46 | enum libNames = "libvorbis.so, libvorbis.so.0, libvorbis.so.0.3.0"; 47 | else 48 | static assert(0, "Need to implement libvorbis libnames for this operating system."); 49 | } 50 | 51 | class DerelictVorbisLoader : SharedLibLoader 52 | { 53 | protected: 54 | override void loadSymbols() 55 | { 56 | bindFunc(cast(void**)&vorbis_info_init, "vorbis_info_init"); 57 | bindFunc(cast(void**)&vorbis_info_clear, "vorbis_info_clear"); 58 | bindFunc(cast(void**)&vorbis_info_blocksize, "vorbis_info_blocksize"); 59 | bindFunc(cast(void**)&vorbis_comment_init, "vorbis_comment_init"); 60 | bindFunc(cast(void**)&vorbis_comment_add, "vorbis_comment_add"); 61 | bindFunc(cast(void**)&vorbis_comment_add_tag, "vorbis_comment_add_tag"); 62 | bindFunc(cast(void**)&vorbis_comment_query, "vorbis_comment_query"); 63 | bindFunc(cast(void**)&vorbis_comment_query_count, "vorbis_comment_query_count"); 64 | bindFunc(cast(void**)&vorbis_comment_clear, "vorbis_comment_clear"); 65 | bindFunc(cast(void**)&vorbis_block_init, "vorbis_block_init"); 66 | bindFunc(cast(void**)&vorbis_block_clear, "vorbis_block_clear"); 67 | bindFunc(cast(void**)&vorbis_dsp_clear, "vorbis_dsp_clear"); 68 | bindFunc(cast(void**)&vorbis_granule_time, "vorbis_granule_time"); 69 | bindFunc(cast(void**)&vorbis_version_string, "vorbis_version_string"); 70 | 71 | bindFunc(cast(void**)&vorbis_analysis_init, "vorbis_analysis_init"); 72 | bindFunc(cast(void**)&vorbis_commentheader_out, "vorbis_commentheader_out"); 73 | bindFunc(cast(void**)&vorbis_analysis_headerout, "vorbis_analysis_headerout"); 74 | 75 | bindFunc(cast(void**)&vorbis_analysis_buffer, "vorbis_analysis_buffer"); 76 | bindFunc(cast(void**)&vorbis_analysis_wrote, "vorbis_analysis_wrote"); 77 | bindFunc(cast(void**)&vorbis_analysis_blockout, "vorbis_analysis_blockout"); 78 | bindFunc(cast(void**)&vorbis_analysis, "vorbis_analysis"); 79 | 80 | bindFunc(cast(void**)&vorbis_bitrate_addblock, "vorbis_bitrate_addblock"); 81 | bindFunc(cast(void**)&vorbis_bitrate_flushpacket, "vorbis_bitrate_flushpacket"); 82 | 83 | bindFunc(cast(void**)&vorbis_synthesis_headerin, "vorbis_synthesis_idheader"); 84 | bindFunc(cast(void**)&vorbis_synthesis_headerin, "vorbis_synthesis_headerin"); 85 | bindFunc(cast(void**)&vorbis_synthesis_init, "vorbis_synthesis_init"); 86 | bindFunc(cast(void**)&vorbis_synthesis_restart, "vorbis_synthesis_restart"); 87 | bindFunc(cast(void**)&vorbis_synthesis, "vorbis_synthesis"); 88 | bindFunc(cast(void**)&vorbis_synthesis_trackonly, "vorbis_synthesis_trackonly"); 89 | bindFunc(cast(void**)&vorbis_synthesis_blockin, "vorbis_synthesis_blockin"); 90 | bindFunc(cast(void**)&vorbis_synthesis_pcmout, "vorbis_synthesis_pcmout"); 91 | bindFunc(cast(void**)&vorbis_synthesis_lapout, "vorbis_synthesis_lapout"); 92 | bindFunc(cast(void**)&vorbis_synthesis_read, "vorbis_synthesis_read"); 93 | bindFunc(cast(void**)&vorbis_packet_blocksize, "vorbis_packet_blocksize"); 94 | bindFunc(cast(void**)&vorbis_synthesis_halfrate, "vorbis_synthesis_halfrate"); 95 | bindFunc(cast(void**)&vorbis_synthesis_halfrate_p, "vorbis_synthesis_halfrate_p"); 96 | } 97 | 98 | public 99 | { 100 | this() 101 | { 102 | super(libNames); 103 | } 104 | } 105 | } 106 | 107 | __gshared DerelictVorbisLoader DerelictVorbis; 108 | 109 | static this() 110 | { 111 | DerelictVorbis = new DerelictVorbisLoader(); 112 | } 113 | 114 | static ~this() 115 | { 116 | DerelictVorbis.unload(); 117 | } 118 | -------------------------------------------------------------------------------- /import/derelict/ogg/vorbisenc.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.ogg.vorbisenc; 29 | 30 | public 31 | { 32 | import derelict.ogg.vorbisenctypes; 33 | import derelict.ogg.vorbisencfunctions; 34 | } 35 | 36 | private 37 | { 38 | import derelict.util.loader; 39 | import derelict.util.system; 40 | 41 | static if(Derelict_OS_Windows) 42 | enum libNames = "vorbisenc.dll, libvorbisenc-2.dll, libvorbisenc.dll"; 43 | else static if(Derelict_OS_Mac) 44 | enum libNames = "libvorbisenc.dylib, libvorbisenc.0.dylib"; 45 | else static if(Derelict_OS_Posix) 46 | enum libNames = "libvorbisenc.so, libvorbisenc.so.0, libvorbisenc.so.0.3.0"; 47 | else 48 | static assert(0, "Need to implement libvorbisenc libnames for this operating system."); 49 | } 50 | 51 | class DerelictVorbisEncLoader : SharedLibLoader 52 | { 53 | protected: 54 | override void loadSymbols() 55 | { 56 | bindFunc(cast(void**)&vorbis_encode_init, "vorbis_encode_init"); 57 | bindFunc(cast(void**)&vorbis_encode_setup_managed, "vorbis_encode_setup_managed"); 58 | bindFunc(cast(void**)&vorbis_encode_setup_vbr, "vorbis_encode_setup_vbr"); 59 | bindFunc(cast(void**)&vorbis_encode_init_vbr, "vorbis_encode_init_vbr"); 60 | bindFunc(cast(void**)&vorbis_encode_setup_init, "vorbis_encode_setup_init"); 61 | bindFunc(cast(void**)&vorbis_encode_ctl, "vorbis_encode_ctl"); 62 | } 63 | 64 | public 65 | { 66 | this() 67 | { 68 | super(libNames); 69 | } 70 | } 71 | } 72 | 73 | __gshared DerelictVorbisEncLoader DerelictVorbisEnc; 74 | 75 | static this() 76 | { 77 | DerelictVorbisEnc = new DerelictVorbisEncLoader(); 78 | } 79 | 80 | static ~this() 81 | { 82 | DerelictVorbisEnc.unload(); 83 | } -------------------------------------------------------------------------------- /import/derelict/ogg/vorbisencfunctions.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.ogg.vorbisencfunctions; 29 | 30 | private 31 | { 32 | import core.stdc.config; 33 | import derelict.ogg.vorbistypes; 34 | } 35 | 36 | extern(C) 37 | { 38 | alias nothrow int function (vorbis_info*, c_long, c_long, c_long, c_long, c_long) da_vorbis_encode_init; 39 | alias nothrow int function(vorbis_info*, c_long, c_long, c_long, c_long, c_long) da_vorbis_encode_setup_managed; 40 | alias nothrow int function(vorbis_info*, c_long, c_long, float) da_vorbis_encode_setup_vbr; 41 | alias nothrow int function(vorbis_info*, c_long, c_long, float) da_vorbis_encode_init_vbr; 42 | alias nothrow int function(vorbis_info*) da_vorbis_encode_setup_init; 43 | alias nothrow int function(vorbis_info*, int, void*) da_vorbis_encode_ctl; 44 | 45 | } 46 | 47 | __gshared 48 | { 49 | da_vorbis_encode_init vorbis_encode_init; 50 | da_vorbis_encode_setup_managed vorbis_encode_setup_managed; 51 | da_vorbis_encode_setup_vbr vorbis_encode_setup_vbr; 52 | da_vorbis_encode_init_vbr vorbis_encode_init_vbr; 53 | da_vorbis_encode_setup_init vorbis_encode_setup_init; 54 | da_vorbis_encode_ctl vorbis_encode_ctl; 55 | } -------------------------------------------------------------------------------- /import/derelict/ogg/vorbisenctypes.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.ogg.vorbisenctypes; 29 | 30 | private 31 | { 32 | import core.stdc.config; 33 | } 34 | 35 | enum 36 | { 37 | OV_ECTL_RATEMANAGE_GET =0x10, 38 | OV_ECTL_RATEMANAGE_SET =0x11, 39 | OV_ECTL_RATEMANAGE_AVG =0x12, 40 | OV_ECTL_RATEMANAGE_HARD =0x13, 41 | } 42 | 43 | struct ovectl_ratemanage_arg { 44 | int management_active; 45 | 46 | c_long bitrate_hard_min; 47 | c_long bitrate_hard_max; 48 | double bitrate_hard_window; 49 | 50 | c_long bitrate_av_lo; 51 | c_long bitrate_av_hi; 52 | double bitrate_av_window; 53 | double bitrate_av_window_center; 54 | }; 55 | 56 | enum 57 | { 58 | OV_ECTL_RATEMANAGE2_GET =0x14, 59 | OV_ECTL_RATEMANAGE2_SET =0x15, 60 | } 61 | 62 | struct ovectl_ratemanage2_arg { 63 | int management_active; 64 | 65 | c_long bitrate_limit_min_kbps; 66 | c_long bitrate_limit_max_kbps; 67 | c_long bitrate_limit_reservoir_bits; 68 | double bitrate_limit_reservoir_bias; 69 | 70 | c_long bitrate_average_kbps; 71 | double bitrate_average_damping; 72 | }; 73 | 74 | enum 75 | { 76 | OV_ECTL_LOWPASS_GET =0x20, 77 | OV_ECTL_LOWPASS_SET =0x21, 78 | OV_ECTL_IBLOCK_GET =0x30, 79 | OV_ECTL_IBLOCK_SET =0x31, 80 | } -------------------------------------------------------------------------------- /import/derelict/ogg/vorbisfile.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.ogg.vorbisfile; 29 | 30 | public 31 | { 32 | import derelict.ogg.vorbisfiletypes; 33 | import derelict.ogg.vorbisfilefunctions; 34 | } 35 | 36 | private 37 | { 38 | import derelict.util.loader; 39 | import derelict.util.system; 40 | 41 | static if(Derelict_OS_Windows) 42 | enum libNames = "vorbisfile.dll, libvorbisfile-3.dll, libvorbisfile.dll"; 43 | else static if(Derelict_OS_Mac) 44 | enum libNames = "libvorbisfile.dylib, libvorbisfile.0.dylib"; 45 | else static if(Derelict_OS_Posix) 46 | enum libNames = "libvorbisfile.so, libvorbisfile.so.3, libvorbisfile.so.3.1.0"; 47 | else 48 | static assert(0, "Need to implement libvorbisfile libnames for this operating system."); 49 | } 50 | 51 | class DerelictVorbisFileLoader : SharedLibLoader 52 | { 53 | protected: 54 | override void loadSymbols() 55 | { 56 | bindFunc(cast(void**)&ov_clear, "ov_clear"); 57 | bindFunc(cast(void**)&ov_fopen, "ov_fopen"); 58 | bindFunc(cast(void**)&ov_open_callbacks, "ov_open_callbacks"); 59 | 60 | bindFunc(cast(void**)&ov_test_callbacks, "ov_test_callbacks"); 61 | bindFunc(cast(void**)&ov_test_open, "ov_test_open"); 62 | 63 | bindFunc(cast(void**)&ov_bitrate, "ov_bitrate"); 64 | bindFunc(cast(void**)&ov_bitrate_instant, "ov_bitrate_instant"); 65 | bindFunc(cast(void**)&ov_streams, "ov_streams"); 66 | bindFunc(cast(void**)&ov_seekable, "ov_seekable"); 67 | bindFunc(cast(void**)&ov_serialnumber, "ov_serialnumber"); 68 | 69 | bindFunc(cast(void**)&ov_raw_total, "ov_raw_total"); 70 | bindFunc(cast(void**)&ov_pcm_total, "ov_pcm_total"); 71 | bindFunc(cast(void**)&ov_time_total, "ov_time_total"); 72 | 73 | bindFunc(cast(void**)&ov_raw_seek, "ov_raw_seek"); 74 | bindFunc(cast(void**)&ov_pcm_seek, "ov_pcm_seek"); 75 | bindFunc(cast(void**)&ov_pcm_seek_page, "ov_pcm_seek_page"); 76 | bindFunc(cast(void**)&ov_time_seek, "ov_time_seek"); 77 | bindFunc(cast(void**)&ov_time_seek_page, "ov_time_seek_page"); 78 | 79 | bindFunc(cast(void**)&ov_raw_seek_lap, "ov_raw_seek_lap"); 80 | bindFunc(cast(void**)&ov_pcm_seek_lap, "ov_pcm_seek_lap"); 81 | bindFunc(cast(void**)&ov_pcm_seek_page_lap, "ov_pcm_seek_page_lap"); 82 | bindFunc(cast(void**)&ov_time_seek_lap, "ov_time_seek_lap"); 83 | bindFunc(cast(void**)&ov_time_seek_page_lap, "ov_time_seek_page_lap"); 84 | 85 | bindFunc(cast(void**)&ov_raw_tell, "ov_raw_tell"); 86 | bindFunc(cast(void**)&ov_pcm_tell, "ov_pcm_tell"); 87 | bindFunc(cast(void**)&ov_time_tell, "ov_time_tell"); 88 | 89 | bindFunc(cast(void**)&ov_info, "ov_info"); 90 | bindFunc(cast(void**)&ov_comment, "ov_comment"); 91 | 92 | bindFunc(cast(void**)&ov_read_float, "ov_read_float"); 93 | bindFunc(cast(void**)&ov_read_filter, "ov_read_filter"); 94 | bindFunc(cast(void**)&ov_read, "ov_read"); 95 | bindFunc(cast(void**)&ov_crosslap, "ov_crosslap"); 96 | 97 | bindFunc(cast(void**)&ov_halfrate, "ov_halfrate"); 98 | bindFunc(cast(void**)&ov_halfrate_p, "ov_halfrate_p"); 99 | } 100 | 101 | public 102 | { 103 | this() 104 | { 105 | super(libNames); 106 | } 107 | } 108 | } 109 | 110 | __gshared DerelictVorbisFileLoader DerelictVorbisFile; 111 | 112 | static this() 113 | { 114 | DerelictVorbisFile = new DerelictVorbisFileLoader(); 115 | } 116 | 117 | static ~this() 118 | { 119 | DerelictVorbisFile.unload(); 120 | } -------------------------------------------------------------------------------- /import/derelict/ogg/vorbisfilefunctions.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.ogg.vorbisfilefunctions; 29 | 30 | private 31 | { 32 | import core.stdc.config; 33 | import core.stdc.stdio; 34 | import derelict.ogg.oggtypes; 35 | import derelict.ogg.vorbistypes; 36 | import derelict.ogg.vorbisfiletypes; 37 | } 38 | 39 | extern(C) 40 | { 41 | alias nothrow int function(OggVorbis_File*) da_ov_clear; 42 | alias nothrow int function(const(char)*, OggVorbis_File*) da_ov_fopen; 43 | alias nothrow int function(void* datasource, OggVorbis_File*, const(char)*, c_long, ov_callbacks) da_ov_open_callbacks; 44 | alias nothrow int function(void*, OggVorbis_File*, const(char)*, c_long, ov_callbacks) da_ov_test_callbacks; 45 | alias nothrow int function(OggVorbis_File*) da_ov_test_open; 46 | alias nothrow c_long function(OggVorbis_File*, int) da_ov_bitrate; 47 | alias nothrow c_long function(OggVorbis_File*) da_ov_bitrate_instant; 48 | alias nothrow c_long function(OggVorbis_File*) da_ov_streams; 49 | alias nothrow c_long function(OggVorbis_File*) da_ov_seekable; 50 | alias nothrow c_long function(OggVorbis_File*, int) da_ov_serialnumber; 51 | alias nothrow ogg_int64_t function(OggVorbis_File*, int) da_ov_raw_total; 52 | alias nothrow ogg_int64_t function(OggVorbis_File*, int) da_ov_pcm_total; 53 | alias nothrow double function(OggVorbis_File*, int) da_ov_time_total; 54 | alias nothrow int function(OggVorbis_File*, ogg_int64_t) da_ov_raw_seek; 55 | alias nothrow int function(OggVorbis_File*, ogg_int64_t) da_ov_pcm_seek; 56 | alias nothrow int function(OggVorbis_File*, ogg_int64_t) da_ov_pcm_seek_page; 57 | alias nothrow int function(OggVorbis_File*, double) da_ov_time_seek; 58 | alias nothrow int function(OggVorbis_File*, double) da_ov_time_seek_page; 59 | alias nothrow int function(OggVorbis_File*, ogg_int64_t) da_ov_raw_seek_lap; 60 | alias nothrow int function(OggVorbis_File*, ogg_int64_t) da_ov_pcm_seek_lap; 61 | alias nothrow int function(OggVorbis_File*, ogg_int64_t) da_ov_pcm_seek_page_lap; 62 | alias nothrow int function(OggVorbis_File*, double) da_ov_time_seek_lap; 63 | alias nothrow int function(OggVorbis_File*, double) da_ov_time_seek_page_lap; 64 | alias nothrow ogg_int64_t function(OggVorbis_File*) da_ov_raw_tell; 65 | alias nothrow ogg_int64_t function(OggVorbis_File*) da_ov_pcm_tell; 66 | alias nothrow double function(OggVorbis_File*) da_ov_time_tell; 67 | alias nothrow vorbis_info* function(OggVorbis_File*, int) da_ov_info; 68 | alias nothrow vorbis_comment* function(OggVorbis_File*, int) da_ov_comment; 69 | alias nothrow c_long function(OggVorbis_File*, float***, int, int*) da_ov_read_float; 70 | alias nothrow c_long function(OggVorbis_File*, char*, int, int, int, int, int*) da_ov_read_filter; 71 | alias nothrow c_long function(OggVorbis_File*, byte*, int, int, int, int, int*) da_ov_read; 72 | alias nothrow int function(OggVorbis_File*, OggVorbis_File*) da_ov_crosslap; 73 | alias nothrow int function(OggVorbis_File*, int) da_ov_halfrate; 74 | alias nothrow int function(OggVorbis_File*) da_ov_halfrate_p; 75 | } 76 | 77 | private extern (C) 78 | { 79 | nothrow size_t Derelict_VorbisRead(void* ptr, size_t byteSize, size_t sizeToRead, void* datasource) 80 | { 81 | return fread(ptr, byteSize, sizeToRead, cast(FILE*)datasource); 82 | } 83 | 84 | nothrow int Derelict_VorbisSeek(void* datasource, ogg_int64_t offset, int whence) 85 | { 86 | return fseek(cast(FILE*)datasource, cast(int)offset, whence); 87 | } 88 | 89 | nothrow int Derelict_VorbisClose(void* datasource) 90 | { 91 | return fclose(cast(FILE*)datasource); 92 | } 93 | 94 | nothrow c_long Derelict_VorbisTell(void* datasource) 95 | { 96 | return cast(c_long)ftell(cast(FILE*)datasource); 97 | } 98 | } 99 | 100 | // ov_open is rewritten below because of incompatibility between compilers with FILE struct 101 | // Using this wrapper, it *should* work exactly as it would in c++. --JoeCoder 102 | int ov_open(FILE* f, OggVorbis_File* vf, const(char)* initial, c_long ibytes) 103 | { 104 | // Fill the ov_callbacks structure 105 | ov_callbacks vorbisCallbacks; // Structure to hold pointers to callback functions 106 | vorbisCallbacks.read_func = &Derelict_VorbisRead; 107 | vorbisCallbacks.close_func = &Derelict_VorbisClose; 108 | vorbisCallbacks.seek_func = &Derelict_VorbisSeek; 109 | vorbisCallbacks.tell_func = &Derelict_VorbisTell; 110 | 111 | return ov_open_callbacks(cast(void*)f, vf, initial, cast(int)ibytes, vorbisCallbacks); 112 | } 113 | 114 | // ditto for ov_test 115 | int ov_test(FILE* f, OggVorbis_File* vf, const(char)* initial, c_long ibytes) 116 | { 117 | // Fill the ov_callbacks structure 118 | ov_callbacks vorbisCallbacks; // Structure to hold pointers to callback functions 119 | vorbisCallbacks.read_func = &Derelict_VorbisRead; 120 | vorbisCallbacks.close_func = &Derelict_VorbisClose; 121 | vorbisCallbacks.seek_func = &Derelict_VorbisSeek; 122 | vorbisCallbacks.tell_func = &Derelict_VorbisTell; 123 | 124 | return ov_test_callbacks(cast(void*)f, vf, initial, cast(int)ibytes, vorbisCallbacks); 125 | } 126 | 127 | __gshared 128 | { 129 | da_ov_clear ov_clear; 130 | da_ov_fopen ov_fopen; 131 | da_ov_open_callbacks ov_open_callbacks; 132 | da_ov_test_callbacks ov_test_callbacks; 133 | da_ov_test_open ov_test_open; 134 | da_ov_bitrate ov_bitrate; 135 | da_ov_bitrate_instant ov_bitrate_instant; 136 | da_ov_streams ov_streams; 137 | da_ov_seekable ov_seekable; 138 | da_ov_serialnumber ov_serialnumber; 139 | da_ov_raw_total ov_raw_total; 140 | da_ov_pcm_total ov_pcm_total; 141 | da_ov_time_total ov_time_total; 142 | da_ov_raw_seek ov_raw_seek; 143 | da_ov_pcm_seek ov_pcm_seek; 144 | da_ov_pcm_seek_page ov_pcm_seek_page; 145 | da_ov_time_seek ov_time_seek; 146 | da_ov_time_seek_page ov_time_seek_page; 147 | da_ov_raw_seek_lap ov_raw_seek_lap; 148 | da_ov_pcm_seek_lap ov_pcm_seek_lap; 149 | da_ov_pcm_seek_page_lap ov_pcm_seek_page_lap; 150 | da_ov_time_seek_lap ov_time_seek_lap; 151 | da_ov_time_seek_page_lap ov_time_seek_page_lap; 152 | da_ov_raw_tell ov_raw_tell; 153 | da_ov_pcm_tell ov_pcm_tell; 154 | da_ov_time_tell ov_time_tell; 155 | da_ov_info ov_info; 156 | da_ov_comment ov_comment; 157 | da_ov_read_float ov_read_float; 158 | da_ov_read_filter ov_read_filter; 159 | da_ov_read ov_read; 160 | da_ov_crosslap ov_crosslap; 161 | da_ov_halfrate ov_halfrate; 162 | da_ov_halfrate_p ov_halfrate_p; 163 | } -------------------------------------------------------------------------------- /import/derelict/ogg/vorbisfiletypes.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.ogg.vorbisfiletypes; 29 | 30 | private 31 | { 32 | import core.stdc.config; 33 | import derelict.ogg.oggtypes; 34 | import derelict.ogg.vorbistypes; 35 | import derelict.ogg.vorbisenctypes; 36 | } 37 | 38 | extern (C) 39 | { 40 | struct ov_callbacks 41 | { 42 | nothrow size_t function(void* ptr, size_t size, size_t nmemb, void* datasource ) read_func; 43 | nothrow int function(void* datasource, ogg_int64_t offset, int whence ) seek_func; 44 | nothrow int function(void* datasource ) close_func; 45 | nothrow c_long function(void* datasource ) tell_func; 46 | } 47 | } 48 | 49 | enum 50 | { 51 | NOTOPEN =0, 52 | PARTOPEN =1, 53 | OPENED =2, 54 | STREAMSET =3, 55 | INITSET =4, 56 | } 57 | 58 | struct OggVorbis_File 59 | { void *datasource; 60 | int seekable; 61 | ogg_int64_t offset; 62 | ogg_int64_t end; 63 | ogg_sync_state oy; 64 | int links; 65 | ogg_int64_t *offsets; 66 | ogg_int64_t *dataoffsets; 67 | c_long *serialnos; 68 | ogg_int64_t *pcmlengths; 69 | vorbis_info *vi; 70 | vorbis_comment *vc; 71 | ogg_int64_t pcm_offset; 72 | int ready_state; 73 | c_long current_serialno; 74 | int current_link; 75 | double bittrack; 76 | double samptrack; 77 | ogg_stream_state os; 78 | vorbis_dsp_state vd; 79 | vorbis_block vb; 80 | 81 | ov_callbacks callbacks; 82 | } -------------------------------------------------------------------------------- /import/derelict/ogg/vorbisfunctions.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.ogg.vorbisfunctions; 29 | 30 | private 31 | { 32 | import core.stdc.config; 33 | import derelict.ogg.oggtypes; 34 | import derelict.ogg.vorbistypes; 35 | } 36 | 37 | extern(C) 38 | { 39 | alias nothrow void function(vorbis_info*) da_vorbis_info_init; 40 | alias nothrow void function(vorbis_info*) da_vorbis_info_clear; 41 | alias nothrow int function(vorbis_info*,int) da_vorbis_info_blocksize; 42 | alias nothrow void function(vorbis_comment*) da_vorbis_comment_init; 43 | alias nothrow void function(vorbis_comment*, byte*t) da_vorbis_comment_add; 44 | alias nothrow void function(vorbis_comment*, byte*, byte*) da_vorbis_comment_add_tag; 45 | alias nothrow byte* function(vorbis_comment*, byte*, int) da_vorbis_comment_query; 46 | alias nothrow int function(vorbis_comment*, byte*) da_vorbis_comment_query_count; 47 | alias nothrow void function(vorbis_comment*) da_vorbis_comment_clear; 48 | alias nothrow int function(vorbis_dsp_state*, vorbis_block*) da_vorbis_block_init; 49 | alias nothrow int function(vorbis_block*) da_vorbis_block_clear; 50 | alias nothrow void function(vorbis_dsp_state*) da_vorbis_dsp_clear; 51 | alias nothrow double function(vorbis_dsp_state*, ogg_int64_t) da_vorbis_granule_time; 52 | alias nothrow const(char)* function() da_vorbis_version_string; 53 | alias nothrow int function(vorbis_dsp_state*,vorbis_info*) da_vorbis_analysis_init; 54 | alias nothrow int function(vorbis_comment*, ogg_packet*) da_vorbis_commentheader_out; 55 | alias nothrow int function(vorbis_dsp_state*, vorbis_comment*, ogg_packet*, ogg_packet*, ogg_packet*) da_vorbis_analysis_headerout; 56 | alias nothrow float** function(vorbis_dsp_state*, int) da_vorbis_analysis_buffer; 57 | alias nothrow int function(vorbis_dsp_state*, int) da_vorbis_analysis_wrote; 58 | alias nothrow int function(vorbis_dsp_state*,vorbis_block*) da_vorbis_analysis_blockout; 59 | alias nothrow int function(vorbis_block*,ogg_packet*) da_vorbis_analysis; 60 | alias nothrow int function(vorbis_block*) da_vorbis_bitrate_addblock; 61 | alias nothrow int function(vorbis_dsp_state*, ogg_packet*) da_vorbis_bitrate_flushpacket; 62 | alias nothrow int function(ogg_packet*) da_vorbis_synthesis_idheader; 63 | alias nothrow int function(vorbis_info*, vorbis_comment*, ogg_packet*) da_vorbis_synthesis_headerin; 64 | alias nothrow int function(vorbis_dsp_state*, vorbis_info*) da_vorbis_synthesis_init; 65 | alias nothrow int function(vorbis_dsp_state*) da_vorbis_synthesis_restart; 66 | alias nothrow int function(vorbis_block*, ogg_packet*) da_vorbis_synthesis; 67 | alias nothrow int function(vorbis_block*, ogg_packet*) da_vorbis_synthesis_trackonly; 68 | alias nothrow int function(vorbis_dsp_state*,vorbis_block*) da_vorbis_synthesis_blockin; 69 | alias nothrow int function(vorbis_dsp_state*, float***) da_vorbis_synthesis_pcmout; 70 | alias nothrow int function(vorbis_dsp_state*, float***) da_vorbis_synthesis_lapout; 71 | alias nothrow int function(vorbis_dsp_state*, int) da_vorbis_synthesis_read; 72 | alias nothrow c_long function(vorbis_info*,ogg_packet*) da_vorbis_packet_blocksize; 73 | alias nothrow int function(vorbis_info*, int) da_vorbis_synthesis_halfrate; 74 | alias nothrow int function(vorbis_info*) da_vorbis_synthesis_halfrate_p; 75 | } 76 | 77 | __gshared 78 | { 79 | da_vorbis_info_init vorbis_info_init; 80 | da_vorbis_info_clear vorbis_info_clear; 81 | da_vorbis_info_blocksize vorbis_info_blocksize; 82 | da_vorbis_comment_init vorbis_comment_init; 83 | da_vorbis_comment_add vorbis_comment_add; 84 | da_vorbis_comment_add_tag vorbis_comment_add_tag; 85 | da_vorbis_comment_query vorbis_comment_query; 86 | da_vorbis_comment_query_count vorbis_comment_query_count; 87 | da_vorbis_comment_clear vorbis_comment_clear; 88 | da_vorbis_block_init vorbis_block_init; 89 | da_vorbis_block_clear vorbis_block_clear; 90 | da_vorbis_dsp_clear vorbis_dsp_clear; 91 | da_vorbis_granule_time vorbis_granule_time; 92 | da_vorbis_version_string vorbis_version_string; 93 | da_vorbis_analysis_init vorbis_analysis_init; 94 | da_vorbis_commentheader_out vorbis_commentheader_out; 95 | da_vorbis_analysis_headerout vorbis_analysis_headerout; 96 | da_vorbis_analysis_buffer vorbis_analysis_buffer; 97 | da_vorbis_analysis_wrote vorbis_analysis_wrote; 98 | da_vorbis_analysis_blockout vorbis_analysis_blockout; 99 | da_vorbis_analysis vorbis_analysis; 100 | da_vorbis_bitrate_addblock vorbis_bitrate_addblock; 101 | da_vorbis_bitrate_flushpacket vorbis_bitrate_flushpacket; 102 | da_vorbis_synthesis_idheader vorbis_synthesis_idheader; 103 | da_vorbis_synthesis_headerin vorbis_synthesis_headerin; 104 | da_vorbis_synthesis_init vorbis_synthesis_init; 105 | da_vorbis_synthesis_restart vorbis_synthesis_restart; 106 | da_vorbis_synthesis vorbis_synthesis; 107 | da_vorbis_synthesis_trackonly vorbis_synthesis_trackonly; 108 | da_vorbis_synthesis_blockin vorbis_synthesis_blockin; 109 | da_vorbis_synthesis_pcmout vorbis_synthesis_pcmout; 110 | da_vorbis_synthesis_lapout vorbis_synthesis_lapout; 111 | da_vorbis_synthesis_read vorbis_synthesis_read; 112 | da_vorbis_packet_blocksize vorbis_packet_blocksize; 113 | da_vorbis_synthesis_halfrate vorbis_synthesis_halfrate; 114 | da_vorbis_synthesis_halfrate_p vorbis_synthesis_halfrate_p; 115 | } -------------------------------------------------------------------------------- /import/derelict/ogg/vorbistypes.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.ogg.vorbistypes; 29 | 30 | private 31 | { 32 | import core.stdc.config; 33 | import derelict.ogg.oggtypes; 34 | } 35 | 36 | enum 37 | { 38 | OV_FALSE = -1, 39 | OV_EOF = -2, 40 | OV_HOLE = -3, 41 | OV_EREAD = -128, 42 | OV_EFAULT = -129, 43 | OV_EIMPL = -130, 44 | OV_EINVAL = -131, 45 | OV_ENOTVORBIS = -132, 46 | OV_EBADHEADER = -133, 47 | OV_EVERSION = -134, 48 | OV_ENOTAUDIO = -135, 49 | OV_EBADPACKET = -136, 50 | OV_EBADLINK = -137, 51 | OV_ENOSEEK = -138, 52 | } 53 | 54 | struct vorbis_info 55 | { int _version; // Renamed from "version", since that's a keyword in D 56 | int channels; 57 | int rate; 58 | c_long bitrate_upper; 59 | c_long bitrate_nominal; 60 | c_long bitrate_lower; 61 | c_long bitrate_window; 62 | 63 | void *codec_setup; 64 | } 65 | 66 | struct vorbis_dsp_state 67 | { int analysisp; 68 | vorbis_info *vi; 69 | 70 | float **pcm; 71 | float **pcmret; 72 | int pcm_storage; 73 | int pcm_current; 74 | int pcm_returned; 75 | 76 | int preextrapolate; 77 | int eofflag; 78 | 79 | c_long lW; 80 | c_long W; 81 | c_long nW; 82 | c_long centerW; 83 | 84 | ogg_int64_t granulepos; 85 | ogg_int64_t sequence; 86 | 87 | ogg_int64_t glue_bits; 88 | ogg_int64_t time_bits; 89 | ogg_int64_t floor_bits; 90 | ogg_int64_t res_bits; 91 | 92 | void *backend_state; 93 | } 94 | 95 | 96 | struct vorbis_block 97 | { 98 | float **pcm; 99 | oggpack_buffer opb; 100 | c_long lW; 101 | c_long W; 102 | c_long nW; 103 | int pcmend; 104 | int mode; 105 | int eofflag; 106 | ogg_int64_t granulepos; 107 | ogg_int64_t sequence; 108 | vorbis_dsp_state *vd; 109 | void *localstore; 110 | c_long localtop; 111 | c_long localalloc; 112 | c_long totaluse; 113 | alloc_chain *reap; 114 | c_long glue_bits; 115 | c_long time_bits; 116 | c_long floor_bits; 117 | c_long res_bits; 118 | 119 | void *internal; 120 | } 121 | 122 | struct alloc_chain 123 | { void *ptr; 124 | alloc_chain *next; 125 | } 126 | 127 | struct vorbis_comment 128 | { 129 | char **user_comments; 130 | int *comment_lengths; 131 | int comments; 132 | char *vendor; 133 | } -------------------------------------------------------------------------------- /import/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 : bool 32 | { 33 | AL_VERSION_1_0 = true, 34 | AL_VERSION_1_1 = true, 35 | } 36 | 37 | alias byte ALboolean; 38 | alias char ALchar; 39 | alias byte ALbyte; 40 | alias ubyte ALubyte; 41 | alias short ALshort; 42 | alias ushort ALushort; 43 | alias int ALint; 44 | alias uint ALuint; 45 | alias int ALsizei; 46 | alias int ALenum; 47 | alias float ALfloat; 48 | alias double ALdouble; 49 | alias void ALvoid; 50 | 51 | enum : ALboolean 52 | { 53 | AL_FALSE = 0, 54 | AL_TRUE = 1, 55 | } 56 | 57 | enum : ALenum 58 | { 59 | AL_INVALID = -1, 60 | AL_NONE = 0, 61 | 62 | AL_SOURCE_RELATIVE = 0x202, 63 | 64 | AL_CONE_INNER_ANGLE = 0x1001, 65 | AL_CONE_OUTER_ANGLE = 0x1002, 66 | 67 | AL_PITCH = 0x1003, 68 | AL_POSITION = 0x1004, 69 | AL_DIRECTION = 0x1005, 70 | AL_VELOCITY = 0x1006, 71 | AL_LOOPING = 0x1007, 72 | AL_BUFFER = 0x1009, 73 | AL_GAIN = 0x100A, 74 | AL_MIN_GAIN = 0x100D, 75 | AL_MAX_GAIN = 0x100E, 76 | AL_ORIENTATION = 0x100F, 77 | 78 | AL_CHANNEL_MASK = 0x3000, 79 | 80 | AL_SOURCE_STATE = 0x1010, 81 | AL_INITIAL = 0x1011, 82 | AL_PLAYING = 0x1012, 83 | AL_PAUSED = 0x1013, 84 | AL_STOPPED = 0x1014, 85 | 86 | AL_BUFFERS_QUEUED = 0x1015, 87 | AL_BUFFERS_PROCESSED = 0x1016, 88 | 89 | AL_REFERENCE_DISTANCE = 0x1020, 90 | AL_ROLLOFF_FACTOR = 0x1021, 91 | AL_CONE_OUTER_GAIN = 0x1022, 92 | AL_MAX_DISTANCE = 0x1023, 93 | 94 | AL_SEC_OFFSET = 0x1024, 95 | AL_SAMPLE_OFFSET = 0x1025, 96 | AL_BYTE_OFFSET = 0x1026, 97 | 98 | AL_SOURCE_TYPE = 0x1027, 99 | AL_STATIC = 0x1028, 100 | AL_STREAMING = 0x1029, 101 | AL_UNDETERMINED = 0x1030, 102 | 103 | AL_FORMAT_MONO8 = 0x1100, 104 | AL_FORMAT_MONO16 = 0x1101, 105 | AL_FORMAT_STEREO8 = 0x1102, 106 | AL_FORMAT_STEREO16 = 0x1103, 107 | 108 | AL_FREQUENCEY = 0x2001, 109 | AL_BITS = 0x2002, 110 | AL_CHANNELS = 0x2003, 111 | AL_SIZE = 0x2004, 112 | 113 | AL_UNUSED = 0x2010, 114 | AL_PENDING = 0x2011, 115 | AL_PROCESSID = 0x2012, 116 | 117 | AL_NO_ERROR = AL_FALSE, 118 | 119 | AL_INVALID_NAME = 0xA001, 120 | AL_INVALID_ENUM = 0xA002, 121 | AL_INVALID_VALUE = 0xA003, 122 | AL_INVALID_OPERATION = 0xA004, 123 | AL_OUT_OF_MEMORY = 0xA005, 124 | 125 | AL_VENDOR = 0xB001, 126 | AL_VERSION = 0xB002, 127 | AL_RENDERER = 0xB003, 128 | AL_EXTENSIONS = 0xB004, 129 | 130 | AL_DOPPLER_FACTOR = 0xC000, 131 | AL_DOPPLER_VELOCITY = 0xC001, 132 | AL_SPEED_OF_SOUND = 0xC003, 133 | 134 | AL_DISTANCE_MODEL = 0xD000, 135 | AL_INVERSE_DISTANCE = 0xD001, 136 | AL_INVERSE_DISTANCE_CLAMPED = 0xD002, 137 | AL_LINEAR_DISTANCE = 0xD003, 138 | AL_LINEAR_DISTANCE_CLAMPED = 0xD004, 139 | AL_EXPONENT_DISTANCE = 0xD005, 140 | AL_EXPONENT_DISTANCE_CLAMPED = 0xD006, 141 | } 142 | 143 | // alc 144 | enum : bool 145 | { 146 | ALC_VERSION_0_1 = true 147 | } 148 | 149 | alias void ALCdevice; 150 | alias void ALCcontext; 151 | 152 | alias byte ALCboolean; 153 | alias char ALCchar; 154 | alias byte ALCbyte; 155 | alias ubyte ALCubyte; 156 | alias short ALCshort; 157 | alias ushort ALCushort; 158 | alias int ALCint; 159 | alias uint ALCuint; 160 | alias int ALCsizei; 161 | alias int ALCenum; 162 | alias float ALCfloat; 163 | alias double ALCdouble; 164 | alias void ALCvoid; 165 | 166 | enum : ALCboolean 167 | { 168 | ALC_FALSE = 0, 169 | ALC_TRUE = 1, 170 | } 171 | 172 | enum : ALCenum 173 | { 174 | ALC_FREQUENCY = 0x1007, 175 | ALC_REFRESH = 0x1008, 176 | ALC_SYNC = 0x1009, 177 | 178 | ALC_MONO_SOURCES = 0x1010, 179 | ALC_STEREO_SOURCES = 0x1011, 180 | 181 | ALC_NO_ERROR = ALC_FALSE, 182 | ALC_INVALID_DEVICE = 0xA001, 183 | ALC_INVALID_CONTEXT = 0xA002, 184 | ALC_INVALID_ENUM = 0xA003, 185 | ALC_INVALID_VALUE = 0xA004, 186 | ALC_OUT_OF_MEMORY = 0xA005, 187 | 188 | ALC_DEFAULT_DEVICE_SPECIFIER = 0x1004, 189 | ALC_DEVICE_SPECIFIER = 0x1005, 190 | ALC_EXTENSIONS = 0x1006, 191 | 192 | ALC_MAJOR_VERSION = 0x1000, 193 | ALC_MINOR_VERSION = 0x1001, 194 | 195 | ALC_ATTRIBUTES_SIZE = 0x1002, 196 | ALC_ALL_ATTRIBUTES = 0x1003, 197 | 198 | ALC_CAPTURE_DEVICE_SPECIFIER = 0x310, 199 | ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER = 0x311, 200 | ALC_CAPTURE_SAMPLES = 0x312, 201 | } 202 | 203 | // alext 204 | enum : ALenum 205 | { 206 | // AL_LOKI_IMA_ADPCM_format 207 | AL_FORMAT_IMA_ADPCM_MONO16_EXT = 0x10000, 208 | AL_FORMAT_IMA_ADPCM_STEREO16_EXT = 0x10001, 209 | 210 | // AL_LOKI_WAVE_format 211 | AL_FORMAT_WAVE_EXT = 0x10002, 212 | 213 | // AL_EXT_vorbis 214 | AL_FORMAT_VORBIS_EXT = 0x10003, 215 | 216 | // AL_LOKI_quadriphonic 217 | AL_FORMAT_QUAD8_LOKI = 0x10004, 218 | AL_FORMAT_QUAD16_LOKI = 0x10005, 219 | 220 | // AL_EXT_float32 221 | AL_FORMAT_MONO_FLOAT32 = 0x10010, 222 | AL_FORMAT_STEREO_FLOAT32 = 0x10011, 223 | 224 | // ALC_LOKI_audio_channel 225 | ALC_CHAN_MAIN_LOKI = 0x500001, 226 | ALC_CHAN_PCM_LOKI = 0x500002, 227 | ALC_CHAN_CD_LOKI = 0x500003, 228 | 229 | // ALC_ENUMERATE_ALL_EXT 230 | ALC_DEFAULT_ALL_DEVICES_SPECIFIER = 0x1012, 231 | ALC_ALL_DEVICES_SPECIFIER = 0x1013, 232 | 233 | // AL_EXT_MCFORMATS 234 | AL_FORMAT_QUAD8 = 0x1204, 235 | AL_FORMAT_QUAD16 = 0x1205, 236 | AL_FORMAT_QUAD32 = 0x1206, 237 | AL_FORMAT_REAR8 = 0x1207, 238 | AL_FORMAT_REAR16 = 0x1208, 239 | AL_FORMAT_REAR32 = 0x1209, 240 | AL_FORMAT_51CHN8 = 0x120A, 241 | AL_FORMAT_51CHN16 = 0x120B, 242 | AL_FORMAT_51CHN32 = 0x120C, 243 | AL_FORMAT_61CHN8 = 0x120D, 244 | AL_FORMAT_61CHN16 = 0x120E, 245 | AL_FORMAT_61CHN32 = 0x120F, 246 | AL_FORMAT_71CHN8 = 0x1210, 247 | AL_FORMAT_71CHN16 = 0x1211, 248 | AL_FORMAT_71CHN32 = 0x1212, 249 | 250 | // AL_EXT_IMA4 251 | AL_FORMAT_MONO_IMA4 = 0x1300, 252 | AL_FORMAT_STEREO_IMA4 = 0x1301, 253 | } -------------------------------------------------------------------------------- /import/derelict/opengl3/internal.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.opengl3.internal; 29 | 30 | private 31 | { 32 | import core.stdc.string; 33 | import std.string; 34 | import std.conv; 35 | 36 | import derelict.util.exception; 37 | import derelict.util.system; 38 | import derelict.opengl3.types; 39 | import derelict.opengl3.constants; 40 | import derelict.opengl3.functions; 41 | static if(Derelict_OS_Windows) import derelict.opengl3.wgl; 42 | else static if(Derelict_OS_Mac) import derelict.opengl3.cgl; 43 | else static if(Derelict_OS_Posix) import derelict.opengl3.glx; 44 | } 45 | 46 | package 47 | { 48 | void bindGLFunc(void** ptr, string symName) 49 | { 50 | auto sym = loadGLFunc(symName); 51 | if(!sym) 52 | throw new SymbolLoadException("Failed to load OpenGL symbol [" ~ symName ~ "]"); 53 | *ptr = sym; 54 | } 55 | 56 | bool isExtSupported(GLVersion glversion, string name) 57 | { 58 | // If OpenGL 3+ is loaded, use glGetStringi. 59 | if(glversion >= GLVersion.GL30) 60 | { 61 | auto cstr = name.toStringz(); 62 | int count; 63 | glGetIntegerv(GL_NUM_EXTENSIONS, &count); 64 | for(int i=0; i 50 | * See http://www.opengroup.org/onlinepubs/007908799/xsh/dlsym.html 51 | */ 52 | 53 | const int RTLD_NOW = 2; 54 | 55 | void *dlopen(const(char)* file, int mode); 56 | int dlclose(void* handle); 57 | void *dlsym(void* handle, const(char*) name); 58 | const(char)* dlerror(); 59 | } 60 | } 61 | 62 | alias void* SharedLibHandle; 63 | 64 | private SharedLibHandle LoadSharedLib(string libName) 65 | { 66 | return dlopen(libName.toStringz(), RTLD_NOW); 67 | } 68 | 69 | private void UnloadSharedLib(SharedLibHandle hlib) 70 | { 71 | dlclose(hlib); 72 | } 73 | 74 | private void* GetSymbol(SharedLibHandle hlib, string symbolName) 75 | { 76 | return dlsym(hlib, symbolName.toStringz()); 77 | } 78 | 79 | private string GetErrorStr() 80 | { 81 | auto err = dlerror(); 82 | if(err is null) 83 | return "Uknown Error"; 84 | 85 | return to!string(err); 86 | } 87 | 88 | } 89 | else static if(Derelict_OS_Windows) 90 | { 91 | private import derelict.util.wintypes; 92 | alias HMODULE SharedLibHandle; 93 | 94 | private SharedLibHandle LoadSharedLib(string libName) 95 | { 96 | return LoadLibraryA(libName.toStringz()); 97 | } 98 | 99 | private void UnloadSharedLib(SharedLibHandle hlib) 100 | { 101 | FreeLibrary(hlib); 102 | } 103 | 104 | private void* GetSymbol(SharedLibHandle hlib, string symbolName) 105 | { 106 | return GetProcAddress(hlib, symbolName.toStringz()); 107 | } 108 | 109 | private string GetErrorStr() 110 | { 111 | // adapted from Tango 112 | 113 | DWORD errcode = GetLastError(); 114 | 115 | LPCSTR msgBuf; 116 | DWORD i = FormatMessageA( 117 | FORMAT_MESSAGE_ALLOCATE_BUFFER | 118 | FORMAT_MESSAGE_FROM_SYSTEM | 119 | FORMAT_MESSAGE_IGNORE_INSERTS, 120 | null, 121 | errcode, 122 | MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), 123 | cast(LPCSTR)&msgBuf, 124 | 0, 125 | null); 126 | 127 | string text = to!string(msgBuf); 128 | LocalFree(cast(HLOCAL)msgBuf); 129 | 130 | if(i >= 2) 131 | i -= 2; 132 | return text[0 .. i]; 133 | } 134 | } 135 | else 136 | { 137 | static assert(0, "Derelict does not support this platform."); 138 | } 139 | 140 | struct SharedLib 141 | { 142 | public 143 | { 144 | string name() @property 145 | { 146 | return _name; 147 | } 148 | 149 | bool isLoaded() @property 150 | { 151 | return (_hlib !is null); 152 | } 153 | 154 | void load(string[] names) 155 | { 156 | if(isLoaded) 157 | return; 158 | 159 | string[] failedLibs; 160 | string[] reasons; 161 | 162 | foreach(n; names) 163 | { 164 | _hlib = LoadSharedLib(n); 165 | if(_hlib !is null) 166 | { 167 | _name = n; 168 | break; 169 | } 170 | 171 | failedLibs ~= n; 172 | reasons ~= GetErrorStr(); 173 | } 174 | 175 | if(!isLoaded) 176 | { 177 | SharedLibLoadException.throwNew(failedLibs, reasons); 178 | } 179 | } 180 | 181 | void* loadSymbol(string symbolName, bool doThrow = true) 182 | { 183 | void* sym = GetSymbol(_hlib, symbolName); 184 | if(doThrow && (sym is null)) 185 | Derelict_HandleMissingSymbol(name, symbolName); 186 | 187 | return sym; 188 | } 189 | 190 | void unload() 191 | { 192 | if(isLoaded) 193 | { 194 | UnloadSharedLib(_hlib); 195 | _hlib = null; 196 | } 197 | } 198 | } 199 | 200 | private 201 | { 202 | string _name; 203 | SharedLibHandle _hlib; 204 | } 205 | } 206 | -------------------------------------------------------------------------------- /import/derelict/util/system.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.util.system; 29 | 30 | version(Windows) enum Derelict_OS_Windows = true; 31 | else enum Derelict_OS_Windows = false; 32 | 33 | version(OSX) enum Derelict_OS_Mac = true; 34 | else enum Derelict_OS_Mac = false; 35 | 36 | version(linux) enum Derelict_OS_Linux = true; 37 | else enum Derelict_OS_Linux = false; 38 | 39 | version(Posix) enum Derelict_OS_Posix = true; 40 | else enum Derelict_OS_Posix = false; 41 | 42 | version(FreeBSD) 43 | { 44 | enum Derelict_OS_AnyBSD = true; 45 | enum Derelict_OS_FreeBSD = true; 46 | enum Derelict_OS_OpenBSD = false; 47 | enum Derelict_OS_OtherBSD = false; 48 | } 49 | else version(OpenBSD) 50 | { 51 | enum Derelict_OS_AnyBSD = true; 52 | enum Derelict_OS_FreeBSD = false; 53 | enum Derelict_OS_OpenBSD = true; 54 | enum Derelict_OS_OtherBSD = false; 55 | } 56 | else version(BSD) 57 | { 58 | enum Derelict_OS_AnyBSD = true; 59 | enum Derelict_OS_FreeBSD = false; 60 | enum Derelict_OS_OpenBSD = false; 61 | enum Derelict_OS_OtherBSD = true; 62 | } 63 | else 64 | { 65 | enum Derelict_OS_AnyBSD = false; 66 | enum Derelict_OS_FreeBSD = false; 67 | enum Derelict_OS_OpenBSD = false; 68 | enum Derelict_OS_OtherBSD = false; 69 | } -------------------------------------------------------------------------------- /import/derelict/util/wintypes.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.util.wintypes; 29 | 30 | /* 31 | This module is used internally to avoid any dependence upon external Win32 modules. 32 | Considering that there are modules in Phobos, Tango, and the Bindings project at 33 | DSource, we want to avoid any conflicts with whichever implementation Derelict users choose. 34 | */ 35 | version(Windows) 36 | { 37 | alias uint DWORD; 38 | alias ushort WORD; 39 | alias ushort USHORT; 40 | alias uint UINT; 41 | alias int INT; 42 | alias int LONG; 43 | alias ubyte BYTE; 44 | alias float FLOAT; 45 | alias int BOOL; 46 | alias DWORD COLORREF; 47 | 48 | alias const(char*) LPCSTR; 49 | alias void* LPVOID; 50 | 51 | alias void* HANDLE; 52 | alias HANDLE HDC; 53 | alias HANDLE HGLRC; 54 | alias HANDLE HINSTANCE; 55 | alias HANDLE HMODULE; 56 | alias HANDLE HWND; 57 | alias HANDLE HLOCAL; 58 | alias HANDLE HPALETTE; 59 | alias HANDLE HBITMAP; 60 | 61 | alias UINT WPARAM; 62 | alias LONG LPARAM; 63 | 64 | alias int function() FARPROC; 65 | 66 | struct LAYERPLANEDESCRIPTOR 67 | { 68 | WORD nSize; 69 | WORD nVersion; 70 | DWORD dwFlags; 71 | BYTE iPixelType; 72 | BYTE cColorBits; 73 | BYTE cRedBits; 74 | BYTE cRedShift; 75 | BYTE cGreenBits; 76 | BYTE cGreenShift; 77 | BYTE cBlueBits; 78 | BYTE cBlueShift; 79 | BYTE cAlphaBits; 80 | BYTE cAlphaShift; 81 | BYTE cAccumBits; 82 | BYTE cAccumRedBits; 83 | BYTE cAccumGreenBits; 84 | BYTE cAccumBlueBits; 85 | BYTE cAccumAlphaBits; 86 | BYTE cDepthBits; 87 | BYTE cStencilBits; 88 | BYTE cAuxBuffers; 89 | BYTE iLayerPlane; 90 | BYTE bReserved; 91 | COLORREF crTransparent; 92 | } 93 | 94 | struct POINTFLOAT 95 | { 96 | FLOAT x; 97 | FLOAT y; 98 | } 99 | 100 | struct GLYPHMETRICSFLOAT 101 | { 102 | FLOAT gmfBlackBoxX; 103 | FLOAT gmfBlackBoxY; 104 | POINTFLOAT gmfptGlyphOrigin; 105 | FLOAT gmfCellIncX; 106 | FLOAT gmfCellIncY; 107 | } 108 | 109 | struct PIXELFORMATDESCRIPTOR 110 | { 111 | WORD nSize; 112 | WORD nVersion; 113 | DWORD dwFlags; 114 | BYTE iPixelType; 115 | BYTE cColorBits; 116 | BYTE cRedBits; 117 | BYTE cRedShift; 118 | BYTE cGreenBits; 119 | BYTE cGreenShift; 120 | BYTE cBlueBits; 121 | BYTE cBlueShift; 122 | BYTE cAlphaBits; 123 | BYTE cAlphaShift; 124 | BYTE cAccumBits; 125 | BYTE cAccumRedBits; 126 | BYTE cAccumGreenBits; 127 | BYTE cAccumBlueBits; 128 | BYTE cAccumAlphaBits; 129 | BYTE cDepthBits; 130 | BYTE cStencilBits; 131 | BYTE cAuxBuffers; 132 | BYTE iLayerType; 133 | BYTE bReserved; 134 | DWORD dwLayerMask; 135 | DWORD dwVisibleMask; 136 | DWORD dwDamageMask; 137 | } 138 | 139 | struct VA_LIST {} 140 | 141 | enum : BYTE 142 | { 143 | PFD_TYPE_RGBA = 0, 144 | PFD_TYPE_COLORINDEX = 1 145 | } 146 | 147 | enum 148 | { 149 | PFD_MAIN_PLANE = 0, 150 | PFD_OVERLAY_PLANE = 1, 151 | PFD_UNDERLAY_PLANE = -1 152 | } 153 | 154 | enum 155 | { 156 | PFD_DOUBLEBUFFER = 0x00000001, 157 | PFD_STEREO = 0x00000002, 158 | PFD_DRAW_TO_WINDOW = 0x00000004, 159 | PFD_DRAW_TO_BITMAP = 0x00000008, 160 | PFD_SUPPORT_GDI = 0x00000010, 161 | PFD_SUPPORT_OPENGL = 0x00000020, 162 | PFD_GENERIC_FORMAT = 0x00000040, 163 | PFD_NEED_PALETTE = 0x00000080, 164 | PFD_NEED_SYSTEM_PALETTE = 0x00000100, 165 | PFD_SWAP_EXCHANGE = 0x00000200, 166 | PFD_SWAP_COPY = 0x00000400, 167 | PFD_SWAP_LAYER_BUFFERS = 0x00000800, 168 | PFD_GENERIC_ACCELERATED = 0x00001000, 169 | PFD_SUPPORT_DIRECTDRAW = 0x00002000, 170 | PFD_DEPTH_DONTCARE = 0x20000000, 171 | PFD_DOUBLBUFFER_DONTCARE = 0x40000000, 172 | PFD_STEREO_DONTCARE = 0x80000000, 173 | } 174 | 175 | enum 176 | { 177 | LANG_NEUTRAL = 0, 178 | SUBLANG_DEFAULT = 1, 179 | FORMAT_MESSAGE_ALLOCATE_BUFFER = 256, 180 | FORMAT_MESSAGE_IGNORE_INSERTS = 512, 181 | FORMAT_MESSAGE_FROM_SYSTEM = 4096 182 | } 183 | 184 | struct RGBQUAD { 185 | BYTE rgbBlue; 186 | BYTE rgbGreen; 187 | BYTE rgbRed; 188 | BYTE rgbReserved; 189 | } 190 | 191 | struct BITMAPINFOHEADER 192 | { 193 | DWORD biSize; 194 | LONG biWidth; 195 | LONG biHeight; 196 | WORD biPlanes; 197 | WORD biBitCount; 198 | DWORD biCompression; 199 | DWORD biSizeImage; 200 | LONG biXPelsPerMeter; 201 | LONG biYPelsPerMeter; 202 | DWORD biClrUsed; 203 | DWORD biClrImportant; 204 | } 205 | 206 | struct BITMAPINFO { 207 | BITMAPINFOHEADER bmiHeader; 208 | RGBQUAD bmiColors[1]; 209 | } 210 | 211 | struct RECT 212 | { 213 | LONG left; 214 | LONG top; 215 | LONG right; 216 | LONG bottom; 217 | } 218 | 219 | extern(Windows) 220 | { 221 | HDC GetDC(HWND); 222 | int ChoosePixelFormat(HDC,PIXELFORMATDESCRIPTOR*); 223 | void SetPixelFormat(HDC,int,PIXELFORMATDESCRIPTOR*); 224 | int GetPixelFormat(HDC); 225 | int DescribePixelFormat(HDC,int,UINT,PIXELFORMATDESCRIPTOR*); 226 | BOOL SwapBuffers(HDC); 227 | 228 | HMODULE LoadLibraryA(LPCSTR); 229 | FARPROC GetProcAddress(HMODULE, LPCSTR); 230 | void FreeLibrary(HMODULE); 231 | DWORD GetLastError(); 232 | DWORD FormatMessageA(DWORD, in void*, DWORD, DWORD, LPCSTR, DWORD, VA_LIST*); 233 | HLOCAL LocalFree(HLOCAL); 234 | } 235 | 236 | DWORD MAKELANGID(WORD p, WORD s) 237 | { 238 | return (((cast(WORD)s) << 10) | cast(WORD)p); 239 | } 240 | } -------------------------------------------------------------------------------- /import/derelict/util/xtypes.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.util.xtypes; 29 | 30 | private 31 | { 32 | import derelict.util.system; 33 | } 34 | 35 | static if(Derelict_OS_Posix) 36 | { 37 | alias int Bool; 38 | alias int Status; 39 | alias uint VisualID; 40 | alias byte* XPointer; 41 | 42 | alias void Display; 43 | alias uint XID; 44 | alias XID Window; 45 | alias XID Drawable; 46 | alias XID Font; 47 | alias XID Pixmap; 48 | alias XID Cursor; 49 | alias XID Colormap; 50 | alias XID GContext; 51 | alias XID KeySym; 52 | 53 | struct XExtData 54 | { 55 | int number; 56 | XExtData* next; 57 | extern(C) int function(XExtData*) free_private; 58 | XPointer private_data; 59 | } 60 | 61 | struct Visual 62 | { 63 | XExtData* ext_data; 64 | VisualID visualid; 65 | int _class; 66 | uint red_mask, green_mask, blue_mask; 67 | int bits_per_rgb; 68 | int map_entries; 69 | } 70 | 71 | struct XVisualInfo 72 | { 73 | Visual *visual; 74 | VisualID visualid; 75 | int screen; 76 | int depth; 77 | int _class; 78 | uint red_mask; 79 | uint green_mask; 80 | uint blue_mask; 81 | int colormap_size; 82 | int bits_per_rgb; 83 | } 84 | } -------------------------------------------------------------------------------- /lib/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdparker/Derelict3/587d02ba7846fdda26c7caa281bb661f6a046e3c/lib/.gitkeep -------------------------------------------------------------------------------- /lib/dmd/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdparker/Derelict3/587d02ba7846fdda26c7caa281bb661f6a046e3c/lib/dmd/.gitkeep -------------------------------------------------------------------------------- /lib/gdc/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdparker/Derelict3/587d02ba7846fdda26c7caa281bb661f6a046e3c/lib/gdc/.gitkeep -------------------------------------------------------------------------------- /lib/ldc/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdparker/Derelict3/587d02ba7846fdda26c7caa281bb661f6a046e3c/lib/ldc/.gitkeep -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "derelict", 3 | "description": "Dynamic bindings to a number of multimedia related C libraries, including OpenGL, OpenAL, SDL and others", 4 | "license": "Boost", 5 | "authors": [ 6 | "Mike Parker", 7 | "https://github.com/aldacron/Derelict3/graphs/contributors" 8 | ], 9 | 10 | "targetPath": "lib", 11 | 12 | "dependencies": { 13 | "derelict:alure": "~master", 14 | "derelict:assimp": "~master", 15 | "derelict:assimp3": "~master", 16 | "derelict:devil": "~master", 17 | "derelict:freeglut": "~master", 18 | "derelict:freeimage": "~master", 19 | "derelict:freetype": "~master", 20 | "derelict:glfw3": "~master", 21 | "derelict:lua": "~master", 22 | "derelict:ode": "~master", 23 | "derelict:ogg": "~master", 24 | "derelict:openal": "~master", 25 | "derelict:opengl3": "~master", 26 | "derelict:physfs": "~master", 27 | "derelict:pq": "~master", 28 | "derelict:sdl2": "~master", 29 | "derelict:sfml2": "~master", 30 | "derelict:tcod": "~master", 31 | }, 32 | 33 | "subPackages" : [ 34 | { 35 | "name": "util", 36 | "targetPath": "lib", 37 | "sourcePaths": ["import/derelict/util"], 38 | "importPaths": ["import"], 39 | "libs-posix": ["dl"] 40 | }, 41 | { 42 | "name": "alure", 43 | "dependencies": {"derelict:util": "~master"}, 44 | "targetPath": "lib", 45 | "sourcePaths": ["import/derelict/alure"], 46 | "importPaths": ["import"] 47 | }, 48 | { 49 | "name": "assimp", 50 | "dependencies": {"derelict:util": "~master"}, 51 | "targetPath": "lib", 52 | "sourcePaths": ["import/derelict/assimp"], 53 | "importPaths": ["import"] 54 | }, 55 | { 56 | "name": "assimp3", 57 | "dependencies": {"derelict:util": "~master"}, 58 | "targetPath": "lib", 59 | "sourcePaths": ["import/derelict/assimp3"], 60 | "importPaths": ["import"] 61 | }, 62 | { 63 | "name": "devil", 64 | "dependencies": {"derelict:util": "~master"}, 65 | "targetPath": "lib", 66 | "sourcePaths": ["import/derelict/devil"], 67 | "importPaths": ["import"] 68 | }, 69 | { 70 | "name": "freeglut", 71 | "dependencies": {"derelict:util": "~master"}, 72 | "targetPath": "lib", 73 | "sourcePaths": ["import/derelict/freeglut"], 74 | "importPaths": ["import"] 75 | }, 76 | { 77 | "name": "freeimage", 78 | "dependencies": {"derelict:util": "~master"}, 79 | "targetPath": "lib", 80 | "sourcePaths": ["import/derelict/freeimage"], 81 | "importPaths": ["import"] 82 | }, 83 | { 84 | "name": "freetype", 85 | "dependencies": {"derelict:util": "~master"}, 86 | "targetPath": "lib", 87 | "sourcePaths": ["import/derelict/freetype"], 88 | "importPaths": ["import"] 89 | }, 90 | { 91 | "name": "glfw3", 92 | "dependencies": {"derelict:util": "~master"}, 93 | "targetPath": "lib", 94 | "sourcePaths": ["import/derelict/glfw3"], 95 | "importPaths": ["import"] 96 | }, 97 | { 98 | "name": "lua", 99 | "dependencies": {"derelict:util": "~master"}, 100 | "targetPath": "lib", 101 | "sourcePaths": ["import/derelict/lua"], 102 | "importPaths": ["import"] 103 | }, 104 | { 105 | "name": "ode", 106 | "dependencies": {"derelict:util": "~master"}, 107 | "targetPath": "lib", 108 | "sourcePaths": ["import/derelict/ode"], 109 | "importPaths": ["import"] 110 | }, 111 | { 112 | "name": "ogg", 113 | "dependencies": {"derelict:util": "~master"}, 114 | "targetPath": "lib", 115 | "sourcePaths": ["import/derelict/ogg"], 116 | "importPaths": ["import"] 117 | }, 118 | { 119 | "name": "openal", 120 | "dependencies": {"derelict:util": "~master"}, 121 | "targetPath": "lib", 122 | "sourcePaths": ["import/derelict/openal"], 123 | "importPaths": ["import"] 124 | }, 125 | { 126 | "name": "opengl3", 127 | "dependencies": {"derelict:util": "~master"}, 128 | "targetPath": "lib", 129 | "sourcePaths": ["import/derelict/opengl3"], 130 | "importPaths": ["import"] 131 | }, 132 | { 133 | "name": "physfs", 134 | "dependencies": {"derelict:util": "~master"}, 135 | "targetPath": "lib", 136 | "sourcePaths": ["import/derelict/physfs"], 137 | "importPaths": ["import"] 138 | }, 139 | { 140 | "name": "pq", 141 | "dependencies": {"derelict:util": "~master"}, 142 | "targetPath": "lib", 143 | "sourcePaths": ["import/derelict/pq"], 144 | "importPaths": ["import"] 145 | }, 146 | { 147 | "name": "sdl2", 148 | "dependencies": {"derelict:util": "~master"}, 149 | "targetPath": "lib", 150 | "sourcePaths": ["import/derelict/sdl2"], 151 | "importPaths": ["import"] 152 | }, 153 | { 154 | "name": "sfml2", 155 | "dependencies": {"derelict:util": "~master"}, 156 | "targetPath": "lib", 157 | "sourcePaths": ["import/derelict/sfml2"], 158 | "importPaths": ["import"] 159 | }, 160 | { 161 | "name": "tcod", 162 | "dependencies": {"derelict:util": "~master"}, 163 | "targetPath": "lib", 164 | "sourcePaths": ["import/derelict/tcod"], 165 | "importPaths": ["import"] 166 | } 167 | ] 168 | } 169 | --------------------------------------------------------------------------------