Egui - is it possible to avoid using eframe?

So this is with fltk-rs, not just fltk?

I mean what if I wanted to design my own GUI game editor and integrate it into a game engine.

Yes fltk-rs.

You can create a gui editor for your assets which can then be shifted to the game engine. You can also spawn an fltk window via the game engine if you like. Embedding an fltk window would actially depend on the game engine itself, ie if it accepts a raw window handle from fltk-rs.

1 Like

So the basic way egui works is that

  • You, the person writing the GUI code, use an egui::CtxRef to render a frame of GUI. This is completely independent of whatever rendering backend code you use, whether it be reframe or some other backend.
  • Later, you, the person writing the render code, use an egui integration (which can be custom written) to paint the GUI to your render surface.
  • At some point, you, the application writer, write a loop which is basically loop { read input; run app; build ui; render app; paint ui; }

(While egui is an immediate mode gui library, it is not meant to be interleaved with business logic the way that Dear ImGuiC++ is.)

If you're using eframe, the main loop looks like

  • eframe sets up winit and egui-winit
  • winit owns the main loop
  • winit talks to the OS and pumps the OS application loop layer
  • winit calls into eframe's frame callback
  • eframe uses egui-winit to read the winit state into egui's state
  • eframe calls your application's frame functions
  • eframe uses egui-winit to paint the built egui GUI
  • repeat

And you are perfectly able to replace any part that you want to.

5 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.