From 296d63b348a01cc2a887c95f40f05527a7b688aa Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Sun, 25 Jun 2017 20:20:51 -0400 Subject: [PATCH] Add build instructions for Windows. --- README.md | 53 ++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 83e0648..5754000 100644 --- a/README.md +++ b/README.md @@ -3,21 +3,59 @@ ## Overview MandelWow is a generalized version of Mandelbrot & Julia in which both C and Z0 vary in a 4-dimensional space. -In each frame, we render a 3D slice of the MandelWow, varying the remaining dimension through time. +On each frame we render a 3D slice of the MandelWow, varying the remaining dimension through time. -I wrote this hack to learn Rust & basic GLSL. Mind the mess. +I wrote this demo to learn Rust & basic GLSL. Mind the mess. + + +## Requirements + +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. ## Building from source -### Native +### Linux -Install cargo, then simply type: +Install cargo (either your distro's packaged version or via rustup), then go to the source root and type: ``` cargo run --release ``` +### Windows + +Mandelwow depends on [libxm](https://github.com/nukep/libxm-rs) and [SDL2](https://github.com/AngryLawyer/rust-sdl2) for sound. +Both are tricky to build using Rust's MSVC toolchain because they assume GCC, so I recommend using the GNU toolchain instead. +I followed these steps to build a native Windows binary: + +* Install Cargo via [rustup](https://www.rustup.rs). +* Install mingw-w64. The [MSYS2](http://www.msys2.org/) installer provides the basic shell environment and the package manager. +* From the MSYS2 console, install the W64 native toolchain and libSDL2: + ``` + pacman -Sy + pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2 + ``` +* While you're at it, you may also want to install the git package: `pacman -S git` +* I had to manually add the mingw-w64 toolchain to your path: + ``` + export PATH="/mingw64/bin:$PATH" + export LIBRARY_PATH=/mingw64/lib + ``` +* In case `cargo` and `rustup` aren't in the shell path, add `$USERPROFILE/.cargo/bin` too. +* Next, install the Rust toolchain targeting GCC: + ``` + rustup toolchain install stable-x86_64-pc-windows-gnu + rustup default stable-x86_64-pc-windows-gnu + ``` +* Now you can proceed to mandelwow's source tree and build a native Windows binary without further hassles: + ``` + cargo run --release + ``` + ### WebAssembly / asm.js Install emsdk 1.36.14: @@ -57,13 +95,6 @@ cd mandelwow ./release_wasm.sh ``` -## Requirements - -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 This project is GPL 3.0. -- 2.25.1