├── .gitignore ├── README.md ├── dub.sdl └── source └── derelict └── glfw3 ├── dynload.d ├── glfw3.d ├── package.d ├── statfun.d └── types.d /.gitignore: -------------------------------------------------------------------------------- 1 | lib 2 | bin 3 | update.txt 4 | .dub 5 | dub.selections.* -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | DerelictGLFW3 2 | ============= 3 | 4 | A dynamic and static binding to version 3.2 of the [GLFW 3][1] library for the D Programming Language. 5 | 6 | The dynamic binding is the default configuration and allows you to load the GLFW3 shared library manually at runtime. Please see the [DerelictGLFW3 documentation][2] and the sections on [Compiling and Linking][3] and [The Derelict Loader][4], in the Derelict documentation, for information on how to build DerelictGLFW3 and load the GLFW3 library at run time. Here's some sample code. 7 | 8 | ```D 9 | import derelict.glfw3.glfw3; 10 | 11 | void main() { 12 | // Load the GLFW 3 library. 13 | DerelictGLFW3.load(); 14 | 15 | // Now GLFW 3 functions can be called. 16 | ... 17 | } 18 | ``` 19 | 20 | The static binding allows you to link with the GLFW3 library both dynamically and statically. To enable this configuration, you must specify it as a subConfiguration in your __dub.sdl__ file, or compile DerelictGLFW3 manually with __-version=DerelictGLFW3Static__. See the [DerelictGLFW3 documentation][5] for more information on this configuration. 21 | 22 | [1]: http://www.glfw.org/ 23 | [2]: https://derelictorg.github.io/packages/glfw3.html 24 | [3]: http://derelictorg.github.io/building/overview/ 25 | [4]: http://derelictorg.github.io/loading/loader/ 26 | [5]: https://derelictorg.github.io/packages/glfw3.html#statbind -------------------------------------------------------------------------------- /dub.sdl: -------------------------------------------------------------------------------- 1 | name "derelict-glfw3" 2 | description "A dynamic and static binding to the GLFW 3 library." 3 | homepage "https://derelictorg.github.io/packages/glfw3.html" 4 | license "Boost" 5 | authors "Mike Parker" 6 | targetType "library" 7 | targetPath "lib" 8 | targetName "DerelictGLFW3" 9 | 10 | configuration "derelict-glfw3-dynamic" { 11 | excludedSourceFiles "source/derelict/glfw3/statfun.d" 12 | dependency "derelict-util" version="~>3.0.0-beta.1" 13 | } 14 | 15 | configuration "derelict-glfw3-static" { 16 | excludedSourceFiles "source/derelict/glfw3/dynload.d" 17 | versions "DerelictGLFW3_Static" 18 | } -------------------------------------------------------------------------------- /source/derelict/glfw3/dynload.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.dynload; 29 | 30 | version(Derlict_Static) {} 31 | else version(DerelictGLFW3_Static) {} 32 | else { version = DerelictGLFW3_Dynamic; } 33 | 34 | version(DerelictGLFW3_Dynamic): 35 | 36 | public import derelict.glfw3.types; 37 | import derelict.util.loader, 38 | derelict.util.system; 39 | 40 | extern(C) @nogc nothrow { 41 | alias da_glfwInit = int function(); 42 | alias da_glfwTerminate = void function(); 43 | alias da_glfwGetVersion = void function(int*,int*,int*); 44 | alias da_glfwGetVersionString = const(char)* function(); 45 | 46 | alias da_glfwSetErrorCallback = GLFWerrorfun function(GLFWerrorfun); 47 | 48 | alias da_glfwGetMonitors = GLFWmonitor** function(int*); 49 | alias da_glfwGetPrimaryMonitor = GLFWmonitor* function(); 50 | alias da_glfwGetMonitorPos = void function(GLFWmonitor*,int*,int*); 51 | alias da_glfwGetMonitorPhysicalSize = void function(GLFWmonitor*,int*,int*); 52 | alias da_glfwGetMonitorName = const(char)* function(GLFWmonitor*); 53 | alias da_glfwSetMonitorCallback = GLFWmonitorfun function(GLFWmonitorfun); 54 | 55 | alias da_glfwGetVideoModes = const(GLFWvidmode)* function(GLFWmonitor*,int*); 56 | alias da_glfwGetVideoMode = const(GLFWvidmode)* function(GLFWmonitor*); 57 | 58 | alias da_glfwSetGamma = void function(GLFWmonitor*,float); 59 | alias da_glfwGetGammaRamp = const(GLFWgammaramp*) function(GLFWmonitor*); 60 | alias da_glfwSetGammaRamp = void function(GLFWmonitor*,const(GLFWgammaramp)*); 61 | 62 | alias da_glfwDefaultWindowHints = void function(); 63 | alias da_glfwWindowHint = void function(int,int); 64 | alias da_glfwCreateWindow = GLFWwindow* function(int,int,const(char)*,GLFWmonitor*,GLFWwindow*); 65 | alias da_glfwDestroyWindow = void function(GLFWwindow*); 66 | alias da_glfwWindowShouldClose = int function(GLFWwindow*); 67 | alias da_glfwSetWindowShouldClose = void function(GLFWwindow*,int); 68 | alias da_glfwSetWindowTitle = void function(GLFWwindow*,const(char)*); 69 | alias da_glfwSetWindowIcon = void function(GLFWwindow*,int,const(GLFWimage)*); 70 | alias da_glfwGetWindowPos = void function(GLFWwindow*,int*,int*); 71 | alias da_glfwSetWindowPos = void function(GLFWwindow*,int,int); 72 | alias da_glfwGetWindowSize = void function(GLFWwindow*,int*,int*); 73 | alias da_glfwSetWindowSizeLimits = void function(GLFWwindow*,int,int,int,int); 74 | alias da_glfwSetWindowAspectRatio = void function(GLFWwindow*,int,int); 75 | alias da_glfwSetWindowSize = void function(GLFWwindow*,int,int); 76 | alias da_glfwGetFramebufferSize = void function(GLFWwindow*,int*,int*); 77 | alias da_glfwGetWindowFrameSize = void function(GLFWwindow*,int*,int*,int*,int*); 78 | alias da_glfwIconifyWindow = void function(GLFWwindow*); 79 | alias da_glfwRestoreWindow = void function(GLFWwindow*); 80 | alias da_glfwMaximizeWindow = void function(GLFWwindow*); 81 | alias da_glfwShowWindow = void function(GLFWwindow*); 82 | alias da_glfwHideWindow = void function(GLFWwindow*); 83 | alias da_glfwFocusWindow = void function(GLFWwindow*); 84 | alias da_glfwGetWindowMonitor = GLFWmonitor* function(GLFWwindow*); 85 | alias da_glfwSetWindowMonitor = void function(GLFWwindow*,GLFWmonitor*,int,int,int,int,int); 86 | alias da_glfwGetWindowAttrib = int function(GLFWwindow*,int); 87 | alias da_glfwSetWindowUserPointer = void function(GLFWwindow*,void*); 88 | alias da_glfwGetWindowUserPointer = void* function(GLFWwindow*); 89 | alias da_glfwSetWindowPosCallback = GLFWwindowposfun function(GLFWwindow*,GLFWwindowposfun); 90 | alias da_glfwSetWindowSizeCallback = GLFWwindowsizefun function(GLFWwindow*,GLFWwindowsizefun); 91 | alias da_glfwSetWindowCloseCallback = GLFWwindowclosefun function(GLFWwindow*,GLFWwindowclosefun); 92 | alias da_glfwSetWindowRefreshCallback = GLFWwindowrefreshfun function(GLFWwindow*,GLFWwindowrefreshfun); 93 | alias da_glfwSetWindowFocusCallback = GLFWwindowfocusfun function(GLFWwindow*,GLFWwindowfocusfun); 94 | alias da_glfwSetWindowIconifyCallback = GLFWwindowiconifyfun function(GLFWwindow*,GLFWwindowiconifyfun); 95 | alias da_glfwSetFramebufferSizeCallback = GLFWframebuffersizefun function(GLFWwindow*,GLFWframebuffersizefun); 96 | 97 | alias da_glfwPollEvents = void function(); 98 | alias da_glfwWaitEvents = void function(); 99 | alias da_glfwWaitEventsTimeout = void function(double); 100 | alias da_glfwPostEmptyEvent = void function(); 101 | 102 | alias da_glfwGetInputMode = int function(GLFWwindow*,int); 103 | alias da_glfwSetInputMode = void function(GLFWwindow*,int,int); 104 | alias da_glfwGetKeyName = const(char)* function(int,int); 105 | alias da_glfwGetKey = int function(GLFWwindow*,int); 106 | alias da_glfwGetMouseButton = int function(GLFWwindow*,int); 107 | alias da_glfwGetCursorPos = void function(GLFWwindow*,double*,double*); 108 | alias da_glfwSetCursorPos = void function(GLFWwindow*,double,double); 109 | alias da_glfwCreateCursor = GLFWcursor* function(const(GLFWimage)*,int,int); 110 | alias da_glfwCreateStandardCursor = GLFWcursor* function(int); 111 | alias da_glfwDestroyCursor = void function(GLFWcursor*); 112 | alias da_glfwSetCursor = void function(GLFWwindow*,GLFWcursor*); 113 | alias da_glfwSetKeyCallback = GLFWkeyfun function(GLFWwindow*,GLFWkeyfun); 114 | alias da_glfwSetCharCallback = GLFWcharfun function(GLFWwindow*,GLFWcharfun); 115 | alias da_glfwSetCharModsCallback = GLFWcharmodsfun function(GLFWwindow*,GLFWcharmodsfun); 116 | alias da_glfwSetMouseButtonCallback = GLFWmousebuttonfun function(GLFWwindow*,GLFWmousebuttonfun); 117 | alias da_glfwSetCursorPosCallback = GLFWcursorposfun function(GLFWwindow*,GLFWcursorposfun); 118 | alias da_glfwSetCursorEnterCallback = GLFWcursorenterfun function(GLFWwindow*,GLFWcursorenterfun); 119 | alias da_glfwSetScrollCallback = GLFWscrollfun function(GLFWwindow*,GLFWscrollfun); 120 | alias da_glfwSetDropCallback = GLFWdropfun function(GLFWwindow*,GLFWdropfun); 121 | 122 | alias da_glfwJoystickPresent = int function(int); 123 | alias da_glfwGetJoystickAxes = float* function(int,int*); 124 | alias da_glfwGetJoystickButtons = ubyte* function(int,int*); 125 | alias da_glfwGetJoystickName = const(char)* function(int); 126 | alias da_glfwSetJoystickCallback = GLFWjoystickfun function(GLFWjoystickfun); 127 | 128 | alias da_glfwSetClipboardString = void function(GLFWwindow*,const(char)*); 129 | alias da_glfwGetClipboardString = const(char)* function(GLFWwindow*); 130 | 131 | alias da_glfwGetTime = double function(); 132 | alias da_glfwSetTime = void function(double); 133 | alias da_glfwGetTimerValue = long function(); 134 | alias da_glfwGetTimerFrequency = long function(); 135 | 136 | alias da_glfwMakeContextCurrent = void function(GLFWwindow*); 137 | alias da_glfwGetCurrentContext = GLFWwindow* function(); 138 | alias da_glfwSwapBuffers = void function(GLFWwindow*); 139 | alias da_glfwSwapInterval = void function(int); 140 | alias da_glfwExtensionSupported = int function(const(char)*); 141 | alias da_glfwGetProcAddress = GLFWglproc function(const(char)*); 142 | alias da_glfwVulkanSupported = int function(); 143 | } 144 | 145 | __gshared { 146 | da_glfwInit glfwInit; 147 | da_glfwTerminate glfwTerminate; 148 | da_glfwGetVersion glfwGetVersion; 149 | da_glfwGetVersionString glfwGetVersionString; 150 | da_glfwSetErrorCallback glfwSetErrorCallback; 151 | da_glfwGetMonitors glfwGetMonitors; 152 | da_glfwGetPrimaryMonitor glfwGetPrimaryMonitor; 153 | da_glfwGetMonitorPos glfwGetMonitorPos; 154 | da_glfwGetMonitorPhysicalSize glfwGetMonitorPhysicalSize; 155 | da_glfwGetMonitorName glfwGetMonitorName; 156 | da_glfwSetMonitorCallback glfwSetMonitorCallback; 157 | da_glfwGetVideoModes glfwGetVideoModes; 158 | da_glfwGetVideoMode glfwGetVideoMode; 159 | da_glfwSetGamma glfwSetGamma; 160 | da_glfwGetGammaRamp glfwGetGammaRamp; 161 | da_glfwSetGammaRamp glfwSetGammaRamp; 162 | da_glfwDefaultWindowHints glfwDefaultWindowHints; 163 | da_glfwWindowHint glfwWindowHint; 164 | da_glfwCreateWindow glfwCreateWindow; 165 | da_glfwDestroyWindow glfwDestroyWindow; 166 | da_glfwWindowShouldClose glfwWindowShouldClose; 167 | da_glfwSetWindowShouldClose glfwSetWindowShouldClose; 168 | da_glfwSetWindowTitle glfwSetWindowTitle; 169 | da_glfwSetWindowIcon glfwSetWindowIcon; 170 | da_glfwGetWindowPos glfwGetWindowPos; 171 | da_glfwSetWindowPos glfwSetWindowPos; 172 | da_glfwGetWindowSize glfwGetWindowSize; 173 | da_glfwSetWindowSizeLimits glfwSetWindowSizeLimits; 174 | da_glfwSetWindowAspectRatio glfwSetWindowAspectRatio; 175 | da_glfwSetWindowSize glfwSetWindowSize; 176 | da_glfwGetFramebufferSize glfwGetFramebufferSize; 177 | da_glfwGetWindowFrameSize glfwGetWindowFrameSize; 178 | da_glfwIconifyWindow glfwIconifyWindow; 179 | da_glfwRestoreWindow glfwRestoreWindow; 180 | da_glfwMaximizeWindow glfwMaximizeWindow; 181 | da_glfwShowWindow glfwShowWindow; 182 | da_glfwHideWindow glfwHideWindow; 183 | da_glfwFocusWindow glfwFocusWindow; 184 | da_glfwGetWindowMonitor glfwGetWindowMonitor; 185 | da_glfwSetWindowMonitor glfwSetWindowMonitor; 186 | da_glfwGetWindowAttrib glfwGetWindowAttrib; 187 | da_glfwSetWindowUserPointer glfwSetWindowUserPointer; 188 | da_glfwGetWindowUserPointer glfwGetWindowUserPointer; 189 | da_glfwSetWindowPosCallback glfwSetWindowPosCallback; 190 | da_glfwSetWindowSizeCallback glfwSetWindowSizeCallback; 191 | da_glfwSetWindowCloseCallback glfwSetWindowCloseCallback; 192 | da_glfwSetWindowRefreshCallback glfwSetWindowRefreshCallback; 193 | da_glfwSetWindowFocusCallback glfwSetWindowFocusCallback; 194 | da_glfwSetWindowIconifyCallback glfwSetWindowIconifyCallback; 195 | da_glfwSetFramebufferSizeCallback glfwSetFramebufferSizeCallback; 196 | da_glfwPollEvents glfwPollEvents; 197 | da_glfwWaitEvents glfwWaitEvents; 198 | da_glfwWaitEventsTimeout glfwWaitEventsTimeout; 199 | da_glfwPostEmptyEvent glfwPostEmptyEvent; 200 | da_glfwGetInputMode glfwGetInputMode; 201 | da_glfwSetInputMode glfwSetInputMode; 202 | da_glfwGetKeyName glfwGetKeyName; 203 | da_glfwGetKey glfwGetKey; 204 | da_glfwGetMouseButton glfwGetMouseButton; 205 | da_glfwGetCursorPos glfwGetCursorPos; 206 | da_glfwSetCursorPos glfwSetCursorPos; 207 | da_glfwCreateCursor glfwCreateCursor; 208 | da_glfwCreateStandardCursor glfwCreateStandardCursor; 209 | da_glfwDestroyCursor glfwDestroyCursor; 210 | da_glfwSetCursor glfwSetCursor; 211 | da_glfwSetKeyCallback glfwSetKeyCallback; 212 | da_glfwSetCharCallback glfwSetCharCallback; 213 | da_glfwSetCharModsCallback glfwSetCharModsCallback; 214 | da_glfwSetMouseButtonCallback glfwSetMouseButtonCallback; 215 | da_glfwSetCursorPosCallback glfwSetCursorPosCallback; 216 | da_glfwSetCursorEnterCallback glfwSetCursorEnterCallback; 217 | da_glfwSetScrollCallback glfwSetScrollCallback; 218 | da_glfwSetDropCallback glfwSetDropCallback; 219 | da_glfwJoystickPresent glfwJoystickPresent; 220 | da_glfwGetJoystickAxes glfwGetJoystickAxes; 221 | da_glfwGetJoystickButtons glfwGetJoystickButtons; 222 | da_glfwGetJoystickName glfwGetJoystickName; 223 | da_glfwSetJoystickCallback glfwSetJoystickCallback; 224 | da_glfwSetClipboardString glfwSetClipboardString; 225 | da_glfwGetClipboardString glfwGetClipboardString; 226 | da_glfwGetTime glfwGetTime; 227 | da_glfwSetTime glfwSetTime; 228 | da_glfwGetTimerValue glfwGetTimerValue; 229 | da_glfwGetTimerFrequency glfwGetTimerFrequency; 230 | da_glfwMakeContextCurrent glfwMakeContextCurrent; 231 | da_glfwGetCurrentContext glfwGetCurrentContext; 232 | da_glfwSwapBuffers glfwSwapBuffers; 233 | da_glfwSwapInterval glfwSwapInterval; 234 | da_glfwExtensionSupported glfwExtensionSupported; 235 | da_glfwGetProcAddress glfwGetProcAddress; 236 | da_glfwVulkanSupported glfwVulkanSupported; 237 | } 238 | 239 | class DerelictGLFW3Loader : SharedLibLoader { 240 | this() 241 | { 242 | super(libNames); 243 | } 244 | 245 | void bindMixedFunc(void** ptr, string name) 246 | { 247 | return bindFunc(ptr, name); 248 | } 249 | 250 | protected override void loadSymbols() 251 | { 252 | bindFunc(cast(void**)&glfwInit,"glfwInit"); 253 | bindFunc(cast(void**)&glfwTerminate,"glfwTerminate"); 254 | bindFunc(cast(void**)&glfwGetVersion,"glfwGetVersion"); 255 | bindFunc(cast(void**)&glfwGetVersionString,"glfwGetVersionString"); 256 | bindFunc(cast(void**)&glfwSetErrorCallback,"glfwSetErrorCallback"); 257 | bindFunc(cast(void**)&glfwGetMonitors,"glfwGetMonitors"); 258 | bindFunc(cast(void**)&glfwGetPrimaryMonitor,"glfwGetPrimaryMonitor"); 259 | bindFunc(cast(void**)&glfwGetMonitorPos,"glfwGetMonitorPos"); 260 | bindFunc(cast(void**)&glfwGetMonitorPhysicalSize,"glfwGetMonitorPhysicalSize"); 261 | bindFunc(cast(void**)&glfwGetMonitorName,"glfwGetMonitorName"); 262 | bindFunc(cast(void**)&glfwSetMonitorCallback,"glfwSetMonitorCallback"); 263 | bindFunc(cast(void**)&glfwGetVideoModes,"glfwGetVideoModes"); 264 | bindFunc(cast(void**)&glfwGetVideoMode,"glfwGetVideoMode"); 265 | bindFunc(cast(void**)&glfwSetGamma,"glfwSetGamma"); 266 | bindFunc(cast(void**)&glfwGetGammaRamp,"glfwGetGammaRamp"); 267 | bindFunc(cast(void**)&glfwSetGammaRamp,"glfwSetGammaRamp"); 268 | bindFunc(cast(void**)&glfwDefaultWindowHints,"glfwDefaultWindowHints"); 269 | bindFunc(cast(void**)&glfwWindowHint,"glfwWindowHint"); 270 | bindFunc(cast(void**)&glfwCreateWindow,"glfwCreateWindow"); 271 | bindFunc(cast(void**)&glfwDestroyWindow,"glfwDestroyWindow"); 272 | bindFunc(cast(void**)&glfwWindowShouldClose,"glfwWindowShouldClose"); 273 | bindFunc(cast(void**)&glfwSetWindowShouldClose,"glfwSetWindowShouldClose"); 274 | bindFunc(cast(void**)&glfwSetWindowTitle,"glfwSetWindowTitle"); 275 | bindFunc(cast(void**)&glfwSetWindowIcon, "glfwSetWindowIcon"); 276 | bindFunc(cast(void**)&glfwGetWindowPos,"glfwGetWindowPos"); 277 | bindFunc(cast(void**)&glfwSetWindowPos,"glfwSetWindowPos"); 278 | bindFunc(cast(void**)&glfwSetWindowSizeLimits, "glfwSetWindowSizeLimits"); 279 | bindFunc(cast(void**)&glfwSetWindowAspectRatio, "glfwSetWindowAspectRatio"); 280 | bindFunc(cast(void**)&glfwGetWindowSize,"glfwGetWindowSize"); 281 | bindFunc(cast(void**)&glfwSetWindowSize,"glfwSetWindowSize"); 282 | bindFunc(cast(void**)&glfwGetFramebufferSize,"glfwGetFramebufferSize"); 283 | bindFunc(cast(void**)&glfwGetWindowFrameSize,"glfwGetWindowFrameSize"); 284 | bindFunc(cast(void**)&glfwIconifyWindow,"glfwIconifyWindow"); 285 | bindFunc(cast(void**)&glfwRestoreWindow,"glfwRestoreWindow"); 286 | bindFunc(cast(void**)&glfwMaximizeWindow, "glfwMaximizeWindow"); 287 | bindFunc(cast(void**)&glfwShowWindow,"glfwShowWindow"); 288 | bindFunc(cast(void**)&glfwHideWindow,"glfwHideWindow"); 289 | bindFunc(cast(void**)&glfwFocusWindow, "glfwFocusWindow"); 290 | bindFunc(cast(void**)&glfwGetWindowMonitor,"glfwGetWindowMonitor"); 291 | bindFunc(cast(void**)&glfwSetWindowMonitor, "glfwSetWindowMonitor"); 292 | bindFunc(cast(void**)&glfwGetWindowAttrib,"glfwGetWindowAttrib"); 293 | bindFunc(cast(void**)&glfwSetWindowUserPointer,"glfwSetWindowUserPointer"); 294 | bindFunc(cast(void**)&glfwGetWindowUserPointer,"glfwGetWindowUserPointer"); 295 | bindFunc(cast(void**)&glfwSetWindowPosCallback,"glfwSetWindowPosCallback"); 296 | bindFunc(cast(void**)&glfwSetWindowSizeCallback,"glfwSetWindowSizeCallback"); 297 | bindFunc(cast(void**)&glfwSetWindowCloseCallback,"glfwSetWindowCloseCallback"); 298 | bindFunc(cast(void**)&glfwSetWindowRefreshCallback,"glfwSetWindowRefreshCallback"); 299 | bindFunc(cast(void**)&glfwSetWindowFocusCallback,"glfwSetWindowFocusCallback"); 300 | bindFunc(cast(void**)&glfwSetWindowIconifyCallback,"glfwSetWindowIconifyCallback"); 301 | bindFunc(cast(void**)&glfwSetFramebufferSizeCallback,"glfwSetFramebufferSizeCallback"); 302 | bindFunc(cast(void**)&glfwPollEvents,"glfwPollEvents"); 303 | bindFunc(cast(void**)&glfwWaitEvents,"glfwWaitEvents"); 304 | bindFunc(cast(void**)&glfwWaitEventsTimeout, "glfwWaitEventsTimeout"); 305 | bindFunc(cast(void**)&glfwPostEmptyEvent,"glfwPostEmptyEvent"); 306 | bindFunc(cast(void**)&glfwGetInputMode,"glfwGetInputMode"); 307 | bindFunc(cast(void**)&glfwSetInputMode,"glfwSetInputMode"); 308 | bindFunc(cast(void**)&glfwGetKeyName, "glfwGetKeyName"); 309 | bindFunc(cast(void**)&glfwGetKey,"glfwGetKey"); 310 | bindFunc(cast(void**)&glfwGetMouseButton,"glfwGetMouseButton"); 311 | bindFunc(cast(void**)&glfwGetCursorPos,"glfwGetCursorPos"); 312 | bindFunc(cast(void**)&glfwSetCursorPos,"glfwSetCursorPos"); 313 | bindFunc(cast(void**)&glfwCreateCursor,"glfwCreateCursor"); 314 | bindFunc(cast(void**)&glfwCreateStandardCursor,"glfwCreateStandardCursor"); 315 | bindFunc(cast(void**)&glfwDestroyCursor,"glfwDestroyCursor"); 316 | bindFunc(cast(void**)&glfwSetCursor,"glfwSetCursor"); 317 | bindFunc(cast(void**)&glfwSetKeyCallback,"glfwSetKeyCallback"); 318 | bindFunc(cast(void**)&glfwSetCharCallback,"glfwSetCharCallback"); 319 | bindFunc(cast(void**)&glfwSetCharModsCallback,"glfwSetCharModsCallback"); 320 | bindFunc(cast(void**)&glfwSetMouseButtonCallback,"glfwSetMouseButtonCallback"); 321 | bindFunc(cast(void**)&glfwSetCursorPosCallback,"glfwSetCursorPosCallback"); 322 | bindFunc(cast(void**)&glfwSetScrollCallback,"glfwSetScrollCallback"); 323 | bindFunc(cast(void**)&glfwSetDropCallback,"glfwSetDropCallback"); 324 | bindFunc(cast(void**)&glfwSetCursorEnterCallback,"glfwSetCursorEnterCallback"); 325 | bindFunc(cast(void**)&glfwJoystickPresent,"glfwJoystickPresent"); 326 | bindFunc(cast(void**)&glfwGetJoystickAxes,"glfwGetJoystickAxes"); 327 | bindFunc(cast(void**)&glfwGetJoystickButtons,"glfwGetJoystickButtons"); 328 | bindFunc(cast(void**)&glfwGetJoystickName,"glfwGetJoystickName"); 329 | bindFunc(cast(void**)&glfwSetJoystickCallback, "glfwSetJoystickCallback"); 330 | bindFunc(cast(void**)&glfwSetClipboardString,"glfwSetClipboardString"); 331 | bindFunc(cast(void**)&glfwGetClipboardString,"glfwGetClipboardString"); 332 | bindFunc(cast(void**)&glfwGetTime,"glfwGetTime"); 333 | bindFunc(cast(void**)&glfwSetTime,"glfwSetTime"); 334 | bindFunc(cast(void**)&glfwGetTimerValue, "glfwGetTimerValue"); 335 | bindFunc(cast(void**)&glfwGetTimerFrequency, "glfwGetTimerFrequency"); 336 | bindFunc(cast(void**)&glfwMakeContextCurrent,"glfwMakeContextCurrent"); 337 | bindFunc(cast(void**)&glfwGetCurrentContext,"glfwGetCurrentContext"); 338 | bindFunc(cast(void**)&glfwSwapBuffers,"glfwSwapBuffers"); 339 | bindFunc(cast(void**)&glfwSwapInterval,"glfwSwapInterval"); 340 | bindFunc(cast(void**)&glfwExtensionSupported,"glfwExtensionSupported"); 341 | bindFunc(cast(void**)&glfwGetProcAddress,"glfwGetProcAddress"); 342 | bindFunc(cast(void**)&glfwVulkanSupported, "glfwVulkanSupported"); 343 | } 344 | } 345 | 346 | __gshared DerelictGLFW3Loader DerelictGLFW3; 347 | 348 | shared static this() { 349 | DerelictGLFW3 = new DerelictGLFW3Loader(); 350 | } 351 | 352 | // Mixins to allow loading Vulkan & OS native functions using the types 353 | // declared in whatever Vulkan or OS binding an app is using. 354 | mixin template DerelictGLFW3_VulkanBind() { 355 | extern(C) @nogc nothrow { 356 | alias da_glfwGetRequiredInstanceExtensions = const(char)** function(uint*); 357 | alias da_glfwGetInstanceProcAddress = GLFWvkproc function(VkInstance,const(char)*); 358 | alias da_glfwGetPhysicalDevicePresentationSupport = int function(VkInstance,VkPhysicalDevice,uint); 359 | alias da_glfwCreateWindowSurface = VkResult function(VkInstance,GLFWwindow*,const(VkAllocationCallbacks)*,VkSurfaceKHR*); 360 | } 361 | 362 | __gshared { 363 | da_glfwGetRequiredInstanceExtensions glfwGetRequiredInstanceExtensions; 364 | da_glfwGetInstanceProcAddress glfwGetInstanceProcAddress; 365 | da_glfwGetPhysicalDevicePresentationSupport glfwGetPhysicalDevicePresentationSupport; 366 | da_glfwCreateWindowSurface glfwCreateWindowSurface; 367 | } 368 | 369 | void DerelictGLFW3_loadVulkan() { 370 | assert(DerelictGLFW3.isLoaded); 371 | 372 | with(DerelictGLFW3) { 373 | bindMixedFunc(cast(void**)&glfwGetRequiredInstanceExtensions, "glfwGetRequiredInstanceExtensions"); 374 | bindMixedFunc(cast(void**)&glfwGetInstanceProcAddress, "glfwGetInstanceProcAddress"); 375 | bindMixedFunc(cast(void**)&glfwGetPhysicalDevicePresentationSupport, "glfwGetPhysicalDevicePresentationSupport"); 376 | bindMixedFunc(cast(void**)&glfwCreateWindowSurface, "glfwCreateWindowSurface"); 377 | } 378 | } 379 | } 380 | 381 | mixin template DerelictGLFW3_EGLBind() { 382 | extern(C) @nogc nothrow { 383 | alias da_glfwGetEGLDisplay = EGLDisplay function(); 384 | alias da_glfwGetEGLContext = EGLContext function(GLFWwindow*); 385 | alias da_glfwGetEGLSurface = EGLSurface function(GLFWwindow*); 386 | } 387 | 388 | __gshared { 389 | da_glfwGetEGLDisplay glfwGetEGLDisplay; 390 | da_glfwGetEGLContext glfwGetEGLContext; 391 | da_glfwGetEGLSurface glfwGetEGLSurface; 392 | } 393 | 394 | void DerelictGLFW3_loadEGK() { 395 | assert(DerelictGLFW3.isLoaded); 396 | 397 | with(DerelictGLFW3) { 398 | bindMixedFunc(cast(void**)&glfwGetEGLDisplay, "glfwGetEGLDisplay"); 399 | bindMixedFunc(cast(void**)&glfwGetEGLContext, "glfwGetEGLContext"); 400 | bindMixedFunc(cast(void**)&glfwGetEGLSurface,"glfwGetEGLSurface"); 401 | } 402 | } 403 | } 404 | 405 | static if(Derelict_OS_Mac) { 406 | mixin template DerelictGLFW3_MacBind() { 407 | extern(C) @nogc nothrow { 408 | alias da_glfwGetCocoaMonitor = CGDirectDisplayID function(GLFWmonitor*); 409 | alias da_glfwGetCocoaWindow = id function(GLFWwindow* window); 410 | alias da_glfwGetNSGLContext = id function(GLFWwindow* window); 411 | } 412 | 413 | void DerelictGLFW3_loadMac() { 414 | assert(DerelictGLFW3.isLoaded); 415 | 416 | with(DerelictGLFW3) { 417 | bindMixedFunc(cast(void**)&glfwGetCocoaMonitor, "glfwGetCocoaMonitor"); 418 | bindMixedFunc(cast(void**)&glfwGetCocoaWindow,"glfwGetCocoaWindow"); 419 | bindMixedFunc(cast(void**)&glfwGetNSGLContext,"glfwGetNSGLContext"); 420 | } 421 | } 422 | alias DerelictGLFW3_loadNative = DerelictGLFW3_loadMac; 423 | } 424 | alias DerelictGLFW3_NativeBind = DerelictGLFW3_MacBind; 425 | } 426 | else static if(Derelict_OS_Windows) { 427 | mixin template DerelictGLFW3_WindowsBind() { 428 | extern(C) @nogc nothrow { 429 | alias da_glfwGetWin32Adapter = const(char)* function(GLFWmonitor*); 430 | alias da_glfwGetWin32Monitor = const(char)* function(GLFWmonitor*); 431 | alias da_glfwGetWin32Window = HWND function(GLFWwindow* window); 432 | alias da_glfwGetWGLContext = HGLRC function(GLFWwindow* window); 433 | } 434 | 435 | __gshared { 436 | da_glfwGetWin32Adapter glfwGetWin32Adapter; 437 | da_glfwGetWin32Monitor glfwGetWin32Monitor; 438 | da_glfwGetWin32Window glfwGetWin32Window; 439 | da_glfwGetWGLContext glfwGetWGLContext; 440 | } 441 | 442 | void DerelictGLFW3_loadWindows() { 443 | assert(DerelictGLFW3.isLoaded); 444 | 445 | with(DerelictGLFW3) { 446 | bindMixedFunc(cast(void**)&glfwGetWin32Adapter, "glfwGetWin32Adapter"); 447 | bindMixedFunc(cast(void**)&glfwGetWin32Monitor, "glfwGetWin32Monitor"); 448 | bindMixedFunc(cast(void**)&glfwGetWin32Window,"glfwGetWin32Window"); 449 | bindMixedFunc(cast(void**)&glfwGetWGLContext,"glfwGetWGLContext"); 450 | } 451 | } 452 | alias DerelictGLFW3_loadNative = DerelictGLFW3_loadWindows; 453 | } 454 | alias DerelictGLFW3_NativeBind = DerelictGLFW3_WindowsBind; 455 | } 456 | else static if(Derelict_OS_Posix) { 457 | mixin template DerelictGLFW3_X11Bind() { 458 | extern(C) @nogc nothrow { 459 | alias da_glfwGetX11Display = Display* function(); 460 | alias da_glfwGetX11Adapter = RRCrtc function(GLFWmonitor*); 461 | alias da_glfwGetX11Monitor = RROutput function(GLFWmonitor*); 462 | alias da_glfwGetX11Window = Window function(GLFWwindow*); 463 | alias da_glfwGetGLXContext = GLXContext function(GLFWwindow*); 464 | alias da_glfwGetGLXWindow = GLXWindow function(GLFWwindow*); 465 | } 466 | 467 | __gshared { 468 | da_glfwGetX11Display glfwGetX11Display; 469 | da_glfwGetX11Adapter glfwGetX11Adapter; 470 | da_glfwGetX11Monitor glfwGetX11Monitor; 471 | da_glfwGetX11Window glfwGetX11Window; 472 | da_glfwGetGLXContext glfwGetGLXContext; 473 | da_glfwGetGLXWindow glfwGetGLXWindow; 474 | } 475 | 476 | void DerelictGLFW3_loadX11() { 477 | assert(DerelictGLFW3.isLoaded); 478 | 479 | with(DerelictGLFW3) { 480 | bindMixedFunc(cast(void**)&glfwGetX11Display, "glfwGetX11Display"); 481 | bindMixedFunc(cast(void**)&glfwGetX11Adapter, "glfwGetX11Adapter"); 482 | bindMixedFunc(cast(void**)&glfwGetX11Monitor,"glfwGetX11Monitor"); 483 | bindMixedFunc(cast(void**)&glfwGetX11Window,"glfwGetX11Window"); 484 | bindMixedFunc(cast(void**)&glfwGetGLXContext, "glfwGetGLXContext"); 485 | bindMixedFunc(cast(void**)&glfwGetGLXWindow, "glfwGetGLXWindow"); 486 | } 487 | } 488 | alias DerelictGLFW3_loadNative = DerelictGLFW3_loadX11; 489 | } 490 | alias DerelictGLFW3_NativeBind = DerelictGLFW3_X11Bind; 491 | 492 | mixin template DerelictGLFW3_WaylandBind() { 493 | extern(C) @nogc nothrow { 494 | alias da_glfwGetWaylandDisplay = wl_display* function(); 495 | alias da_glfwGetWaylandMonitor = wl_output* function(GLFWmonitor*); 496 | alias da_glfwGetWaylandWindow = wl_surface* function(GLFWwindow*); 497 | } 498 | 499 | __gshared { 500 | da_glfwGetWaylandDisplay glfwGetWaylandDisplay; 501 | da_glfwGetWaylandMonitor glfwGetWaylandMonitor; 502 | da_glfwGetWaylandWindow glfwGetWaylandWindow; 503 | } 504 | 505 | void DerelictGLFW3_loadWayland() { 506 | assert(DerelictGLFW3.isLoaded); 507 | 508 | with(DerelictGLFW3) { 509 | bindMixedFunc(cast(void**)&glfwGetWaylandDisplay, "glfwGetWaylandDisplay"); 510 | bindMixedFunc(cast(void**)&glfwGetWaylandMonitor, "glfwGetWaylandMonitor"); 511 | bindMixedFunc(cast(void**)&glfwGetWaylandWindow,"glfwGetWaylandWindow"); 512 | } 513 | } 514 | } 515 | 516 | mixin template DerelictGLFW3_MirBind() { 517 | extern(C) @nogc nothrow { 518 | alias da_glfwGetMirDisplay = MirConnection* function(); 519 | alias da_glfwGetMirMonitor = int function(GLFWmonitor*); 520 | alias da_glfwGetMirWindow = MirSurface* function(GLFWwindow*); 521 | } 522 | 523 | __gshared { 524 | da_glfwGetMirDisplay glfwGetMirDisplay; 525 | da_glfwGetMirMonitor glfwGetMirMonitor; 526 | da_glfwGetMirWindow glfwGetMirWindow; 527 | } 528 | 529 | void DerelictGLFW3_loadMir() { 530 | assert(DerelictGLFW3.isLoaded); 531 | 532 | with(DerelictGLFW3) { 533 | bindMixedFunc(cast(void**)&glfwGetMirDisplay, "glfwGetMirDisplay"); 534 | bindMixedFunc(cast(void**)&glfwGetMirMonitor, "glfwGetMirMonitor"); 535 | bindMixedFunc(cast(void**)&glfwGetMirWindow,"glfwGetMirWindow"); 536 | } 537 | } 538 | } 539 | 540 | } 541 | 542 | private: 543 | static if(Derelict_OS_Windows) 544 | enum libNames = "glfw3.dll"; 545 | else static if(Derelict_OS_Mac) 546 | enum libNames = "libglfw.3.dylib,libglfw3.dylib"; 547 | else static if(Derelict_OS_Posix) 548 | enum libNames = "libglfw3.so,libglfw.so.3,/usr/local/lib/libglfw3.so,/usr/local/lib/libglfw.so.3"; 549 | else 550 | static assert(0,"Need to implement GLFW libNames for this operating system."); -------------------------------------------------------------------------------- /source/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 | version(Derelict_Static) version = DerelictGLFW3_Static; 31 | 32 | public: 33 | version(DerelictGLFW3_Static) 34 | import derelict.glfw3.statfun; 35 | else 36 | import derelict.glfw3.dynload; -------------------------------------------------------------------------------- /source/derelict/glfw3/package.d: -------------------------------------------------------------------------------- 1 | module derelict.glfw3; 2 | 3 | public import derelict.glfw3.glfw3; -------------------------------------------------------------------------------- /source/derelict/glfw3/statfun.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.statfun; 29 | 30 | version(Derelict_Static) version = DerelictGLFW3_Static; 31 | version(DerelictGLFW3_Static): 32 | 33 | public import derelict.glfw3.types; 34 | 35 | extern(C) @nogc nothrow { 36 | int glfwInit(); 37 | void glfwTerminate(); 38 | void glfwGetVersion(int*,int*,int*); 39 | const(char)* glfwGetVersionString(); 40 | GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun); 41 | GLFWmonitor** glfwGetMonitors(int*); 42 | GLFWmonitor* glfwGetPrimaryMonitor(); 43 | void glfwGetMonitorPos(GLFWmonitor*,int*,int*); 44 | void glfwGetMonitorPhysicalSize(GLFWmonitor*,int*,int*); 45 | const(char)* glfwGetMonitorName(GLFWmonitor*); 46 | GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun); 47 | const(GLFWvidmode)* glfwGetVideoModes(GLFWmonitor*,int*); 48 | const(GLFWvidmode)* glfwGetVideoMode(GLFWmonitor*); 49 | void glfwSetGamma(GLFWmonitor*,float); 50 | const(GLFWgammaramp*) glfwGetGammaRamp(GLFWmonitor*); 51 | void glfwSetGammaRamp(GLFWmonitor*,const(GLFWgammaramp)*); 52 | void glfwDefaultWindowHints(); 53 | void glfwWindowHint(int,int); 54 | GLFWwindow* glfwCreateWindow(int,int,const(char)*,GLFWmonitor*,GLFWwindow*); 55 | void glfwDestroyWindow(GLFWwindow*); 56 | int glfwWindowShouldClose(GLFWwindow*); 57 | void glfwSetWindowShouldClose(GLFWwindow*,int); 58 | void glfwSetWindowTitle(GLFWwindow*,const(char)*); 59 | void glfwSetWindowIcon(GLFWwindow*,int,const(GLFWimage)*); 60 | void glfwGetWindowPos(GLFWwindow*,int*,int*); 61 | void glfwSetWindowPos(GLFWwindow*,int,int); 62 | void glfwGetWindowSize(GLFWwindow*,int*,int*); 63 | void glfwSetWindowSizeLimits(GLFWwindow*,int,int,int,int); 64 | void glfwSetWindowAspectRatio(GLFWwindow*,int,int); 65 | void glfwSetWindowSize(GLFWwindow*,int,int); 66 | void glfwGetFramebufferSize(GLFWwindow*,int*,int*); 67 | void glfwGetWindowFrameSize(GLFWwindow*,int*,int*,int*,int*); 68 | void glfwIconifyWindow(GLFWwindow*); 69 | void glfwRestoreWindow(GLFWwindow*); 70 | void glfwMaximizeWindow(GLFWwindow*); 71 | void glfwShowWindow(GLFWwindow*); 72 | void glfwHideWindow(GLFWwindow*); 73 | void glfwFocusWindow(GLFWwindow*); 74 | GLFWmonitor* glfwGetWindowMonitor(GLFWwindow*); 75 | void glfwSetWindowMonitor(GLFWwindow*,GLFWmonitor*,int,int,int,int,int); 76 | int glfwGetWindowAttrib(GLFWwindow*,int); 77 | void glfwSetWindowUserPointer(GLFWwindow*,void*); 78 | void* glfwGetWindowUserPointer(GLFWwindow*); 79 | GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow*,GLFWwindowposfun); 80 | GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow*,GLFWwindowsizefun); 81 | GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow*,GLFWwindowclosefun); 82 | GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow*,GLFWwindowrefreshfun); 83 | GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow*,GLFWwindowfocusfun); 84 | GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow*,GLFWwindowiconifyfun); 85 | GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow*,GLFWframebuffersizefun); 86 | void glfwPollEvents(); 87 | void glfwWaitEvents(); 88 | void glfwWaitEventsTimeout(double); 89 | void glfwPostEmptyEvent(); 90 | int glfwGetInputMode(GLFWwindow*,int); 91 | void glfwSetInputMode(GLFWwindow*,int,int); 92 | const(char)* glfwGetKeyName(int,int); 93 | int glfwGetKey(GLFWwindow*,int); 94 | int glfwGetMouseButton(GLFWwindow*,int); 95 | void glfwGetCursorPos(GLFWwindow*,double*,double*); 96 | void glfwSetCursorPos(GLFWwindow*,double,double); 97 | GLFWcursor* glfwCreateCursor(const(GLFWimage)*,int,int); 98 | GLFWcursor* glfwCreateStandardCursor(int); 99 | void glfwDestroyCursor(GLFWcursor*); 100 | void glfwSetCursor(GLFWwindow*,GLFWcursor*); 101 | GLFWkeyfun glfwSetKeyCallback(GLFWwindow*,GLFWkeyfun); 102 | GLFWcharfun glfwSetCharCallback(GLFWwindow*,GLFWcharfun); 103 | GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow*,GLFWcharmodsfun); 104 | GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow*,GLFWmousebuttonfun); 105 | GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow*,GLFWcursorposfun); 106 | GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow*,GLFWcursorenterfun); 107 | GLFWscrollfun glfwSetScrollCallback(GLFWwindow*,GLFWscrollfun); 108 | GLFWdropfun glfwSetDropCallback(GLFWwindow*,GLFWdropfun); 109 | int glfwJoystickPresent(int); 110 | float* glfwGetJoystickAxes(int,int*); 111 | ubyte* glfwGetJoystickButtons(int,int*); 112 | const(char)* glfwGetJoystickName(int); 113 | GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun); 114 | void glfwSetClipboardString(GLFWwindow*,const(char)*); 115 | const(char)* glfwGetClipboardString(GLFWwindow*); 116 | double glfwGetTime(); 117 | void glfwSetTime(double); 118 | long glfwGetTimerValue(); 119 | long glfwGetTimerFrequency(); 120 | void glfwMakeContextCurrent(GLFWwindow*); 121 | GLFWwindow* glfwGetCurrentContext(); 122 | void glfwSwapBuffers(GLFWwindow*); 123 | void glfwSwapInterval(int); 124 | int glfwExtensionSupported(const(char)*); 125 | GLFWglproc glfwGetProcAddress(const(char)*); 126 | int glfwVulkanSupported(); 127 | } 128 | 129 | // Mixins to allow linking with Vulkan & OS native functions using the 130 | // types declared in whatever Vulkan or OS binding an app is using. 131 | mixin template DerelictGLFW3_VulkanBind() { 132 | extern(C) @nogc nothrow { 133 | const(char)** glfwGetRequiredInstanceExtensions(uint*); 134 | GLFWvkproc glfwGetInstanceProcAddress(VkInstance,const(char)*); 135 | int glfwGetPhysicalDevicePresentationSupport(VkInstance,VkPhysicalDevice,uint); 136 | VkResult glfwCreateWindowSurface(VkInstance,GLFWwindow*,const(VkAllocationCallbacks)*,VkSurfaceKHR*); 137 | } 138 | } 139 | 140 | mixin template DerelictGLFW3_EGLBind() { 141 | extern(C) @nogc nothrow { 142 | EGLDisplay glfwGetEGLDisplay(); 143 | EGLContext glfwGetEGLContext(GLFWwindow*); 144 | EGLSurface glfwGetEGLSurface(GLFWwindow*); 145 | } 146 | } 147 | 148 | // The static binding shouldn't depend on DerelictUtil, so use 149 | // version identifiers here rather than static if with Derelict_OS_*. 150 | version(OSX) { 151 | mixin template DerelictGLFW3_MacBind() { 152 | extern(C) @nogc nothrow { 153 | CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor*); 154 | id glfwGetCocoaWindow(GLFWwindow*); 155 | id glfwGetNSGLContext(GLFWwindow*); 156 | } 157 | } 158 | alias DerelictGLFW3_NativeBind = DerelictGLFW3_MacBind; 159 | } 160 | else version(Windows) { 161 | mixin template DerelictGLFW3_WindowsBind() { 162 | extern(C) @nogc nothrow { 163 | const(char)* glfwGetWin32Adapter(GLFWmonitor*); 164 | const(char)* glfwGetWin32Monitor(GLFWmonitor*); 165 | HWND glfwGetWin32Window(GLFWwindow*); 166 | HGLRC glfwGetWGLContext(GLFWwindow*); 167 | } 168 | } 169 | alias DerelictGLFW3_NativeBind = DerelictGLFW3_WindowsBind; 170 | } 171 | else version(Posix) { 172 | mixin template DerelictGLFW3_X11Bind() { 173 | extern(C) @nogc nothrow { 174 | Display* glfwGetX11Display(); 175 | RRCrtc glfwGetX11Adapter(GLFWmonitor*); 176 | RROutput glfwGetX11Monitor(GLFWmonitor*); 177 | Window glfwGetX11Window(GLFWwindow*); 178 | GLXContext glfwGetGLXContext(GLFWwindow*); 179 | GLXwindow glfwGetGLXWindow(GLFWwindow*); 180 | } 181 | } 182 | alias DerelictGLFW3_NativeBind = DerelictGLFW3_X11Bind; 183 | 184 | mixin template DerelictGLFW3_WaylandBind() { 185 | extern(C) @nogc nothrow { 186 | wl_display* glfwGetWaylandDisplay(); 187 | wl_output* glfwGetWaylandMonitor(GLFWmonitor*); 188 | wl_surface* glfwGetWaylandWindow(GLFWwindow*); 189 | } 190 | } 191 | 192 | mixin template DerelictGLFW3_MirBind() { 193 | extern(C) @nogc nothrow { 194 | MirConnection* glfwGetMirDisplay(); 195 | int glfwGetMirMonitor(GLFWmonitor*); 196 | MirSurface* glfwGetMirWindow(GLFWwindow*); 197 | } 198 | } 199 | } 200 | 201 | -------------------------------------------------------------------------------- /source/derelict/glfw3/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.glfw3.types; 29 | 30 | enum { 31 | GLFW_VERSION_MAJOR = 3, 32 | GLFW_VERSION_MINOR = 2, 33 | GLFW_VERSION_REVISION = 0 34 | } 35 | 36 | enum { 37 | GLFW_FALSE, 38 | GLFW_TRUE, 39 | } 40 | 41 | enum { 42 | GLFW_RELEASE = 0, 43 | GLFW_PRESS = 1, 44 | GLFW_REPEAT = 2, 45 | } 46 | 47 | enum { 48 | GLFW_KEY_UNKNOWN = -1, 49 | GLFW_KEY_SPACE = 32, 50 | GLFW_KEY_APOSTROPHE = 39, 51 | GLFW_KEY_COMMA = 44, 52 | GLFW_KEY_MINUS = 45, 53 | GLFW_KEY_PERIOD = 46, 54 | GLFW_KEY_SLASH = 47, 55 | GLFW_KEY_0 = 48, 56 | GLFW_KEY_1 = 49, 57 | GLFW_KEY_2 = 50, 58 | GLFW_KEY_3 = 51, 59 | GLFW_KEY_4 = 52, 60 | GLFW_KEY_5 = 53, 61 | GLFW_KEY_6 = 54, 62 | GLFW_KEY_7 = 55, 63 | GLFW_KEY_8 = 56, 64 | GLFW_KEY_9 = 57, 65 | GLFW_KEY_SEMICOLON = 59, 66 | GLFW_KEY_EQUAL = 61, 67 | GLFW_KEY_A = 65, 68 | GLFW_KEY_B = 66, 69 | GLFW_KEY_C = 67, 70 | GLFW_KEY_D = 68, 71 | GLFW_KEY_E = 69, 72 | GLFW_KEY_F = 70, 73 | GLFW_KEY_G = 71, 74 | GLFW_KEY_H = 72, 75 | GLFW_KEY_I = 73, 76 | GLFW_KEY_J = 74, 77 | GLFW_KEY_K = 75, 78 | GLFW_KEY_L = 76, 79 | GLFW_KEY_M = 77, 80 | GLFW_KEY_N = 78, 81 | GLFW_KEY_O = 79, 82 | GLFW_KEY_P = 80, 83 | GLFW_KEY_Q = 81, 84 | GLFW_KEY_R = 82, 85 | GLFW_KEY_S = 83, 86 | GLFW_KEY_T = 84, 87 | GLFW_KEY_U = 85, 88 | GLFW_KEY_V = 86, 89 | GLFW_KEY_W = 87, 90 | GLFW_KEY_X = 88, 91 | GLFW_KEY_Y = 89, 92 | GLFW_KEY_Z = 90, 93 | GLFW_KEY_LEFT_BRACKET = 91, 94 | GLFW_KEY_BACKSLASH = 92, 95 | GLFW_KEY_RIGHT_BRACKET = 93, 96 | GLFW_KEY_GRAVE_ACCENT = 96, 97 | GLFW_KEY_WORLD_1 = 161, 98 | GLFW_KEY_WORLD_2 = 162, 99 | 100 | GLFW_KEY_ESCAPE = 256, 101 | GLFW_KEY_ENTER = 257, 102 | GLFW_KEY_TAB = 258, 103 | GLFW_KEY_BACKSPACE = 259, 104 | GLFW_KEY_INSERT = 260, 105 | GLFW_KEY_DELETE = 261, 106 | GLFW_KEY_RIGHT = 262, 107 | GLFW_KEY_LEFT = 263, 108 | GLFW_KEY_DOWN = 264, 109 | GLFW_KEY_UP = 265, 110 | GLFW_KEY_PAGE_UP = 266, 111 | GLFW_KEY_PAGE_DOWN = 267, 112 | GLFW_KEY_HOME = 268, 113 | GLFW_KEY_END = 269, 114 | GLFW_KEY_CAPS_LOCK = 280, 115 | GLFW_KEY_SCROLL_LOCK = 281, 116 | GLFW_KEY_NUM_LOCK = 282, 117 | GLFW_KEY_PRINT_SCREEN = 283, 118 | GLFW_KEY_PAUSE = 284, 119 | GLFW_KEY_F1 = 290, 120 | GLFW_KEY_F2 = 291, 121 | GLFW_KEY_F3 = 292, 122 | GLFW_KEY_F4 = 293, 123 | GLFW_KEY_F5 = 294, 124 | GLFW_KEY_F6 = 295, 125 | GLFW_KEY_F7 = 296, 126 | GLFW_KEY_F8 = 297, 127 | GLFW_KEY_F9 = 298, 128 | GLFW_KEY_F10 = 299, 129 | GLFW_KEY_F11 = 300, 130 | GLFW_KEY_F12 = 301, 131 | GLFW_KEY_F13 = 302, 132 | GLFW_KEY_F14 = 303, 133 | GLFW_KEY_F15 = 304, 134 | GLFW_KEY_F16 = 305, 135 | GLFW_KEY_F17 = 306, 136 | GLFW_KEY_F18 = 307, 137 | GLFW_KEY_F19 = 308, 138 | GLFW_KEY_F20 = 309, 139 | GLFW_KEY_F21 = 310, 140 | GLFW_KEY_F22 = 311, 141 | GLFW_KEY_F23 = 312, 142 | GLFW_KEY_F24 = 313, 143 | GLFW_KEY_F25 = 314, 144 | GLFW_KEY_KP_0 = 320, 145 | GLFW_KEY_KP_1 = 321, 146 | GLFW_KEY_KP_2 = 322, 147 | GLFW_KEY_KP_3 = 323, 148 | GLFW_KEY_KP_4 = 324, 149 | GLFW_KEY_KP_5 = 325, 150 | GLFW_KEY_KP_6 = 326, 151 | GLFW_KEY_KP_7 = 327, 152 | GLFW_KEY_KP_8 = 328, 153 | GLFW_KEY_KP_9 = 329, 154 | GLFW_KEY_KP_DECIMAL = 330, 155 | GLFW_KEY_KP_DIVIDE = 331, 156 | GLFW_KEY_KP_MULTIPLY = 332, 157 | GLFW_KEY_KP_SUBTRACT = 333, 158 | GLFW_KEY_KP_ADD = 334, 159 | GLFW_KEY_KP_ENTER = 335, 160 | GLFW_KEY_KP_EQUAL = 336, 161 | GLFW_KEY_LEFT_SHIFT = 340, 162 | GLFW_KEY_LEFT_CONTROL = 341, 163 | GLFW_KEY_LEFT_ALT = 342, 164 | GLFW_KEY_LEFT_SUPER = 343, 165 | GLFW_KEY_RIGHT_SHIFT = 344, 166 | GLFW_KEY_RIGHT_CONTROL = 345, 167 | GLFW_KEY_RIGHT_ALT = 346, 168 | GLFW_KEY_RIGHT_SUPER = 347, 169 | GLFW_KEY_MENU = 348, 170 | GLFW_KEY_LAST = GLFW_KEY_MENU, 171 | 172 | GLFW_KEY_ESC = GLFW_KEY_ESCAPE, 173 | GLFW_KEY_DEL = GLFW_KEY_DELETE, 174 | GLFW_KEY_PAGEUP = GLFW_KEY_PAGE_UP, 175 | GLFW_KEY_PAGEDOWN = GLFW_KEY_PAGE_DOWN, 176 | GLFW_KEY_KP_NUM_LOCK = GLFW_KEY_NUM_LOCK, 177 | GLFW_KEY_LCTRL = GLFW_KEY_LEFT_CONTROL, 178 | GLFW_KEY_LSHIFT = GLFW_KEY_LEFT_SHIFT, 179 | GLFW_KEY_LALT = GLFW_KEY_LEFT_ALT, 180 | GLFW_KEY_LSUPER = GLFW_KEY_LEFT_SUPER, 181 | GLFW_KEY_RCTRL = GLFW_KEY_RIGHT_CONTROL, 182 | GLFW_KEY_RSHIFT = GLFW_KEY_RIGHT_SHIFT, 183 | GLFW_KEY_RALT = GLFW_KEY_RIGHT_ALT, 184 | GLFW_KEY_RSUPER = GLFW_KEY_RIGHT_SUPER, 185 | 186 | GLFW_MOD_SHIFT = 0x0001, 187 | GLFW_MOD_CONTROL = 0x0002, 188 | GLFW_MOD_ALT = 0x0004, 189 | GLFW_MOD_SUPER = 0x0008, 190 | 191 | GLFW_MOUSE_BUTTON_1 = 0, 192 | GLFW_MOUSE_BUTTON_2 = 1, 193 | GLFW_MOUSE_BUTTON_3 = 2, 194 | GLFW_MOUSE_BUTTON_4 = 3, 195 | GLFW_MOUSE_BUTTON_5 = 4, 196 | GLFW_MOUSE_BUTTON_6 = 5, 197 | GLFW_MOUSE_BUTTON_7 = 6, 198 | GLFW_MOUSE_BUTTON_8 = 7, 199 | GLFW_MOUSE_BUTTON_LAST = GLFW_MOUSE_BUTTON_8, 200 | GLFW_MOUSE_BUTTON_LEFT = GLFW_MOUSE_BUTTON_1, 201 | GLFW_MOUSE_BUTTON_RIGHT = GLFW_MOUSE_BUTTON_2, 202 | GLFW_MOUSE_BUTTON_MIDDLE = GLFW_MOUSE_BUTTON_3, 203 | 204 | GLFW_JOYSTICK_1 = 0, 205 | GLFW_JOYSTICK_2 = 1, 206 | GLFW_JOYSTICK_3 = 2, 207 | GLFW_JOYSTICK_4 = 3, 208 | GLFW_JOYSTICK_5 = 4, 209 | GLFW_JOYSTICK_6 = 5, 210 | GLFW_JOYSTICK_7 = 6, 211 | GLFW_JOYSTICK_8 = 7, 212 | GLFW_JOYSTICK_9 = 8, 213 | GLFW_JOYSTICK_10 = 9, 214 | GLFW_JOYSTICK_11 = 10, 215 | GLFW_JOYSTICK_12 = 11, 216 | GLFW_JOYSTICK_13 = 12, 217 | GLFW_JOYSTICK_14 = 13, 218 | GLFW_JOYSTICK_15 = 14, 219 | GLFW_JOYSTICK_16 = 15, 220 | GLFW_JOYSTICK_LAST = GLFW_JOYSTICK_16, 221 | } 222 | 223 | enum { 224 | GLFW_NOT_INITIALIZED = 0x00010001, 225 | GLFW_NO_CURRENT_CONTEXT = 0x00010002, 226 | GLFW_INVALID_ENUM = 0x00010003, 227 | GLFW_INVALID_VALUE = 0x00010004, 228 | GLFW_OUT_OF_MEMORY = 0x00010005, 229 | GLFW_API_UNAVAILABLE = 0x00010006, 230 | GLFW_VERSION_UNAVAILABLE = 0x00010007, 231 | GLFW_PLATFORM_ERROR = 0x00010008, 232 | GLFW_FORMAT_UNAVAILABLE = 0x00010009, 233 | GLFW_NO_WINDOW_CONTEXT = 0x0001000A, 234 | 235 | GLFW_FOCUSED = 0x00020001, 236 | GLFW_ICONIFIED = 0x00020002, 237 | GLFW_RESIZABLE = 0x00020003, 238 | GLFW_VISIBLE = 0x00020004, 239 | GLFW_DECORATED = 0x00020005, 240 | GLFW_AUTO_ICONIFY = 0x00020006, 241 | GLFW_FLOATING = 0x00020007, 242 | GLFW_MAXIMIZED = 0x00020008, 243 | 244 | GLFW_RED_BITS = 0x00021001, 245 | GLFW_GREEN_BITS = 0x00021002, 246 | GLFW_BLUE_BITS = 0x00021003, 247 | GLFW_ALPHA_BITS = 0x00021004, 248 | GLFW_DEPTH_BITS = 0x00021005, 249 | GLFW_STENCIL_BITS = 0x00021006, 250 | GLFW_ACCUM_RED_BITS = 0x00021007, 251 | GLFW_ACCUM_GREEN_BITS = 0x00021008, 252 | GLFW_ACCUM_BLUE_BITS = 0x00021009, 253 | GLFW_ACCUM_ALPHA_BITS = 0x0002100A, 254 | GLFW_AUX_BUFFERS = 0x0002100B, 255 | GLFW_STEREO = 0x0002100C, 256 | GLFW_SAMPLES = 0x0002100D, 257 | GLFW_SRGB_CAPABLE = 0x0002100E, 258 | GLFW_REFRESH_RATE = 0x0002100F, 259 | GLFW_DOUBLEBUFFER = 0x00021010, 260 | 261 | GLFW_CLIENT_API = 0x00022001, 262 | GLFW_CONTEXT_VERSION_MAJOR = 0x00022002, 263 | GLFW_CONTEXT_VERSION_MINOR = 0x00022003, 264 | GLFW_CONTEXT_REVISION = 0x00022004, 265 | GLFW_CONTEXT_ROBUSTNESS = 0x00022005, 266 | GLFW_OPENGL_FORWARD_COMPAT = 0x00022006, 267 | GLFW_OPENGL_DEBUG_CONTEXT = 0x00022007, 268 | GLFW_OPENGL_PROFILE = 0x00022008, 269 | GLFW_CONTEXT_RELEASE_BEHAVIOR = 0x00022009, 270 | 271 | GLFW_NO_API = 0, 272 | GLFW_OPENGL_API = 0x00030001, 273 | GLFW_OPENGL_ES_API = 0x00030002, 274 | 275 | GLFW_NO_ROBUSTNESS = 0, 276 | GLFW_NO_RESET_NOTIFICATION = 0x00031001, 277 | GLFW_LOSE_CONTEXT_ON_RESET = 0x00031002, 278 | 279 | GLFW_OPENGL_ANY_PROFILE = 0, 280 | GLFW_OPENGL_CORE_PROFILE = 0x00032001, 281 | GLFW_OPENGL_COMPAT_PROFILE = 0x00032002, 282 | 283 | GLFW_CURSOR = 0x00033001, 284 | GLFW_STICKY_KEYS = 0x00033002, 285 | GLFW_STICKY_MOUSE_BUTTONS = 0x00033003, 286 | 287 | GLFW_CURSOR_NORMAL = 0x00034001, 288 | GLFW_CURSOR_HIDDEN = 0x00034002, 289 | GLFW_CURSOR_DISABLED = 0x00034003, 290 | 291 | GLFW_ANY_RELEASE_BEHAVIOR = 0, 292 | GLFW_RELEASE_BEHAVIOR_FLUSH = 0x00035001, 293 | GLFW_RELEASE_BEHAVIOR_NONE = 0x00035002, 294 | 295 | GLFW_NATIVE_CONTEXT_API = 0x00036001, 296 | GLFW_EGL_CONTEXT_API = 0x00036002, 297 | 298 | GLFW_ARROW_CURSOR = 0x00036001, 299 | GLFW_IBEAM_CURSOR = 0x00036002, 300 | GLFW_CROSSHAIR_CURSOR = 0x00036003, 301 | GLFW_HAND_CURSOR = 0x00036004, 302 | GLFW_HRESIZE_CURSOR = 0x00036005, 303 | GLFW_VRESIZE_CURSOR = 0x00036006, 304 | 305 | GLFW_CONNECTED = 0x00040001, 306 | GLFW_DISCONNECTED = 0x00040002, 307 | 308 | GLFW_DONT_CARE = -1, 309 | } 310 | 311 | extern(C) @nogc nothrow { 312 | alias void function() GLFWglproc; 313 | alias void function() GLFWvkproc; 314 | } 315 | 316 | struct GLFWmonitor; 317 | struct GLFWwindow; 318 | struct GLFWcursor; 319 | 320 | extern(C) nothrow { 321 | alias GLFWerrorfun = void function(int,const(char)*); 322 | alias GLFWwindowposfun = void function(GLFWwindow*,int,int); 323 | alias GLFWwindowsizefun = void function(GLFWwindow*,int,int); 324 | alias GLFWwindowclosefun = void function(GLFWwindow*); 325 | alias GLFWwindowrefreshfun = void function(GLFWwindow*); 326 | alias GLFWwindowfocusfun = void function(GLFWwindow*,int); 327 | alias GLFWwindowiconifyfun = void function(GLFWwindow*,int); 328 | alias GLFWframebuffersizefun = void function(GLFWwindow*,int,int); 329 | alias GLFWmousebuttonfun = void function(GLFWwindow*,int,int,int); 330 | alias GLFWcursorposfun = void function(GLFWwindow*,double,double); 331 | alias GLFWcursorenterfun = void function(GLFWwindow*,int); 332 | alias GLFWscrollfun = void function(GLFWwindow*,double,double); 333 | alias GLFWkeyfun = void function(GLFWwindow*,int,int,int,int); 334 | alias GLFWcharfun = void function(GLFWwindow*,uint); 335 | alias GLFWcharmodsfun = void function(GLFWwindow*,uint,int); 336 | alias GLFWdropfun = void function(GLFWwindow*,int,const(char*)*); 337 | alias GLFWmonitorfun = void function(GLFWmonitor*,int); 338 | alias GLFWjoystickfun = void function(int,int); 339 | } 340 | 341 | struct GLFWvidmode { 342 | int width; 343 | int height; 344 | int redBits; 345 | int greenBits; 346 | int blueBits; 347 | int refreshRate; 348 | } 349 | 350 | struct GLFWgammaramp { 351 | ushort* red; 352 | ushort* green; 353 | ushort* blue; 354 | uint size; 355 | } 356 | 357 | struct GLFWimage { 358 | int width; 359 | int height; 360 | ubyte* pixels; 361 | } --------------------------------------------------------------------------------