diff --git a/.swift-version b/.swift-version
new file mode 100644
index 0000000..5186d07
--- /dev/null
+++ b/.swift-version
@@ -0,0 +1 @@
+4.0
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..fbeb7a1
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016-2017 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/SGLOpenGL.podspec b/SGLOpenGL.podspec
new file mode 100644
index 0000000..e95b8a2
--- /dev/null
+++ b/SGLOpenGL.podspec
@@ -0,0 +1,14 @@
+Pod::Spec.new do |s|
+ s.name = 'SGLOpenGL'
+ s.version = '3.1.0'
+ s.summary = 'SwiftGL OpenGL Library'
+ s.description = <<-DESC
+The SwiftGL OpenGL library allows for easy acess of OpenGL API from Swfit on macOS.
+ DESC
+ s.homepage = 'https://github.com/SwiftGL/OpenGL'
+ s.license = { :type => 'MIT', :file => 'LICENSE' }
+ s.author = { 'AE9RB' => 'dturnbull@gmail.com' }
+ s.source = { :git => 'https://github.com/SwiftGL/OpenGL.git', :tag => s.version.to_s }
+ s.osx.deployment_target = '10.11'
+ s.osx.source_files = 'Sources/SGLOpenGL/*.swift'
+end
diff --git a/SGLOpenGL.xcodeproj/SGLOpenGL_Info.plist b/SGLOpenGL.xcodeproj/SGLOpenGL_Info.plist
new file mode 100644
index 0000000..57ada9f
--- /dev/null
+++ b/SGLOpenGL.xcodeproj/SGLOpenGL_Info.plist
@@ -0,0 +1,25 @@
+
+
+
+ CFBundleDevelopmentRegion
+ en
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ FMWK
+ CFBundleShortVersionString
+ 1.0
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ $(CURRENT_PROJECT_VERSION)
+ NSPrincipalClass
+
+
+
diff --git a/SGLOpenGL.xcodeproj/project.pbxproj b/SGLOpenGL.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..39dc4d7
--- /dev/null
+++ b/SGLOpenGL.xcodeproj/project.pbxproj
@@ -0,0 +1,518 @@
+// !$*UTF8*$!
+{
+ archiveVersion = "1";
+ objectVersion = "46";
+ objects = {
+ "OBJ_1" = {
+ isa = "PBXProject";
+ attributes = {
+ LastUpgradeCheck = "9999";
+ };
+ buildConfigurationList = "OBJ_2";
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = "English";
+ hasScannedForEncodings = "0";
+ knownRegions = (
+ "en",
+ );
+ mainGroup = "OBJ_5";
+ productRefGroup = "OBJ_17";
+ projectDirPath = ".";
+ targets = (
+ "SGLOpenGL::SwiftPMPackageDescription",
+ "SGLOpenGL::SGLOpenGL",
+ "SGLOpenGL::Tools",
+ "SGLOpenGL::glgen::ProductTarget",
+ );
+ };
+ "OBJ_10" = {
+ isa = "PBXGroup";
+ children = (
+ "OBJ_11",
+ "OBJ_12",
+ "OBJ_13",
+ "OBJ_14",
+ );
+ name = "SGLOpenGL";
+ path = "Sources/SGLOpenGL";
+ sourceTree = "SOURCE_ROOT";
+ };
+ "OBJ_11" = {
+ isa = "PBXFileReference";
+ path = "Commands.swift";
+ sourceTree = "";
+ };
+ "OBJ_12" = {
+ isa = "PBXFileReference";
+ path = "Constants.swift";
+ sourceTree = "";
+ };
+ "OBJ_13" = {
+ isa = "PBXFileReference";
+ path = "Loaders.swift";
+ sourceTree = "";
+ };
+ "OBJ_14" = {
+ isa = "PBXFileReference";
+ path = "SwiftGL.swift";
+ sourceTree = "";
+ };
+ "OBJ_15" = {
+ isa = "PBXGroup";
+ children = (
+ );
+ name = "Tests";
+ path = "";
+ sourceTree = "SOURCE_ROOT";
+ };
+ "OBJ_16" = {
+ isa = "PBXFileReference";
+ path = "Data";
+ sourceTree = "SOURCE_ROOT";
+ };
+ "OBJ_17" = {
+ isa = "PBXGroup";
+ children = (
+ "SGLOpenGL::SGLOpenGL::Product",
+ "SGLOpenGL::Tools::Product",
+ );
+ name = "Products";
+ path = "";
+ sourceTree = "BUILT_PRODUCTS_DIR";
+ };
+ "OBJ_2" = {
+ isa = "XCConfigurationList";
+ buildConfigurations = (
+ "OBJ_3",
+ "OBJ_4",
+ );
+ defaultConfigurationIsVisible = "0";
+ defaultConfigurationName = "Debug";
+ };
+ "OBJ_21" = {
+ isa = "XCConfigurationList";
+ buildConfigurations = (
+ "OBJ_22",
+ "OBJ_23",
+ );
+ defaultConfigurationIsVisible = "0";
+ defaultConfigurationName = "Debug";
+ };
+ "OBJ_22" = {
+ isa = "XCBuildConfiguration";
+ buildSettings = {
+ LD = "/usr/bin/true";
+ OTHER_SWIFT_FLAGS = (
+ "-swift-version",
+ "4",
+ "-I",
+ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/4",
+ "-target",
+ "x86_64-apple-macosx10.10",
+ "-sdk",
+ "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk",
+ );
+ SWIFT_VERSION = "4.0";
+ };
+ name = "Debug";
+ };
+ "OBJ_23" = {
+ isa = "XCBuildConfiguration";
+ buildSettings = {
+ LD = "/usr/bin/true";
+ OTHER_SWIFT_FLAGS = (
+ "-swift-version",
+ "4",
+ "-I",
+ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/4",
+ "-target",
+ "x86_64-apple-macosx10.10",
+ "-sdk",
+ "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk",
+ );
+ SWIFT_VERSION = "4.0";
+ };
+ name = "Release";
+ };
+ "OBJ_24" = {
+ isa = "PBXSourcesBuildPhase";
+ files = (
+ "OBJ_25",
+ );
+ };
+ "OBJ_25" = {
+ isa = "PBXBuildFile";
+ fileRef = "OBJ_6";
+ };
+ "OBJ_27" = {
+ isa = "XCConfigurationList";
+ buildConfigurations = (
+ "OBJ_28",
+ "OBJ_29",
+ );
+ defaultConfigurationIsVisible = "0";
+ defaultConfigurationName = "Debug";
+ };
+ "OBJ_28" = {
+ isa = "XCBuildConfiguration";
+ buildSettings = {
+ ENABLE_TESTABILITY = "YES";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PLATFORM_DIR)/Developer/Library/Frameworks",
+ );
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)",
+ );
+ INFOPLIST_FILE = "SGLOpenGL.xcodeproj/SGLOpenGL_Info.plist";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx",
+ );
+ OTHER_LDFLAGS = (
+ "$(inherited)",
+ );
+ OTHER_SWIFT_FLAGS = (
+ "$(inherited)",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = "SGLOpenGL";
+ PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ SKIP_INSTALL = "YES";
+ SWIFT_VERSION = "4.0";
+ TARGET_NAME = "SGLOpenGL";
+ };
+ name = "Debug";
+ };
+ "OBJ_29" = {
+ isa = "XCBuildConfiguration";
+ buildSettings = {
+ ENABLE_TESTABILITY = "YES";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PLATFORM_DIR)/Developer/Library/Frameworks",
+ );
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)",
+ );
+ INFOPLIST_FILE = "SGLOpenGL.xcodeproj/SGLOpenGL_Info.plist";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx",
+ );
+ OTHER_LDFLAGS = (
+ "$(inherited)",
+ );
+ OTHER_SWIFT_FLAGS = (
+ "$(inherited)",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = "SGLOpenGL";
+ PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)";
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ SKIP_INSTALL = "YES";
+ SWIFT_VERSION = "4.0";
+ TARGET_NAME = "SGLOpenGL";
+ };
+ name = "Release";
+ };
+ "OBJ_3" = {
+ isa = "XCBuildConfiguration";
+ buildSettings = {
+ CLANG_ENABLE_OBJC_ARC = "YES";
+ COMBINE_HIDPI_IMAGES = "YES";
+ COPY_PHASE_STRIP = "NO";
+ DEBUG_INFORMATION_FORMAT = "dwarf";
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ ENABLE_NS_ASSERTIONS = "YES";
+ GCC_OPTIMIZATION_LEVEL = "0";
+ MACOSX_DEPLOYMENT_TARGET = "10.10";
+ ONLY_ACTIVE_ARCH = "YES";
+ OTHER_SWIFT_FLAGS = (
+ "-DXcode",
+ );
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = "macosx";
+ SUPPORTED_PLATFORMS = (
+ "macosx",
+ "iphoneos",
+ "iphonesimulator",
+ "appletvos",
+ "appletvsimulator",
+ "watchos",
+ "watchsimulator",
+ );
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "SWIFT_PACKAGE";
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ USE_HEADERMAP = "NO";
+ };
+ name = "Debug";
+ };
+ "OBJ_30" = {
+ isa = "PBXSourcesBuildPhase";
+ files = (
+ "OBJ_31",
+ "OBJ_32",
+ "OBJ_33",
+ "OBJ_34",
+ );
+ };
+ "OBJ_31" = {
+ isa = "PBXBuildFile";
+ fileRef = "OBJ_11";
+ };
+ "OBJ_32" = {
+ isa = "PBXBuildFile";
+ fileRef = "OBJ_12";
+ };
+ "OBJ_33" = {
+ isa = "PBXBuildFile";
+ fileRef = "OBJ_13";
+ };
+ "OBJ_34" = {
+ isa = "PBXBuildFile";
+ fileRef = "OBJ_14";
+ };
+ "OBJ_35" = {
+ isa = "PBXFrameworksBuildPhase";
+ files = (
+ );
+ };
+ "OBJ_37" = {
+ isa = "XCConfigurationList";
+ buildConfigurations = (
+ "OBJ_38",
+ "OBJ_39",
+ );
+ defaultConfigurationIsVisible = "0";
+ defaultConfigurationName = "Debug";
+ };
+ "OBJ_38" = {
+ isa = "XCBuildConfiguration";
+ buildSettings = {
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PLATFORM_DIR)/Developer/Library/Frameworks",
+ );
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)",
+ );
+ INFOPLIST_FILE = "SGLOpenGL.xcodeproj/Tools_Info.plist";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx",
+ "@executable_path",
+ );
+ OTHER_LDFLAGS = (
+ "$(inherited)",
+ );
+ OTHER_SWIFT_FLAGS = (
+ "$(inherited)",
+ );
+ SWIFT_FORCE_DYNAMIC_LINK_STDLIB = "YES";
+ SWIFT_FORCE_STATIC_LINK_STDLIB = "NO";
+ SWIFT_VERSION = "4.0";
+ TARGET_NAME = "Tools";
+ };
+ name = "Debug";
+ };
+ "OBJ_39" = {
+ isa = "XCBuildConfiguration";
+ buildSettings = {
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PLATFORM_DIR)/Developer/Library/Frameworks",
+ );
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)",
+ );
+ INFOPLIST_FILE = "SGLOpenGL.xcodeproj/Tools_Info.plist";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx",
+ "@executable_path",
+ );
+ OTHER_LDFLAGS = (
+ "$(inherited)",
+ );
+ OTHER_SWIFT_FLAGS = (
+ "$(inherited)",
+ );
+ SWIFT_FORCE_DYNAMIC_LINK_STDLIB = "YES";
+ SWIFT_FORCE_STATIC_LINK_STDLIB = "NO";
+ SWIFT_VERSION = "4.0";
+ TARGET_NAME = "Tools";
+ };
+ name = "Release";
+ };
+ "OBJ_4" = {
+ isa = "XCBuildConfiguration";
+ buildSettings = {
+ CLANG_ENABLE_OBJC_ARC = "YES";
+ COMBINE_HIDPI_IMAGES = "YES";
+ COPY_PHASE_STRIP = "YES";
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ GCC_OPTIMIZATION_LEVEL = "s";
+ MACOSX_DEPLOYMENT_TARGET = "10.10";
+ OTHER_SWIFT_FLAGS = (
+ "-DXcode",
+ );
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = "macosx";
+ SUPPORTED_PLATFORMS = (
+ "macosx",
+ "iphoneos",
+ "iphonesimulator",
+ "appletvos",
+ "appletvsimulator",
+ "watchos",
+ "watchsimulator",
+ );
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "SWIFT_PACKAGE";
+ SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
+ USE_HEADERMAP = "NO";
+ };
+ name = "Release";
+ };
+ "OBJ_40" = {
+ isa = "PBXSourcesBuildPhase";
+ files = (
+ "OBJ_41",
+ );
+ };
+ "OBJ_41" = {
+ isa = "PBXBuildFile";
+ fileRef = "OBJ_9";
+ };
+ "OBJ_42" = {
+ isa = "PBXFrameworksBuildPhase";
+ files = (
+ );
+ };
+ "OBJ_44" = {
+ isa = "XCConfigurationList";
+ buildConfigurations = (
+ "OBJ_45",
+ "OBJ_46",
+ );
+ defaultConfigurationIsVisible = "0";
+ defaultConfigurationName = "Debug";
+ };
+ "OBJ_45" = {
+ isa = "XCBuildConfiguration";
+ buildSettings = {
+ };
+ name = "Debug";
+ };
+ "OBJ_46" = {
+ isa = "XCBuildConfiguration";
+ buildSettings = {
+ };
+ name = "Release";
+ };
+ "OBJ_47" = {
+ isa = "PBXTargetDependency";
+ target = "SGLOpenGL::Tools";
+ };
+ "OBJ_5" = {
+ isa = "PBXGroup";
+ children = (
+ "OBJ_6",
+ "OBJ_7",
+ "OBJ_15",
+ "OBJ_16",
+ "OBJ_17",
+ );
+ path = "";
+ sourceTree = "";
+ };
+ "OBJ_6" = {
+ isa = "PBXFileReference";
+ explicitFileType = "sourcecode.swift";
+ path = "Package.swift";
+ sourceTree = "";
+ };
+ "OBJ_7" = {
+ isa = "PBXGroup";
+ children = (
+ "OBJ_8",
+ "OBJ_10",
+ );
+ name = "Sources";
+ path = "";
+ sourceTree = "SOURCE_ROOT";
+ };
+ "OBJ_8" = {
+ isa = "PBXGroup";
+ children = (
+ "OBJ_9",
+ );
+ name = "Tools";
+ path = "Sources/Tools";
+ sourceTree = "SOURCE_ROOT";
+ };
+ "OBJ_9" = {
+ isa = "PBXFileReference";
+ path = "main.swift";
+ sourceTree = "";
+ };
+ "SGLOpenGL::SGLOpenGL" = {
+ isa = "PBXNativeTarget";
+ buildConfigurationList = "OBJ_27";
+ buildPhases = (
+ "OBJ_30",
+ "OBJ_35",
+ );
+ dependencies = (
+ );
+ name = "SGLOpenGL";
+ productName = "SGLOpenGL";
+ productReference = "SGLOpenGL::SGLOpenGL::Product";
+ productType = "com.apple.product-type.framework";
+ };
+ "SGLOpenGL::SGLOpenGL::Product" = {
+ isa = "PBXFileReference";
+ path = "SGLOpenGL.framework";
+ sourceTree = "BUILT_PRODUCTS_DIR";
+ };
+ "SGLOpenGL::SwiftPMPackageDescription" = {
+ isa = "PBXNativeTarget";
+ buildConfigurationList = "OBJ_21";
+ buildPhases = (
+ "OBJ_24",
+ );
+ dependencies = (
+ );
+ name = "SGLOpenGLPackageDescription";
+ productName = "SGLOpenGLPackageDescription";
+ productType = "com.apple.product-type.framework";
+ };
+ "SGLOpenGL::Tools" = {
+ isa = "PBXNativeTarget";
+ buildConfigurationList = "OBJ_37";
+ buildPhases = (
+ "OBJ_40",
+ "OBJ_42",
+ );
+ dependencies = (
+ );
+ name = "Tools";
+ productName = "Tools";
+ productReference = "SGLOpenGL::Tools::Product";
+ productType = "com.apple.product-type.tool";
+ };
+ "SGLOpenGL::Tools::Product" = {
+ isa = "PBXFileReference";
+ path = "Tools";
+ sourceTree = "BUILT_PRODUCTS_DIR";
+ };
+ "SGLOpenGL::glgen::ProductTarget" = {
+ isa = "PBXAggregateTarget";
+ buildConfigurationList = "OBJ_44";
+ buildPhases = (
+ );
+ dependencies = (
+ "OBJ_47",
+ );
+ name = "glgen";
+ productName = "glgen";
+ };
+ };
+ rootObject = "OBJ_1";
+}
diff --git a/SGLOpenGL.xcodeproj/xcshareddata/xcschemes/SGLOpenGL-Package.xcscheme b/SGLOpenGL.xcodeproj/xcshareddata/xcschemes/SGLOpenGL-Package.xcscheme
new file mode 100644
index 0000000..e371c6f
--- /dev/null
+++ b/SGLOpenGL.xcodeproj/xcshareddata/xcschemes/SGLOpenGL-Package.xcscheme
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SGLOpenGL.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist b/SGLOpenGL.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist
new file mode 100644
index 0000000..a072544
--- /dev/null
+++ b/SGLOpenGL.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist
@@ -0,0 +1,12 @@
+
+
+
+ SchemeUserState
+
+ SGLOpenGL-Package.xcscheme
+
+
+ SuppressBuildableAutocreation
+
+
+