From 9c8c1ae5772344c22820e8cb293cfdba14f18373 Mon Sep 17 00:00:00 2001 From: Jakub Valtar Date: Wed, 23 Sep 2015 16:07:44 -0400 Subject: [PATCH] Fix GL version getter for ES --- core/src/processing/opengl/PGL.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/src/processing/opengl/PGL.java b/core/src/processing/opengl/PGL.java index 37094c6c8..880194b5f 100644 --- a/core/src/processing/opengl/PGL.java +++ b/core/src/processing/opengl/PGL.java @@ -1992,9 +1992,19 @@ public abstract class PGL { return false; } + protected boolean isES() { + return getString(VERSION).trim().toLowerCase().contains("opengl es"); + } protected int[] getGLVersion() { - String version = getString(VERSION).trim(); + String version = getString(VERSION).trim().toLowerCase(); + + String ES = "opengl es"; + int esPosition = version.indexOf(ES); + if (esPosition >= 0) { + version = version.substring(esPosition + ES.length()).trim(); + } + int[] res = {0, 0, 0}; String[] parts = version.split(" "); for (int i = 0; i < parts.length; i++) {