Commit Graph

173 Commits

Author SHA1 Message Date
Emil Ernerfeldt f14fa1663e rename pair to id_pair 2023-11-03 13:45:44 +01:00
Emil Ernerfeldt 256ad734b4 More cleanup 2023-11-03 13:36:12 +01:00
Emil Ernerfeldt 1f0fc7a005 format let-else statements 2023-11-03 13:15:21 +01:00
Emil Ernerfeldt 9fd65ad21e Rename render to viewport_ui_cb to avoid confusion 2023-11-03 12:09:09 +01:00
Emil Ernerfeldt 51b083a896 Misc code cleanup 2023-11-03 11:37:09 +01:00
Emil Ernerfeldt 0df4b493fb Better error reporting 2023-11-03 11:36:07 +01:00
Konkitoman 75e6d3c85d Fix crash on eframe wgpu when rendering a sync viewport in a sync viewport
Better names
2023-11-02 11:18:39 +02:00
Emil Ernerfeldt 46febb4af1 Fix crash during shutdown 2023-11-02 09:07:38 +01:00
Emil Ernerfeldt 9749e1ea6d Move Rc<RefCell<……>> outside of struct Viewports 2023-11-02 09:05:19 +01:00
Konkitoman 76d3873b47 Better names 2023-11-01 21:27:27 +02:00
Konkitoman 2b8e5b5896 Fix crash when rendering a sync viewport in a sync viewport 2023-11-01 21:00:14 +02:00
Emil Ernerfeldt e5dab1eec9 Less RefCell in parameters 2023-11-01 19:04:16 +01:00
Emil Ernerfeldt 7340acf7b3 Less RefCell in parameters 2023-11-01 19:03:43 +01:00
Emil Ernerfeldt 2eb1240648 Less RefCell in parameters 2023-11-01 19:02:46 +01:00
Emil Ernerfeldt 7c1af06cc9 Less RwLock 2023-11-01 19:00:57 +01:00
Emil Ernerfeldt 9fce858c5f Less RwLock in parameters 2023-11-01 18:52:00 +01:00
Emil Ernerfeldt 3d1ee1bafa Replace some Arc with Rc to make it clear what is thread-local 2023-11-01 18:45:16 +01:00
Emil Ernerfeldt ec39563183 Use less RwLocks and Arcs in public interfaces 2023-11-01 18:43:13 +01:00
Emil Ernerfeldt 521678b5d9 Simplify another function signature 2023-11-01 18:35:17 +01:00
Emil Ernerfeldt f6c5e71870 Simplify function signature 2023-11-01 18:27:02 +01:00
Emil Ernerfeldt 678a3b035e Replace RwLock with RefCell in thread_local 2023-11-01 18:19:01 +01:00
Konkitoman d6c2f3e8f3 Fix pixels per point for multiples viewports
Fix ./scripts/check.sh errors
2023-10-22 17:15:21 +03:00
Konkitoman 84ef02d9f5 eframe WGPU:
* Fix msaa and depth textures for multiples viewports
* Fix panic when the width or height was 0
2023-10-20 18:40:11 +03:00
Konkitoman 9e89188ebe Fix trying to render not existent viewport resulting in 100% cpu usage 2023-10-19 20:05:21 +03:00
Konkitoman 4f1696cf9c big refractor
egui:
* removed FullOutput::repaint_after
* now for redraw only request_repaint_callback is used!
* now on every Context::request_repaint() will repaint only once
* exposed Context::requested_repaint and Context::requested_repaint_last_frame

eframe:
* now event result is returned as EventResult insted of Vec<EventResult>
* fix to many redraw requests

----:
* fix egui not waking when a repaint was from other thread
* now every thing feels more responsive!
2023-10-19 15:53:38 +03:00
Konkitoman b1e7fafe70 egui:
* now every viewport has his own frame_nr

eframe:
* some refactoring
* now on Windows spinner will make the async viewport refresh, this problem was only for async viewport in Windows

