From a4e0e634c1546cb9922dee3a5512546c32561797 Mon Sep 17 00:00:00 2001 From: "Sha..om" Date: Fri, 29 Apr 2011 19:04:13 +0000 Subject: [PATCH] * Fix NPE in LwjglCanvas.restoreCanvas() git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7361 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/lwjgl-ogl/com/jme3/system/lwjgl/LwjglCanvas.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/src/lwjgl-ogl/com/jme3/system/lwjgl/LwjglCanvas.java b/engine/src/lwjgl-ogl/com/jme3/system/lwjgl/LwjglCanvas.java index 77c8ef3c4..94d00fcf0 100644 --- a/engine/src/lwjgl-ogl/com/jme3/system/lwjgl/LwjglCanvas.java +++ b/engine/src/lwjgl-ogl/com/jme3/system/lwjgl/LwjglCanvas.java @@ -227,12 +227,14 @@ public class LwjglCanvas extends LwjglAbstractDisplay implements JmeCanvasContex } } - renderer.resetGLObjects(); logger.log(Level.INFO, "OGL: Creating display.."); // Set renderable to true, since canvas is now displayable. renderable.set(true); createContext(settings); + + // must call after createContext, as renderer might be null + renderer.resetGLObjects(); logger.log(Level.INFO, "OGL: Waiting for display to become active.."); while (!Display.isCreated()){