REAMDE: add link to egui docs about immediate mode
This commit is contained in:
parent
ffbd094f53
commit
ce19e10258
1 changed files with 2 additions and 0 deletions
|
@ -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); }`.
|
`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.
|
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.
|
The short of it is this: immediate mode GUI libraries are easier to use, but less powerful.
|
||||||
|
|
Loading…
Reference in a new issue