From 93e5e8da2d99525c95b5350fc7ae9c3c02bec1a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xerxes=20R=C3=A5nby?= Date: Sat, 30 Mar 2013 21:52:02 +0100 Subject: [PATCH] getChosenGLCapabilities may return null before GLListener init. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Store capabilities at a safe location inside PGLListener init. Signed-off-by: Xerxes RÄnby --- core/src/processing/opengl/PGL.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/src/processing/opengl/PGL.java b/core/src/processing/opengl/PGL.java index 9b85d414d..2fb88edd5 100644 --- a/core/src/processing/opengl/PGL.java +++ b/core/src/processing/opengl/PGL.java @@ -627,7 +627,6 @@ public class PGL { pg.parent.removeListeners(pg.parent); pg.parent.addListeners(canvasAWT); - capabilities = canvasAWT.getChosenGLCapabilities(); canvas = canvasAWT; canvasNEWT = null; @@ -656,7 +655,6 @@ public class PGL { pg.parent.addListeners(canvasNEWT); } - capabilities = window.getChosenGLCapabilities(); canvas = canvasNEWT; canvasAWT = null; @@ -3248,6 +3246,7 @@ public class PGL { public void init(GLAutoDrawable adrawable) { drawable = adrawable; context = adrawable.getContext(); + capabilities = adrawable.getChosenGLCapabilities(); gl = context.getGL(); String extensions = gl.glGetString(GL.GL_EXTENSIONS);