diff --git a/src/java/org/lwjgl/opengl/AWTGLCanvas.java b/src/java/org/lwjgl/opengl/AWTGLCanvas.java index c762ccd8..a1dfadab 100644 --- a/src/java/org/lwjgl/opengl/AWTGLCanvas.java +++ b/src/java/org/lwjgl/opengl/AWTGLCanvas.java @@ -228,6 +228,14 @@ public class AWTGLCanvas extends Canvas implements Drawable, ComponentListener, } } + /** + * Override this to do initialising of the context. + * It will be called once from paint(), immediately after + * the context is created. + */ + protected void initGL() { + } + /** * Override this to do painting */ @@ -246,6 +254,8 @@ public class AWTGLCanvas extends Canvas implements Drawable, ComponentListener, try { if (context == null) { this.context = new Context(peer_info, drawable != null ? drawable.getContext() : null); + context.makeCurrent(); + initGL(); } if (!context.isCurrent()) context.makeCurrent();