From 70439a6a63a90008496719257d0bd728bcf695c1 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Thu, 13 Aug 2015 14:07:16 -0400 Subject: [PATCH] put report() back in its original position, explain why --- core/src/processing/opengl/PGraphicsOpenGL.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/processing/opengl/PGraphicsOpenGL.java b/core/src/processing/opengl/PGraphicsOpenGL.java index d6da0c2b2..31156581d 100644 --- a/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/core/src/processing/opengl/PGraphicsOpenGL.java @@ -1999,8 +1999,6 @@ public class PGraphicsOpenGL extends PGraphics { @Override public void beginDraw() { - report("top beginDraw()"); - if (primaryGraphics) { if (!initialized) { initPrimary(); @@ -2011,6 +2009,10 @@ public class PGraphicsOpenGL extends PGraphics { getPrimaryPG().setCurrentPG(this); } + // This has to go after the surface initialization, otherwise offscreen + // surfaces will have a null gl object. + report("top beginDraw()"); + if (!checkGLThread()) { return; }