{"id":13741420,"url":"https://github.com/Guigui220D/zig-sfml-wrapper","last_synced_at":"2025-05-08T21:33:51.877Z","repository":{"id":38073111,"uuid":"308385762","full_name":"Guigui220D/zig-sfml-wrapper","owner":"Guigui220D","description":"A zig wrapper for csfml","archived":false,"fork":false,"pushed_at":"2024-08-02T11:42:03.000Z","size":7506,"stargazers_count":45,"open_issues_count":6,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-08-02T13:14:41.452Z","etag":null,"topics":["binding","csfml","sfml","wrapper","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/Guigui220D.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":"2020-10-29T16:25:03.000Z","updated_at":"2024-08-02T11:42:07.000Z","dependencies_parsed_at":"2024-06-22T08:56:35.606Z","dependency_job_id":"2e1a9250-33cf-4914-9eca-df6e03840bff","html_url":"https://github.com/Guigui220D/zig-sfml-wrapper","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guigui220D%2Fzig-sfml-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guigui220D%2Fzig-sfml-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guigui220D%2Fzig-sfml-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guigui220D%2Fzig-sfml-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Guigui220D","download_url":"https://codeload.github.com/Guigui220D/zig-sfml-wrapper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224774796,"owners_count":17367795,"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":["binding","csfml","sfml","wrapper","zig","zig-package"],"created_at":"2024-08-03T04:00:59.028Z","updated_at":"2025-05-08T21:33:51.870Z","avatar_url":"https://github.com/Guigui220D.png","language":"Zig","funding_links":[],"categories":["Libraries"],"sub_categories":[],"readme":"# Zig [SFML](https://www.sfml-dev.org/) Wrapper\r\n\r\n## A pretty interface to use CSFML in a way that looks Object-Oriented in zig!\r\n\r\n### What this is\r\n\r\nThis is a wrapper for CSFML. Theres no problem importing CSFML in Zig, but the resulting code can be a little bit messy.\r\nMy goal is to make things close enough to SFML, with nice methods.\r\n\r\nThis currently for Zig 0.12 (should work with 0.13) and CSFML 2.6.1.\r\n\r\n### Adding to your project\r\n\r\nAdd using Zig's package manager like so: `zig fetch --save https://github.com/Guigui220D/zig-sfml-wrapper/archive/d5272051a937c8a3756bb96eab8276b76a271de4.tar.gz` (replace the commit hash if you want an other version).\r\n\r\nAdd this to your exe compile in `build.zig`:\r\n\r\n```zig\r\nconst sfml = @import(\"sfml\"); // AT THE TOP OF THE FILE\r\n\r\nexe.root_module.addImport(\"sfml\", b.dependency(\"sfml\", .{}).module(\"sfml\"));\r\nsfml.link(exe);\r\n```\r\n\r\n\u003e **Note:** Your project must know the location of the CSFML2.6.1 include, lib, and binaries directories for successful building and running. For more information, please refer to the wiki 👇 \r\n\r\nCheck the [wiki](../../wiki) for more details on how to compile your project or the examples.\r\n\r\n### Small example\r\n\r\nThis is a small example of how you use this sfml wrapper:\r\n\r\n```zig\r\n//! This is a translation of the c++ code the sfml website gives you to test if SFML works\r\n//! for instance, in this page: https://www.sfml-dev.org/tutorials/2.6/start-vc.php\r\n\r\nconst sf = struct {\r\n    usingnamespace @import(\"sfml\");\r\n    usingnamespace sf.graphics;\r\n};\r\n\r\npub fn main() !void {\r\n    var window = try sf.RenderWindow.createDefault(.{ .x = 200, .y = 200 }, \"SFML works!\");\r\n    defer window.destroy();\r\n\r\n    var shape = try sf.CircleShape.create(100.0);\r\n    defer shape.destroy();\r\n    shape.setFillColor(sf.Color.Green);\r\n\r\n    while (window.isOpen()) {\r\n        while (window.pollEvent()) |event| {\r\n            if (event == .closed)\r\n                window.close();\r\n        }\r\n\r\n        window.clear(sf.Color.Black);\r\n        window.draw(shape, null);\r\n        window.display();\r\n    }\r\n}\r\n```\r\n\r\n### Projects made with this wrapper\r\n\r\nFeel free to add your project to this list!\r\n\r\n- [Pong clone I made](https://github.com/Guigui220D/sfml-pong-zig)\r\n- [Minez](https://github.com/Guigui220D/minez) an arcade looking minecraft inspired mining game\r\n- [quran-warsh](https://github.com/muslimDevCommunity/quran-warsh) a desktop quran app\r\n  \r\n### How much is done\r\n\r\nMost of the classes are wrapped and you should be able to write games with this wrapper.\r\nThe network module is a recent addition and does not contain all classes yet (HTTP, FTP, ...).\r\nThreads are not available yet.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGuigui220D%2Fzig-sfml-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGuigui220D%2Fzig-sfml-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGuigui220D%2Fzig-sfml-wrapper/lists"}