Skip to content

StereoKit/sk_app

Repository files navigation

sk_app

A small cross-platform library for windows / vulkan surfaces / input / OS functionality. Targets Win32, Linux, Android, and MacOS.

Building

From the project root:

Linux

# To configure
cmake -B build

# To build
cmake --build build -j8

# To run
./build/examples/simple_window/simple_window

Windows (Cross-compile with MinGW)

# To configure
cmake -B build-mingw -DCMAKE_TOOLCHAIN_FILE=cmake/mingw-toolchain.cmake -DCMAKE_BUILD_TYPE=Release

# To build
cmake --build build-mingw -j8

# To run with Wine
wine ./build-mingw/examples/simple_window/simple_window.exe

Android

Prerequisites:

  • ANDROID_HOME or ANDROID_SDK_ROOT environment variable set
  • ANDROID_NDK environment variable (optional - auto-detected from SDK)
  • Java JDK installed for signing APKs
# Quick build for arm64 (default)
./build_android.sh
# Install and run on connected device or simulator
cmake --build build-android --target simple_window-run
# OR x86_64
./build_android.sh x86
# Install and run on connected device or simulator
cmake --build build-androidx86 --target simple_window-run

Android manual build

# arm64 (default)
cmake -B build-android \
    -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
    -DANDROID_ABI=arm64-v8a \
    -DANDROID_PLATFORM=android-32 \
    -DCMAKE_BUILD_TYPE=Release
cmake --build build-android -j8
# Build the APK
cmake --build build-android --target simple_window-apk
# Install and run on connected device or simulator
adb install -r build-android/examples/simple_window.apk
adb shell am start -n com.example.ska.simple_window/android.app.NativeActivity
# OR x86_64
cmake -B build-androidx86 \
    -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
    -DANDROID_ABI=x86_64 \
    -DANDROID_PLATFORM=android-32 \
    -DCMAKE_BUILD_TYPE=Release
cmake --build build-androidx86 -j8
# Build the APK
cmake --build build-androidx86 --target simple_window-apk
# Install and run on connected device or simulator
adb install -r build-androidx86/examples/simple_window/simple_window.apk
adb shell am start -n com.example.ska.simple_window/android.app.NativeActivity
# Install and run on connected device or simulator
adb install -r build-android/examples/simple_window/simple_window.apk
adb shell am start -n com.example.ska.simple_window/android.app.NativeActivity

Filtering Android logcat

# Filtered logcat of the app
adb logcat -v color --uid `adb shell pm list package -U net.stereokit.simple_window | cut -d ":" -f3`

Available commands

ESC - Exit application T - Show virtual keyboard M - Maximize window N - Minimize window R - Restore window H - Hide window (2 seconds) P - Set window position S - Set window size SPACE - Rename window title C - Toggle cursor visibility V - Toggle relative mouse mode W - Warp mouse to center Mouse - Move and click Wheel - Scroll

About

Cross-platform abstraction for windowing, Vulkan surfaces, and input.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •