Skip to content

Commit

Permalink
Merge branch 'FCL-Team:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangjing-GitHub-Code authored Mar 20, 2023
2 parents ca7befb + e09cbe9 commit 8e8d3f7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions FCL/src/main/res/values-zh/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@
<string name="settings_fcl_controller_injector">基岩版触控手势</string>
<string name="settings_fcl_renderer">渲染器</string>
<string name="settings_fcl_renderer_angle">ANGLE (OpenGL 4.6, 仅支持 1.17+)</string>
<string name="settings_fcl_renderer_vgpu" >VGPU (OpenGL 2.1+, 仅支持 1.17-)</string>

<string name="settings_game">游戏设置</string>
<string name="settings_game_dimension">窗口分辨率</string>
Expand Down
2 changes: 1 addition & 1 deletion FCL/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@
<string name="settings_fcl_renderer_gl4es" translatable="false">Holy GL4ES (OpenGL 2.1)</string>
<string name="settings_fcl_renderer_virgl" translatable="false">VirGLRenderer (OpenGL 4.3)</string>
<string name="settings_fcl_renderer_angle">ANGLE (OpenGL 4.6, only support 1.17+)</string>
<string name="settings_fcl_renderer_vgpu" translatable="false">VGPU (OpenGL 2.1+)</string>
<string name="settings_fcl_renderer_vgpu" >VGPU (OpenGL 2.1+,only support 1.17-)</string>

<string name="settings_game">Game Settings</string>
<string name="settings_game_dimension">Resolution</string>
Expand Down
2 changes: 1 addition & 1 deletion FCLauncher/src/main/jni/glfw/include/fcl_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ typedef VkResult (APIENTRY *PFN_vkCreateAndroidSurfaceKHR)(VkInstance, const VkA
#include "egl_context.h"
#include "osmesa_context.h"

#define _glfw_dlopen(name) by_dlopen(name, BY_RTLD_LAZY)
#define _glfw_dlopen(name) by_dlopen(name, RTLD_LAZY | RTLD_GLOBAL)
#define _glfw_dlclose(handle) by_dlclose(handle)
#define _glfw_dlsym(handle, name) by_dlsym(handle, name)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ JNIEXPORT jlong JNICALL Java_org_lwjgl_system_fcl_DynamicLinkLoader_ndlopen(JNIE
char const *filename = (char const *)(intptr_t)filenameAddress;
UNUSED_PARAMS(__env, clazz)
if (!glesHandle) {
glesHandle = by_dlopen("libGLESv2.so", BY_RTLD_LAZY);
glesHandle = dlopen("libGLESv2.so", RTLD_LAZY | RTLD_GLOBAL);
}
return (jlong)(intptr_t)by_dlopen(filename, BY_RTLD_LAZY);
if (strstr(filename,"glfw")!=0){
return (jlong)(intptr_t)by_dlopen(filename, RTLD_LAZY | RTLD_GLOBAL);
}
return (jlong)(intptr_t)dlopen(filename, RTLD_LAZY | RTLD_GLOBAL);
}

JNIEXPORT jlong JNICALL Java_org_lwjgl_system_fcl_DynamicLinkLoader_ndlerror(JNIEnv *__env, jclass clazz) {
Expand All @@ -30,17 +33,20 @@ JNIEXPORT jlong JNICALL Java_org_lwjgl_system_fcl_DynamicLinkLoader_ndlsym(JNIEn
void *handle = (void *)(intptr_t)handleAddress;
char const *name = (char const *)(intptr_t)nameAddress;
UNUSED_PARAMS(__env, clazz)
jlong retval = (jlong)(intptr_t)by_dlsym(handle, name);
if (strstr(name,"glfw")!=0){
return (jlong)(intptr_t)by_dlsym(handle, name);
}
jlong retval = (jlong)(intptr_t)dlsym(handle, name);
if (!retval && name[0] == 'g' && name[1] == 'l') {
retval = (jlong)(intptr_t)by_dlsym(glesHandle, name);
retval = (jlong)(intptr_t)dlsym(glesHandle, name);
}
return retval;
}

JNIEXPORT jint JNICALL Java_org_lwjgl_system_fcl_DynamicLinkLoader_ndlclose(JNIEnv *__env, jclass clazz, jlong handleAddress) {
void *handle = (void *)(intptr_t)handleAddress;
UNUSED_PARAMS(__env, clazz)
return (jint)by_dlclose(handle);
return (jint)dlclose(handle);
}

EXTERN_C_EXIT

0 comments on commit 8e8d3f7

Please sign in to comment.