Skip to content

Instantly share code, notes, and snippets.

@Noxalus
Last active May 23, 2017 23:35
Show Gist options
  • Select an option

  • Save Noxalus/3f8bd7ccd93d6ace5d72 to your computer and use it in GitHub Desktop.

Select an option

Save Noxalus/3f8bd7ccd93d6ace5d72 to your computer and use it in GitHub Desktop.
GearVR intergration with SDL
// 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);
@bnolan
Copy link
Copy Markdown

bnolan commented May 23, 2017

Thanks for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment