Module imgui_wgpu::simple_api[][src]

A simple API to get an imgui context in only a few lines of code.

This API only provides stability on a best efforts basis because its meant for small/ temporary projects like if you need to quickly plot something and just need a context do some imgui work.

It aims to make updating the wgpu imgui bindings easier to use as it abstracts all the setup. This comes with the drawback of yet another API.

It is basically a wrapper around the hello world example with a few customization options.

The API consists of a Config which you may not need to touch and just use the Default one. Optionally, you can provide your own Struct to have a place to store mutable state in your small application.

fn main() {
    imgui_wgpu::simple_api::run(Default::default(), (), |ui, _| {
        imgui::Window::new(imgui::im_str!("hello world")).build(&ui, || {
            ui.text(imgui::im_str!("Hello world!"));
        });
    });
}

Structs

Config

use Default::default if you don’t need anything specific.

Functions

run

simple function to draw imgui