com.sun.opengl.impl
Class GLContextShareSet

java.lang.Object
  extended by com.sun.opengl.impl.GLContextShareSet

public class GLContextShareSet
extends java.lang.Object

Provides a mechanism by which OpenGL contexts can share textures and display lists in the face of multithreading and asynchronous context creation as is inherent in the AWT and Swing.


Constructor Summary
GLContextShareSet()
           
 
Method Summary
static void contextCreated(GLContext context)
           
static void contextDestroyed(GLContext context)
           
static GLContext getShareContext(GLContext contextToCreate)
           
static void registerForBufferObjectSharing(GLContext olderContextOrNull, GLContext newContext)
          In order to avoid glGet calls for buffer object checks related to glVertexPointer, etc.
static void registerForObjectTracking(GLContext olderContextOrNull, GLContext newContext, GLContext realShareContext)
          Indicates that the two supplied contexts (which must be able to share textures and display lists) should be in the same namespace for tracking of server-side object creation and deletion.
static void registerSharing(GLContext share1, GLContext share2)
          Indicate that contexts share1 and share2 will share textures and display lists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GLContextShareSet

public GLContextShareSet()
Method Detail

registerSharing

public static void registerSharing(GLContext share1,
                                   GLContext share2)
Indicate that contexts share1 and share2 will share textures and display lists. Both must be non-null.


getShareContext

public static GLContext getShareContext(GLContext contextToCreate)

contextCreated

public static void contextCreated(GLContext context)

contextDestroyed

public static void contextDestroyed(GLContext context)

registerForObjectTracking

public static void registerForObjectTracking(GLContext olderContextOrNull,
                                             GLContext newContext,
                                             GLContext realShareContext)
Indicates that the two supplied contexts (which must be able to share textures and display lists) should be in the same namespace for tracking of server-side object creation and deletion. Because the sharing necessary behind the scenes is different than that requested at the user level, the two notions are different. This must be called immediately after the creation of the new context (which is the second argument) before any server-side OpenGL objects have been created in that context.


registerForBufferObjectSharing

public static void registerForBufferObjectSharing(GLContext olderContextOrNull,
                                                  GLContext newContext)
In order to avoid glGet calls for buffer object checks related to glVertexPointer, etc. calls as well as glMapBuffer calls, we need to share the same GLBufferSizeTracker object between contexts sharing textures and display lists. For now we keep this mechanism orthogonal to the GLObjectTracker to hopefully keep things easier to understand. (The GLObjectTracker is currently only needed in a fairly esoteric case, when the Java2D/JOGL bridge is active, but the GLBufferSizeTracker mechanism is now always required.)



Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.