diff options
author | Sven Gothel <[email protected]> | 2009-10-04 13:20:53 -0700 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2009-10-04 13:20:53 -0700 |
commit | 012460d1fdef767afdc454fb09ba50f056d26e20 (patch) | |
tree | 029523ba595bfda18934337c7dd2776b79fe36f5 | |
parent | 5cd7e4fab47996eddf1a2798215fb975fe32b4bf (diff) |
Fix Config: Set doublebuffer:=false if offscreen; NEWT: Fix KDWindow.
7 files changed, 13 insertions, 1 deletions
diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java index 757a2bcf9..90aecdabc 100755 --- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java +++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java @@ -72,6 +72,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { GLCapabilitiesChooser chooser, int width, int height) { + capabilities.setDoubleBuffered(false); // FIXME capabilities.setOnscreen(false); capabilities.setPBuffer(false); throw new GLException("Not yet implemented"); @@ -84,6 +85,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { final GLCapabilitiesChooser chooser, final int initialWidth, final int initialHeight) { + capabilities.setDoubleBuffered(false); // FIXME capabilities.setOnscreen(false); capabilities.setPBuffer(true); return new EGLPbufferDrawable(this, capabilities, chooser, diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLGraphicsConfiguration.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLGraphicsConfiguration.java index 9d337a207..e98d97659 100644 --- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLGraphicsConfiguration.java +++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLGraphicsConfiguration.java @@ -164,14 +164,17 @@ public class EGLGraphicsConfiguration extends DefaultGraphicsConfiguration imple if(EGL.eglGetConfigAttrib(display, _config, EGL.EGL_SURFACE_TYPE, val, 0)) { switch(val[0]) { case EGL.EGL_WINDOW_BIT: + caps.setDoubleBuffered(true); caps.setOnscreen(true); caps.setPBuffer(false); break; case EGL.EGL_PBUFFER_BIT: + caps.setDoubleBuffered(false); caps.setOnscreen(false); caps.setPBuffer(true); break; case EGL.EGL_PIXMAP_BIT: + caps.setDoubleBuffered(false); caps.setOnscreen(false); caps.setPBuffer(false); break; 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 f398ed8a0..ee1ba732d 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 @@ -74,6 +74,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl implements D int width, int height) { AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault(); + capabilities.setDoubleBuffered(false); // FIXME capabilities.setOnscreen(false); capabilities.setPBuffer(false); return new MacOSXOffscreenCGLDrawable(this, aScreen, capabilities, chooser, width, height); @@ -88,6 +89,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl implements D final int initialWidth, final int initialHeight) { AbstractGraphicsScreen screen = DefaultGraphicsScreen.createDefault(); + capabilities.setDoubleBuffered(false); // FIXME capabilities.setOnscreen(false); capabilities.setPBuffer(true); return new MacOSXPbufferCGLDrawable(this, screen, capabilities, chooser, diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java index 8feb36d25..9137e4c7b 100644 --- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java +++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java @@ -83,6 +83,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl implements int width, int height) { AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault(); + capabilities.setDoubleBuffered(false); // FIXME capabilities.setOnscreen(false); capabilities.setPBuffer(false); return new WindowsOffscreenWGLDrawable(this, aScreen, capabilities, chooser, width, height); @@ -130,6 +131,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl implements if (!canCreateGLPbuffer()) { throw new GLException("Pbuffer support not available with current graphics card"); } + capabilities.setDoubleBuffered(false); // FIXME capabilities.setOnscreen(false); capabilities.setPBuffer(true); final GLCapabilities caps = capabilities; diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java index 3fd96e7bc..add5c7b25 100644 --- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java +++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java @@ -60,6 +60,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GraphicsConfiguratio protected static WindowsWGLGraphicsConfiguration createDefaultGraphicsConfiguration(AbstractGraphicsScreen absScreen, boolean onscreen, boolean usePBuffer) { GLCapabilities caps = new GLCapabilities(null); + caps.setDoubleBuffered(onscreen); // FIXME caps.setOnscreen (onscreen); caps.setPBuffer (usePBuffer); diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java index 8ee1efcb7..f278d76d0 100644 --- a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java +++ b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java @@ -77,6 +77,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl implements Dyna int width, int height) { AbstractGraphicsScreen screen = X11GraphicsScreen.createDefault(); + capabilities.setDoubleBuffered(false); // FIXME capabilities.setOnscreen(false); capabilities.setPBuffer(false); return new X11OffscreenGLXDrawable(this, screen, capabilities, chooser, width, height); @@ -124,6 +125,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl implements Dyna throw new GLException("Pbuffer support not available with current graphics card"); } + capabilities.setDoubleBuffered(false); // FIXME capabilities.setOnscreen(false); capabilities.setPBuffer(true); AbstractGraphicsScreen screen = X11GraphicsScreen.createDefault(); diff --git a/src/newt/classes/com/sun/javafx/newt/opengl/kd/KDWindow.java b/src/newt/classes/com/sun/javafx/newt/opengl/kd/KDWindow.java index fd5711b08..605e9c064 100755 --- a/src/newt/classes/com/sun/javafx/newt/opengl/kd/KDWindow.java +++ b/src/newt/classes/com/sun/javafx/newt/opengl/kd/KDWindow.java @@ -63,7 +63,7 @@ public class KDWindow extends Window { } GLCapabilities eglCaps = (GLCapabilities)config.getChosenCapabilities(); - int[] eglAttribs = EGLGraphicsConfiguration.GLCapabilities2AttribList(eglCaps, EGL.EGL_WINDOW_BIT); + int[] eglAttribs = EGLGraphicsConfiguration.GLCapabilities2AttribList(eglCaps); windowHandle = 0; eglWindowHandle = CreateWindow(getDisplayHandle(), eglAttribs); |