1 /// Translated from C to D 2 module glfw3.null_platform; 3 4 extern(C): @nogc: nothrow: __gshared: 5 //======================================================================== 6 // GLFW 3.3 - www.glfw.org 7 //------------------------------------------------------------------------ 8 // Copyright (c) 2016 Google Inc. 9 // Copyright (c) 2016-2017 Camilla Löwy <elmindreda@glfw.org> 10 // 11 // This software is provided 'as-is', without any express or implied 12 // warranty. In no event will the authors be held liable for any damages 13 // arising from the use of this software. 14 // 15 // Permission is granted to anyone to use this software for any purpose, 16 // including commercial applications, and to alter it and redistribute it 17 // freely, subject to the following restrictions: 18 // 19 // 1. The origin of this software must not be misrepresented; you must not 20 // claim that you wrote the original software. If you use this software 21 // in a product, an acknowledgment in the product documentation would 22 // be appreciated but is not required. 23 // 24 // 2. Altered source versions must be plainly marked as such, and must not 25 // be misrepresented as being the original software. 26 // 27 // 3. This notice may not be removed or altered from any source 28 // distribution. 29 // 30 //======================================================================== 31 32 import core.sys.posix.dlfcn; 33 34 mixin template _GLFW_PLATFORM_WINDOW_STATE() {GLFWwindowNull null_;} 35 36 mixin template _GLFW_PLATFORM_CONTEXT_STATE() { int dummyContext; }; 37 mixin template _GLFW_PLATFORM_MONITOR_STATE() { int dummyMonitor; }; 38 mixin template _GLFW_PLATFORM_CURSOR_STATE() { int dummyCursor; }; 39 mixin template _GLFW_PLATFORM_LIBRARY_WINDOW_STATE() { int dummyLibraryWindow; }; 40 mixin template _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE() {int dummyLibraryContext; }; 41 mixin template _GLFW_EGL_CONTEXT_STATE() { int dummyEGLContext; }; 42 mixin template _GLFW_EGL_LIBRARY_CONTEXT_STATE() { int dummyEGLLibraryContext; }; 43 44 public import glfw3.osmesa_context; 45 public import glfw3.posix_time; 46 public import glfw3.posix_thread; 47 public import glfw3.null_joystick; 48 49 version (_GLFW_WIN32) { 50 auto _glfw_dlopen(const(char)* name) { return LoadLibraryA(name); } 51 auto _glfw_dlclose(void* handle) { return FreeLibrary(cast(HMODULE) handle); } 52 auto _glfw_dlsym(void* handle, const(char)* name) { return GetProcAddress(cast(HMODULE) handle, name);} 53 } else { 54 auto _glfw_dlopen(const(char)* name) {return dlopen(name, RTLD_LAZY | RTLD_LOCAL);} 55 auto _glfw_dlclose(void* handle) {return dlclose(handle);} 56 auto _glfw_dlsym(void* handle, const(char)* name) {return dlsym(handle, name);} 57 } 58 59 // Null-specific per-window data 60 // 61 struct _GLFWwindowNull { 62 int width; 63 int height; 64 }