{"id":32151509,"url":"https://github.com/thepotatoking55/cglfw3","last_synced_at":"2026-02-18T22:01:30.822Z","repository":{"id":117679321,"uuid":"362582029","full_name":"ThePotatoKing55/CGLFW3","owner":"ThePotatoKing55","description":"Swift bindings for GLFW.","archived":false,"fork":false,"pushed_at":"2024-06-02T17:24:16.000Z","size":1122,"stargazers_count":8,"open_issues_count":3,"forks_count":10,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-16T22:42:47.929Z","etag":null,"topics":["glfw","glfw-bindings","glfw3","macos","opengl","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThePotatoKing55.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-28T19:19:26.000Z","updated_at":"2025-10-24T13:49:09.000Z","dependencies_parsed_at":"2024-06-02T19:05:33.472Z","dependency_job_id":"015dbb61-5965-45a9-b7c9-bac36fbf47aa","html_url":"https://github.com/ThePotatoKing55/CGLFW3","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ThePotatoKing55/CGLFW3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePotatoKing55%2FCGLFW3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePotatoKing55%2FCGLFW3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePotatoKing55%2FCGLFW3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePotatoKing55%2FCGLFW3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThePotatoKing55","download_url":"https://codeload.github.com/ThePotatoKing55/CGLFW3/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePotatoKing55%2FCGLFW3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29596329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T20:59:56.587Z","status":"ssl_error","status_checked_at":"2026-02-18T20:58:41.434Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["glfw","glfw-bindings","glfw3","macos","opengl","swift"],"created_at":"2025-10-21T10:46:50.753Z","updated_at":"2026-02-18T22:01:30.809Z","avatar_url":"https://github.com/ThePotatoKing55.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CGLFW3\n\nBuilds [GLFW](https://www.glfw.org) as a library to add to your Swift Package. As of writing, it's currently updated to the [latest commit](https://github.com/glfw/glfw/commit/955fbd9d265fa95adf9cb94896eb9a516aa50420) for GLFW 3.4.\n\nThis package can work on its own, but it was created as a base for [SwiftGLFW](https://github.com/thepotatoking55/SwiftGLFW).\n\n## Getting Started\n\nSwiftPM doesn't support unsafe flags with semantic versioned packages, so add this to your dependecies in `Package.swift`:\n\n```swift\n.package(url: \"https://github.com/thepotatoking55/CGLFW3.git\", branch: \"main\")\n```\n\nFrom there, you can just import it with `import CGLFW3` and use it like normal.\n\n## Cross-Platform Support\n\nTo expose platform-native functions such as `glfwGetCocoaWindow`, add the following C settings to your target:\n\n```swift\n.target(\n    name: \"ExampleTarget\",\n    dependencies: [\"CGLFW3\"],\n    cSettings: [\n        .define(\"GLFW_EXPOSE_NATIVE_WIN32\", .when(platforms: [.windows])),\n        .define(\"GLFW_EXPOSE_NATIVE_WGL\", .when(platforms: [.windows])),\n        .define(\"GLFW_EXPOSE_NATIVE_COCOA\", .when(platforms: [.macOS])),\n        .define(\"GLFW_EXPOSE_NATIVE_NSGL\", .when(platforms: [.macOS])),\n        .define(\"GLFW_EXPOSE_NATIVE_X11\", .when(platforms: [.linux]))\n    ]\n)\n```\n\nI don't have a computer running Linux and Windows support for SwiftPM is rudimentary, so this will probably still take some work to get ported to non-Mac platforms.\n\n## Hello World\n\nA Swift translation of the \"hello world\" program in [GLFW's documentation](https://www.glfw.org/documentation):\n\n```swift\nimport CGLFW3\n\nfunc main() {\n    glfwInit()\n    \n    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4)\n    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1)\n    glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE)\n    glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE)\n    \n    guard let window = glfwCreateWindow(800, 600, \"Hello World\", nil, nil) else {\n        let error = glfwGetError(nil)\n        print(error)\n        return\n    }\n\n    glfwMakeContextCurrent(window)\n    while glfwWindowShouldClose(window) == GLFW_FALSE {\n        glfwSwapBuffers(window)\n        glfwPollEvents()\n    }\n    \n    glfwTerminate()\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthepotatoking55%2Fcglfw3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthepotatoking55%2Fcglfw3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthepotatoking55%2Fcglfw3/lists"}