mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-14 23:28:52 -04:00
Cleanup
This commit is contained in:
parent
7a331dd5ab
commit
7efe9581cf
@ -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));
|
||||||
|
|
||||||
|
@ -40,42 +40,30 @@ 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",
|
|
||||||
eglGetError_p());
|
|
||||||
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 {
|
} else {
|
||||||
if (eglChooseConfig_p(g_EglDisplay, egl_attributes, NULL, 0, &num_configs) != EGL_TRUE) {
|
egl_attributes[13] = EGL_OPENGL_ES2_BIT;
|
||||||
__android_log_print(ANDROID_LOG_ERROR, g_LogTag, "eglChooseConfig_p() failed: %04x",
|
|
||||||
eglGetError_p());
|
|
||||||
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_attributes, &bundle->config, 1, &num_configs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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",
|
||||||
|
eglGetError_p());
|
||||||
|
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_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);
|
||||||
|
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user