mirror of
https://github.com/processing/processing4.git
synced 2026-02-15 11:25:38 +01:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user