From ce19e10258d5ba6ac4ecfa3b015246b09cd6b569 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 23 Aug 2021 21:48:38 +0200 Subject: [PATCH] REAMDE: add link to egui docs about immediate mode --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1f255415..5ee68130 100644 --- a/README.md +++ b/README.md @@ -235,6 +235,8 @@ For a reference OpenGL backend, see [the `egui_glium` painter](https://github.co `egui` is an [immediate mode GUI library](https://en.wikipedia.org/wiki/Immediate_mode_GUI), as opposed to a *retained mode* GUI library. The difference between retained mode and immediate mode is best illustrated with the example of a button: In a retained GUI you create a button, add it to some UI and install some on-click handler (callback). The button is retained in the UI, and to change the text on it you need to store some sort of reference to it. By contrast, in immediate mode you show the button and interact with it immediately, and you do so every frame (e.g. 60 times per second). This means there is no need for any on-click handler, nor to store any reference to it. In `egui` this looks like this: `if ui.button("Save file").clicked() { save(file); }`. +A more detailed description of immediate mode can be found [in the `egui` docs](https://docs.rs/egui/latest/egui/#understanding-immediate-mode). + There are advantages and disadvantages to both systems. The short of it is this: immediate mode GUI libraries are easier to use, but less powerful.