{"id":13626651,"url":"https://github.com/IridescenceTech/zglfw","last_synced_at":"2025-04-16T14:34:14.343Z","repository":{"id":45018194,"uuid":"296404405","full_name":"IridescenceTech/zglfw","owner":"IridescenceTech","description":"A thin, idiomatic wrapper for GLFW. Written in Zig, for Zig!","archived":false,"fork":false,"pushed_at":"2025-03-01T23:58:04.000Z","size":377,"stargazers_count":97,"open_issues_count":0,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-05T10:01:40.234Z","etag":null,"topics":["glfw","opengl","zig","zig-package"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IridescenceTech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-09-17T18:03:48.000Z","updated_at":"2025-04-01T22:22:05.000Z","dependencies_parsed_at":"2023-01-20T05:21:13.924Z","dependency_job_id":"1a952e3d-4c5e-4795-ab8a-669c1b14b7cf","html_url":"https://github.com/IridescenceTech/zglfw","commit_stats":null,"previous_names":["iridescencetech/zglfw","iridescence-technologies/zglfw"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IridescenceTech%2Fzglfw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IridescenceTech%2Fzglfw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IridescenceTech%2Fzglfw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IridescenceTech%2Fzglfw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IridescenceTech","download_url":"https://codeload.github.com/IridescenceTech/zglfw/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249250843,"owners_count":21237961,"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","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","opengl","zig","zig-package"],"created_at":"2024-08-01T21:02:25.583Z","updated_at":"2025-04-16T14:34:14.104Z","avatar_url":"https://github.com/IridescenceTech.png","language":"Zig","funding_links":[],"categories":["Zig"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003ezGLFW\u003c/h1\u003e\n\u003cp align=\"center\"\u003eA thin, idiomatic wrapper for GLFW. Written in Zig, for Zig!\u003c/p\u003e\n\n# Why write a wrapper?\nWhile Zig is PERFECTLY capable of simply `@cImport`ing glfw3.h and using it in your application, I think it lacks a lot of cleanliness and succinctness that can be expressed with Zig. I decided to write this wrapper to provide GLFW with a nicer interface, error handling options, and quality of life changes (for example `[]const u8` instead of `[*c]const u8`). It also uses nicely named constants in place of `#define`s.\n\nzGLFW is NOT 100% tested. I am happy to fix any errors that may arise, and I will accept contributions! Errors that arise from GLFW will be printed to `stderr`.\n\n# Examples\n\n```zig\nconst std = @import(\"std\");\nconst glfw = @import(\"glfw\");\n\npub fn main() !void {\n    var major: i32 = 0;\n    var minor: i32 = 0;\n    var rev: i32 = 0;\n\n    glfw.getVersion(\u0026major, \u0026minor, \u0026rev);\n    std.debug.print(\"GLFW {}.{}.{}\\n\", .{ major, minor, rev });\n\n    //Example of something that fails with GLFW_NOT_INITIALIZED - but will continue with execution\n    //var monitor: ?*glfw.Monitor = glfw.getPrimaryMonitor();\n\n    try glfw.init();\n    defer glfw.terminate();\n    std.debug.print(\"GLFW Init Succeeded.\\n\", .{});\n\n    var window: *glfw.Window = try glfw.createWindow(800, 640, \"Hello World\", null, null);\n    defer glfw.destroyWindow(window);\n\n    while (!glfw.windowShouldClose(window)) {\n        if (glfw.getKey(window, glfw.KeyEscape) == glfw.Press) {\n            glfw.setWindowShouldClose(window, true);\n        }\n\n        glfw.pollEvents();\n    }\n}\n```\n\n# Documentation\n\nI would suggest you look into the `glfw.zig` file themselves, as most of the changes are simple syntactically, but I have made some comments in cases where it may be different than you expect. Obviously [GLFW's Documentation](https://www.glfw.org/documentation.html) should cover most things that you want to know.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIridescenceTech%2Fzglfw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FIridescenceTech%2Fzglfw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIridescenceTech%2Fzglfw/lists"}