Vulkan: Allow C++ to determine use of JavaGL.

Based on config - this way we can enable Vulkan more easily even before we
determine why some devices don't like C++ EGL for GLES.
This commit is contained in:
Unknown W. Brackets committed 2016-07-01 14:05:15 -07:00
1 parent 0bf65150d6
commit 4d4e334fc4
4 files changed
+18 -5

No files matched your search

@@ -60,7 +60,7 @@ public class NativeActivity extends Activity implements SurfaceHolder.Callback {
// Allows us to skip a lot of initialization on secondary calls to onCreate.
private static boolean initialized = false;
// Change this to false to switch to C++ EGL.
// False to use C++ EGL, queried from C++ after NativeApp.init.
private static boolean javaGL = true;
// Graphics and audio interfaces for EGL (javaGL = false)
@@ -266,7 +266,10 @@ public class NativeActivity extends Activity implements SurfaceHolder.Callback {
String languageRegion = Locale.getDefault().getLanguage() + "_" + Locale.getDefault().getCountry();
NativeApp.audioConfig(optimalFramesPerBuffer, optimalSampleRate);
NativeApp.init(model, deviceType, languageRegion, apkFilePath, dataDir, externalStorageDir, libraryDir, cacheDir, shortcutParam, Build.VERSION.SDK_INT, Build.BOARD, javaGL);
NativeApp.init(model, deviceType, languageRegion, apkFilePath, dataDir, externalStorageDir, libraryDir, cacheDir, shortcutParam, Build.VERSION.SDK_INT, Build.BOARD);
// Allow C++ to tell us to use JavaGL or not.
javaGL = NativeApp.queryConfig("androidJavaGL") == "true";
sendInitialGrants();
+1 -1
View File
@@ -13,7 +13,7 @@ public class NativeApp {
public final static int DEVICE_TYPE_TV = 1;
public final static int DEVICE_TYPE_DESKTOP = 2;
public static native void init(String model, int deviceType, String languageRegion, String apkPath, String dataDir, String externalDir, String libraryDir, String cacheDir, String shortcutParam, int androidVersion, String board, boolean javaGL);
public static native void init(String model, int deviceType, String languageRegion, String apkPath, String dataDir, String externalDir, String libraryDir, String cacheDir, String shortcutParam, int androidVersion, String board);
public static native void audioInit();
public static native void audioShutdown();
public static native void audioConfig(int optimalFramesPerBuffer, int optimalSampleRate);