PageRenderTime 3034ms CodeModel.GetById 30ms RepoModel.GetById 1ms app.codeStats 0ms

/import/derelict/assimp3/assimp.d

http://github.com/aldacron/Derelict3
D | 122 lines | 87 code | 8 blank | 27 comment | 10 complexity | f862fbcd4f0490249d399b66b9acf9f9 MD5 | raw file
  1. /*
  2. Boost Software License - Version 1.0 - August 17th, 2003
  3. Permission is hereby granted, free of charge, to any person or organization
  4. obtaining a copy of the software and accompanying documentation covered by
  5. this license (the "Software") to use, reproduce, display, distribute,
  6. execute, and transmit the Software, and to prepare derivative works of the
  7. Software, and to permit third-parties to whom the Software is furnished to
  8. do so, all subject to the following:
  9. The copyright notices in the Software and this entire statement, including
  10. the above license grant, this restriction and the following disclaimer,
  11. must be included in all copies of the Software, in whole or in part, and
  12. all derivative works of the Software, unless such copies or derivative
  13. works are solely in the form of machine-executable object code generated by
  14. a source language processor.
  15. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
  18. SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
  19. FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
  20. ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  21. DEALINGS IN THE SOFTWARE.
  22. */
  23. module derelict.assimp3.assimp;
  24. public {
  25. import derelict.assimp3.types;
  26. import derelict.assimp3.functions;
  27. }
  28. private {
  29. import derelict.util.loader;
  30. import derelict.util.system;
  31. static if(Derelict_OS_Windows) {
  32. static if (size_t.sizeof == 4)
  33. enum libNames = "assimp.dll, Assimp32.dll";
  34. else static if (size_t.sizeof == 8)
  35. enum libNames = "assimp.dll, Assimp64.dll";
  36. else
  37. static assert(0);
  38. }
  39. else static if(Derelict_OS_Mac)
  40. enum libNames = "libassimp.3.dylib";
  41. else static if(Derelict_OS_Posix)
  42. enum libNames = "libassimp.so.3, libassimp.so.3.0.0";
  43. else
  44. static assert(0, "Need to implement ASSIMP3 libNames for this operating system.");
  45. }
  46. class DerelictASSIMP3Loader : SharedLibLoader {
  47. protected override void loadSymbols() {
  48. bindFunc(cast(void**)&aiGetExportFormatCount, "aiGetExportFormatCount");
  49. bindFunc(cast(void**)&aiGetExportFormatDescription, "aiGetExportFormatDescription");
  50. bindFunc(cast(void**)&aiCopyScene, "aiCopyScene");
  51. bindFunc(cast(void**)&aiExportScene, "aiExportScene");
  52. bindFunc(cast(void**)&aiExportSceneEx, "aiExportSceneEx");
  53. bindFunc(cast(void**)&aiExportSceneToBlob, "aiExportSceneToBlob");
  54. bindFunc(cast(void**)&aiReleaseExportBlob, "aiReleaseExportBlob");
  55. bindFunc(cast(void**)&aiImportFile, "aiImportFile");
  56. bindFunc(cast(void**)&aiImportFileEx, "aiImportFileEx");
  57. bindFunc(cast(void**)&aiImportFileExWithProperties, "aiImportFileExWithProperties");
  58. bindFunc(cast(void**)&aiImportFileFromMemory, "aiImportFileFromMemory");
  59. bindFunc(cast(void**)&aiImportFileFromMemoryWithProperties, "aiImportFileFromMemoryWithProperties");
  60. bindFunc(cast(void**)&aiApplyPostProcessing, "aiApplyPostProcessing");
  61. bindFunc(cast(void**)&aiGetPredefinedLogStream, "aiGetPredefinedLogStream");
  62. bindFunc(cast(void**)&aiAttachLogStream, "aiAttachLogStream");
  63. bindFunc(cast(void**)&aiEnableVerboseLogging, "aiEnableVerboseLogging");
  64. bindFunc(cast(void**)&aiDetachLogStream, "aiDetachLogStream");
  65. bindFunc(cast(void**)&aiDetachAllLogStreams, "aiDetachAllLogStreams");
  66. bindFunc(cast(void**)&aiReleaseImport, "aiReleaseImport");
  67. bindFunc(cast(void**)&aiGetErrorString, "aiGetErrorString");
  68. bindFunc(cast(void**)&aiIsExtensionSupported, "aiIsExtensionSupported");
  69. bindFunc(cast(void**)&aiGetExtensionList, "aiGetExtensionList");
  70. bindFunc(cast(void**)&aiGetMemoryRequirements, "aiGetMemoryRequirements");
  71. bindFunc(cast(void**)&aiCreatePropertyStore, "aiCreatePropertyStore");
  72. bindFunc(cast(void**)&aiReleasePropertyStore, "aiReleasePropertyStore");
  73. bindFunc(cast(void**)&aiSetImportPropertyInteger, "aiSetImportPropertyInteger");
  74. bindFunc(cast(void**)&aiSetImportPropertyFloat, "aiSetImportPropertyFloat");
  75. bindFunc(cast(void**)&aiSetImportPropertyString, "aiSetImportPropertyString");
  76. bindFunc(cast(void**)&aiCreateQuaternionFromMatrix, "aiCreateQuaternionFromMatrix");
  77. bindFunc(cast(void**)&aiDecomposeMatrix, "aiDecomposeMatrix");
  78. bindFunc(cast(void**)&aiTransposeMatrix4, "aiTransposeMatrix4");
  79. bindFunc(cast(void**)&aiTransposeMatrix3, "aiTransposeMatrix3");
  80. bindFunc(cast(void**)&aiTransformVecByMatrix3, "aiTransformVecByMatrix3");
  81. bindFunc(cast(void**)&aiTransformVecByMatrix4, "aiTransformVecByMatrix4");
  82. bindFunc(cast(void**)&aiMultiplyMatrix4, "aiMultiplyMatrix4");
  83. bindFunc(cast(void**)&aiMultiplyMatrix3, "aiMultiplyMatrix3");
  84. bindFunc(cast(void**)&aiIdentityMatrix3, "aiIdentityMatrix3");
  85. bindFunc(cast(void**)&aiIdentityMatrix4, "aiIdentityMatrix4");
  86. bindFunc(cast(void**)&aiGetMaterialProperty, "aiGetMaterialProperty");
  87. bindFunc(cast(void**)&aiGetMaterialFloatArray, "aiGetMaterialFloatArray");
  88. bindFunc(cast(void**)&aiGetMaterialIntegerArray, "aiGetMaterialIntegerArray");
  89. bindFunc(cast(void**)&aiGetMaterialColor, "aiGetMaterialColor");
  90. bindFunc(cast(void**)&aiGetMaterialString, "aiGetMaterialString");
  91. bindFunc(cast(void**)&aiGetMaterialTextureCount, "aiGetMaterialTextureCount");
  92. bindFunc(cast(void**)&aiGetMaterialTexture, "aiGetMaterialTexture");
  93. bindFunc(cast(void**)&aiGetLegalString, "aiGetLegalString");
  94. bindFunc(cast(void**)&aiGetVersionMinor, "aiGetVersionMinor");
  95. bindFunc(cast(void**)&aiGetVersionMajor, "aiGetVersionMajor");
  96. bindFunc(cast(void**)&aiGetVersionRevision, "aiGetVersionRevision");
  97. bindFunc(cast(void**)&aiGetCompileFlags, "aiGetCompileFlags");
  98. }
  99. public this() {
  100. super( libNames );
  101. }
  102. }
  103. __gshared DerelictASSIMP3Loader DerelictASSIMP3;
  104. shared static this() {
  105. DerelictASSIMP3 = new DerelictASSIMP3Loader;
  106. }
  107. shared static ~this() {
  108. DerelictASSIMP3.unload();
  109. }