[dependencies]
cgmath = "*"
#gleam = "*"
-glium = "0.29"
-glutin = "0.26"
-winit = { version = "0.24", features = ["web-sys"] }
+glium = "0.30"
+glutin = "0.27"
+winit = { version = "0.25", features = ["web-sys"] }
image = { version = "*", features = ["png_codec"], optional = true }
instant = { version = "0.1", features = ["wasm-bindgen"] }
libxm = "1.0.0"
use glium::uniform;
use mandelwow_lib::Cube;
use mandelwow_lib::bounding_box::*;
+use std::rc::Rc;
#[bench]
fn bench_bounding_box(b: &mut test::Bencher) {
- 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 event_loop = glutin::event_loop::EventLoop::new();
+ let window = glutin::window::WindowBuilder::new();
+ let context = glutin::ContextBuilder::new();
+ let display = glium::Display::new(window, context, &event_loop).unwrap();
- let program = solid_fill_program(&display);
+ let program = Rc::new(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);
+ let bbox = BoundingBox::new(&display, &bounds, program);
let mut frame = display.draw();
b.iter(|| {
let mat = [[1., 0., 0., 0.], [0., 1., 0., 0.], [0., 0., 1., 0.], [0., 0., 0., 1.0f32]];
use glium::uniform;
use mandelwow_lib::shaded_cube::*;
+use std::rc::Rc;
#[bench]
fn bench_shaded_cube(b: &mut test::Bencher) {
- 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 event_loop = glutin::event_loop::EventLoop::new();
+ let window = glutin::window::WindowBuilder::new();
+ let context = glutin::ContextBuilder::new();
+ let display = glium::Display::new(window, context, &event_loop).unwrap();
- let program = shaded_program(&display);
- let cube = ShadedCube::new(&display, &program);
+ let program = Rc::new(shaded_program(&display));
+ let cube = ShadedCube::new(&display, program);
let mut frame = display.draw();
b.iter(|| {
let model = [[0.7, 0.5, -0.5, 0.0], [0.0, 0.7, 0.7, 0.0], [0.7, -0.5, 0.5, 0.0], [0., 0., -3.0, 1.0f32]];
-Subproject commit 3ca2caba4878c73bfa4d2d7a36c2f3b943f9888a
+Subproject commit 006eaf1463af595aa11113b5e4f407e3223a40df
use rust_rocket;
#[cfg(feature = "editor")]
-type Rocket = rust_rocket::Rocket;
+type Rocket = rust_rocket::client::RocketClient;
#[cfg(not(feature = "editor"))]
type Rocket = ();
#[cfg(feature = "editor")]
fn poll_rocket(&mut self) {
+ use rust_rocket::client::Event;
+
match self.rocket {
Some(ref mut rocket) => {
let current_row = (self.t * BPS) as u32;
- if let Some(event) = rocket.poll_events() {
+ if let Some(event) = rocket.poll_events().unwrap() {
match event {
- rust_rocket::Event::SetRow(row) => {
+ Event::SetRow(row) => {
println!("SetRow (row: {:?})", row);
self.t = row as f32 / BPS;
}
- rust_rocket::Event::Pause(_) => {
- let track1 = rocket.get_track_mut("test");
+ Event::Pause(_) => {
+ let track1 = rocket.get_track_mut("test").unwrap();
println!("Pause (value: {:?}) (row: {:?})", track1.get_value(current_row as f32), current_row);
}
_ => (),