This is a very simple project I made to visualize the Mandelbrot set using Rust. The Mandelbrot set is a fractal defined by iterating
The default controls are left-clicking to zoom, right-clicking to go back to the previous view, and space
to toggle a box which shows the next zoom selection. The left
and right
arrow keys will also allow you to cycle through colorschemes while running the program, and tab
will invert the colorscheme.
Dependencies for pix-engine:
brew install sdl2 sdl2_gfx sdl2_image sdl2_mixer sdl2_ttf
Note: The minimum SDL2 version is 2.0.20. Some package managers may not have the latest versions available.
- Ubuntu:
sudo apt-get install libsdl2-dev libsdl2-gfx-dev libsdl2-image-dev
libsdl2-mixer-dev libsdl2-ttf-dev
- Fedora:
sudo dnf install SDL2-devel SDL2_gfx-devel SDL2_image-devel SDL2_mixer-devel SDL2_ttf-devel
- Arch:
sudo pacman -S sdl2 sdl2_gfx sdl2_image sdl2_mixer sdl2_ttf
- Download the latest SDL2 MSVC development libraries from https://www.libsdl.org/download-2.0.php e.g. (SDL2-devel-2.0.20-VC.zip).
- Download the latest SDL2_image, SDL2_mixer, and SDL2_ttf MSVC development libraries from https://www.libsdl.org/projects/. e.g. (SDL2_image-devel-2.0.5-VC.zip).
- Unzip each .zip file into a folder.
- Copy library files:
- from:
lib\x64\
- to:
C:\Users\{Username}\.rustup\toolchains\{current toolchain}\lib\rustlib\{current toolchain}\lib
where{current toolchain}
is likelystable-x86_64-pc-windows-msvc
. Note: If you don’t use rustup, Seerust-sdl2
for more info on Windows installation.
- from:
- Copy all dll files:
- from:
lib\x64\
- to: your cargo project next to
Cargo.toml
. MSVC binaries for SDL2 are also present in this repository under the lib folder.
- from:
After the dependencies are installed, you can run:
cargo install --git https://github.com/denehoffman/mandelbrot.git
This will add the executable mandelbrot
to your path. Run mandelbrot
for the default viewer, or run mandelbrot --help
for more options, including changing window size and colorscheme.