docs.rs failed to build imgui-winit-support-0.13.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
imgui-winit-support-0.8.2
imgui-winit-support
This crate provides a winit-based backend platform for [imgui-rs
].
A backend platform handles window/input device events and manages their state.
Using the library
There are five things you need to do to use this library correctly:
- Initialize a [
WinitPlatform
] instance. - Attach it to a winit [
Window
] with [WinitPlatform::attach_window
]. - Pass events to the platform (every frame) with [
WinitPlatform::handle_event
]. - Call the frame preparation callback [
WinitPlatform::prepare_frame
] (every frame) - Call the render preparation callback [
WinitPlatform::prepare_render
] (every frame)
Complete example (without a renderer)
use Context;
use ;
use Instant;
use ;
use EventLoop;
use WindowAttributes;
let event_loop = new.expect;
let window = event_loop
.create_window
.expect;
let mut imgui = create;
// configure imgui-rs Context if necessary
let mut platform = new; // step 1
platform.attach_window; // step 2
let mut last_frame = now;
event_loop
.run
.expect;
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.