crossplatform_gfx_hal_example
crossplatform_gfx_hal_example copied to clipboard
Gfx-hal quad example running on Windows, Linux, Mac, iOS, Android
Cross-platform gfx-hal example project
Gfx-hal quad example running on Windows, Linux, Mac, iOS, Android.
Desktop (Windows, Linux, Mac)
cd rust/game_desktop/
cargo run --features target
Where target: mac (Metal), linux (Vulkan), pc_dx12 (DirectX 12) or pc_dx11 (DirectX 11).
iOS (Metal)
- Install Rust iOS target:
rustup target add aarch64-apple-ios - Install XcodeGen
cdto theiosdirectory- Run XcodeGen
- Open project in Xcode
- Run example on device (with metal support)
cd ios/
xcodegen
Android (Vulkan)
- Install Rust Android targets:
rustup target add armv7-linux-androideabi - Install cargo-apk:
cargo install --git https://github.com/rust-windowing/android-rs-glue.git cargo-apk - Install the OpenJDK (1.8)
- Install the CMake
- Install Android SDK
- Install API level 24 support
- Install Android NDK 17c (why 17c? see issue)
- Install Gradle (4.6)
- Set the environment variables
JAVA_HOME,NDK_HOME,ANDROID_HOME,GRADLE_HOME. cdto therust/game_androiddirectory- Run
cargo-apk build - Install Vulkan validation layers:
cdto theproject_root/target/android-artifactsdirectorycp -fr $NDK_HOME/sources/third_party/vulkan/src/build-android/jniLibs/armeabi-v7a app/src/main/
- Run
gradle assembleDebug - Run
gradle installDebug - Run
adb logcat | grep RustAndroidGlueStdouterr - Run example on connected device