diff options
| author | Rémi Verschelde | 2018-06-26 10:00:25 +0200 |
|---|---|---|
| committer | GitHub | 2018-06-26 10:00:25 +0200 |
| commit | 07af826051ffe5b8500e60ed1a6d53d24a1771cd (patch) | |
| tree | b88827c098767934cf29fdd9cae2a4c478f0fdf5 /platform/android/java/src | |
| parent | e574c7cedc629c0df3baac6cae68256149722f45 (diff) | |
| parent | e2aa777d4d391647062268fe36f3a1f3be488dbf (diff) | |
| download | godot-07af826051ffe5b8500e60ed1a6d53d24a1771cd.tar.gz godot-07af826051ffe5b8500e60ed1a6d53d24a1771cd.tar.zst godot-07af826051ffe5b8500e60ed1a6d53d24a1771cd.zip | |
Diffstat (limited to 'platform/android/java/src')
| -rw-r--r-- | platform/android/java/src/org/godotengine/godot/Godot.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/platform/android/java/src/org/godotengine/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java index 90848e6a9..8a2d789dc 100644 --- a/platform/android/java/src/org/godotengine/godot/Godot.java +++ b/platform/android/java/src/org/godotengine/godot/Godot.java @@ -32,6 +32,7 @@ package org.godotengine.godot; import android.R; import android.app.Activity; +import android.content.pm.ConfigurationInfo; import android.os.Bundle; import android.view.MotionEvent; import android.view.View; @@ -246,9 +247,11 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC } }; - public void onVideoInit(boolean use_gl2) { + public void onVideoInit() { - //mView = new GodotView(getApplication(),io,use_gl2); + boolean use_gl3 = getGLESVersionCode() >= 0x00030000; + + //mView = new GodotView(getApplication(),io,use_gl3); //setContentView(mView); layout = new FrameLayout(this); @@ -261,7 +264,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC // ...add to FrameLayout layout.addView(edittext); - mView = new GodotView(getApplication(), io, use_gl2, use_32_bits, this); + mView = new GodotView(getApplication(), io, use_gl3, use_32_bits, this); layout.addView(mView, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); edittext.setView(mView); io.setEdit(edittext); @@ -338,6 +341,12 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC return Godot._self; } + public int getGLESVersionCode() { + ActivityManager am = (ActivityManager)Godot.getInstance().getSystemService(Context.ACTIVITY_SERVICE); + ConfigurationInfo deviceInfo = am.getDeviceConfigurationInfo(); + return deviceInfo.reqGlEsVersion; + } + private String[] getCommandLine() { InputStream is; try { |
