Skip to content

Commit

Permalink
Change vloader path
Browse files Browse the repository at this point in the history
  • Loading branch information
The Judge committed Nov 13, 2024
1 parent 8a60a95 commit ab016d3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 36 deletions.
4 changes: 2 additions & 2 deletions src/main/jni/libopenxr_loader.so
Git LFS file not shown
46 changes: 12 additions & 34 deletions src/main/jni/vloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@

extern "C"
JNIEXPORT jlong JNICALL
Java_org_vivecraft_util_VLoader_getEGLDisplay(JNIEnv* env, jclass clazz) {
Java_org_digitalgenesis_VLoader_getEGLDisplay(JNIEnv* env, jclass clazz) {
return reinterpret_cast<jlong>(eglGetCurrentDisplay());
}

extern "C"
JNIEXPORT jlong JNICALL
Java_org_vivecraft_util_VLoader_getEGLContext(JNIEnv* env, jclass clazz) {
Java_org_digitalgenesis_VLoader_getEGLContext(JNIEnv* env, jclass clazz) {
return reinterpret_cast<jlong>(eglGetCurrentContext());
}

extern "C"
JNIEXPORT jlong JNICALL
Java_org_vivecraft_util_VLoader_getEGLConfig(JNIEnv* env, jclass clazz) {
Java_org_digitalgenesis_VLoader_getEGLConfig(JNIEnv* env, jclass clazz) {
EGLConfig cfg;
EGLint num_configs;

Expand All @@ -50,47 +50,25 @@ Java_org_vivecraft_util_VLoader_getEGLConfig(JNIEnv* env, jclass clazz) {
return reinterpret_cast<jlong>(cfg);
}

extern "C"
JNIEXPORT void JNICALL
Java_org_vivecraft_util_VLoader_initOpenXRLoader(JNIEnv* env, jclass clazz) {
PFN_xrInitializeLoaderKHR initializeLoader = nullptr;
XrResult res;

res = xrGetInstanceProcAddr(XR_NULL_HANDLE, "xrInitializeLoaderKHR",
(PFN_xrVoidFunction *) (&initializeLoader));

if (!XR_SUCCEEDED(res)) {
printf("xrGetInstanceProcAddr returned %d.\n", res);
}

XrLoaderInitInfoAndroidKHR loaderInitInfoAndroidKhr = {
XR_TYPE_LOADER_INIT_INFO_ANDROID_KHR,
nullptr,
(void *) pojav_environ->dalvikJavaVMPtr,
(void *) pojav_environ->activity
};

res = initializeLoader((const XrLoaderInitInfoBaseHeaderKHR *) &loaderInitInfoAndroidKhr);
if (!XR_SUCCEEDED(res)) {
printf("xrInitializeLoaderKHR returned %d.\n", res);
}

JNIEnv *newEnv;
pojav_environ->dalvikJavaVMPtr->AttachCurrentThread(&newEnv, NULL);
}

extern "C"
JNIEXPORT jlong JNICALL
Java_org_vivecraft_util_VLoader_getDalvikVM(JNIEnv* env, jclass clazz) {
Java_org_digitalgenesis_VLoader_getDalvikVM(JNIEnv* env, jclass clazz) {
return reinterpret_cast<jlong>(pojav_environ->dalvikJavaVMPtr);
}

extern "C"
JNIEXPORT jlong JNICALL
Java_org_vivecraft_util_VLoader_getDalvikActivity(JNIEnv* env, jclass clazz) {
Java_org_digitalgenesis_VLoader_getDalvikActivity(JNIEnv* env, jclass clazz) {
return reinterpret_cast<jlong>(pojav_environ->activity);
}

extern "C"
JNIEXPORT void JNICALL
Java_org_digitalgenesis_VLoader_setupAndroid(JNIEnv* env, jclass clazz) {
JNIEnv *newEnv;
pojav_environ->dalvikJavaVMPtr->AttachCurrentThread(&newEnv, NULL);
}

extern "C"
JNIEXPORT void JNICALL
Java_pojlib_util_VLoader_setAndroidInitInfo(JNIEnv *env, jclass clazz, jobject ctx) {
Expand Down

0 comments on commit ab016d3

Please sign in to comment.