{"id":13493930,"url":"https://github.com/ctreffs/SwiftImGui","last_synced_at":"2025-03-28T13:31:27.939Z","repository":{"id":41547120,"uuid":"217808855","full_name":"ctreffs/SwiftImGui","owner":"ctreffs","description":"Swift wrapper around Dear imgui for macOS, iOS, Linux and Windows","archived":false,"fork":false,"pushed_at":"2025-03-19T19:24:12.000Z","size":11399,"stargazers_count":163,"open_issues_count":10,"forks_count":19,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-21T17:09:00.203Z","etag":null,"topics":["cimgui","gui","imgui","library","mit-license","spm","swift","swift-package-manager","swiftimgui"],"latest_commit_sha":null,"homepage":"","language":"C++","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/ctreffs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"github":["ctreffs"],"custom":["https://www.paypal.com/donate?hosted_button_id=GCG3K54SKRALQ"]}},"created_at":"2019-10-27T05:20:57.000Z","updated_at":"2025-03-21T16:03:43.000Z","dependencies_parsed_at":"2022-07-07T14:31:48.994Z","dependency_job_id":"ada999a6-4092-455f-947b-d6a45bc073f4","html_url":"https://github.com/ctreffs/SwiftImGui","commit_stats":{"total_commits":227,"total_committers":5,"mean_commits":45.4,"dds":"0.026431718061673992","last_synced_commit":"c81197496f9227001fd5531673604a6f29f880b1"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctreffs%2FSwiftImGui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctreffs%2FSwiftImGui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctreffs%2FSwiftImGui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctreffs%2FSwiftImGui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ctreffs","download_url":"https://codeload.github.com/ctreffs/SwiftImGui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246037332,"owners_count":20713396,"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":["cimgui","gui","imgui","library","mit-license","spm","swift","swift-package-manager","swiftimgui"],"created_at":"2024-07-31T19:01:20.088Z","updated_at":"2025-03-28T13:31:26.423Z","avatar_url":"https://github.com/ctreffs.png","language":"C++","funding_links":["https://github.com/sponsors/ctreffs","https://www.paypal.com/donate?hosted_button_id=GCG3K54SKRALQ","http://www.patreon.com/imgui","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=WGHNC6MBFLZ2S"],"categories":["C++"],"sub_categories":[],"readme":"# Swift ImGui\n\n[![macOS](https://github.com/ctreffs/SwiftImGui/actions/workflows/ci-macos.yml/badge.svg)](https://github.com/ctreffs/SwiftImGui/actions/workflows/ci-macos.yml)\n[![Linux](https://github.com/ctreffs/SwiftImGui/actions/workflows/ci-linux.yml/badge.svg)](https://github.com/ctreffs/SwiftImGui/actions/workflows/ci-linux.yml)\n[![Windows](https://github.com/ctreffs/SwiftImGui/actions/workflows/ci-windows.yml/badge.svg)](https://github.com/ctreffs/SwiftImGui/actions/workflows/ci-windows.yml)\n[![platform-compatibility](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fctreffs%2FSwiftImGui%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/ctreffs/SwiftImGui)   \n[![swift-version-compatibility](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fctreffs%2FSwiftImGui%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/ctreffs/SwiftImGui)\n[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE)  \n\n\u003cp align=\"center\"\u003e\n\t\u003cimg src=\"docs/swiftimgui.gif\" width=\"100%\" alt=\"swiftimgui-gif\"/\u003e\n\u003c/p\u003e   \n\nThis is a **lightweight**, **auto-generated** and **thin** Swift wrapper around the popular and excellent [**dear imgui**](https://github.com/ocornut/imgui) library.  \n\nIt provides a **swifty** and especially **typesafe** API. It is easily maintainable and updatable, as well, since it relies heavily on automated code generation.\n\nThere are working [demo examples](Sources/Demos/), too, provided as part of the library.\n\nCurrently it is based on **v1.86** of ImGui.\n\n## 🚀 Getting Started\n\nThese instructions will get your copy of the project up and running on your local machine and provide a code example.\n\n### 📋 Prerequisites\n\n* [Swift Package Manager (SPM)](https://github.com/apple/swift-package-manager)\n* [Swiftlint](https://github.com/realm/SwiftLint) for linting - (optional)\n\n### 💻 Installing\n\nSwift ImGui is available for all platforms that support [Swift 5.3](https://swift.org/) and higher and the [Swift Package Manager (SPM)](https://github.com/apple/swift-package-manager).\n\nExtend the following lines in your `Package.swift` file or use it to create a new project.\n\n```swift\n// swift-tools-version:5.3\n\nimport PackageDescription\n\nlet package = Package(\n    name: \"YourPackageName\",\n    dependencies: [\n        .package(url: \"https://github.com/ctreffs/SwiftImGui.git\", from: \"1.86.0\")\n    ],\n    targets: [\n        .target(\n            name: \"YourTargetName\",\n            dependencies: [\"ImGui\"])\n    ]\n)\n\n```\n\n\n## 📝 Code Example\n\n### Minimal\n\nA minimal example is located at [Sources/Demos/Minimal/main.swift](Sources/Demos/Minimal/main.swift).   \n\nThis is an excerpt:\n\n```swift\nimport ImGui\n\nIMGUI_CHECKVERSION()\nlet ctx = ImGuiCreateContext(nil)\nlet io = ImGuiGetIO()!\n\n/// Build font atlas\nvar pixels: UnsafeMutablePointer\u003cUInt8\u003e?\nvar width: Int32 = 0\nvar height: Int32 = 0\nvar bytesPerPixel: Int32 = 0\nImFontAtlas_GetTexDataAsRGBA32(io.pointee.Fonts, \u0026pixels, \u0026width, \u0026height, \u0026bytesPerPixel)\n\nfor n in 0..\u003c20 {\n    io.pointee.DisplaySize = ImVec2(x: 1920, y: 1080)\n    io.pointee.DeltaTime = 1.0 / 60.0\n    ImGuiNewFrame()\n    var f: Float = 0.0\n    ImGuiTextV(\"Hello, world!\")\n    ImGuiSliderFloat(\"float\", \u0026f, 0.0, 1.0, nil, 1)\n    ImGuiTextV(\"Application average %.3f ms/frame (%.1f FPS)\", 1000.0 / io.pointee.Framerate, io.pointee.Framerate)\n    ImGuiShowDemoWindow(nil)\n    ImGuiRender()\n}\n\nImGuiDestroyContext(ctx)\n```\n\n### Metal + OSX\n\nThis is another demo displaying ImGui demo window at [Sources/Demos/Metal](Sources/Demos/Metal).\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"docs/imgui_demo.png\" width=\"70%\" alt=\"imgui_demo\"/\u003e\n\u003c/p\u003e \n\nIt provides two backend files ([imgui_impl_metal.swift](Sources/Demos/Metal/imgui_impl_metal.swift), [imgui_impl_osx.swift](Sources/Demos/Metal/imgui_impl_metal.swift)). Feel free to include more backends for GLFW, SDL2, etc.\n\n## 🆕 Update SwiftImGui\n\nSwiftImGui uses a mutli-stage process to update to the latest [cimgui](https://github.com/cimgui/cimgui) and [imgui](https://github.com/ocornut/imgui) versions.\n\nSee [HOWTO.md](docs/HOWTO.md) for steps about how to contribute.\n\n## 💁 Help Needed\n\nThis project needs a lot of love.\nIf you are interested in contributing please feel free to do so!\n\nThings that need to be done among others are:\n\n- [ ] Extend the AutoWrapper to wrap more cimgui functions\n    - Currently there are **112** 'invalid' functions that will not be wrapped and **974** will be wrapped properly.\n- [ ] Some functions are not available via the C interface - see `Sources/AutoWrapper/Exceptions.swift`\n- [ ] Find a solution for manual adjustments in cimgui generator template\n- [ ] Write some more tests\n\n## 🏷️ Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. For the versions available, see the [releases](https://github.com/ctreffs/SwiftImGui/releases) in this repository.\n\n## ✍️ Authors\n\n* [Christian Treffs](https://github.com/ctreffs)\n\nSee also the list of [contributors](https://github.com/ctreffs/SwiftImGui/graphs/contributors) who participated in this project.\n\n## 🔏 Licenses\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n* imgui licensed under [MIT License](https://github.com/ocornut/imgui/blob/master/LICENSE.txt)\n* CImGui licensed under [MIT License](https://github.com/cimgui/cimgui/blob/master/LICENSE)\n\n## 🙏 Original Code\n\nSwiftImGui is merely a wrapper around [**imgui**](https://github.com/ocornut/imgui). It also makes use of the excellent C-API wrapper [**cimgui**](https://github.com/cimgui/cimgui).\n\nSupport them if you can!\n\n### imgui\n\n##### From [ocornut/imgui/docs/README.md](https://github.com/ocornut/imgui/blob/master/docs/README.md):\n\n\u003e Dear ImGui is a **bloat-free graphical user interface library for C++**. It outputs optimized vertex buffers that you can render anytime in your 3D-pipeline enabled application. It is fast, portable, renderer agnostic and self-contained (no external dependencies).\n\u003e \n\u003e Dear ImGui is designed to **enable fast iterations** and to **empower programmers** to create **content creation tools and visualization / debug tools** (as opposed to UI for the average end-user). It favors simplicity and productivity toward this goal, and lacks certain features normally found in more high-level libraries.\n\u003e \n\u003e Dear ImGui is particularly suited to integration in games engine (for tooling), real-time 3D applications, fullscreen applications, embedded applications, or any applications on consoles platforms where operating system features are non-standard.\n\n\u003csub\u003e(This library is available under a free and permissive license, but needs financial support to sustain its continued improvements. In addition to maintenance and stability there are many desirable features yet to be added. If your company is using dear imgui, please consider reaching out. If you are an individual using dear imgui, please consider supporting the project via Patreon or PayPal.)\u003c/sub\u003e\n\n- **Businesses:** support continued development via invoiced technical support, maintenance, sponsoring contracts:\n\u003cbr\u003e\u0026nbsp;\u0026nbsp;_E-mail: contact @ dearimgui dot org_\n- **Individuals/hobbyists:** support continued maintenance and development via the monthly Patreon:\n\u003cbr\u003e\u0026nbsp;\u0026nbsp;[![Patreon](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/patreon_02.png)](http://www.patreon.com/imgui)\n- **Individuals/hobbyists:** support continued maintenance and development via PayPal:\n\u003cbr\u003e\u0026nbsp;\u0026nbsp;[![PayPal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=WGHNC6MBFLZ2S)\n\n----\n\n### cimgui\n\n##### From [cimgui/cimgui/README.md](https://github.com/cimgui/cimgui/blob/master/README.md)\n\n\u003e CImGui is a thin C-API wrapper programmatically generated for the excellent C++ immediate mode GUI Dear ImGui. All imgui.h functions are programmatically wrapped. Generated files are: cimgui.cpp, cimgui.h for C compilation. Also for helping in bindings creation, definitions.lua with function definition information and structs_and_enums.lua. This library is intended as a intermediate layer to be able to use Dear ImGui from other languages that can interface with C (like D - see D-binding)\n\n\n## ☮️ Alternatives\n\n* [mnmly/Swift-imgui](https://github.com/mnmly/Swift-imgui)\n* [troughton/SwiftImGui](https://github.com/troughton/SwiftImGui)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctreffs%2FSwiftImGui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fctreffs%2FSwiftImGui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctreffs%2FSwiftImGui/lists"}