glutin
glutin copied to clipboard
Reexport `Display`, `Config`, etc in the `api::<platform>` modules
Right now I need to write the following to use EGL:
use glutin::api::egl;
let display = egl::display::Display::from_raw(display_handle);
I see your issue, but nothing stops from exporting the Display directly?
The thing is that we don't have reexports for top-level structs as well, and I don't see why we should? Right the only change of toplevel exports and the ones from api is api::backend part.
So you have.
use glutin::display::Display
use glutin::api::egl::display::Display
It's not that much longer?
You may ask how to mix api and top-level exports, but the thing is that you don't. You can access api from top-level without a single use, and if you use api directly it means that you`ve explicitly opted out from top-level api.
Right now I need to write the following to use EGL:
And? Your issue fails to mention what the problem is here.
Do you find it too long? Or are you disliking the repetitive naming of mod and item inside the mod being the same? If so, please mention this explicitly.
I guess my desire here is the have the commonly used types (for example Display, Context, Surface, Config) all reexported in the root module of glutin. For the api dependent types, reexported in the respective api::<platform>.
So ideally you could reference Display with the following
let display = glutin::Display::from_raw(...);
For APIs, something like this:
let display = glutin::api::egl::Display::from_raw(...);
Regarding what Marijin said, a bit of both. Needing to specify display::Display feels redundant and needlessly lengthens the import paths.
So far I've seen Marjin, but Marijin is new :grimacing:
Thanks for clarifying, though!
Sure if we do that for both top-levels and apis it should be fine. Though, the issue is that we have a lot of builders around to create values...
Not sure whether we should reexport them as well? It's like you'd have to bring use glutin::context::ContextBuidler anyway to create Context...