Crate egui_sdl2

Crate egui_sdl2 

Source
Expand description

§egui-sdl2

Integration between egui and sdl2.

§Features

  • Translate SDL2 events into egui events.
  • Handle egui::PlatformOutput (clipboard, cursor updates, links).
  • Render with OpenGL via glow (glow-backend feature).
  • Render with the SDL2 software renderer via sdl2::render::Canvas (canvas-backend feature).

§Usage

// Create SDL2 window:
let sdl = sdl2::init().unwrap();
let video = sdl.video().unwrap();
let window = video.window("Egui SDL2 Canvas", 800, 600).build().unwrap();
// Create egui renderer:
let mut egui = egui_sdl2::EguiCanvas::new(window);
// Feed SDL2 events into egui:
let mut event_pump = sdl.event_pump().unwrap();
let event = event_pump.wait_event();
egui.on_event(&event);
// Call `run` + `paint` each frame:
egui.run(|ctx: &egui::Context| {});
egui.paint();

Re-exports§

pub use canvas::EguiCanvas;
pub use wgpu::EguiWgpu;
pub use egui;
pub use egui_glow;
pub use sdl2;
pub use glow::*;
pub use state::*;

Modules§

canvas
Integration between egui and SDL2’s sdl2::render::Canvas API.
glow
Integration between egui and glow for SDL2 applications.
state
State management for egui + SDL2 integration.
wgpu
Integration between egui and wgpu API.

Structs§

EguiRunOutput
The results of running one frame of egui.