getChosenGLCapabilities may return null before GLListener init.

Store capabilities at a safe location inside PGLListener init.

Signed-off-by: Xerxes Rånby <xerxes@zafena.se>
This commit is contained in:
Xerxes Rånby
2013-03-30 21:52:02 +01:00
parent 0a66cf6299
commit 93e5e8da2d

View File

@@ -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);