Skip to content

Commit

Permalink
Remove epi backend from egui_glow (#1361)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk authored Mar 13, 2022
1 parent 50539bd commit 29c52e8
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 168 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions egui_glium/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ All notable changes to the `egui_glium` integration will be noted in this file.


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


## 0.17.0 - 2022-02-22
Expand Down
13 changes: 2 additions & 11 deletions egui_glium/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,7 @@ default_fonts = ["egui/default_fonts"]
links = ["egui-winit/links"]

# enable persisting native window options and egui memory
persistence = [
"egui-winit/persistence",
"egui/persistence",
"epi", # also implied by the lines below, see https://github.com/rust-lang/cargo/issues/8832
"epi/file_storage",
"epi/persistence",
]
persistence = ["egui-winit/persistence", "egui/persistence"]

# experimental support for a screen reader
screen_reader = ["egui-winit/screen_reader"]
Expand All @@ -55,10 +49,7 @@ egui = { version = "0.17.0", path = "../egui", default-features = false, feature
"convert_bytemuck",
"single_threaded",
] }
egui-winit = { version = "0.17.0", path = "../egui-winit", default-features = false, features = [
"epi",
] }
epi = { version = "0.17.0", path = "../epi", optional = true }
egui-winit = { version = "0.17.0", path = "../egui-winit", default-features = false }

ahash = "0.7"
bytemuck = "1.7"
Expand Down
1 change: 0 additions & 1 deletion egui_glium/examples/native_texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release

use epi::NativeTexture;
use glium::glutin;

fn create_display(event_loop: &glutin::event_loop::EventLoop<()>) -> glium::Display {
Expand Down
141 changes: 0 additions & 141 deletions egui_glium/src/epi_backend.rs

This file was deleted.

5 changes: 0 additions & 5 deletions egui_glium/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@
mod painter;
pub use painter::Painter;

#[cfg(feature = "epi")]
mod epi_backend;
#[cfg(feature = "epi")]
pub use epi_backend::{run, NativeOptions};

pub use egui_winit;

// ----------------------------------------------------------------------------
Expand Down
11 changes: 2 additions & 9 deletions egui_glium/src/painter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ pub struct Painter {

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

#[cfg(feature = "epi")]
/// [`egui::TextureId::User`] index
next_native_tex_id: u64,
}
Expand Down Expand Up @@ -56,7 +55,6 @@ impl Painter {
max_texture_side,
program,
textures: Default::default(),
#[cfg(feature = "epi")]
next_native_tex_id: 0,
}
}
Expand Down Expand Up @@ -266,20 +264,15 @@ impl Painter {
fn get_texture(&self, texture_id: egui::TextureId) -> Option<&SrgbTexture2d> {
self.textures.get(&texture_id).map(|rc| rc.as_ref())
}
}

#[cfg(feature = "epi")]
impl epi::NativeTexture for Painter {
type Texture = Rc<SrgbTexture2d>;

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

fn replace_native_texture(&mut self, id: egui::TextureId, replacing: Self::Texture) {
pub fn replace_native_texture(&mut self, id: egui::TextureId, replacing: Rc<SrgbTexture2d>) {
self.textures.insert(id, replacing);
}
}

0 comments on commit 29c52e8

Please sign in to comment.