From a9403c5b68afe3ad9d759bfe101c1e57bc279f13 Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Thu, 27 Dec 2018 21:09:40 +0700 Subject: [PATCH] Update benches to latest glium display setup api --- benches/bounding_box.rs | 7 +++++-- benches/shaded_cube.rs | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/benches/bounding_box.rs b/benches/bounding_box.rs index 597f215..be448a7 100644 --- a/benches/bounding_box.rs +++ b/benches/bounding_box.rs @@ -6,13 +6,16 @@ extern crate glutin; extern crate glium; extern crate test; -use glium::DisplayBuild; use mandelwow_lib::Cube; use mandelwow_lib::bounding_box::*; #[bench] fn bench_bounding_box(b: &mut test::Bencher) { - let display = glutin::WindowBuilder::new().build_glium().unwrap(); + let events_loop = glium::glutin::EventsLoop::new(); + let window = glium::glutin::WindowBuilder::new(); + let context = glium::glutin::ContextBuilder::new(); + let display = glium::Display::new(window, context, &events_loop).unwrap(); + let program = solid_fill_program(&display); let bounds = Cube { xmin: -2., xmax: 0.7, ymin: -1., ymax: 1., zmin: -1.1, zmax: 1.1 }; let bbox = BoundingBox::new(&display, &bounds, &program); diff --git a/benches/shaded_cube.rs b/benches/shaded_cube.rs index 5f91034..501976b 100644 --- a/benches/shaded_cube.rs +++ b/benches/shaded_cube.rs @@ -6,12 +6,15 @@ extern crate glium; extern crate glutin; extern crate test; -use glium::DisplayBuild; use mandelwow_lib::shaded_cube::*; #[bench] fn bench_shaded_cube(b: &mut test::Bencher) { - let display = glutin::WindowBuilder::new().build_glium().unwrap(); + let events_loop = glium::glutin::EventsLoop::new(); + let window = glium::glutin::WindowBuilder::new(); + let context = glium::glutin::ContextBuilder::new(); + let display = glium::Display::new(window, context, &events_loop).unwrap(); + let program = shaded_program(&display); let cube = ShadedCube::new(&display, &program); let mut frame = display.draw(); -- 2.25.1