Last active
May 23, 2017 23:35
-
-
Save Noxalus/3f8bd7ccd93d6ace5d72 to your computer and use it in GitHub Desktop.
GearVR intergration with SDL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Setup the Java references. | |
ovrJava java; | |
auto jniEnv = (JNIEnv*)SDL_AndroidGetJNIEnv(); | |
JavaVM* javaVm; | |
jniEnv->GetJavaVM(&javaVm); | |
auto activity = (jobject)SDL_AndroidGetActivity(); | |
java.Vm = javaVm; | |
java.Env = jniEnv; | |
java.ActivityObject = activity; | |
// Initialize the API | |
const ovrInitParms initParms = vrapi_DefaultInitParms(&java); | |
auto initResult = vrapi_Initialize(&initParms); | |
LOG_INFO("VrAPI Init result: " << initResult); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this.