aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/games/jogl/GLCanvas.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/java/games/jogl/GLCanvas.java')
-rw-r--r--src/net/java/games/jogl/GLCanvas.java19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/net/java/games/jogl/GLCanvas.java b/src/net/java/games/jogl/GLCanvas.java
index adee0315d..474dd238d 100644
--- a/src/net/java/games/jogl/GLCanvas.java
+++ b/src/net/java/games/jogl/GLCanvas.java
@@ -65,14 +65,21 @@ public final class GLCanvas extends Canvas implements GLDrawable {
// This workaround makes things quite a bit slower
private static final boolean isOSX = System.getProperty("os.name").equals("Mac OS X");
- GLCanvas(GLCapabilities capabilities, GLCapabilitiesChooser chooser) {
+ GLCanvas(GLCapabilities capabilities,
+ GLCapabilitiesChooser chooser,
+ GLDrawable shareWith) {
super();
- context = GLContextFactory.getFactory().createGLContext(this, capabilities, chooser);
+ context = GLContextFactory.getFactory().createGLContext(this, capabilities, chooser,
+ GLContextHelper.getContext(shareWith));
}
- GLCanvas(GraphicsConfiguration config, GLCapabilities capabilities, GLCapabilitiesChooser chooser) {
+ GLCanvas(GraphicsConfiguration config,
+ GLCapabilities capabilities,
+ GLCapabilitiesChooser chooser,
+ GLDrawable shareWith) {
super(config);
- context = GLContextFactory.getFactory().createGLContext(this, capabilities, chooser);
+ context = GLContextFactory.getFactory().createGLContext(this, capabilities, chooser,
+ GLContextHelper.getContext(shareWith));
}
public void display() {
@@ -171,6 +178,10 @@ public final class GLCanvas extends Canvas implements GLDrawable {
return new GLPbufferImpl(context.createPbufferContext(capabilities, initialWidth, initialHeight));
}
+ GLContext getContext() {
+ return context;
+ }
+
//----------------------------------------------------------------------
// Internals only below this point
//