[dependencies]
cgmath = "*"
glium = "0.15.0"
-glutin = "*"
+glutin = "0.6.2"
genmesh = "0.4.1"
image = "0.12.0"
obj = { version = "0.5", features = ["usegenmesh"] }
## Building from source
+### Native
+
Install cargo, then simply type:
```
cargo run --release
```
+### asm.js
+
+Install emsdk 1.36.14:
+
+```
+cd ~
+curl -O https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz
+tar xf emsdk-portable.tar.gz
+source emsdk-portable/emsdk_env.sh
+emsdk install emscripten-1.37.9 --build=MinSizeRel
+emsdk activate emscripten-1.37.9 --build=MinSizeRel
+```
+
+Install rustc:
+
+```
+cd ~
+curl https://sh.rustup.rs -sSf | sh
+source ~/.cargo/env
+rustup toolchain install nightly
+rustup default nightly
+rustup target install asmjs-unknown-emscripten
+rustup target install wasm32-unknown-emscripten
+```
+
+Build and run mandelwow:
+
+```
+cd mandelwow
+./release.sh
+```
+
+Build the WebAssembly binary:
+
+```
+cd mandelwow
+./release_wasm.sh
+```
## Requirements
-Requires OpenGL 3.1. Should perform well on reasonably modern hardware.
-Tested on Linux with Intel HD Graphics 4000 (Ivy Bridge) and NVidia GTX 970.
+The native binary requires OpenGL 3.1. Should perform well on reasonably modern
+hardware. Tested on Linux with Intel HD Graphics 4000 (Ivy Bridge) and NVidia GTX 970.
+
+The asmjs and WebAssembly versions were tested on Chromium 57 and Firefox 53.
## License
let _soundplayer = sound::start();
let display = glutin::WindowBuilder::new()
- .with_dimensions(1024, 768)
+ .with_dimensions(300, 300)
//.with_fullscreen(glutin::get_primary_monitor())
.with_depth_buffer(24)
.with_vsync()
.build_glium()
.unwrap();
+ let version = *display.get_opengl_version();
+ let api = match version {
+ glium::Version(glium::Api::Gl, _, _) => "OpenGL",
+ glium::Version(glium::Api::GlEs, _, _) => "OpenGL ES"
+ };
+ println!("{} context verson: {}", api, display.get_opengl_version_string());
+
let mandelwow_program = mandelwow::program(&display);
let bounding_box_program = bounding_box::solid_fill_program(&display);
--- /dev/null
+set -e
+cargo build --target wasm32-unknown-emscripten --release
+cp target/wasm32-unknown-emscripten/release/mandelwow.js .
+cp target/wasm32-unknown-emscripten/release/deps/mandelwow-*.wasm .
+emrun .