mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 04:40:03 -04:00
Change Arc<glow::Context> to Rc<glow::Context> (#3598)
This is required for Rust 1.72 (for unknown reasons; see https://github.com/emilk/egui/pull/3595), but also for updating to glow 0.13, where the `glow::Context` is not longer `Sync+Send`
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#![allow(clippy::collapsible_else_if)]
|
||||
#![allow(unsafe_code)]
|
||||
|
||||
use std::{collections::HashMap, sync::Arc};
|
||||
use std::{collections::HashMap, rc::Rc};
|
||||
|
||||
use egui::{
|
||||
emath::Rect,
|
||||
@@ -60,7 +60,7 @@ impl From<String> for PainterError {
|
||||
/// This struct must be destroyed with [`Painter::destroy`] before dropping, to ensure OpenGL
|
||||
/// objects have been properly deleted and are not leaked.
|
||||
pub struct Painter {
|
||||
gl: Arc<glow::Context>,
|
||||
gl: Rc<glow::Context>,
|
||||
|
||||
max_texture_side: usize,
|
||||
|
||||
@@ -118,7 +118,7 @@ impl Painter {
|
||||
/// * failed to create postprocess on webgl with `sRGB` support
|
||||
/// * failed to create buffer
|
||||
pub fn new(
|
||||
gl: Arc<glow::Context>,
|
||||
gl: Rc<glow::Context>,
|
||||
shader_prefix: &str,
|
||||
shader_version: Option<ShaderVersion>,
|
||||
) -> Result<Painter, PainterError> {
|
||||
@@ -248,7 +248,7 @@ impl Painter {
|
||||
}
|
||||
|
||||
/// Access the shared glow context.
|
||||
pub fn gl(&self) -> &Arc<glow::Context> {
|
||||
pub fn gl(&self) -> &Rc<glow::Context> {
|
||||
&self.gl
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user