This project is a an experiment to test a few ideas:
- Have a simple build system (i.e. no gradle, no cmake, or android make)
- Build an example to the Meta Quest 1, 2, or 3
- Provide a lightweight C example that uses both OpenXR and Vulkan
Note that the following project was built on a Linux machine. Building on other platforms may work, but has not been tested.
Acquire the following:
Android NDK version: 21.0.6113669
Android SDK using API: 29 (specifically SDK tools 29.0.2)
glslc: any version will due.
Once downloaded, adjust the SDK, NDK, and GLSLC defines in nob.c (the build system):
e.g.
#define SDK "/Path/To/Android/Sdk"
#define NDK "/Path/To/Android/Sdk/ndk/21.0.6113669"
#define GLSLC "/Path/To/glslc"Everything else is implicity derived from these defines.
e.g in nob.c.
#define CC NDK"/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" // Currently plain C
#define AAPT SDK"/build-tools/29.0.2/aapt"
#define ANDROID_JAR SDK"/platforms/android-29/android.jar"
#define APK_SIGNER SDK"/build-tools/29.0.2/apksigner"
#define ZIP_ALIGN SDK"/build-tools/29.0.2/zipalign"If you want to know more about nob.h, check it out here.
First build the build system:
gcc -o nob nob.cInstall adb if you haven't already. Check if your device is visible:
adb devicesIf it's not, then you'll likely need to look up how to enable developer mode. Make a key for the android app one time.
./nob --make_keyTo build without installing simply run:
./nobTo build, install, and launch logcat run:
./nob -iThe example should be able to exit normally by the usual method (or in the case of this demo, also through the use of the menu button), however to force quit the app you can always run:
adb shell am force-stop com.imminenteminence.hellovulkan