This commit is contained in:
The Judge 2022-10-16 11:05:20 -07:00
parent 7a331dd5ab
commit 7efe9581cf
2 changed files with 24 additions and 34 deletions

View File

@ -222,9 +222,11 @@ public class JREUtils {
envMap.put("REGAL_GL_VERSION", "4.5"); envMap.put("REGAL_GL_VERSION", "4.5");
if(LOCAL_RENDERER != null) { if(LOCAL_RENDERER != null) {
envMap.put("POJAV_RENDERER", LOCAL_RENDERER); envMap.put("POJAV_RENDERER", LOCAL_RENDERER);
envMap.put("LIBGL_ES", Character.toString(LOCAL_RENDERER.charAt(8))); if(LOCAL_RENDERER.equals("opengles3_desktopgl_angle_vulkan")) {
envMap.put("LIBGL_ES", "3");
envMap.put("POJAVEXEC_EGL","libEGL_angle.so"); // Use ANGLE EGL
}
} }
if(LOCAL_RENDERER.equals("opengles3_desktopgl_angle_vulkan")) envMap.put("POJAVEXEC_EGL","libEGL_angle.so"); // use ANGLE egl
envMap.put("AWTSTUB_WIDTH", Integer.toString(CallbackBridge.windowWidth > 0 ? CallbackBridge.windowWidth : CallbackBridge.physicalWidth)); envMap.put("AWTSTUB_WIDTH", Integer.toString(CallbackBridge.windowWidth > 0 ? CallbackBridge.windowWidth : CallbackBridge.physicalWidth));
envMap.put("AWTSTUB_HEIGHT", Integer.toString(CallbackBridge.windowHeight > 0 ? CallbackBridge.windowHeight : CallbackBridge.physicalHeight)); envMap.put("AWTSTUB_HEIGHT", Integer.toString(CallbackBridge.windowHeight > 0 ? CallbackBridge.windowHeight : CallbackBridge.physicalHeight));

View File

@ -40,26 +40,15 @@ bool gl_init() {
render_window_t* gl_init_context(render_window_t *share) { render_window_t* gl_init_context(render_window_t *share) {
render_window_t* bundle = malloc(sizeof(render_window_t)); render_window_t* bundle = malloc(sizeof(render_window_t));
memset(bundle, 0, sizeof(render_window_t)); memset(bundle, 0, sizeof(render_window_t));
const EGLint egl_attributes[] = { EGL_BLUE_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_RED_SIZE, 8, EGL_ALPHA_SIZE, 8, EGL_DEPTH_SIZE, 24, EGL_SURFACE_TYPE, EGL_WINDOW_BIT|EGL_PBUFFER_BIT, EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT, EGL_NONE }; EGLint egl_attributes[] = { EGL_BLUE_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_RED_SIZE, 8, EGL_ALPHA_SIZE, 8, EGL_DEPTH_SIZE, 24, EGL_SURFACE_TYPE, EGL_WINDOW_BIT|EGL_PBUFFER_BIT, EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT, EGL_NONE };
const EGLint egl_attributes2[] = { EGL_BLUE_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_RED_SIZE, 8, EGL_ALPHA_SIZE, 8, EGL_DEPTH_SIZE, 24, EGL_SURFACE_TYPE, EGL_WINDOW_BIT|EGL_PBUFFER_BIT, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_NONE };
EGLint num_configs = 0; EGLint num_configs = 0;
if(strncmp(getenv("POJAV_RENDERER"), "opengles3_desktopgl", 19) == 0) { if(strncmp(getenv("POJAV_RENDERER"), "opengles3_desktopgl", 19) == 0) {
if (eglChooseConfig_p(g_EglDisplay, egl_attributes2, NULL, 0, &num_configs) != EGL_TRUE) { egl_attributes[13] = EGL_OPENGL_BIT;
__android_log_print(ANDROID_LOG_ERROR, g_LogTag, "eglChooseConfig_p() failed: %04x", } else {
eglGetError_p()); egl_attributes[13] = EGL_OPENGL_ES2_BIT;
free(bundle);
return NULL;
}
if (num_configs == 0) {
__android_log_print(ANDROID_LOG_ERROR, g_LogTag, "%s",
"eglChooseConfig_p() found no matching config");
free(bundle);
return NULL;
} }
// Get the first matching config
eglChooseConfig_p(g_EglDisplay, egl_attributes2, &bundle->config, 1, &num_configs);
} else {
if (eglChooseConfig_p(g_EglDisplay, egl_attributes, NULL, 0, &num_configs) != EGL_TRUE) { if (eglChooseConfig_p(g_EglDisplay, egl_attributes, NULL, 0, &num_configs) != EGL_TRUE) {
__android_log_print(ANDROID_LOG_ERROR, g_LogTag, "eglChooseConfig_p() failed: %04x", __android_log_print(ANDROID_LOG_ERROR, g_LogTag, "eglChooseConfig_p() failed: %04x",
eglGetError_p()); eglGetError_p());
@ -75,7 +64,6 @@ render_window_t* gl_init_context(render_window_t *share) {
// Get the first matching config // Get the first matching config
eglChooseConfig_p(g_EglDisplay, egl_attributes, &bundle->config, 1, &num_configs); eglChooseConfig_p(g_EglDisplay, egl_attributes, &bundle->config, 1, &num_configs);
}
eglGetConfigAttrib_p(g_EglDisplay, bundle->config, EGL_NATIVE_VISUAL_ID, &bundle->format); eglGetConfigAttrib_p(g_EglDisplay, bundle->config, EGL_NATIVE_VISUAL_ID, &bundle->format);
{ {