add a third opengl fallback that expresses no pixel reqs whatsoever, for [rebuild]
@@ -14,23 +14,50 @@ pub fn setup(
) {
let event_loop = winit::event_loop::EventLoop::new();
let display = match glium::Display::new(
- winit::window::WindowBuilder::new().with_title(window_title).with_maximized(true),
+ winit::window::WindowBuilder::new()
+ .with_title(window_title)
+ .with_maximized(true),
// multisampling: 2 looks bad, 4 looks fine
- glutin::ContextBuilder::new().with_multisampling(4).with_depth_buffer(2),
- &event_loop)
- {
+ glutin::ContextBuilder::new()
+ .with_multisampling(4)
+ .with_depth_buffer(2),
+ &event_loop,
+ ) {
Ok(d) => d,
Err(err1) => match glium::Display::new(
- winit::window::WindowBuilder::new().with_title(window_title).with_maximized(true),
+ winit::window::WindowBuilder::new()
+ .with_title(window_title)
+ .with_maximized(true),
glutin::ContextBuilder::new(),
- &event_loop)
+ &event_loop,
+ ) {
+ Ok(d) => {
+ println!("Preferred glutin context failed, falling back on default");
+ d
+ }
+ Err(err2) => match glium::Display::new(
+ winit::window::WindowBuilder::new()
+ .with_title(window_title)
+ .with_maximized(true),
{
+ let mut ctx = glutin::ContextBuilder::new();
+ ctx.pf_reqs.color_bits = None;
+ ctx.pf_reqs.alpha_bits = None;
+ ctx.pf_reqs.depth_bits = Some(16);
+ ctx.pf_reqs.stencil_bits = None;
+ ctx
+ },
+ &event_loop,
+ ) {
Ok(d) => {
println!("Preferred glutin context failed, falling back on default");
d
}
- Err(err2) => panic!("Can't create an OpenGL window. Please file an issue at https://github.com/dabreegster/abstreet/issues/ and include output.txt. First attempt {}, second attempt {}", err1, err2),
+ Err(err3) => {
+ panic!("Can't create an OpenGL window. Please file an issue at https://github.com/dabreegster/abstreet/issues/ and include output.txt. First attempt {}, second attempt {}, third attempt {}", err1, err2, err3);
}
+ },
+ },
};
let (vertex_shader, fragment_shader) =
