From 03215a5836234dd40bb89bfdc4161ff2f21ee849 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Tue, 22 Jan 2019 22:47:30 -0800 Subject: [PATCH] disable unneeded depth testing. enable antialiasing and alpha blending --- docs/TODO_ux.md | 2 ++ ezgui/src/lib.rs | 8 ++------ ezgui/src/runner.rs | 3 ++- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/TODO_ux.md b/docs/TODO_ux.md index cdc2681ad3..0d360b14c7 100644 --- a/docs/TODO_ux.md +++ b/docs/TODO_ux.md @@ -66,6 +66,8 @@ ## Switch to OpenGL (for speed) - get things running again + - editor is very slow... why? + - colors still seem off - circles, arrows, other disabled things - forking - render text diff --git a/ezgui/src/lib.rs b/ezgui/src/lib.rs index faeee7402d..5f57e348f7 100644 --- a/ezgui/src/lib.rs +++ b/ezgui/src/lib.rs @@ -113,11 +113,7 @@ impl<'a> GfxCtx<'a> { program: &'a glium::Program, ) -> GfxCtx<'a> { let params = glium::DrawParameters { - depth: glium::Depth { - test: glium::DepthTest::IfLess, - write: true, - ..Default::default() - }, + blend: glium::Blend::alpha_blending(), ..Default::default() }; @@ -152,7 +148,7 @@ impl<'a> GfxCtx<'a> { pub fn clear(&mut self, color: Color) { self.target - .clear_color_and_depth((color.0[0], color.0[1], color.0[2], color.0[3]), 1.0); + .clear_color(color.0[0], color.0[1], color.0[2], color.0[3]); } // Use graphics::Line internally for now, but make it easy to switch to something else by diff --git a/ezgui/src/runner.rs b/ezgui/src/runner.rs index 0aab78b49d..7b2e0886bf 100644 --- a/ezgui/src/runner.rs +++ b/ezgui/src/runner.rs @@ -251,7 +251,8 @@ pub fn run>(mut gui: G, window_title: &str) { gui.get_mut_canvas().window_width, gui.get_mut_canvas().window_height, )); - let context = glutin::ContextBuilder::new().with_depth_buffer(24); + // 2 looks bad, 4 looks fine + let context = glutin::ContextBuilder::new().with_multisampling(4); let display = glium::Display::new(window, context, &events_loop).unwrap(); let program = glium::Program::from_source( &display,