{"id":25972020,"url":"https://github.com/Gekkio/imgui-rs","last_synced_at":"2025-03-05T00:02:46.278Z","repository":{"id":36525625,"uuid":"40831387","full_name":"imgui-rs/imgui-rs","owner":"imgui-rs","description":"Rust bindings for Dear ImGui","archived":false,"fork":false,"pushed_at":"2024-10-18T18:25:37.000Z","size":9213,"stargazers_count":2678,"open_issues_count":63,"forks_count":363,"subscribers_count":34,"default_branch":"main","last_synced_at":"2024-10-29T11:44:43.272Z","etag":null,"topics":["gui","imgui","rust","rust-library"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imgui-rs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2015-08-16T17:51:04.000Z","updated_at":"2024-10-29T01:41:18.000Z","dependencies_parsed_at":"2023-02-19T12:31:29.986Z","dependency_job_id":"ce006546-7e6e-446b-b9f3-326adbc3c8be","html_url":"https://github.com/imgui-rs/imgui-rs","commit_stats":{"total_commits":1441,"total_committers":115,"mean_commits":"12.530434782608696","dds":0.6544066620402498,"last_synced_commit":"ba02f2287fb5781bb921b7dc4a7ec95cd88b74d0"},"previous_names":["gekkio/imgui-rs"],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imgui-rs%2Fimgui-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imgui-rs%2Fimgui-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imgui-rs%2Fimgui-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imgui-rs%2Fimgui-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imgui-rs","download_url":"https://codeload.github.com/imgui-rs/imgui-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241940573,"owners_count":20045881,"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":["gui","imgui","rust","rust-library"],"created_at":"2025-03-05T00:02:45.755Z","updated_at":"2025-03-05T00:02:46.140Z","avatar_url":"https://github.com/imgui-rs.png","language":"Rust","funding_links":[],"categories":["Libraries","库","库 Libraries","Rust"],"sub_categories":["GUI","图形用户界面 GUI"],"readme":"# imgui-rs: Rust bindings for Dear ImGui\n\n[![Build Status](https://github.com/imgui-rs/imgui-rs/workflows/ci/badge.svg)](https://github.com/imgui-rs/imgui-rs/actions)\n[![Latest release on crates.io](https://img.shields.io/crates/v/imgui.svg)](https://crates.io/crates/imgui)\n[![Documentation on docs.rs](https://docs.rs/imgui/badge.svg)](https://docs.rs/imgui)\n[![Wrapped Dear ImGui Version](https://img.shields.io/badge/Dear%20ImGui%20Version-1.89.2-blue.svg)](https://github.com/ocornut/imgui)\n\n![Hello world](hello_world.png)\n\n```rust\nui.window(\"Hello world\")\n    .size([300.0, 100.0], Condition::FirstUseEver)\n    .build(|| {\n        ui.text(\"Hello world!\");\n        ui.text(\"こんにちは世界！\");\n        ui.text(\"This...is...imgui-rs!\");\n        ui.separator();\n        let mouse_pos = ui.io().mouse_pos;\n        ui.text(format!(\n            \"Mouse Position: ({:.1},{:.1})\",\n            mouse_pos[0], mouse_pos[1]\n        ));\n    });\n```\n\n`imgui-rs` are the Rust bindings to [Dear ImGui](https://github.com/ocornut/imgui), the standard immediate mode user interface library.\n\n## Main library crates\n\nThe core of imgui-rs consists of:\n\n- [`imgui`](./imgui): High-level safe API\n- [`imgui-sys`](./imgui-sys): Low-level unsafe API (automatically generated)\n\nNext, we provide an example renderer, and two example backend platform implementations:\n\n- [`imgui-glow-renderer`](https://github.com/imgui-rs/imgui-glow-renderer): Renderer implementation that uses the `glow` crate\n- [`imgui-winit-support`](https://github.com/imgui-rs/imgui-winit-support): Backend platform implementation that uses the `winit` crate\n- [`imgui-sdl2-support`](https://github.com/imgui-rs/imgui-sdl2-support): Backend platform using SDL2\n\nEach of these contain an `examples` folder showing their usage. Check\ntheir respective `Cargo.toml` to find compatible versions (e.g\n`imgui-glow-renderer/Cargo.toml` the `[dependencies]` describes the\ncompatible `glow` version and `[dev-dependencies]` describes the\ncompatible `glutin` version)\n\nSee below as well for community lead platform and renderer crates.\n\n## Features\n\n- Bindings for Dear ImGui that can be used with safe Rust. Note: API coverage\n  is not 100%, but will keep improving over time.\n- Builder structs for use cases where the original C++ library uses optional\n  function parameters\n- Easy integration with `glow` and community integrations with `wgpu` and `glium`\n- Easy integration with `winit` and `sdl2`\n- Optional support for the freetype font rasterizer and the docking branch\n\n## Minimum Support Rust Version (MSRV)\n\nThe MSRV for `imgui-rs` and all of the backend crates is **1.82**. We update our MSRV periodically, and issue a minor bump for it.\n\n## Choosing a backend platform and a renderer\n\nAlmost every application that uses imgui-rs needs two additional components in\naddition to the main `imgui` crate: a backend platform, and a renderer.\n\n**imgui-rs is not tied to any particular renderer or platform.**\n\nThe backend platform is responsible for integrating imgui-rs with the operating\nsystem and its window management. Its responsibilities include the following:\n\n- Handling input events (e.g. keyboard, mouse) and updating imgui-rs state\n  accordingly\n- Passing information about the OS window (e.g. size, DPI factor) to imgui-rs\n- Updating the OS-side mouse cursor when imgui-rs requests it\n\nThe renderer is responsible for taking generic, renderer-agnostic _draw lists_\ngenerated by imgui-rs, and rendering them using some graphics API. Its\nresponsibilities include the following:\n\n- Rendering using vertex/index buffers and command lists\n- Handling of DPI factors and scissor rects\n- Texture management\n\nWe provide the following renderer as an official source (ie, they will always be up to date and working): `imgui-glow-renderer`.\n\nAdditionally, we provide the following backends as an official source (ie, they will always be up to date and working): `imgui-winit-support` and `imgui-sdl2-support`.\n\nThe most tested platform/renderer combination is `imgui-glow-renderer` +\n`imgui-winit-support` + `winit`, but this is not the only possible\ncombination.\n\nAdditionally, there are other libraries which provide other kinds of renderers, which may be out of date with `imgui-rs` releases, but might work well for your use case:\n\n1.  [`imgui-wgpu`](https://github.com/Yatekii/imgui-wgpu-rs)\n2.  [`imgui-d3d12-renderer`](https://github.com/curldivergence/imgui-d3d12-renderer)\n3.  [`imgui-dx11-renderer`](https://github.com/veykril/imgui-dx11-renderer)\n4.  [`imgui-gfx-renderer`](https://github.com/imgui-rs/imgui-gfx-renderer): Deprecated (no longer maintained beyond imgui-rs v0.8). Renderer implementation that uses the `gfx` crate (_not the new gfx-hal crate_)\n5.  [`imgui-glium-renderer`](https://github.com/imgui-rs/imgui-glium-renderer): Deprecated implementation that uses the `glium` crate\n6.  Many more can be found on [crates.io](https://crates.io) either using search or the [\"dependents\" page](https://crates.io/crates/imgui/reverse_dependencies) (the \"depends on\" text indicates if the crate has been updated for current versions of imgui-rs)\n\nYou can also write your own support code if you have a more advanced use case, because **imgui-rs is not tied to any specific graphics / OS API**.\n\n## Compiling and running the demos\n\nExamples for `imgui` are in their own crate [`imgui-examples`](https://github.com/imgui-rs/imgui-examples).\n\n```bash\ngit clone https://github.com/imgui-rs/imgui-examples\ncd imgui-examples\n\n# At the reposity root\ncargo test\n\ncargo run --example hello_world\ncargo run --example test_window\ncargo run --example test_window_impl\n```\n\n## Windows Platform Notes\n\nWindows platform users will need to use the _MSVC ABI_ version of the Rust\ncompiler along with its associated\n[dependencies](https://www.rust-lang.org/en-US/downloads.html#win-foot) to\nbuild this libary and run the examples.\n\n## How to contribute\n\n1. Change or add something\n2. Make sure you're using the latest stable Rust\n3. Run rustfmt to guarantee code style conformance\n\n   ```bash\n   rustup component add rustfmt\n   cargo fmt\n   ```\n\n4. Open a pull request in Github\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT)\n\nat your option.\n\nUses [Dear ImGui](https://github.com/ocornut/imgui) and\n[cimgui](https://github.com/cimgui/cimgui).\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall\nbe dual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGekkio%2Fimgui-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGekkio%2Fimgui-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGekkio%2Fimgui-rs/lists"}