{"id":13712780,"url":"https://github.com/JonSnowbd/ZT","last_synced_at":"2025-05-06T22:31:30.429Z","repository":{"id":43031976,"uuid":"369734112","full_name":"JonSnowbd/ZT","owner":"JonSnowbd","description":"A zig based Imgui Application framework","archived":false,"fork":false,"pushed_at":"2025-02-26T22:15:25.000Z","size":3149,"stargazers_count":119,"open_issues_count":0,"forks_count":20,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-02-26T23:22:35.975Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JonSnowbd.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":"2021-05-22T06:32:29.000Z","updated_at":"2025-02-26T22:15:28.000Z","dependencies_parsed_at":"2024-11-13T23:30:55.650Z","dependency_job_id":"6c220caa-83b7-41f7-89ec-6edb6627a64c","html_url":"https://github.com/JonSnowbd/ZT","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonSnowbd%2FZT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonSnowbd%2FZT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonSnowbd%2FZT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonSnowbd%2FZT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JonSnowbd","download_url":"https://codeload.github.com/JonSnowbd/ZT/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252779087,"owners_count":21802880,"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":[],"created_at":"2024-08-02T23:01:22.580Z","updated_at":"2025-05-06T22:31:30.409Z","avatar_url":"https://github.com/JonSnowbd.png","language":"Zig","readme":"\u003cp align=\"center\"\u003e\r\n  \u003cimg width=\"200\" height=\"100\" src=\"/example/assets/texture/logo.png\"\u003e\r\n\u003c/p\u003e\r\n\r\n## DISCONTINUED\r\n\r\nI had hoped to come back to this when Zig was a bit more mature to actively maintain ZT,\r\nbut the decision to remove LLVM from the zig toolchain has killed any advantage I viewed\r\nas a benefit for the language, having a universal consistent toolchain for C that I could\r\nrely on existing for everyone who would use Zig was an immeasurable benefit. \r\n\r\nThe need for an external package, or a self installed version of C turned my interest in\r\na consistent and powerful language built to turn C code into amazing Zig companions, into\r\nthe mess I didn't want to come back to from other languages that try to do what Zig did.\r\n\r\nThe toolchain that made me confident that replication was perfectly stable is now (im pretty sure? I'd love to be wrong about this) back to\r\nhoping end users have the right toolchain installed next to zig, installation instructions, \"try it on clang/msvc/llvm instead\" that I wanted\r\nto avoid from other languages. Sorry, loved the time I spent with it, maybe check out Mach and adding your own imgui layer in that, if it doesnt\r\nhave one already.\r\n\r\n## Old readme\r\n\r\nA zig-contained library for Windows and Ubuntu that automatically compiles and\r\nlinks ImGui, OpenGL, stb_image, and GLFW into typed packages.\r\n\r\nZT will always target the latest dev version of Zig, and will\r\ncreate a branch for stable releases when convenient.\r\n\r\nCheck out the [wiki](https://github.com/JonSnowbd/ZT/wiki) for documentation and help.\r\n\r\n\u003ch1 align=center\u003eFor Applications\u003c/h1\u003e\r\n\u003cp align=\"center\"\u003e\r\n  \u003cimg width=\"640px\" height=\"390px\" src=\"https://cdn.discordapp.com/attachments/602279341371424780/864667669940273172/unknown.png\"\u003e\r\n\u003c/p\u003e\r\n\r\nGet your applications done quick with industry standard ImGui library, used\r\nby a bunch of applications for its convenience and power.\r\n\r\nUsing ImGui is as simple as calling the functions! ZT will render\r\neverything for you without ever needing to touch gamedev code.\r\n\r\n\u003chr/\u003e\r\n\r\n\u003ch1 align=center\u003eFor Games\u003c/h1\u003e\r\n\u003cp align=\"center\"\u003e\r\n  \u003cimg width=\"640px\" height=\"390px\" src=\"https://cdn.discordapp.com/attachments/602279341371424780/864667491817095218/unknown.png\"\u003e\r\n\u003c/p\u003e\r\n\r\nWith ImGui at the forefront for free, debugging and creating editors\r\nfor your game is as smooth as it can be without deciding anything for you\r\n\r\n\u003chr/\u003e\r\n\r\n# Overview\r\n\r\nTo work with ZT You will need:\r\n\r\n- Zig 0.11.* Main branch build. Nightly might work as well (last tested `0.12.0-dev.1856+94c63f31f`).\r\n- Ubuntu: `sudo apt install build-essential xorg-dev`\r\n\r\n### Current Status\r\n\r\n- ZT when used for the purpose of GL/ImGui libraries is very stable\r\n- ZT.App is still receiving breaking changes as I find where I can make\r\nthe library more flexible for casual use, but overall I find it convenient for\r\napplications and games\r\n\r\nSee [the example](/example/src/main.zig) for what ZT.App has to offer.\r\n\r\n### Why\r\n\r\nZT is intended for an extremely broad group of developers in zig realtime graphics and applications, as it does not railroad you into\r\nusing its app+windowing interface to function, and is better viewed as the following goals being accomplished without\r\nany resistance:\r\n\r\n- Linear Algebra and Math types\r\n- Cross platform windowing (GLFW) within Zig\r\n- OpenGL binding within Zig\r\n- Completely up to date (c)ImGui Docking branch bindings within Zig\r\n- STB_Image bindings within Zig\r\n- (Optional) barebones wrappers around basic opengl constructs like shaders/textures/buffers\r\n\r\nand additionally a ready to go combination of all 3 that lets you just immediately use close to the metal\r\nOpenGL constructs to just work on your application with convenience for use as desktop application code such as\r\nEnergy Saving mode.\r\n\r\n# Getting Started\r\n\r\nFirst you'll want to clone this into your zig project's folder, and `const ztBuild = @import(\"path/to/ZT/build.zig\")` \r\nin your own `build.zig` to import this framework's build.zig, and that will expose some important functions\r\nto link ZT into your project.\r\n\r\n- `ztBuild.link(exe)` will add ZT's packages to your exe and link the source files for GLFW/GL/ImGui\r\n- (optional) `ztBuild.addBinaryContent(\"path/to/binContent\")` adds binary content to your zig-out folder output, basically the folder structure\r\nends up being as if `path/to/binContent` was the root folder containing your executable. This is smart and will skip older assets.\r\n\r\nSo with `ztBuild` imported you just `ztBuild.link(exe)` and you can start importing and using\r\nZT, or if you so choose, completely ignore ZT and use raw opengl/glfw/imgui.\r\n\r\nThen getting started is as easy as this:\r\n\r\n```Zig\r\nconst std = @import(\"std\");\r\nconst zt = @import(\"zt\");\r\n\r\n/// SampleData will be available through the context anywhere.\r\nconst SampleData = struct {\r\n    yourData: i32 = 0,\r\n};\r\n\r\nconst SampleApplication = zt.App(SampleData);\r\n\r\npub fn main() !void {\r\n    var context = try SampleApplication.begin(std.heap.c_allocator);\r\n    // Config here,\r\n    while(context.open) {\r\n        context.beginFrame();\r\n        // Application code here!\r\n        context.data.yourData += 1;\r\n        context.endFrame();\r\n    }\r\n    // Unload here\r\n    context.deinit();\r\n}\r\n```\r\n\r\nFor a more indepth example [see the example file that shows opengl rendering mixed with imgui and more](example/src/main.zig)\r\n\r\n## Gotcha:\r\n\r\n- ZT.App.begin sets its own GLFW user pointer! Its important too, so use something else for your storage, or if you really want the functionality,\r\nlet me know and I'll see how I can enable your usecase within ZT.\r\n- By linking ZT the following packages are available to your app on both windows and ubuntu: `zt`, `gl`, `glfw`, `imgui`, `stb_image`\r\n- ImVec2 and ImVec4 are both substituted with zlm's Vec2 and Vec4 structs respectively, you can use both interchangeably.\r\n- Disabling power saving mode will let GLFW handle buffer flip timing, so likely will be at vsync fps rather than on every\r\nevent, unless you disable vsync.\r\n- Need direct access to the input queue? Your context contains an ArrayList of tagged unions that summarizes every input event.\r\nTry to use this instead of overriding GLFW event callbacks.\r\n\r\n## Credits\r\n\r\n- Example Font - https://github.com/uswds/public-sans\r\n- Inspiration and Code Snippets - https://github.com/digitalcreature/ube (Thanks sammy for all the help!)\r\n","funding_links":[],"categories":["Multimedia \u0026 Graphics","Libraries"],"sub_categories":["Graphics Library"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJonSnowbd%2FZT","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJonSnowbd%2FZT","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJonSnowbd%2FZT/lists"}