* problem found there are two redraw systems, one was broken now is fixed, the one that was broken on Linux X11 was not needed, but for Windows both are needed!
1: The egui repaint_callback system
2: The egui repaint_after from FullOutput
2023-10-18 18:47:16 +03:00
Konkitoman 7f1a1e3b2e Now in ViewportBuilder has close_button and drag_and_drop enabled by default!
Fix Windows not rendering a sync viewport in a sync viewport
2023-10-18 14:50:42 +03:00
Konkitoman 954366ef7f eframe: refactor code to be more compact and faster 2023-10-11 21:08:07 +03:00
Konkitoman 287f7041f6 Fix typos and expose Context::is_desktop 2023-09-30 10:22:17 +03:00
Konkitoman 7caa042b92 Merge branch 'master' of https://github.com/emilk/egui into multiples_viewports 2023-09-30 09:39:45 +03:00
Konkitoman 73f14c9b0a Update crates/eframe/src/native/run.rs
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-09-28 19:04:37 +03:00
Emil Ernerfeldt 9a947e5547 Final image API doc tweaks 2023-09-27 16:40:26 +02:00
Simon 4986b35701 Add NativeOptions::window_builder for more customization (#3390)
* added a window builder hook for more customization

* `EFrame` -> `eframe`

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-09-27 08:52:49 +02:00
Konkitoman 449f38adf2 This is a temporary fix to not unsafe impl Sync + Send for backends
The problem is that when we call Context::create_viewport_sync can be on any thread because egui::Context is Sync + Send but the backend is not!
So we want the callback to the backend to be thread local!

The problem that this adds is that now you cannot create more then one egui::Context,
 because the thread local variabile is static and i don't know how to store a non static LocalKey on egui::ContextImpl
2023-09-27 00:21:06 +03:00
Konkitoman 38e00e2ea2 refactor eframe viewport sync rendering for glow and wgpu 2023-09-26 22:56:46 +03:00
Konkitoman 5c8c56c1b8 rename the events that are result of events event_result 2023-09-26 19:50:11 +03:00
Konkitoman e5783127f4 Fix max_texture_side for the main viewport was alwats set to 0 2023-09-26 19:45:12 +03:00
Konkitoman 43ad25a4d9 Renamed gl_window to glutin_ctx in init_run_state and initializate max_texture_side, and now on any egui_winit has max_texture_side set 2023-09-26 18:59:42 +03:00
Konkitoman b719e1c030 eframe fix android build 2023-09-26 18:23:37 +03:00
Konkitoman 543a0a2a83 egui, egui_glow, eframe: fix all errors returned by ./scripts/check.sh 2023-09-26 00:45:33 +03:00
Konkitoman e453d667e5 egui and eframe now uses more ViewportIdPair 2023-09-26 00:05:04 +03:00
Konkitoman f4c5378ad3 Merge branch 'master' of https://github.com/emilk/egui into multiples_viewports 2023-09-25 23:15:51 +03:00
Emil Ernerfeldt fdd493d48f Misc cleanup (#3381)
* Give credit to recent big-time contributors in the main README.md

* Better named profiling scopes

* Document everything in memory.rs

* Better doc-strings

* Add a section about dependencies to the main README.md

* Improve egui_extras docs

* fix typos
2023-09-24 09:32:31 +02:00
Konkitoman 8ecd29dea7 eframe: Now WGPU implementation when creating a sync viewport will inherit the icon of his parent
And refactoring and adding some inline documentation
2023-09-20 18:56:38 +03:00
Konkitoman 915d1b6997 Add ViewportIdPair, Viewport, ViewportOutput 2023-09-19 17:55:54 +03:00
Konkitoman c96197db79 Merge branch 'master' of https://github.com/emilk/egui into multiples_viewports 2023-09-19 17:22:31 +03:00
Barugon c07394b576 Only show on-screen-keyboard and IME when editing text (#3362)
* Remove calls to `set_ime_allowed`

* Allow IME if `text_cursor_pos` is `Some`

* Only call `Window::set_ime_allowed` when necessary

* allow_ime doesn't need to be atomic

* Remove unused imports

* Fix assignment
2023-09-19 14:14:42 +02:00
Emil Ernerfeldt 4b5146d35d Add more profiling scopes (#3332) 2023-09-13 19:32:19 +02:00
Emil Ernerfeldt fc3bddd0cf Add more puffin profile scopes to eframe (#3330)
* Add puffin profile scopes to the startup and running of eframe

* puffin_profiler example: start puffin right away

* cargo format let-else statements

* More profile scopes

* Add some `#[inline]`

* Standardize puffin profile scope definitions

* standardize again

* Silence warning when puffin is disabled
2023-09-13 09:00:38 +02:00
Konkitoman fc90a7e7c8 Fix cyclical reference
Removed the last fix because there is not need for it now!
2023-09-11 18:50:17 +03:00