-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
eframe app creation refactor #1363
Conversation
5f4ee67
to
bebca37
Compare
bebca37
to
1f0e84a
Compare
This is a very welcome refactor! Thanks for the work you have put into this. |
Sorry for the comment noise, just wanted to mention that it took me a while to find this while trying to understand why setup + name existed on I'm working on updating |
This refactors how eframe creates an app, removing the need for
App::setup
.The purpose of this is to be able to access the following state before/during creation of ones app:
egui::Context
: alllow users to set fonts, style and maybe create textures.epi::Storage
: for reading app state from storage.epi::Frame
: can be cloned and stored so we can runrequest_repaint
.glow::Context
: for creating rendering resources.Previously eframe was designed so that these were passed into
App::setup
, but that meant one would have to create an app before running the setup of it, makingApp::setup
a weird "second constructor". This PR solves that problem.App::name
is now also removed, and is instead passed in by argument toeframe::run_native
.Additionally,
eframe
now re-exports everything inepi
, soeframe
users can ignoreepi
completely.This now changes the
eframe
use to look like so:EDIT: this has been edited to reflect the changes added in #1373