Skip to content

Allow taking ownership of the OpenGL context#120

Closed
robbert-vdh wants to merge 1 commit into
RustAudio:masterfrom
robbert-vdh:fix/gl-context-ownership
Closed

Allow taking ownership of the OpenGL context#120
robbert-vdh wants to merge 1 commit into
RustAudio:masterfrom
robbert-vdh:fix/gl-context-ownership

Conversation

@robbert-vdh
Copy link
Copy Markdown
Member

This is a follow up to #115. Having the window own the context seemed like a sensible approach to me since there's an on_frame() callback where you'd do your rendering, but some integrations like @BillyDM's iced_baseview do the rendering from a separate Send + Sync + 'static context, and you thus need to be able to move the OpenGL context into there. This change means that you'll need to move the GlContext into your window handle struct when first creating it by calling window.gl_context().take().

This is needed for certain GUI integrations that require moving the
context into something that's `Send + Sync + 'static`.
@robbert-vdh
Copy link
Copy Markdown
Member Author

Since this allows the context to outlive the window this isn't a great solution. We'll need to find a different way to make iced_baseview work.

@robbert-vdh robbert-vdh deleted the fix/gl-context-ownership branch November 22, 2022 14:29
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.

1 participant