Skip to content

Commit 29c52e8

Browse files
authored
Remove epi backend from egui_glow (#1361)
1 parent 50539bd commit 29c52e8

File tree

7 files changed

+6
-168
lines changed

7 files changed

+6
-168
lines changed

Cargo.lock

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

egui_glium/CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ All notable changes to the `egui_glium` integration will be noted in this file.
33

44

55
## Unreleased
6+
* Remove "epi" feature ([#1361](https://github.com/emilk/egui/pull/1361)).
7+
* Remove need for `trait epi::NativeTexture` to use the `fn register_native_texture/replace_native_texture` ([#1361](https://github.com/emilk/egui/pull/1361)).
68

79

810
## 0.17.0 - 2022-02-22

egui_glium/Cargo.toml

+2-11
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,7 @@ default_fonts = ["egui/default_fonts"]
3838
links = ["egui-winit/links"]
3939

4040
# enable persisting native window options and egui memory
41-
persistence = [
42-
"egui-winit/persistence",
43-
"egui/persistence",
44-
"epi", # also implied by the lines below, see https://github.com/rust-lang/cargo/issues/8832
45-
"epi/file_storage",
46-
"epi/persistence",
47-
]
41+
persistence = ["egui-winit/persistence", "egui/persistence"]
4842

4943
# experimental support for a screen reader
5044
screen_reader = ["egui-winit/screen_reader"]
@@ -55,10 +49,7 @@ egui = { version = "0.17.0", path = "../egui", default-features = false, feature
5549
"convert_bytemuck",
5650
"single_threaded",
5751
] }
58-
egui-winit = { version = "0.17.0", path = "../egui-winit", default-features = false, features = [
59-
"epi",
60-
] }
61-
epi = { version = "0.17.0", path = "../epi", optional = true }
52+
egui-winit = { version = "0.17.0", path = "../egui-winit", default-features = false }
6253

6354
ahash = "0.7"
6455
bytemuck = "1.7"

egui_glium/examples/native_texture.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
33
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
44

5-
use epi::NativeTexture;
65
use glium::glutin;
76

87
fn create_display(event_loop: &glutin::event_loop::EventLoop<()>) -> glium::Display {

egui_glium/src/epi_backend.rs

-141
This file was deleted.

egui_glium/src/lib.rs

-5
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,6 @@
9090
mod painter;
9191
pub use painter::Painter;
9292

93-
#[cfg(feature = "epi")]
94-
mod epi_backend;
95-
#[cfg(feature = "epi")]
96-
pub use epi_backend::{run, NativeOptions};
97-
9893
pub use egui_winit;
9994

10095
// ----------------------------------------------------------------------------

egui_glium/src/painter.rs

+2-9
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ pub struct Painter {
2121

2222
textures: AHashMap<egui::TextureId, Rc<SrgbTexture2d>>,
2323

24-
#[cfg(feature = "epi")]
2524
/// [`egui::TextureId::User`] index
2625
next_native_tex_id: u64,
2726
}
@@ -56,7 +55,6 @@ impl Painter {
5655
max_texture_side,
5756
program,
5857
textures: Default::default(),
59-
#[cfg(feature = "epi")]
6058
next_native_tex_id: 0,
6159
}
6260
}
@@ -266,20 +264,15 @@ impl Painter {
266264
fn get_texture(&self, texture_id: egui::TextureId) -> Option<&SrgbTexture2d> {
267265
self.textures.get(&texture_id).map(|rc| rc.as_ref())
268266
}
269-
}
270-
271-
#[cfg(feature = "epi")]
272-
impl epi::NativeTexture for Painter {
273-
type Texture = Rc<SrgbTexture2d>;
274267

275-
fn register_native_texture(&mut self, native: Self::Texture) -> egui::TextureId {
268+
pub fn register_native_texture(&mut self, native: Rc<SrgbTexture2d>) -> egui::TextureId {
276269
let id = egui::TextureId::User(self.next_native_tex_id);
277270
self.next_native_tex_id += 1;
278271
self.textures.insert(id, native);
279272
id
280273
}
281274

282-
fn replace_native_texture(&mut self, id: egui::TextureId, replacing: Self::Texture) {
275+
pub fn replace_native_texture(&mut self, id: egui::TextureId, replacing: Rc<SrgbTexture2d>) {
283276
self.textures.insert(id, replacing);
284277
}
285278
}

0 commit comments

Comments
 (0)