commit 30beb34ff9bea0deaecf8aa62392d9abdea2a5a7
Author: Leszek Koltunski <leszek@distoretedandroid.org>
Date:   Wed Mar 29 13:41:54 2017 +0100

    It now automatically chooses OpenGL ES 2.0 and GLSL 100 or OpenGL ES 3.0 and GLSL 300.
    
    Postprocessing effects will not work on OpenGL ES 2.0 contexts.

diff --git a/src/main/java/org/distorted/library/Distorted.java b/src/main/java/org/distorted/library/Distorted.java
index 9dc833f..e278435 100644
--- a/src/main/java/org/distorted/library/Distorted.java
+++ b/src/main/java/org/distorted/library/Distorted.java
@@ -19,7 +19,9 @@
 
 package org.distorted.library;
 
+import android.app.ActivityManager;
 import android.content.Context;
+import android.content.pm.ConfigurationInfo;
 import android.content.res.Resources;
 import org.distorted.library.program.*;
 
@@ -106,7 +108,11 @@ public class Distorted
   public static void onCreate(final Context context)
   throws FragmentCompilationException,VertexCompilationException,VertexUniformsException,FragmentUniformsException,LinkingException
     {
-    GLSL = 100;
+    final ActivityManager activityManager     = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
+    final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
+    android.util.Log.e("DISTORTED", "Using OpenGL ES "+configurationInfo.getGlEsVersion());
+
+    GLSL = ( (configurationInfo.reqGlEsVersion>>16)>=3 ? 300 : 100 );
     GLSL_VERSION= (GLSL==100 ? "#version 100\n" : "#version 300 es\n");
 
     final Resources resources = context.getResources();
