Take Glow context using Arc. (#1640)
This allows usage with a Glow context that is passed between threads.
This commit is contained in:
@@ -185,7 +185,7 @@ impl EpiIntegration {
|
||||
max_texture_side: usize,
|
||||
window: &winit::window::Window,
|
||||
storage: Option<Box<dyn epi::Storage>>,
|
||||
#[cfg(feature = "glow")] gl: Option<std::rc::Rc<glow::Context>>,
|
||||
#[cfg(feature = "glow")] gl: Option<std::sync::Arc<glow::Context>>,
|
||||
) -> Self {
|
||||
let egui_ctx = egui::Context::default();
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ pub fn run_glow(
|
||||
let window_builder =
|
||||
epi_integration::window_builder(native_options, &window_settings).with_title(app_name);
|
||||
let (gl_window, gl) = create_display(native_options, window_builder, &event_loop);
|
||||
let gl = std::rc::Rc::new(gl);
|
||||
let gl = std::sync::Arc::new(gl);
|
||||
|
||||
let mut painter = egui_glow::Painter::new(gl.clone(), None, "")
|
||||
.unwrap_or_else(|error| panic!("some OpenGL error occurred {}\n", error));
|
||||
|
||||
Reference in New Issue
Block a user