Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove epi backend from egui_glow #1361

Merged
merged 1 commit into from
Mar 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}