Move sound code to sound.rs
[mandelwow.git] / mandelwow.rs
index 3c4da07d4f6064c4ba538416be0ebf9fc8c45bdf..4c5d25e74bdd7fb7098a185287ab57952a74c1ed 100644 (file)
@@ -4,6 +4,8 @@
 
 extern crate glium;
 extern crate glutin;
 
 extern crate glium;
 extern crate glutin;
+extern crate libxm;
+extern crate sdl2;
 
 use glium::{DisplayBuild, Surface};
 use glium::index::{IndexBuffer, PrimitiveType};
 
 use glium::{DisplayBuild, Surface};
 use glium::index::{IndexBuffer, PrimitiveType};
@@ -11,6 +13,7 @@ use glutin::ElementState::Pressed;
 use glutin::Event::KeyboardInput;
 use glutin::VirtualKeyCode;
 
 use glutin::Event::KeyboardInput;
 use glutin::VirtualKeyCode;
 
+mod sound;
 mod support;
 
 #[derive(Copy, Clone)]
 mod support;
 
 #[derive(Copy, Clone)]
@@ -154,10 +157,10 @@ fn bounding_box<U>(display: &glium::Display,
         depth: glium::Depth {
             test: glium::draw_parameters::DepthTest::IfLess,
             write: true,
         depth: glium::Depth {
             test: glium::draw_parameters::DepthTest::IfLess,
             write: true,
-            .. Default::default()
+            ..Default::default()
         },
         blend: glium::Blend::alpha_blending(),
         },
         blend: glium::Blend::alpha_blending(),
-        .. Default::default()
+        ..Default::default()
     };
 
     let front_indices = IndexBuffer::new(display, PrimitiveType::LineLoop,
     };
 
     let front_indices = IndexBuffer::new(display, PrimitiveType::LineLoop,
@@ -232,10 +235,10 @@ fn mandel<U>(display: &glium::Display,
         depth: glium::Depth {
             test: glium::draw_parameters::DepthTest::IfLess,
             write: true,
         depth: glium::Depth {
             test: glium::draw_parameters::DepthTest::IfLess,
             write: true,
-            .. Default::default()
+            ..Default::default()
         },
         blend: glium::Blend::alpha_blending(),
         },
         blend: glium::Blend::alpha_blending(),
-        .. Default::default()
+        ..Default::default()
     };
 
     frame.draw(&vb, &indices, program, uniforms, &params).unwrap();
     };
 
     frame.draw(&vb, &indices, program, uniforms, &params).unwrap();
@@ -270,6 +273,8 @@ fn mandelwow(display: &glium::Display,
 }
 
 fn main() {
 }
 
 fn main() {
+    sound::start();
+
     let display = glium::glutin::WindowBuilder::new()
         //.with_dimensions(1024, 768)
         .with_fullscreen(glutin::get_primary_monitor())
     let display = glium::glutin::WindowBuilder::new()
         //.with_dimensions(1024, 768)
         .with_fullscreen(glutin::get_primary_monitor())
@@ -325,8 +330,8 @@ fn main() {
             [     0.0,  0.0,      z_trans, 1.0f32]
         ];
 
             [     0.0,  0.0,      z_trans, 1.0f32]
         ];
 
-        // Draw the bounding box before the fractal, when the Z-buffer is still clear, so the lines
-        // behind the semi-translucent areas will be drawn.
+        // Draw the bounding box before the fractal, when the Z-buffer is still clear,
+        // so the lines behind the semi-translucent areas will be drawn.
         if bounding_box_enabled {
             let uniforms = uniform! {
                 model: model,
         if bounding_box_enabled {
             let uniforms = uniform! {
                 model: model,