Expand description

fltk-egui

An FLTK backend for Egui using a GlWindow.

To use on Linux

Install FLTK deps:

sudo apt-get update && sudo apt-get install -y libpango1.0-dev libx11-dev libxext-dev libxft-dev libxinerama-dev libxcursor-dev libxrender-dev libxfixes-dev libgl1-mesa-dev libglu1-mesa-dev libmpv-dev

and then install egui deps:

sudo apt-get update && sudo apt-get install -y libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev

Usage

Add to your Cargo.toml:

[dependencies]
fltk-egui = "0.7" # targets egui 0.18

On wayland desktop enable feature:

[dependencies]
fltk-egui = { version = "0.7",  features = ["wayland"] }

The basic premise is that egui is an immediate mode gui, while FLTK is retained. To be able to run Egui code, events and redrawing would need to be handled/done in the FLTK event loop. The events are those of the GlWindow, which are sent to egui’s event handlers. Other FLTK widgets can function also normally since there is no interference from Egui. Please check the basic example.

Examples

To run the examples, just run:

$ cargo run --example demo_windows
$ cargo run --example triangle
$ cargo run --example basic
$ cargo run --example embedded

A demo app can be found here: https://github.com/fltk-rs/demos/tree/master/egui-demo

Re-exports

pub use egui;
pub use egui_glow::glow;
pub use fltk;

Modules

Structs

Shuttles FLTK’s input and events to Egui

The default cursor

An image to be shown in egui.

Traits

Functions

Casting slice to another type of slice

Frame time for FPS.

Handles input/events from FLTK

egui::TextureHandle from slice of egui::Color32

egui::TextureHandle from slice of u8

egui::TextureHandle from Vec egui::Color32

egui::TextureHandle from Vec u8

Translates FLTK cursor to Egui cursors

Translates key codes

Construct the backend.