Skip to content
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

Update dependencies & examples to glutin 0.9 / winit 0.7 #1362

Merged
merged 1 commit into from
Jul 11, 2017

Conversation

alexheretic
Copy link
Contributor

@alexheretic alexheretic commented Jul 11, 2017

This PR brings gfx up to date with the latest glutin & winit releases. Having a ContextBuilder in addition to the WindowBuilder and a rework of the event structures are the main changes for gfx users. The events are particularly groansome for refactoring. I'm particularly interested in getting gfx up to date so I can finally have XWayland window support in Linux. See glutin ContextBuilder addition PR & winit event rework PR

Fixes #1348

@brendanzab
Copy link
Contributor

Updated the description so that #1348 will auto-close.

@alexheretic
Copy link
Contributor Author

I've amended the commit to fix Vulkan compile issue, and apply the same fixes to mac/windows. I couldn't actually test these though.

Updated & tested OpenGL examples
Update other backends
Incremented winit depending backends by x.x.1
Incremented winit/glutin depending windows by x.1
Copy link
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work, thank you!
Just one question/concern before we proceed.

}
},
_ => app.on(event),
events_loop.poll_events(|event| {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason the poll_events blocks are rewritten? is it rustfmt doing the work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code had to be reworked to handle the winit::Event rework. Events seem to be split into Device & Window now, plus in general all winit events are more nested and have switched to named variable enums.

I've simply reworked the existing code into the new structure.

@kvark kvark merged commit c42fd4a into gfx-rs:master Jul 11, 2017
@mitchmindtree
Copy link
Contributor

@alexheretic you might have already addressed this somewhere else, but I couldn't find it in this PR so just in case I wanted to add that GlContext::resize must be called now when either EventsLoop::poll_events or EventsLoop::run_forever receives Resized events, e.g. see here for a demonstration in the updated glutin example. This is because the glutin::Context does not know about events being emitted by the eventloop, and on some platforms (macos comes to mind) GL contexts require being updated when the window is resized.

Originally this was not necessary as glutin wrapped the entire EventsLoop and so this could be hidden from the glutin user.

@alexheretic
Copy link
Contributor Author

Thanks @mitchmindtree, nice spot. Not ideal from a consumers perspective. I'll raise a PR to fix the examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants