aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/games/jogl/impl/GLContext.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/impl/GLContext.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/impl/GLContext.java')
-rw-r--r--src/net/java/games/jogl/impl/GLContext.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/net/java/games/jogl/impl/GLContext.java b/src/net/java/games/jogl/impl/GLContext.java
index eb7d21988..db8842b39 100644
--- a/src/net/java/games/jogl/impl/GLContext.java
+++ b/src/net/java/games/jogl/impl/GLContext.java
@@ -113,7 +113,10 @@ public abstract class GLContext {
// moment in time
protected FunctionAvailabilityCache functionAvailability;
- public GLContext(Component component, GLCapabilities capabilities, GLCapabilitiesChooser chooser) {
+ public GLContext(Component component,
+ GLCapabilities capabilities,
+ GLCapabilitiesChooser chooser,
+ GLContext shareWith) {
this.component = component;
try {
this.capabilities = (GLCapabilities) capabilities.clone();
@@ -123,6 +126,9 @@ public abstract class GLContext {
this.chooser = chooser;
gl = createGL();
functionAvailability = new FunctionAvailabilityCache(this);
+ if (shareWith != null) {
+ GLContextShareSet.registerSharing(this, shareWith);
+ }
}
/** Runs the given runnable with this OpenGL context valid. */
@@ -434,7 +440,12 @@ public abstract class GLContext {
/** Dynamically looks up the given function. */
protected abstract long dynamicLookupFunction(String glFuncName);
-
+
+ /** Indicates whether the underlying OpenGL context has been
+ created. This is used to manage sharing of display lists and
+ textures between contexts. */
+ public abstract boolean isCreated();
+
//----------------------------------------------------------------------
// Internals only below this point
//