Skip to content

Commit

Permalink
Addressing some of the suggested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexApps99 committed Sep 30, 2021
1 parent d763365 commit 8a5bfb8
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 99 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions egui_glium/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ egui-winit = { version = "0.14.0", path = "../egui-winit", default-features = fa
epi = { version = "0.14.0", path = "../epi" }
glutin = "0.27"
glow = "0.11"
memoffset = "0.6"

# feature "persistence":
directories-next = { version = "2", optional = true }
Expand Down
9 changes: 8 additions & 1 deletion egui_glium/examples/pure.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! Example how to use pure `egui_glium` without [`epi`].

fn create_display(
event_loop: &glutin::event_loop::EventLoop<()>,
) -> (
Expand Down Expand Up @@ -88,7 +89,13 @@ fn main() {
);
gl.clear(glow::COLOR_BUFFER_BIT);
}

// draw things behind egui here

egui.paint(&gl_window, &gl, shapes);

// draw things on top of egui here

gl_window.swap_buffers().unwrap();
}
};
Expand All @@ -114,7 +121,7 @@ fn main() {
gl_window.window().request_redraw(); // TODO: ask egui if the events warrants a repaint instead
}
glutin::event::Event::LoopDestroyed => {
egui.destruct(&gl);
egui.destroy(&gl);
}

_ => (),
Expand Down
2 changes: 1 addition & 1 deletion egui_glium/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,5 +415,5 @@ pub fn run(mut app: Box<dyn epi::App>, native_options: &epi::NativeOptions) {
storage.flush();
}

egui.destruct(&gl);
egui.destroy(&gl);
}
8 changes: 4 additions & 4 deletions egui_glium/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,12 @@ impl EguiGlium {
}

#[cfg(debug_assertions)]
pub fn destruct(&mut self, gl: &glow::Context) {
self.painter.destruct(gl)
pub fn destroy(&mut self, gl: &glow::Context) {
self.painter.destroy(gl)
}

#[cfg(not(debug_assertions))]
pub fn destruct(&self, gl: &glow::Context) {
self.painter.destruct(gl)
pub fn destroy(&self, gl: &glow::Context) {
self.painter.destroy(gl)
}
}
Loading

0 comments on commit 8a5bfb8

Please sign in to comment.