Skip to content

Use glutin-winit in integration_opengl example#1689

Closed
ids1024 wants to merge 1 commit intoiced-rs:masterfrom
ids1024:glutin-winit
Closed

Use glutin-winit in integration_opengl example#1689
ids1024 wants to merge 1 commit intoiced-rs:masterfrom
ids1024:glutin-winit

Conversation

@ids1024
Copy link
Copy Markdown
Contributor

@ids1024 ids1024 commented Feb 1, 2023

Glutin 0.30 changes the API to not depend on winit, and instead take a raw window handle. glutin-winit is a helper to make it a bit easier to create a GL context on top of winit.

Things like iced_winit::conversion::window_event are problematic here since we end up using a different winit version from iced_winit, and that function is quite complicated to duplicate...

@ids1024
Copy link
Copy Markdown
Contributor Author

ids1024 commented Feb 1, 2023

I guess for window_event, the expected way to do it in an integration like this might be to only convert the event types that are relevant to the application?

Glutin 0.30 changes the API to not depend on winit, and instead take a
raw window handle. `glutin-winit` is a helper to make it a bit easier to
create a GL context on top of winit.

Things like `iced_winit::conversion::window_event` are problematic here
since we end up using a different winit version from `iced_winit`, and
that function is quite complicated to duplicate. But we don't need all
of it.

Duplicating isn't so unreasonable. It's probably expected that
integrations of Iced could not rely on conversions from `iced_winit`,
since likely use something other than winit to get a window and OpenGL
context, and in any case are not using the Iced fork of `winit`.
@ids1024 ids1024 changed the title WIP Use glutin-winit in integration_opengl example Use glutin-winit in integration_opengl example Feb 1, 2023
@ids1024 ids1024 marked this pull request as ready for review February 1, 2023 23:39
@ids1024
Copy link
Copy Markdown
Contributor Author

ids1024 commented Feb 1, 2023

This seems to be working well now, with some event conversion code copied from iced_winit.

An OpenGL integration is expected to be used with things other than winit, and in any case not the Iced fork of winit, so this is perhaps better as a minimal example of what an integration like this requires.

@hecrj
Copy link
Copy Markdown
Member

hecrj commented Apr 12, 2023

Closing because of #1688 (comment).

@hecrj hecrj closed this Apr 12, 2023
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.

2 participants