aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/sun/opengl/impl/macosx/cgl
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/com/sun/opengl/impl/macosx/cgl')
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java4
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java15
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java10
3 files changed, 25 insertions, 4 deletions
diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java
index 662c2ba78..b417668da 100644
--- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java
+++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java
@@ -82,9 +82,7 @@ public abstract class MacOSXCGLDrawable extends GLDrawableImpl {
super(factory, comp, realized);
}
- public void setRealized(boolean realized) {
- super.setRealized(realized);
-
+ protected void setRealizedImpl() {
if(realized) {
if( NativeWindow.LOCK_SURFACE_NOT_READY == lockSurface() ) {
throw new GLException("Couldn't lock surface");
diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java
index f8c15b7f2..be18ee2da 100644
--- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java
+++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java
@@ -77,7 +77,20 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl implements D
return true;
}
- protected GLDrawableImpl createGLPbufferDrawableImpl(NativeWindow target) {
+ protected GLDrawableImpl createGLPbufferDrawableImpl(final NativeWindow target) {
+ /**
+ * FIXME: Think about this ..
+ * should not be necessary ? ..
+ final List returnList = new ArrayList();
+ final GLDrawableFactory factory = this;
+ Runnable r = new Runnable() {
+ public void run() {
+ returnList.add(new MacOSXPbufferCGLDrawable(factory, target));
+ }
+ };
+ maybeDoSingleThreadedWorkaround(r);
+ return (GLDrawableImpl) returnList.get(0);
+ */
return new MacOSXPbufferCGLDrawable(this, target);
}
diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java
index c90e5d6bd..f57952b7c 100644
--- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java
+++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java
@@ -71,14 +71,24 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
}
}
+ protected void setRealizedImpl() {
+ if(realized) {
+ createPbuffer();
+ } else {
+ destroy();
+ }
+ }
+
public GLContext createContext(GLContext shareWith) {
return new MacOSXPbufferCGLContext(this, shareWith);
}
public void destroy() {
if (this.pBuffer != 0) {
+ NativeWindow nw = getNativeWindow();
impl.destroy(pBuffer);
this.pBuffer = 0;
+ ((SurfaceChangeable)nw).setSurfaceHandle(0);
if (DEBUG) {
System.err.println("Destroyed pbuffer: " + pBuffer);
}