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 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 separateSend + 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 theGlContext
into your window handle struct when first creating it by callingwindow.gl_context().take()
.