aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/games/jogl/GLCanvas.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2003-07-08 09:20:04 +0000
committerKenneth Russel <[email protected]>2003-07-08 09:20:04 +0000
commit4f936be964c9e8613a5e43e1d88490ff7f550ec9 (patch)
tree74a2c01c6093d89ac123d08642b11a2007cc99e2 /src/net/java/games/jogl/GLCanvas.java
parent93d272a0525ec57aa3cd584f15cde6cf2a637e0c (diff)
Added sharing of display lists and textures among OpenGL contexts
through new methods in GLDrawableFactory; GLContext has not been exposed in the public API. Tested with new simple TestContextSharing demonstration on Windows, Linux and Mac OS X. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@18 232f8b59-042b-4e1e-8c03-345bb8c30851
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
//