This is a Rust port of the OpenGL SuperBible 6th Edition sample code.
The original C++ sample code can be found at
https://github.com/openglsuperbible/sb6code. The media archive used by the
samples is available on the book's website http://www.openglsuperbible.com.
Note that the provided Makefile
will automatically download the media
archive as part of the build process.
Only a small number of the C++ samples have been ported to Rust, however the supporting sample application classes are mostly complete and for the most part have a similar interface. The Rust implementation should be able to load all of the SB6 media pack models, texture and shaders.
-
Make sure you have the following dependencies installed:
rust
1.0.0-beta3 or laterg++
4.7 or later- GNU
make
3.81 or later cmake
2.8 or latergit
curl
unzip
-
Build the samples: Simply build the samples by running
make
. This will runcargo build
and copy required media files to thetarget/debug
directory. -
Run the samples:
cd
to thetarget/debug
directory and run the sample you want.
To install the required prerequsites on Windows you can use MSYS2:
-
Download and run the latest MSYS2 installer.
-
From the MSYS2 terminal install the
mingw64
toolchain and the other required tools.$ pacman -S git make unzip # Choose one based on platform: $ pacman -S mingw-w64-i686-cmake mingw-w64-i686-gcc $ pacman -S mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc
-
Start
mingw32_shell.bat
ormingw64_shell.bat
from your MSYS2 install (i.e.C:\msys64
), depending on whether you are using 32-bit or 64-bit Rust.
You are now ready to build and run the samples.
The OpenGL SuperBible 6th Edition sample code is distributed under terms of the MIT license.
See LICENSE for details.