Android renderer : fixed issue where parsing opengl es version was failing on some device and causing a crash

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10711 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
rem..om 12 years ago
parent aa325fc854
commit b143904913
  1. 4
      engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java

@ -128,7 +128,7 @@ public class OGLESShaderRenderer implements Renderer {
public EnumSet<Caps> getCaps() {
return caps;
}
private int extractVersion(String prefixStr, String versionStr) {
if (versionStr != null) {
int spaceIdx = versionStr.indexOf(" ", prefixStr.length());
@ -137,6 +137,8 @@ public class OGLESShaderRenderer implements Renderer {
} else {
versionStr = versionStr.substring(prefixStr.length()).trim();
}
//some device have ":" at the end of the version.
versionStr = versionStr.replaceAll("\\:", "");
float version = Float.parseFloat(versionStr);
return (int) (version * 100);
} else {

Loading…
Cancel
Save