From adaf62ff2e4ee4aad763f49ac964796e4801afdb Mon Sep 17 00:00:00 2001 From: gohai Date: Fri, 3 Jun 2016 20:18:13 -0400 Subject: [PATCH] Fix GLExceptions on Raspberry Pi when using offscreen PGraphics --- .../processing/opengl/PGraphicsOpenGL.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/core/src/processing/opengl/PGraphicsOpenGL.java b/core/src/processing/opengl/PGraphicsOpenGL.java index bf45bf957..5c17d87b5 100644 --- a/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/core/src/processing/opengl/PGraphicsOpenGL.java @@ -1607,9 +1607,12 @@ public class PGraphicsOpenGL extends PGraphics { } pgl.depthFunc(PGL.LEQUAL); - if (smooth < 1) { + if (OPENGL_RENDERER.equals("VideoCore IV HW")) { + // Broadcom's VC IV driver is unhappy with either of these + // ignore for now + } else if (smooth < 1) { pgl.disable(PGL.MULTISAMPLE); - } else { + } else if (1 <= smooth) { pgl.enable(PGL.MULTISAMPLE); pgl.disable(PGL.POLYGON_SMOOTH); } @@ -6788,13 +6791,13 @@ public class PGraphicsOpenGL extends PGraphics { // quality = temp; // } } - if (smooth < 1) { + if (OPENGL_RENDERER.equals("VideoCore IV HW")) { + // Broadcom's VC IV driver is unhappy with either of these + // ignore for now + } else if (smooth < 1) { pgl.disable(PGL.MULTISAMPLE); - } else { - // work around runtime exceptions in Broadcom's VC IV driver - if (false == OPENGL_RENDERER.equals("VideoCore IV HW")) { - pgl.enable(PGL.MULTISAMPLE); - } + } else if (1 <= smooth) { + pgl.enable(PGL.MULTISAMPLE); } // work around runtime exceptions in Broadcom's VC IV driver if (false == OPENGL_RENDERER.equals("VideoCore IV HW")) {