aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/sun/opengl/impl/macosx
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2009-10-02 15:32:02 -0700
committerSven Gothel <[email protected]>2009-10-02 15:32:02 -0700
commit8fb68690f20eece763561f6f0038a007e934a1dc (patch)
tree96aeac10e4bb9215b06855295aeccd67626176bd /src/jogl/classes/com/sun/opengl/impl/macosx
parent52c3caf07ad07fcb029ea584d7e5f4c5031f84c2 (diff)
Proper PBuffer drawable abstraction
Diffstat (limited to 'src/jogl/classes/com/sun/opengl/impl/macosx')
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java34
1 files changed, 11 insertions, 23 deletions
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 024b69629..2aefa7b5b 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
@@ -81,25 +81,22 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl implements D
return true;
}
+ public GLDrawableImpl createGLPbufferDrawable(GLCapabilities capabilities,
+ final GLCapabilitiesChooser chooser,
+ final int initialWidth,
+ final int initialHeight) {
+ AbstractGraphicsScreen screen = DefaultGraphicsScreen.createDefault();
+ return new MacOSXPbufferCGLDrawable(this, screen, capabilities, chooser,
+ initialWidth, initialHeight);
+ }
+
public GLPbuffer createGLPbuffer(final GLCapabilities capabilities,
final GLCapabilitiesChooser chooser,
final int initialWidth,
final int initialHeight,
final GLContext shareWith) {
- final List returnList = new ArrayList();
- final GLDrawableFactory factory = this;
- Runnable r = new Runnable() {
- public void run() {
- AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault();
- MacOSXPbufferCGLDrawable pbufferDrawable = new MacOSXPbufferCGLDrawable(factory, aScreen, capabilities, chooser,
- initialWidth,
- initialHeight);
- GLPbufferImpl pbuffer = new GLPbufferImpl(pbufferDrawable, shareWith);
- returnList.add(pbuffer);
- }
- };
- maybeDoSingleThreadedWorkaround(r);
- return (GLPbuffer) returnList.get(0);
+ GLDrawableImpl drawable = createGLPbufferDrawable( capabilities, chooser, initialWidth, initialHeight);
+ return new GLPbufferImpl(drawable, shareWith);
}
public GLContext createExternalGLContext() {
@@ -124,15 +121,6 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl implements D
return CGL.getProcAddress(glFuncName);
}
- private void maybeDoSingleThreadedWorkaround(Runnable action) {
- if (Threading.isSingleThreaded() &&
- !Threading.isOpenGLThread()) {
- Threading.invokeOnOpenGLThread(action);
- } else {
- action.run();
- }
- }
-
public boolean canCreateContextOnJava2DSurface() {
return false;
}