X-Git-Url: https://codewiz.org/gitweb?p=mandelwow.git;a=blobdiff_plain;f=mandelwow.rs;h=4c5d25e74bdd7fb7098a185287ab57952a74c1ed;hp=f760a26266cf597c6db612d391f5a2a274f8ecf5;hb=af94c9fcbc1e73cc008b090d6355a35eda7aea70;hpb=10d007d74417609fe2fbf2345c060d006010cb58 diff --git a/mandelwow.rs b/mandelwow.rs index f760a26..4c5d25e 100644 --- a/mandelwow.rs +++ b/mandelwow.rs @@ -5,17 +5,15 @@ extern crate glium; extern crate glutin; extern crate libxm; +extern crate sdl2; use glium::{DisplayBuild, Surface}; use glium::index::{IndexBuffer, PrimitiveType}; use glutin::ElementState::Pressed; use glutin::Event::KeyboardInput; use glutin::VirtualKeyCode; -use libxm::XMContext; -use std::fs::File; -use std::io::Read; - +mod sound; mod support; #[derive(Copy, Clone)] @@ -159,10 +157,10 @@ fn bounding_box(display: &glium::Display, depth: glium::Depth { test: glium::draw_parameters::DepthTest::IfLess, write: true, - .. Default::default() + ..Default::default() }, blend: glium::Blend::alpha_blending(), - .. Default::default() + ..Default::default() }; let front_indices = IndexBuffer::new(display, PrimitiveType::LineLoop, @@ -237,10 +235,10 @@ fn mandel(display: &glium::Display, depth: glium::Depth { test: glium::draw_parameters::DepthTest::IfLess, write: true, - .. Default::default() + ..Default::default() }, blend: glium::Blend::alpha_blending(), - .. Default::default() + ..Default::default() }; frame.draw(&vb, &indices, program, uniforms, ¶ms).unwrap(); @@ -273,15 +271,9 @@ fn mandelwow(display: &glium::Display, mandel(&display, &mut frame, &program, &uniforms, bounds, z0); } } -fn play_xm(raw_xm: &[u8]) { - let freq = 48000u32; - let mut xm = XMContext::new(&raw_xm, freq).unwrap(); -} fn main() { - let mut xm = Vec::new(); - File::open("flora.xm").unwrap().read_to_end(&mut xm).unwrap(); - play_xm(&xm); + sound::start(); let display = glium::glutin::WindowBuilder::new() //.with_dimensions(1024, 768) @@ -338,8 +330,8 @@ fn main() { [ 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,