Tolerates a failure in the parsing of GLSL version string and then assumes GLSL 1.00 is supported only on the Raspberry Pi

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10455 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
jul..om 12 years ago
parent 845b14c4f0
commit 503adbfd85
  1. 9
      engine/src/jogl/com/jme3/renderer/jogl/JoglRenderer.java

@ -69,6 +69,7 @@ import java.util.EnumSet;
import java.util.List; import java.util.List;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.media.nativewindow.NativeWindowFactory;
import javax.media.opengl.GL; import javax.media.opengl.GL;
import javax.media.opengl.GL2; import javax.media.opengl.GL2;
import javax.media.opengl.GL2ES1; import javax.media.opengl.GL2ES1;
@ -188,13 +189,15 @@ public class JoglRenderer implements Renderer {
versionStr = versionStr.substring(0, spaceIdx); versionStr = versionStr.substring(0, spaceIdx);
} }
//FIXME revisit this fix later
try { try {
float version = Float.parseFloat(versionStr); float version = Float.parseFloat(versionStr);
glslVer = (int) (version * 100); glslVer = (int) (version * 100);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
logger.warning("Failed parsing GLSL version assuming it's v1.00"); // the parsing fails on Raspberry Pi
glslVer = 100; if (NativeWindowFactory.getNativeWindowType(false).equals(NativeWindowFactory.TYPE_BCM_VC_IV)) {
logger.warning("Failed parsing GLSL version assuming it's v1.00");
glslVer = 100;
}
} }
switch (glslVer) { switch (glslVer) {

Loading…
Cancel
Save