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.opengl.glu; 29 30 public 31 { 32 import derelict.opengl.glutypes; 33 import derelict.opengl.glufuncs; 34 } 35 36 private 37 { 38 import derelict.util.loader; 39 import derelict.util.exception; 40 } 41 42 class DerelictGLULoader : SharedLibLoader 43 { 44 private: 45 this() 46 { 47 super( 48 "glu32.dll", 49 "libGLU.so,libGLU.so.1", 50 // on Mac, the GLU functions are in the OpenGL framework 51 "../Frameworks/OpenGL.framework/OpenGL, /Library/Frameworks/OpenGL.framework/OpenGL, /System/Library/Frameworks/OpenGL.framework/OpenGL" 52 ); 53 } 54 55 protected: 56 override void loadSymbols() 57 { 58 bindFunc(cast(void**)&gluBeginCurve, "gluBeginCurve"); 59 bindFunc(cast(void**)&gluBeginPolygon, "gluBeginPolygon"); 60 bindFunc(cast(void**)&gluBeginSurface, "gluBeginSurface"); 61 bindFunc(cast(void**)&gluBeginTrim, "gluBeginTrim"); 62 bindFunc(cast(void**)&gluBuild1DMipmaps, "gluBuild1DMipmaps"); 63 bindFunc(cast(void**)&gluBuild2DMipmaps, "gluBuild2DMipmaps"); 64 bindFunc(cast(void**)&gluCylinder, "gluCylinder"); 65 bindFunc(cast(void**)&gluDeleteNurbsRenderer, "gluDeleteNurbsRenderer"); 66 bindFunc(cast(void**)&gluDeleteQuadric, "gluDeleteQuadric"); 67 bindFunc(cast(void**)&gluDeleteTess, "gluDeleteTess"); 68 bindFunc(cast(void**)&gluDisk, "gluDisk"); 69 bindFunc(cast(void**)&gluEndCurve, "gluEndCurve"); 70 bindFunc(cast(void**)&gluEndPolygon, "gluEndPolygon"); 71 bindFunc(cast(void**)&gluEndSurface, "gluEndSurface"); 72 bindFunc(cast(void**)&gluEndTrim, "gluEndTrim"); 73 bindFunc(cast(void**)&gluErrorString, "gluErrorString"); 74 bindFunc(cast(void**)&gluGetNurbsProperty, "gluGetNurbsProperty"); 75 bindFunc(cast(void**)&gluGetString, "gluGetString"); 76 bindFunc(cast(void**)&gluGetTessProperty, "gluGetTessProperty"); 77 bindFunc(cast(void**)&gluLoadSamplingMatrices, "gluLoadSamplingMatrices"); 78 bindFunc(cast(void**)&gluLookAt, "gluLookAt"); 79 bindFunc(cast(void**)&gluNewNurbsRenderer, "gluNewNurbsRenderer"); 80 bindFunc(cast(void**)&gluNewQuadric, "gluNewQuadric"); 81 bindFunc(cast(void**)&gluNewTess, "gluNewTess"); 82 bindFunc(cast(void**)&gluNextContour, "gluNextContour"); 83 bindFunc(cast(void**)&gluNurbsCallback, "gluNurbsCallback"); 84 bindFunc(cast(void**)&gluNurbsCurve, "gluNurbsCurve"); 85 bindFunc(cast(void**)&gluNurbsProperty, "gluNurbsProperty"); 86 bindFunc(cast(void**)&gluNurbsSurface, "gluNurbsSurface"); 87 bindFunc(cast(void**)&gluOrtho2D, "gluOrtho2D"); 88 bindFunc(cast(void**)&gluPartialDisk, "gluPartialDisk"); 89 bindFunc(cast(void**)&gluPerspective, "gluPerspective"); 90 bindFunc(cast(void**)&gluPickMatrix, "gluPickMatrix"); 91 bindFunc(cast(void**)&gluProject, "gluProject"); 92 bindFunc(cast(void**)&gluPwlCurve, "gluPwlCurve"); 93 bindFunc(cast(void**)&gluQuadricCallback, "gluQuadricCallback"); 94 bindFunc(cast(void**)&gluQuadricDrawStyle, "gluQuadricDrawStyle"); 95 bindFunc(cast(void**)&gluQuadricNormals, "gluQuadricNormals"); 96 bindFunc(cast(void**)&gluQuadricOrientation, "gluQuadricOrientation"); 97 bindFunc(cast(void**)&gluQuadricTexture, "gluQuadricTexture"); 98 bindFunc(cast(void**)&gluScaleImage, "gluScaleImage"); 99 bindFunc(cast(void**)&gluSphere, "gluSphere"); 100 bindFunc(cast(void**)&gluTessBeginContour, "gluTessBeginContour"); 101 bindFunc(cast(void**)&gluTessBeginPolygon, "gluTessBeginPolygon"); 102 bindFunc(cast(void**)&gluTessCallback, "gluTessCallback"); 103 bindFunc(cast(void**)&gluTessEndContour, "gluTessEndContour"); 104 bindFunc(cast(void**)&gluTessEndPolygon, "gluTessEndPolygon"); 105 bindFunc(cast(void**)&gluTessNormal, "gluTessNormal"); 106 bindFunc(cast(void**)&gluTessProperty, "gluTessProperty"); 107 bindFunc(cast(void**)&gluTessVertex, "gluTessVertex"); 108 bindFunc(cast(void**)&gluUnProject, "gluUnProject"); 109 } 110 } 111 112 DerelictGLULoader DerelictGLU; 113 114 static this() 115 { 116 DerelictGLU = new DerelictGLULoader(); 117 } 118 119 static ~this() 120 { 121 if(SharedLibLoader.isAutoUnloadEnabled()) 122 DerelictGLU.unload(); 123 }