From 0b099e2de7e1cf1cb68ebd2c7fd12a60f6572689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xerxes=20R=C3=A5nby?= Date: Mon, 27 Jul 2015 17:33:12 +0200 Subject: [PATCH] Hack around some calls that caused runtime exceptions when using Broadcom's VC IV driver Note: VC IV is the old, binary driver. Still it'd be interesting to see how well this can be made to work with some recent JOGL work. Initial patch by xranby, conditionals by gohai. --- core/src/processing/opengl/PGraphicsOpenGL.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/core/src/processing/opengl/PGraphicsOpenGL.java b/core/src/processing/opengl/PGraphicsOpenGL.java index 8965eb524..512ad3d9d 100644 --- a/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/core/src/processing/opengl/PGraphicsOpenGL.java @@ -7042,9 +7042,15 @@ public class PGraphicsOpenGL extends PGraphics { if (smooth < 1) { pgl.disable(PGL.MULTISAMPLE); } else { - pgl.enable(PGL.MULTISAMPLE); + // work around runtime exceptions in Broadcom's VC IV driver + if (false == OPENGL_RENDERER.equals("VideoCore IV HW")) { + pgl.enable(PGL.MULTISAMPLE); + } + } + // work around runtime exceptions in Broadcom's VC IV driver + if (false == OPENGL_RENDERER.equals("VideoCore IV HW")) { + pgl.disable(PGL.POLYGON_SMOOTH); } - pgl.disable(PGL.POLYGON_SMOOTH); if (sized) { // reapplySettings(); @@ -7154,8 +7160,11 @@ public class PGraphicsOpenGL extends PGraphics { pgl.getIntegerv(PGL.MAX_TEXTURE_SIZE, intBuffer); maxTextureSize = intBuffer.get(0); - pgl.getIntegerv(PGL.MAX_SAMPLES, intBuffer); - maxSamples = intBuffer.get(0); + // work around runtime exceptions in Broadcom's VC IV driver + if (false == OPENGL_RENDERER.equals("VideoCore IV HW")) { + pgl.getIntegerv(PGL.MAX_SAMPLES, intBuffer); + maxSamples = intBuffer.get(0); + } if (anisoSamplingSupported) { pgl.getFloatv(PGL.MAX_TEXTURE_MAX_ANISOTROPY, floatBuffer);