mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-25 11:44:25 +03:00
disable unneeded depth testing. enable antialiasing and alpha blending
This commit is contained in:
parent
099846437c
commit
03215a5836
@ -66,6 +66,8 @@
|
|||||||
## Switch to OpenGL (for speed)
|
## Switch to OpenGL (for speed)
|
||||||
|
|
||||||
- get things running again
|
- get things running again
|
||||||
|
- editor is very slow... why?
|
||||||
|
- colors still seem off
|
||||||
- circles, arrows, other disabled things
|
- circles, arrows, other disabled things
|
||||||
- forking
|
- forking
|
||||||
- render text
|
- render text
|
||||||
|
@ -113,11 +113,7 @@ impl<'a> GfxCtx<'a> {
|
|||||||
program: &'a glium::Program,
|
program: &'a glium::Program,
|
||||||
) -> GfxCtx<'a> {
|
) -> GfxCtx<'a> {
|
||||||
let params = glium::DrawParameters {
|
let params = glium::DrawParameters {
|
||||||
depth: glium::Depth {
|
blend: glium::Blend::alpha_blending(),
|
||||||
test: glium::DepthTest::IfLess,
|
|
||||||
write: true,
|
|
||||||
..Default::default()
|
|
||||||
},
|
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -152,7 +148,7 @@ impl<'a> GfxCtx<'a> {
|
|||||||
|
|
||||||
pub fn clear(&mut self, color: Color) {
|
pub fn clear(&mut self, color: Color) {
|
||||||
self.target
|
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
|
// Use graphics::Line internally for now, but make it easy to switch to something else by
|
||||||
|
@ -251,7 +251,8 @@ pub fn run<T, G: GUI<T>>(mut gui: G, window_title: &str) {
|
|||||||
gui.get_mut_canvas().window_width,
|
gui.get_mut_canvas().window_width,
|
||||||
gui.get_mut_canvas().window_height,
|
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 display = glium::Display::new(window, context, &events_loop).unwrap();
|
||||||
let program = glium::Program::from_source(
|
let program = glium::Program::from_source(
|
||||||
&display,
|
&display,
|
||||||
|
Loading…
Reference in New Issue
Block a user