{"id":17928703,"url":"https://github.com/tayloraswift/swift-opengl","last_synced_at":"2026-03-02T13:02:46.727Z","repository":{"id":63914350,"uuid":"95395899","full_name":"tayloraswift/swift-opengl","owner":"tayloraswift","description":"pure swift OpenGL function loading","archived":false,"fork":false,"pushed_at":"2017-08-18T04:01:35.000Z","size":734,"stargazers_count":33,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-29T04:35:05.490Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tayloraswift.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-26T01:16:43.000Z","updated_at":"2025-08-07T04:34:37.000Z","dependencies_parsed_at":"2023-01-14T13:31:08.395Z","dependency_job_id":null,"html_url":"https://github.com/tayloraswift/swift-opengl","commit_stats":null,"previous_names":["kelvin13/swift-opengl"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/tayloraswift/swift-opengl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tayloraswift%2Fswift-opengl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tayloraswift%2Fswift-opengl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tayloraswift%2Fswift-opengl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tayloraswift%2Fswift-opengl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tayloraswift","download_url":"https://codeload.github.com/tayloraswift/swift-opengl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tayloraswift%2Fswift-opengl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27672063,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-11T02:00:11.302Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-28T21:04:49.661Z","updated_at":"2025-12-11T22:56:16.287Z","avatar_url":"https://github.com/tayloraswift.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Platforms](https://img.shields.io/badge/platform-linux-lightgrey.svg)](https://swift.org)\n[![Release tag](https://img.shields.io/github/release/kelvin13/swift-opengl.svg)](https://github.com/kelvin13/swift-opengl/releases)\n[![Build](https://travis-ci.org/kelvin13/swift-opengl.svg?branch=master)](https://travis-ci.org/kelvin13/swift-opengl)\n[![Issues](https://img.shields.io/github/issues/kelvin13/swift-opengl.svg)](https://github.com/kelvin13/swift-opengl/issues?state=open)\n[![Language](https://img.shields.io/badge/version-swift_4-ffa020.svg)](https://swift.org)\n[![License](https://img.shields.io/badge/license-GPL3-ff3079.svg)](https://github.com/kelvin13/swift-opengl/blob/master/COPYING)\n[![KK25](https://img.shields.io/badge/karlie-kloss-e030ff.svg)](https://www.google.com/search?q=karlie+kloss)\n\n# OpenGL\n\nAn OpenGL function loader written in pure swift. To use it, `import GL` in your swift file.\n\n*OpenGL* is a function loader which allows you to call OpenGL GPU functions from swift programs. These functions are loaded lazily at runtime by *OpenGL*. *OpenGL* also diagnoses invalid OpenGL function calls due to the function not being available on a particular GPU and OpenGL version. *OpenGL* can load any OpenGL function up to OpenGL 4.5.\n\n*OpenGL* works on Linux; it’s untested on Mac OSX, but there is no reason it shouldn’t work.\n\n## Functions\n\n*OpenGL* provides access to OpenGL functions both with labeled and unlabeled arguments. This can help you avoid common argument ordering bugs.\n\n```swift\nglClearColor(0.15, 0.15, 0.15, 1)\nglClearColor(red: 0.15, green: 0.15, blue: 0.15, alpha: 1)\n```\n\nThe function names are the same as the OpenGL C specification, and the argument labels are the same as the parameter names in the C specification, with two exceptions: `` `in`: `` has been renamed to `input:`, and `` `func`: `` has been renamed to `f:` to avoid conflicts with Swift keywords.\n\n## Constants\n\n*OpenGL* imports OpenGL constants under the scope `GL`. Unless doing so would cause the constant’s name to start with a digit, the constant’s redundant `GL_` prefix is dropped.\n\n```swift\nglBlendFunc(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA)\n```\n\n\u003e Note: The `GL` scope is not the same as the module scope which is also called `GL`. The fully qualified name of an OpenGL enum or an OpenGL type is `GL.GL.__symbolname__`. The fully qualified name of an OpenGL function is just `GL.__functionname__`.\n\nAll *OpenGL* constants are of one of the following types: `GL.Enum`, `GL.Bitfield`, or `GL.UInt64`. (`Int32`, `UInt32`, or `UInt64`, respectively.)\n\n## Types\n\n*OpenGL* provides typealias definitions for OpenGL types. The typealiases are given Swifty names, and are also scoped to `GL`.\n\n```swift\nvar tex_id:GL.UInt = 0\n```\n\n| OpenGL C type     | *OpenGL* Swift typealias | *OpenGL* Swift type |\n| ----------------- | ----------------- | ------------------------- |\n| GLboolean         | GL.Bool           | Bool                      |\n| GLdouble          | GL.Double         | Double                    |\n| GLclampd          | GL.ClampDouble    | Double                    |\n| GLfloat           | GL.Float          | Float                     |\n| GLclampf          | GL.ClampFloat     | Float                     |\n| GLbyte            | GL.Byte           | Int8                      |\n| GLchar            | GL.Char           | Int8                      |\n| GLcharARB         | GL.CharARB        | Int8                      |\n| GLshort           | GL.Short          | Int16                     |\n| GLint             | GL.Int            | Int32                     |\n| GLsizei           | GL.Size           | Int32                     |\n| GLenum            | GL.Enum           | Int32                     |\n| GLfixed           | GL.Fixed          | Int32                     |\n| GLclampx          | GL.ClampX         | Int32                     |\n| GLint64           | GL.Int64          | Int64                     |\n| GLint64EXT        | GL.Int64EXT       | Int64                     |\n| GLintptr          | GL.IntPointer     | Int                       |\n| GLintptrARB       | GL.IntPointerARB  | Int                       |\n| GLsizeiptr        | GL.SizePointer    | Int                       |\n| GLsizeiptrARB     | GL.SizePointerARB | Int                       |\n| GLvdpauSurfaceNV  | GL.VdpauSurfaceNV | Int                       |\n| GLubyte           | GL.UByte          | UInt8                     |\n| GLushort          | GL.UShort         | UInt16                    |\n| GLhalfNV          | GL.HalfNV         | UInt16                    |\n| GLuint            | GL.UInt           | UInt32                    |\n| GLbitfield        | GL.Bitfield       | UInt32                    |\n| GLuint64          | GL.UInt64         | UInt64                    |\n| GLuint64EXT       | GL.UInt64EXT      | UInt64                    |\n| GLhandleARB       | GL.HandleARB      | UnsafeMutableRawPointer?  |\n| GLeglImageOES     | GL.EGLImageOES    | UnsafeMutableRawPointer?  |\n| GLsync            | GL.Sync           | OpaquePointer?            |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftayloraswift%2Fswift-opengl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftayloraswift%2Fswift-opengl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftayloraswift%2Fswift-opengl/lists"}