Update to glium 0.28, glutin 0.25 and winit 0.23
[mandelwow.git] / main.rs
diff --git a/main.rs b/main.rs
index 2bdcae815801a7a1958ed770f282be4e593c4d00..9d2563c2f599b0a47db1f0d6f487fa887f557e78 100644 (file)
--- a/main.rs
+++ b/main.rs
@@ -6,7 +6,7 @@ use glium::{Display, Program, Surface, uniform};
 use mandelwow_lib::*;
 use std::f32::consts::PI;
 use std::rc::Rc;
-use std::time::{Duration, Instant};
+use instant::{Duration, Instant};
 
 #[cfg(target_os = "emscripten")]
 use std::os::raw::{c_int, c_void};
@@ -72,6 +72,7 @@ impl World {
         println!("xstep={} ystep={:?}", sea_xstep, sea_zstep);
 
         let mut sea = [[Vector3::zero(); SEA_ZSIZE]; SEA_XSIZE];
+        #[allow(clippy::needless_range_loop)]
         for x in 0..SEA_XSIZE {
             for z in 0..SEA_ZSIZE {
                 sea[x][z] = Vector3 {
@@ -85,11 +86,11 @@ impl World {
         World {
             mandelwow_program,
             mandelwow_bbox: BoundingBox::new(
-                display, &mandelwow_bounds, bounding_box_program.clone()),
+                display, &mandelwow_bounds, bounding_box_program),
             mandelwow_bounds,
             bounding_box_enabled: true,
 
-            shaded_cube: ShadedCube::new(display, shaded_program.clone()),
+            shaded_cube: ShadedCube::new(display, shaded_program),
             text: text::Text::new(display),
             sea,
 
@@ -248,7 +249,7 @@ fn main() {
             emscripten_GetProcAddress(addr.into_raw() as *const _) as *const _
         });
     gl.glGetInternalformativ(0, 0, 0, 0, 0);
-*/
+    */
 
     let mut soundplayer = sound::start();
 
@@ -273,7 +274,7 @@ fn main() {
 
     let mut timer = Timer::new();
     let mut camera = support::camera::CameraState::new();
-    let mut fullscreen = true;
+    let mut fullscreen = false;
 
     event_loop.run(move |event, _, control_flow| {
         let t = timer.t;
@@ -310,13 +311,13 @@ fn main() {
                                     VirtualKeyCode::P => timer.pause ^= true,
                                     VirtualKeyCode::PageUp => timer.t += 0.1,
                                     VirtualKeyCode::PageDown => timer.t -= 0.2,
-                                    VirtualKeyCode::F10 => screenshot(&display),
+                                    VirtualKeyCode::F10 => screenshot::take_screenshot(&display),
                                     VirtualKeyCode::F11 | VirtualKeyCode::Return => {
                                         fullscreen ^= true;
                                         let fs = if fullscreen {
-                                            let monitor_handle = display.gl_window().window()
-                                                .available_monitors().next().unwrap();
-                                            Some(glium::glutin::window::Fullscreen::Borderless(monitor_handle))
+                                            // let monitor_handle = display.gl_window().window()
+                                            //    .available_monitors().next().unwrap();
+                                            Some(glium::glutin::window::Fullscreen::Borderless(None))
                                         } else {
                                             None
                                         };