3 extern crate mandelwow_lib;
9 use mandelwow_lib::Cube;
10 use mandelwow_lib::bounding_box::*;
13 fn bench_bounding_box(b: &mut test::Bencher) {
14 let events_loop = glium::glutin::EventsLoop::new();
15 let window = glium::glutin::WindowBuilder::new();
16 let context = glium::glutin::ContextBuilder::new();
17 let display = glium::Display::new(window, context, &events_loop).unwrap();
19 let program = solid_fill_program(&display);
20 let bounds = Cube { xmin: -2., xmax: 0.7, ymin: -1., ymax: 1., zmin: -1.1, zmax: 1.1 };
21 let bbox = BoundingBox::new(&display, &bounds, &program);
22 let mut frame = display.draw();
24 let mat = [[1., 0., 0., 0.], [0., 1., 0., 0.], [0., 0., 1., 0.], [0., 0., 0., 1.0f32]];
25 let uniforms = uniform! {
30 bbox.draw(&mut frame, &uniforms);
32 frame.finish().unwrap();