There are two other templates (see the branches) if you prefer to use gradle for android or if you do not want to use winit and want to have an android version (gradle then being the only solution available)
See installation and how to build and test your application
In order to use the build_sk_rs or compile_sks command you have to 'install' the project: cargo install -F event-loop stereokit-rust
- git clone https://github.com/mvvvv/stereokit-template/
- For Windows only and if you want to get DLLs add to the PATH environment variable the directory ./target/debug/deps
Then, go to the Stereokit-template project and transform it to your project:
- by renaming the name, package and labels in Cargo.toml,
- and removing the .git in order to create yours,
- Make sure you have OpenXR installed with an active runtine.
- Launch:
cargo run
(using Wayland on Linux may require to unset temporarily the DISPLAY variable:DISPLAY= cargo run
)
Run your project on your PC using the simulator:
- Launch:
cargo run -- --test
if you want to give a more useful name to you executable (i.e.my_main_app
), you'll have to use the --bin option: cargo run --bin my_main_app -- --test
If you're using VsCode you'll see two launchers in launch.json to debug the project.
cargo build_sk_rs --bin main <the path of your exportable repository>
- Launch:
cargo apk run --lib
For Android you'll have to set a keystore. See cargo-apk to store the path and keyword
- Desktop :
cargo build --release
if you want to give a more useful name to you executable (i.e.my_main_app
), you'll have to use the --bin option:cargo build --release --bin my_main_app
- Android :
cargo apk build --lib --release
Binaries and APK archives are produced under ./target/release
Important: By default build_sk_rs compiles the shaders optimally for the target platform.
compile_sks
calls the stereokit binary skshaderc
using the following configuration:
- The shaders (*.hlsl files) must be created inside the
shaders_src
directory inside the root directory of your project. - The result (*.hlsl.sks files) will be produced inside the
assets/shaders
directory inside the root directory of your project.
To compile the *.hlsl files, go to the root directory of your project then launch cargo compile_sks
This is the regular way to run the doc tests: cargo test --doc
or cargo test
but screenshots will fail on Wayland because of the DISPLAY variable. So you have to unset it before running the tests: DISPLAY= cargo test
Submit bugs on the Issues tab, and ask questions in the Discussions tab!
The project https://github.com/StereoKit/StereoKit/ will give you many useful links (Discord/Twitter/Blog)