Rismosch / ris_engine

Barebones game engine. Home made passion project.
MIT License
2 stars 1 forks source link
3d-graphics game game-development game-engine rust sdl2 vulkan

ris_engine

Barebones game engine. Home made passion project.

πŸ—οΈ VERY WIP πŸ‘·

thumbnail

Features:

Requirements

Notes
Compiler rustc 1.77.2 Download Link
Platform x86_64 Windows and Linux may or may not compile on other platforms
Graphics Vulkan capable Hardware

You also require an internet connection, to download dependencies from crates.io. You can vendor crates for offline use or download an archived repo from my website. Note that I make these archives sporadically, meaning they may not be up to date.

Installation

This engine is using various 3rd party libraries. Trying to build without these will most definitely result in diverse compile, linker and runtime errors. Depending on your platform, follow the instructions below.

Windows

In this repo you will find the ./external/ directory. It contains all required libraries. If you don't want to use the binaries in this repo, you can install the Vulkan SDK, which provides binaries for SDL2 and shaderc.

1. Copy EVERY *.dll in ./external/bin/ to the root of this repository.

These DLLs need to be available in your environment. So either assign it to your environment variables or move them to the root of the directory.

2. Set the environment variable SHADERC_LIB_DIR

shaderc requires the DLL shaderc_shared.dll during build time. shaderc allows to store and compile shader code inside Rust source files. ris_engine does not use this feature, but shaderc requires this dependency regardless. It searches the DLL in SHADERC_LIB_DIR.

For more info, check this link: https://docs.rs/shaderc/0.8.3/shaderc/index.html

So, if shaderc_shared.dll sits inside directory /path/to/shaderc/, then set SHADERC_LIB_DIR to /path/to/shaderc/. If you don't want to move the DLL, you can simply set SHADERC_LIB_DIR to <path of this repo>/external/bin/.

3. Copy EVERY *.lib in ./external/lib/ to

C:\Users\<your username>\.rustup\toolchains\<current toolchain>\lib\rustlib\<current toolchain>\lib

Rust still needs to link. If you are using rustup, the linker will search for LIBs in the directory above. If you are not using rustup, you must figure out how to link against the required LIBs.

Linux

Examples use the pacman package manager from Arch.

1. Install SDL2

sudo pacman -S sdl2

2. Install shaderc

sudo pacman -S shaderc

3. Install Vulkan

Depending on your graphics card, you need to install a different package. Follow the instructions in the link below:

https://wiki.archlinux.org/title/Vulkan#Installation

Building

Assuming everything is installed correctly, you can now compile and run the engine with:

cargo run

Alternatively, you can build a release-ready package, by running the command below. Note that this builds with all optimizations enabled, which may take longer than just using cargo run.

cargo run -p cli build

Testing

All tests are found under ./tests/ and can be run with:

cargo test

Alternatively, to run much more extensive tests, you can run the command below. Note that this may take several minutes.

cargo run -p cli pipeline all

Cli

For more info about the command cargo run -p cli, see ./cli/README.md.