aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/opengl/impl/GLContextShareSet.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2008-07-11 10:57:14 +0000
committerSven Gothel <[email protected]>2008-07-11 10:57:14 +0000
commitb02975d74ba8410dffaccc18f2279c1e165972df (patch)
tree27ce9e90da732cb428d34199dd49244f6c172b7a /src/classes/com/sun/opengl/impl/GLContextShareSet.java
parentb92e5acb2b4db1bf6873bea74bda64d63afd6fee (diff)
Fixed:
- NEWT: - X11: Fullscreen toggle: (un)decorated window and resize event - CloseNative: Use copied display/window handle to close after invalidate - Cleanup/validations - GLDrawableHelper: Removed 'optimization' path - no sense and too complicated - GL, GLContextImpl, GLContextShareSet: - Activated: registerForBufferObjectSharing - Working BufferSizeTracker - GLBufferStateTracker: Activated: PBO state for GL2 - GL2/GLES1/GLES2: Activated VBO/PBO validation code git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1720 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/opengl/impl/GLContextShareSet.java')
-rw-r--r--src/classes/com/sun/opengl/impl/GLContextShareSet.java54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/classes/com/sun/opengl/impl/GLContextShareSet.java b/src/classes/com/sun/opengl/impl/GLContextShareSet.java
index a3614633d..d02b8c8a6 100644
--- a/src/classes/com/sun/opengl/impl/GLContextShareSet.java
+++ b/src/classes/com/sun/opengl/impl/GLContextShareSet.java
@@ -150,6 +150,31 @@ public class GLContextShareSet {
}
}
+ /** 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.) */
+ public static void registerForBufferObjectSharing(GLContext olderContextOrNull, GLContext newContext) {
+ // FIXME: downcasts to GLContextImpl undesirable
+ GLContextImpl older = (GLContextImpl) olderContextOrNull;
+ GLContextImpl newer = (GLContextImpl) newContext;
+ GLBufferSizeTracker tracker = null;
+ if (older != null) {
+ tracker = older.getBufferSizeTracker();
+ assert (tracker != null)
+ : "registerForBufferObjectSharing was not called properly for the older context, or has a bug in it";
+ }
+ if (tracker == null) {
+ tracker = new GLBufferSizeTracker();
+ }
+ newer.setBufferSizeTracker(tracker);
+ }
+
// FIXME: refactor Java SE dependencies
// /** Indicates that the two supplied contexts (which must be able to
// share textures and display lists) should be in the same
@@ -242,35 +267,10 @@ public class GLContextShareSet {
// }
// }
// }
- //
- // /** 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.) */
- // public static void registerForBufferObjectSharing(GLContext olderContextOrNull, GLContext newContext) {
- // // FIXME: downcasts to GLContextImpl undesirable
- // GLContextImpl older = (GLContextImpl) olderContextOrNull;
- // GLContextImpl newer = (GLContextImpl) newContext;
- // GLBufferSizeTracker tracker = null;
- // if (older != null) {
- // tracker = older.getBufferSizeTracker();
- // assert (tracker != null)
- // : "registerForBufferObjectSharing was not called properly for the older context, or has a bug in it";
- // }
- // if (tracker == null) {
- // tracker = new GLBufferSizeTracker();
- // }
- // newer.setBufferSizeTracker(tracker);
- // }
-
+
//----------------------------------------------------------------------
// Internals only below this point
- //
+
private static ShareSet entryFor(GLContext context) {
return (ShareSet) shareMap.get(context);