From a8aabe008e0b3bb39bdd9414dc999cc3f6a01687 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 28 Dec 2005 22:23:35 +0000 Subject: [PATCH] Added initGL to AWTGLCanvas --- src/java/org/lwjgl/opengl/AWTGLCanvas.java | 10 ++++++++++ 1 file changed, 10 insertions(+) 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();