aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2009-10-03 01:18:34 -0700
committerSven Gothel <[email protected]>2009-10-03 01:18:34 -0700
commitcf4c403733363a0e0e06079d85ddae91399696ab (patch)
treefc32b0cef12f1472130ab7ed6e571c2d2df28c7a /src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java
parent1304fcd939bea7ea804d2fef22a942848b02a20b (diff)
Offscreen/PBuffer capabilities cleanup ; Generic read drawable support
Diffstat (limited to 'src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java')
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java33
1 files changed, 31 insertions, 2 deletions
diff --git a/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java b/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java
index 16eb934bd..343ca7efe 100644
--- a/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java
+++ b/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java
@@ -73,9 +73,12 @@ public abstract class GLContextImpl extends GLContext {
// repeated glGet calls upon glMapBuffer operations
private GLBufferSizeTracker bufferSizeTracker;
+ protected GLDrawableImpl drawable;
+ protected GLDrawableImpl drawableRead;
+
protected GL gl;
- public GLContextImpl(GLProfile glp, GLContext shareWith) {
+ public GLContextImpl(GLDrawableImpl drawable, GLDrawableImpl drawableRead, GLContext shareWith) {
extensionAvailability = new ExtensionAvailabilityCache(this);
if (shareWith != null) {
GLContextShareSet.registerSharing(this, shareWith);
@@ -83,7 +86,33 @@ public abstract class GLContextImpl extends GLContext {
GLContextShareSet.registerForBufferObjectSharing(shareWith, this);
// This must occur after the above calls into the
// GLContextShareSet, which set up state needed by the GL object
- setGL(createGL(glp));
+ setGL(createGL(drawable.getGLProfile()));
+
+ this.drawable = drawable;
+ setGLDrawableRead(drawableRead);
+ }
+
+ public GLContextImpl(GLDrawableImpl drawable, GLContext shareWith) {
+ this(drawable, null, shareWith);
+ }
+
+ public void setGLDrawableRead(GLDrawable read) {
+ boolean lockHeld = lock.isHeld();
+ if(lockHeld) {
+ release();
+ }
+ drawableRead = ( null != read ) ? (GLDrawableImpl) read : drawable;
+ if(lockHeld) {
+ makeCurrent();
+ }
+ }
+
+ public GLDrawable getGLDrawable() {
+ return drawable;
+ }
+
+ public GLDrawable getGLDrawableRead() {
+ return drawableRead;
}
public GLDrawableImpl getDrawableImpl() {