diff --git a/gdx/src/main/java/de/damios/guacamole/gdx/graphics/ShaderCompatibilityHelper.java b/gdx/src/main/java/de/damios/guacamole/gdx/graphics/ShaderCompatibilityHelper.java index 086b4d2..3193857 100644 --- a/gdx/src/main/java/de/damios/guacamole/gdx/graphics/ShaderCompatibilityHelper.java +++ b/gdx/src/main/java/de/damios/guacamole/gdx/graphics/ShaderCompatibilityHelper.java @@ -20,7 +20,7 @@ import com.badlogic.gdx.graphics.glutils.ShaderProgram; import com.badlogic.gdx.scenes.scene2d.utils.UIUtils; -import de.damios.guacamole.gdx.graphics.ShaderProgramFactory; +import de.damios.guacamole.gdx.reflection.ReflectionUtils; /** * This class allows programmatically porting GLSL shader code from version 120 @@ -111,6 +111,11 @@ public static boolean mustUse32CShader() { } public static String getDefaultShaderVersion() { + if (ReflectionUtils.getClassByNameOrNull( + "com.badlogic.gdx.backends.lwjgl3.awt.GlfwAWTLoader") != null) + return "100"; // ANGLE, see + // https://github.com/google/angle/blob/0ed0de4f0b7f5a81fbe35b28e6a68a739f365556/src/compiler/translator/DirectiveHandler.cpp#L285 + if (mustUse32CShader()) return "150"; // macOS 3.2 core profile diff --git a/gdx/src/main/java/de/damios/guacamole/gdx/reflection/ReflectionUtils.java b/gdx/src/main/java/de/damios/guacamole/gdx/reflection/ReflectionUtils.java index f287483..4c11266 100644 --- a/gdx/src/main/java/de/damios/guacamole/gdx/reflection/ReflectionUtils.java +++ b/gdx/src/main/java/de/damios/guacamole/gdx/reflection/ReflectionUtils.java @@ -34,7 +34,6 @@ import de.damios.guacamole.Exceptions; import de.damios.guacamole.Preconditions; -import de.damios.guacamole.annotations.GwtIncompatible; import de.damios.guacamole.gdx.log.Logger; import de.damios.guacamole.gdx.log.LoggerService;