summaryrefslogtreecommitdiff
path: root/platform/android/java
diff options
context:
space:
mode:
authorgeequlim <geequlim@gmail.com>2018-06-25 22:43:46 +0800
committergeequlim <geequlim@gmail.com>2018-06-26 12:21:06 +0800
commite2aa777d4d391647062268fe36f3a1f3be488dbf (patch)
tree612e8398c6691d005ccbc8119b9739b2c1827d48 /platform/android/java
parent25275de50e31aa081cdefe0c8b3b76b6389cb6a6 (diff)
Implement OpenGL ES rasterizer selection logic for Android.
Diffstat (limited to 'platform/android/java')
-rw-r--r--platform/android/java/src/org/godotengine/godot/Godot.java15
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 90848e6a90..8a2d789dc5 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 {