summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/macosx
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-12-17 21:41:30 +0100
committerSven Gothel <[email protected]>2011-12-17 21:41:30 +0100
commit47dc069104723f3d2e8d9ebdd700182e067163d0 (patch)
tree538c9abdcf3861b0d4f067633f733c26b882c003 /src/jogl/classes/jogamp/opengl/macosx
parent5ebb4c2704711b4387f263484a5b820edffadf0a (diff)
GLDrawableFactory*.createOffscreenDrawable(): No implicit setRealized(true) @ creation
GLDrawableFactory*.createOffscreenDrawable(): No implicit setRealized(true) @ creation, following deferred creation like onscreen drawables. This allows using offscreen drawables in classes like GLCanvas, where realization is deferred due to pending valid size. Only createGLPBuffer() realizes the offscreen pbuffer drawable immediatly to reduce the impact on user-code. GLDrawableFactoryImpl.createGLDrawable(): - Simplify OffscreenLayerSurface validation and check it first regardless of the chosenCaps to get a chance to use pbuffer.
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/macosx')
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java3
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOffscreenCGLDrawable.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java6
3 files changed, 4 insertions, 7 deletions
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java
index ed53a9ee5..1e55879f7 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java
@@ -215,6 +215,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
caps.setPBuffer(true);
final MacOSXCGLDrawable drawable = (MacOSXCGLDrawable) createGLDrawable( createOffscreenSurfaceImpl(sharedDevice, caps, caps, null, 64, 64) );
if(null!=drawable) {
+ drawable.setRealized(true);
final GLContext context = drawable.createContext(null);
if (null != context) {
context.setSynchronized(true);
@@ -302,7 +303,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
if(!caps.isPBuffer()) {
return new MacOSXOffscreenCGLDrawable(this, target);
}
- return new MacOSXPbufferCGLDrawable(this, target, true);
+ return new MacOSXPbufferCGLDrawable(this, target);
}
public boolean canCreateGLPbuffer(AbstractGraphicsDevice device) {
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOffscreenCGLDrawable.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOffscreenCGLDrawable.java
index ae3fa1428..f81cd725e 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOffscreenCGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOffscreenCGLDrawable.java
@@ -48,7 +48,7 @@ public class MacOSXOffscreenCGLDrawable extends MacOSXPbufferCGLDrawable {
public MacOSXOffscreenCGLDrawable(GLDrawableFactory factory,
NativeSurface target) {
- super(factory, target, true);
+ super(factory, target);
}
public GLContext createContext(GLContext shareWith) {
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java
index 5463c67bf..e02c3efec 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java
@@ -74,12 +74,8 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
protected long pBuffer;
protected int pBufferTexTarget, pBufferTexWidth, pBufferTexHeight;
- public MacOSXPbufferCGLDrawable(GLDrawableFactory factory, NativeSurface target, boolean realizeNow) {
+ public MacOSXPbufferCGLDrawable(GLDrawableFactory factory, NativeSurface target) {
super(factory, target, false);
-
- if(realizeNow) {
- setRealized(true);
- }
}
protected void destroyImpl() {