/import/derelict/assimp3/assimp.d
D | 122 lines | 87 code | 8 blank | 27 comment | 10 complexity | f862fbcd4f0490249d399b66b9acf9f9 MD5 | raw file
- /*
- Boost Software License - Version 1.0 - August 17th, 2003
- Permission is hereby granted, free of charge, to any person or organization
- obtaining a copy of the software and accompanying documentation covered by
- this license (the "Software") to use, reproduce, display, distribute,
- execute, and transmit the Software, and to prepare derivative works of the
- Software, and to permit third-parties to whom the Software is furnished to
- do so, all subject to the following:
- The copyright notices in the Software and this entire statement, including
- the above license grant, this restriction and the following disclaimer,
- must be included in all copies of the Software, in whole or in part, and
- all derivative works of the Software, unless such copies or derivative
- works are solely in the form of machine-executable object code generated by
- a source language processor.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
- SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
- FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- */
- module derelict.assimp3.assimp;
- public {
- import derelict.assimp3.types;
- import derelict.assimp3.functions;
- }
- private {
- import derelict.util.loader;
- import derelict.util.system;
- static if(Derelict_OS_Windows) {
- static if (size_t.sizeof == 4)
- enum libNames = "assimp.dll, Assimp32.dll";
- else static if (size_t.sizeof == 8)
- enum libNames = "assimp.dll, Assimp64.dll";
- else
- static assert(0);
- }
- else static if(Derelict_OS_Mac)
- enum libNames = "libassimp.3.dylib";
- else static if(Derelict_OS_Posix)
- enum libNames = "libassimp.so.3, libassimp.so.3.0.0";
- else
- static assert(0, "Need to implement ASSIMP3 libNames for this operating system.");
- }
- class DerelictASSIMP3Loader : SharedLibLoader {
- protected override void loadSymbols() {
- bindFunc(cast(void**)&aiGetExportFormatCount, "aiGetExportFormatCount");
- bindFunc(cast(void**)&aiGetExportFormatDescription, "aiGetExportFormatDescription");
- bindFunc(cast(void**)&aiCopyScene, "aiCopyScene");
- bindFunc(cast(void**)&aiExportScene, "aiExportScene");
- bindFunc(cast(void**)&aiExportSceneEx, "aiExportSceneEx");
- bindFunc(cast(void**)&aiExportSceneToBlob, "aiExportSceneToBlob");
- bindFunc(cast(void**)&aiReleaseExportBlob, "aiReleaseExportBlob");
- bindFunc(cast(void**)&aiImportFile, "aiImportFile");
- bindFunc(cast(void**)&aiImportFileEx, "aiImportFileEx");
- bindFunc(cast(void**)&aiImportFileExWithProperties, "aiImportFileExWithProperties");
- bindFunc(cast(void**)&aiImportFileFromMemory, "aiImportFileFromMemory");
- bindFunc(cast(void**)&aiImportFileFromMemoryWithProperties, "aiImportFileFromMemoryWithProperties");
- bindFunc(cast(void**)&aiApplyPostProcessing, "aiApplyPostProcessing");
- bindFunc(cast(void**)&aiGetPredefinedLogStream, "aiGetPredefinedLogStream");
- bindFunc(cast(void**)&aiAttachLogStream, "aiAttachLogStream");
- bindFunc(cast(void**)&aiEnableVerboseLogging, "aiEnableVerboseLogging");
- bindFunc(cast(void**)&aiDetachLogStream, "aiDetachLogStream");
- bindFunc(cast(void**)&aiDetachAllLogStreams, "aiDetachAllLogStreams");
- bindFunc(cast(void**)&aiReleaseImport, "aiReleaseImport");
- bindFunc(cast(void**)&aiGetErrorString, "aiGetErrorString");
- bindFunc(cast(void**)&aiIsExtensionSupported, "aiIsExtensionSupported");
- bindFunc(cast(void**)&aiGetExtensionList, "aiGetExtensionList");
- bindFunc(cast(void**)&aiGetMemoryRequirements, "aiGetMemoryRequirements");
- bindFunc(cast(void**)&aiCreatePropertyStore, "aiCreatePropertyStore");
- bindFunc(cast(void**)&aiReleasePropertyStore, "aiReleasePropertyStore");
- bindFunc(cast(void**)&aiSetImportPropertyInteger, "aiSetImportPropertyInteger");
- bindFunc(cast(void**)&aiSetImportPropertyFloat, "aiSetImportPropertyFloat");
- bindFunc(cast(void**)&aiSetImportPropertyString, "aiSetImportPropertyString");
- bindFunc(cast(void**)&aiCreateQuaternionFromMatrix, "aiCreateQuaternionFromMatrix");
- bindFunc(cast(void**)&aiDecomposeMatrix, "aiDecomposeMatrix");
- bindFunc(cast(void**)&aiTransposeMatrix4, "aiTransposeMatrix4");
- bindFunc(cast(void**)&aiTransposeMatrix3, "aiTransposeMatrix3");
- bindFunc(cast(void**)&aiTransformVecByMatrix3, "aiTransformVecByMatrix3");
- bindFunc(cast(void**)&aiTransformVecByMatrix4, "aiTransformVecByMatrix4");
- bindFunc(cast(void**)&aiMultiplyMatrix4, "aiMultiplyMatrix4");
- bindFunc(cast(void**)&aiMultiplyMatrix3, "aiMultiplyMatrix3");
- bindFunc(cast(void**)&aiIdentityMatrix3, "aiIdentityMatrix3");
- bindFunc(cast(void**)&aiIdentityMatrix4, "aiIdentityMatrix4");
- bindFunc(cast(void**)&aiGetMaterialProperty, "aiGetMaterialProperty");
- bindFunc(cast(void**)&aiGetMaterialFloatArray, "aiGetMaterialFloatArray");
- bindFunc(cast(void**)&aiGetMaterialIntegerArray, "aiGetMaterialIntegerArray");
- bindFunc(cast(void**)&aiGetMaterialColor, "aiGetMaterialColor");
- bindFunc(cast(void**)&aiGetMaterialString, "aiGetMaterialString");
- bindFunc(cast(void**)&aiGetMaterialTextureCount, "aiGetMaterialTextureCount");
- bindFunc(cast(void**)&aiGetMaterialTexture, "aiGetMaterialTexture");
- bindFunc(cast(void**)&aiGetLegalString, "aiGetLegalString");
- bindFunc(cast(void**)&aiGetVersionMinor, "aiGetVersionMinor");
- bindFunc(cast(void**)&aiGetVersionMajor, "aiGetVersionMajor");
- bindFunc(cast(void**)&aiGetVersionRevision, "aiGetVersionRevision");
- bindFunc(cast(void**)&aiGetCompileFlags, "aiGetCompileFlags");
- }
- public this() {
- super( libNames );
- }
- }
- __gshared DerelictASSIMP3Loader DerelictASSIMP3;
- shared static this() {
- DerelictASSIMP3 = new DerelictASSIMP3Loader;
- }
- shared static ~this() {
- DerelictASSIMP3.unload();
- }