Git Product home page Git Product logo

imgui-inspect's People

Contributors

aclysma avatar fkarg avatar jasper-bekkers avatar maxded avatar niklasnummelin avatar repi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

imgui-inspect's Issues

Add support for passing an arbitrary Context through the render/render_mut APIs

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.

Q. `enum` support?

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 :)

Deriving an empty struct crashes the proc-macro

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.

Upgrade to imgui 0.5?

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.

not building (on linux)

"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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.