From 9ec9187c4d091c6c6a9c2141eae4ad423fbfbc98 Mon Sep 17 00:00:00 2001 From: David Turnbull Date: Thu, 25 Feb 2016 10:50:10 -0800 Subject: [PATCH] first commit --- LICENSE.txt | 19 +++++++++++++++++++ Package.swift | 0 README.md | 19 +++++++++++++++++++ module.modulemap | 12 ++++++++++++ shim.h | 5 +++++ 5 files changed, 55 insertions(+) create mode 100644 LICENSE.txt create mode 100644 Package.swift create mode 100644 README.md create mode 100644 module.modulemap create mode 100644 shim.h diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..88d7d17 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,19 @@ +Copyright (c) 2015 David Turnbull + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +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 AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..9707a55 --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +# Swift C bindings for GLFW v3 + +[GLFW home page] +(http://www.glfw.org) + +This is a package for the open source Swift. Usage: + +- Install GLFW version 3. +- Include dependency in your `Package.swift`: +```swift +let package = Package( + dependencies: [ + .Package(url: "https://github.com/SwiftGL/CGLFWLinux.git", majorVersion: 1) + ] +) +``` +- `import CGLFW3` in your swift file. +- Use as a C API. [Read the Apple docs to learn how.] + (https://developer.apple.com/library/mac/documentation/Swift/Conceptual/BuildingCocoaApps/InteractingWithCAPIs.html) diff --git a/module.modulemap b/module.modulemap new file mode 100644 index 0000000..2bd391f --- /dev/null +++ b/module.modulemap @@ -0,0 +1,12 @@ +module CGLFW3 [system] { + header "shim.h" + link "glfw" + export * + + link "X11" + link "Xxf86vm" + link "Xrandr" + link "Xi" + link "Xinerama" + link "Xcursor" +} diff --git a/shim.h b/shim.h new file mode 100644 index 0000000..2c1579a --- /dev/null +++ b/shim.h @@ -0,0 +1,5 @@ +// Don't load OpenGL +#define GLFW_INCLUDE_NONE + +// find GLFW using include path +#include "GLFW/glfw3.h"