aclysma / imgui-inspect Goto Github PK
View Code? Open in Web Editor NEWAn inspector UI using imgui in Rust
License: Apache License 2.0
An inspector UI using imgui in Rust
License: Apache License 2.0
I think once this issue is solved it would open up a whole lot more possibilities out of the box
ping @LPGhatguy
It also says "Message not implemented"
How to reproduce:
#[derive(Inspect)]
struct Empty; // crashes the proc macro
I'm using it because the empty struct is used as a flag component in an ecs.
What I guess should be derived:
impl InspectRenderDefault<Empty> for Empty {
fn render(data: &[&Empty], label: &'static str, ui: &Ui, args: &InspectArgsDefault) {
ui.text(imgui::im_str!("Empty"));
}
fn render_mut(
data: &mut [&mut Empty],
label: &'static str,
ui: &Ui,
args: &InspectArgsDefault,
) -> bool {
ui.text(imgui::im_str!("Empty");
false
}
}
Or something alike.
"cargo (v. 1.42.0) run" fails with:
(...)
Compiling imgui-inspect-demo v0.1.0 (/home/luiz/tmp/git/imgui-inspect/imgui-inspect-demo)
error[E0308]: mismatched types
--> imgui-inspect-demo/src/imgui_support.rs:115:57
|
115 | platform.handle_event(context.io_mut(), &window, &event);
| ^^^^^^^ expected struct winit::window::Window
, found &winit::window::Window
|
= note: expected reference &winit::window::Window
found reference &&winit::window::Window
error[E0308]: mismatched types
--> imgui-inspect-demo/src/imgui_support.rs:115:66
|
115 | platform.handle_event(context.io_mut(), &window, &event);
| ^^^^^^ expected enum winit::event::Event
, found reference
|
= note: expected reference &winit::event::Event<'_, _>
found reference &&winit::event::Event<'_, T>
error[E0308]: mismatched types
--> imgui-inspect-demo/src/imgui_support.rs:189:52
|
189 | .prepare_frame(inner.context.io_mut(), window)
| ^^^^^^ expected struct winit::window::Window
, found a different struct winit::window::Window
|
= note: expected reference &winit::window::Window
(struct winit::window::Window
)
found reference &winit::window::Window
(struct winit::window::Window
)
= note: perhaps two different versions of crate winit
are being used?
error[E0308]: mismatched types
--> imgui-inspect-demo/src/imgui_support.rs:228:48
|
228 | inner.platform.prepare_render(&ui, window);
| ^^^^^^ expected struct winit::window::Window
, found a different struct winit::window::Window
|
= note: expected reference &winit::window::Window
(struct winit::window::Window
)
found reference &winit::window::Window
(struct winit::window::Window
)
= note: perhaps two different versions of crate winit
are being used?
error[E0308]: mismatched types
--> imgui-inspect-demo/src/imgui_support.rs:319:9
|
319 | &window,
| ^^^^^^^ expected struct winit::window::Window
, found &winit::window::Window
|
= note: expected reference &winit::window::Window
found reference &&winit::window::Window
error: aborting due to 5 previous errors
For more information about this error, try rustc --explain E0308
.
error: could not compile imgui-inspect-demo
.
To learn more, run the command again with --verbose.
Test with PR #9 and publish
Is enum
not supported yet?
Example:
use imgui_inspect_derive::Inspect;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Inspect)]
pub enum ShadowConfig {
Blur,
Raw,
None,
}
cargo build
:
error: proc-macro derive panicked
--> crates/grue2d/src/game/cfg.rs:7:51
|
7 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Inspect)]
| ^^^^^^^
|
= help: message: not implemented
Thank you :)
This crate currently uses imgui 0.4 which is no compatible with imgui 0.5, would be great to upgrade to 0.5 and publish a new version of this.
I'm posting this as an issue, but It's really a usability question and maybe there's a way to do this that I haven't seen.
I'm using this crate to inspect an Entity
using specs
, however I found that there was no way for the render functions to use the World
reference, which makes indirection impossible.
For example I have a car entity which has a component Objective
, the objective corresponds to the id of a node in the road graph.
I would like in the inspector to show the position of this node instead of just an id (which is pretty meaningless).
Is there a way to do this already ? Or does this require significant work ? Maybe some way of passing the world in the InspectArgs ?
I also thought about forking the crate to add a "Option<&mut World>" to the render trait and derive mechanism or something like that.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.