diff --git a/docs/TODO_ux.md b/docs/TODO_ux.md index a0c728ffaf..e784b89f4a 100644 --- a/docs/TODO_ux.md +++ b/docs/TODO_ux.md @@ -68,15 +68,12 @@ - no bugs - arrows... then debug legend - top menu rectangles are slightly off; grab the " " glyph's width? - - some colors are wrong - - ContextBuilder has with_pixel_format and with_srgb - - gamma_srgb_to_linear doesn't work - - need padding around text - - text entry needs to draw the cursor differently - make polygon store points and indices efficiently - change ezgui API to allow uploading geometry once - undo the y inversion hacks at last! +- need padding around text +- text entry needs to draw the cursor differently - refactoring - pass canvas to text module, make it do the glyph borrowing? - pass dims to draw_text_bubble; all callers have it anyway, right? diff --git a/docs/development.md b/docs/development.md index a4b5c70f43..f6c9076c39 100644 --- a/docs/development.md +++ b/docs/development.md @@ -5,3 +5,8 @@ Find packages to upgrade: `cargo outdated -R` Diff screencaps: http://www.imagemagick.org/Usage/compare/#methods Cross-compilation: https://github.com/rust-embedded/cross + +Debug OpenGL calls: + apitrace trace --api gl ../target/debug/editor ../data/raw_maps/montlake.abst + qapitrace editor.trace + apitrace dump editor.trace diff --git a/ezgui/src/lib.rs b/ezgui/src/lib.rs index ac449da737..59fd13ad42 100644 --- a/ezgui/src/lib.rs +++ b/ezgui/src/lib.rs @@ -162,8 +162,9 @@ impl<'a> GfxCtx<'a> { } pub fn clear(&mut self, color: Color) { + // Without this, SRGB gets enabled and post-processes the color from the fragment shader. self.target - .clear_color(color.0[0], color.0[1], color.0[2], color.0[3]); + .clear_color_srgb(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 8f958f03cf..a08fdd6305 100644 --- a/ezgui/src/runner.rs +++ b/ezgui/src/runner.rs @@ -266,11 +266,20 @@ pub fn run>(mut gui: G, window_title: &str) { // 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( + let program = glium::Program::new( &display, - include_str!("vertex.glsl"), - include_str!("fragment.glsl"), - None, + glium::program::ProgramCreationInput::SourceCode { + vertex_shader: include_str!("vertex.glsl"), + tessellation_control_shader: None, + tessellation_evaluation_shader: None, + geometry_shader: None, + fragment_shader: include_str!("fragment.glsl"), + transform_feedback_varyings: None, + // Without this, SRGB gets enabled and post-processes the color from the fragment + // shader. + outputs_srgb: true, + uses_point_size: false, + }, ) .unwrap();