Skip to content

nukep/rust-cubes-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a simple tech demo I wrote so I could learn Rust. It utilizes OpenGL 3 and SDL2.

Controls

Use your mouse to hover over and explode subcubes.

  • Left click: Explode (subdivide) hovered subcube
  • Right click: Rearrange all subcubes into their original positions
  • Middle drag: Rotate view
  • Mouse wheel: Zoom in/out
  • Space: Hurl all subcubes outward
  • "O" key: Toggle outlines
  • "R" key: Reset to a single subcube

Screenshots

Screenshot 1 Screenshot 2

Build instructions

It is recommended you install Rust nightly and Cargo on your machine. An easy way to do this on Linux and OS X is by entering the following:

    curl -s https://static.rust-lang.org/rustup.sh | sudo sh

You need the SDL2 binaries on your system, as this is a non-Rust dependency.

  • Windows: Download SDL2.dll here and place it on the project's root.
  • Ubuntu/Debian: sudo apt-get install libsdl2-dev
  • Mac OS X: brew install sdl2 (make sure you have Homebrew installed)

Then run cargo on the project's root:

cargo build --release

My impression of Rust

The experience I had with Rust was mostly pleasant. It's a serious breath of fresh air, having done similar projects in C++. The only caveat for me so far is the language's infancy and frequent changes in Rust nightly. This will obviously go away over time, when Rust reaches 1.0 in a few months.

I recommend Rust for anybody who is familiar with C or C++.

About

OpenGL and SDL tech demo in Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published