egui/egui_demo_lib
Emil Ernerfeldt 8e4fd942a9
Refactor memory data (#836)
This refactors the widget state storage introduced by @optozorax in https://github.com/emilk/egui/pull/257

* Unify the four buckets (`data`, `data_temp`, `id_data` and `id_data_temp`) into a single `data`.
  * Less complexity, and also less chance of error (storing in one bucket, reading from another).
* Store data by `Id` and `TypeId`.
  * Users can thus reuse the same `Id` to store many types.
  * Uses a simple xor of id and typeid, which is fast and good since both id and typeid are already high-entropy hashes.
* Use different suffixes on the functions to pick if you want the data persisted or not (`get_temp`, `insert_persisted`, etc).
  * Writing with one suffix and reading with the other works.
* To store state not bound to a specific `Id` (i.e. only based on type), use the new `Id::null` as the key.
2021-10-27 08:51:34 +02:00
..
benches Shape refactor (#705) 2021-09-20 21:36:56 +02:00
src Refactor memory data (#836) 2021-10-27 08:51:34 +02:00
Cargo.toml Release 0.15.0 - Syntax highlighting, hscroll, egui-winit and egui_glow 2021-10-24 16:15:07 +02:00
README.md Point crate repository & homepage urls to their subfolders 2021-09-03 21:12:44 +02:00

egui demo library

Latest version Documentation unsafe forbidden MIT Apache

This crate contains example code for egui.

It is in a separate crate for two reasons:

  • To ensure it only uses the public egui api.
  • To remove the amount of code in egui proper.