-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor epi #212
Comments
split http glium as egui_http_native and http web as egui_http_web |
There is no need to interact with If using https://github.com/hasenbanck/egui_wgpu_backend forces you to 15 lines of boilerplate, then I suggest you open an issue in that repo instead of this one. |
I know Some paths of investigation:
Find or create a http request crate that worked both natively and on web. The lack of this is the only reason for the Find or create a crate for opening links that works both native and with the Find or create a crate that can do persistence that is backed either by a file system or by local storage, depending on compile target (WASI?). Find or create a crate for getting the time of day that works both natively and on the web (WASI?). |
To be clear, the crate mentioned does not use |
Oh, I see! I saw Yes, it would be awesome if Note that parts of I used to have |
In fact, It isn't that |
chrono works both natively and on web. Related: #212
A lot of eframe/epi has been refactored now (on Do you think we can close this issue? Or perhaps clarify it to be more up-to-date with how epi/eframe looks today? |
I agree, let's close this! |
I'm experimenting with
egui_winit_platform
, which is intentionally lightweight. It does not attempt to provide persistence, or take over the event loop (unlike, say,egui_glium::run
). But this lightweight approach means that application developers need to interact withepi
directly. This isn't a bad thing, but it has exposed some code smells inepi
that I want to address here.Is your feature request related to a problem? Please describe.
A short list of curiosities I've encountered so far:
epi::IntegrationInfo
requires some unusual fields, including:seconds_since_midnight
is only used by the demo app.native_pixels_per_point
doesn't feel like it belongs because physical pixels should only be relevant to the presentation layer. E.g. the GPU is concerned with this metric for rendering, butepi
doesn't do any rasterization. (And it looks likeepi::Frame::set_pixels_per_point
was deprecated in 0.10 anyway.)cpu_usage
? What purpose does this serve for generic applications? Is this another leaky abstraction like the two above?epi::backend::FrameBuilder
has some unusual fields, including:http
is a conditionally compiled field that requires crates to use feature flags to create aFrameBuilder
. (E.g. there is noDefault
impl and it doesn't use the builder pattern to customize optional functionality.) This field is completely missing from documentation because it is behind a feature gate.output
is anAppOutput
field which is peculiar because it tries to provide some feedback mechanism that is separate from the normal immediate mode GUI control flow. These actions do nothing on web apps by definition.I'm calling these out specifically because
Frame
is necessary forepi::App
implementors, even when unnecessary . See:egui/egui_demo_lib/src/apps/demo/app.rs
Lines 27 to 29 in c1ef816
Describe the solution you'd like
Option<T>
andimpl Default
.AppOutput
feels like an anti-pattern. What does this solve that can't be done with normal GUI event handling?epi::App
trait could be more useful if it focused solely on application/GUI functionality like persistence, and less on window manager and rendering duties (IIUC, these should be provided by the platform and backend, respectively).Describe alternatives you've considered
N/A.
Additional context
The apps I build with the
winit
platform support crate are probably just not going to useepi::App
. Maybe when they get sufficiently complex, I might want to take advantage of persistence. But to take advantage of persistence with the current trait, I need to deal with all of this craziness.Granted, it isn't a lot to deal with, but running the demo app is 15 lines of useless boilerplate (ugh!) and 1 line to draw and handle events for the whole app (wow!)
The text was updated successfully, but these errors were encountered: