Glutin Version v0.30.0
The glutin was rewritten from the ground to solve its previous design pitfalls. If this rewrite is a surprise to you, it was on the radar for a long time before @kchibisov started seriously maintaining this crate. Previously there was an attempt to do so by @goddessfreya in https://github.com/rust-windowing/glutin/tree/v0.23_reworks , but unfortunately she disappeared and we can only hope that she is alright. While her code wasn't complete the comments about some edge cases were very helpful and saved a lot of time.
To outline some major issues glutin had and that were solved:
- The maintenance was hard, since the code was a bag of glue around winit and GL shenanigans.
- Very hard to use with anything other than winit.
- MT safety was wrong and it was causing issues on Wayland(EGL in general), since some stuff ended up
Send
+Sync
while it shouldn't due to other platfroms. - Impossible for specialized use, like
EGL
only features. - Configuration picking is a mess due to building everything at once(Display, Config, Surface, and Context) leading to complex fallback behavior downsteam.
- etc.
The glutin 0.30.0
is more low-level now and its core concepts are now around Display
, Config
, Context
, and Surface
, using raw window handle for window related config creation and display creation.
Each platform EGL
, GLX
, WGL
, and CGL
could be used on their own and every backend/platform are optional.
For an example of bootstrapping and working with the new glutin we strongly advise to look at the example.
Unfortunately, not every platform was ported to glutin 0.30.0
. The ios, surfaceless, and os-mesa platforms were removed due to
the lack of maintenance, however if there's a desire and maintainer for such platforms we'd warmly welcome them and guide through the code.
More formal changelog:
- This version of
glutin
has been rewritten from the ground and no longer depends onwinit
, theraw-window-handle
is now used instead of it. - The Api is now built around
Display
,Surface
,Config
, andSurface
. For more info see crate documentation and examples. - Breaking: Bump MSRV from
1.57
to1.60
. - The ios support was removed for the lack of maintainance for now. In case there's a need for it, contributions are welcome.
- The context creation is no longer limited to winit's supported platforms.
- The underlying Api providers are publically exposed now, so glutin could be used with just e.g.
EGL
. - Fixed soundness issues with
Surface
MT safety, since beforeEGLSurface
could be sent to a different thread, which is not safe. - Fallback to
Surface::swap_buffers
whenSurface::swap_buffers_with_damage
is not supported onEGL
. - iOS, os-mesa, and surfaceless platforms were removed.