diff options
author | Sven Gothel <[email protected]> | 2010-10-14 21:26:43 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-10-14 21:26:43 +0200 |
commit | 774138544e1eec3330309ad682fa05154a07ab8d (patch) | |
tree | a9d612e98f1d16390763f54ab1888ff66f081a22 /src/jogl/classes/com/jogamp/opengl/impl/x11/glx | |
parent | d7faeb8b96f5aba76967096006af4c420d964fef (diff) |
JOGL: Reenable Applet/Webstart/RCP support for JOGL + AWT + X11
Changed GLProfile/NativeWindowFactory/.. initialization methodology:
GLProfile:
public static synchronized void initSingleton(final boolean firstUIActionOnProcess);
NativeWindowFactory:
public static synchronized void initSingleton(final boolean firstUIActionOnProcess);
+++
Introducing NativeWindow ToolkitLock, implementations are
NullToolkitLock
JAWTToolkitLock
X11JAWTToolkitLock
X11ToolkitLock
AbstractGraphicsDevice provides generic global toolkit locking methods,
implemented by the ToolkitLock interface.
ToolkitLock's are aggregated in NativeWindow's DefaultGraphicsDevice
to implement it's superclass lock()/unlock() methods.
This enables a device specific locking strategy, ie on X11/AWT utilizing
JAWT && X11 locking, and maybe none for others (NEWT).
No locking is required for X11 / AWT, in case the above mentioned
initialization happened as a 'firstUIActionOnProcess'.
The ToolkitLock factory is currently a hardcoded part of NativeWindowFactory.
We may have to allow 3rd party NativeWindow implementations
to register custom ones.
+++
com.jogamp.opengl.impl.GLDrawableImpl cleanup:
Dealing with all locking code, providing all public methods. Exceptions are commented.
Specializations x11/windows/.. only contains platform code.
Pulled down access qualifiers if possible public -> protected.
com.jogamp.nativewindow.impl.x11.X11Util
Wrapping all X11Lib method with the new locking code.
com.jogamp.nativewindow.impl.jawt.JAWTUtil
Utilize global SunToolkit.awtLock() is available,
the fallback to global JAWT.lock().
The latter just invokes the first.
javax.media.nativewindow.awt.AWTGraphicsDevice
setHandle(long handle) -> setSubType(String type, long handle)
which also resets the ToolkitLock respecting the new type.
This ensures correct locking after the sub type has been determined,
ie AWT using an X11 peer.
+++
Misc Changes done on the way ..
GLCanvas:
Fixed inversed this.drawableHelper.isExternalAnimatorAnimating() condition,
which disabled normal repaint.
GLJPanel:
Removed drawableHelper.isExternalAnimatorAnimating() condition,
which disabled painting, since the animation thread just updates the source image.
NEWT WindowImpl:
When reparenting back to parent and 'refit' child if it's size exceeds it's parent.
More 'Fix: Memory consumption' commit 6ced17f0325d5719e992b246ffd156e5b39694b4.
NEWTEvent:
Removed code to evaluate the 'system event' attribute, need to find a better approach.
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/impl/x11/glx')
8 files changed, 97 insertions, 84 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11DummyGLXDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11DummyGLXDrawable.java index 690bc4b52..e77735637 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11DummyGLXDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11DummyGLXDrawable.java @@ -57,7 +57,7 @@ public class X11DummyGLXDrawable extends X11OnscreenGLXDrawable { int scrn = screen.getIndex(); long visualID = config.getVisualID(); - dummyWindow = X11Lib.CreateDummyWindow(dpy, scrn, visualID); + dummyWindow = X11Util.CreateDummyWindow(dpy, scrn, visualID); ns.setSurfaceHandle( dummyWindow ); updateHandle(); @@ -74,11 +74,11 @@ public class X11DummyGLXDrawable extends X11OnscreenGLXDrawable { return 1; } - public void destroy() { + protected void destroyImpl() { if(0!=dummyWindow) { destroyHandle(); X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration(); - X11Lib.DestroyDummyWindow(config.getScreen().getDevice().getHandle(), dummyWindow); + X11Util.DestroyDummyWindow(config.getScreen().getDevice().getHandle(), dummyWindow); } } } diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java index 494860c5b..21de61ff8 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java @@ -119,7 +119,7 @@ public abstract class X11GLXContext extends GLContextImpl { } } catch (RuntimeException re) { if(DEBUG) { - System.err.println("X11GLXContext.glXMakeContextCurrent failed: "+re+", with "+ + System.err.println("Warning: X11GLXContext.glXMakeContextCurrent failed: "+re+", with "+ "dpy "+toHexString(dpy)+ ", write "+toHexString(writeDrawable)+ ", read "+toHexString(readDrawable)+ @@ -191,7 +191,7 @@ public abstract class X11GLXContext extends GLContextImpl { ctx = glXExt.glXCreateContextAttribsARB(display, config.getFBConfig(), share, direct, attribs, 0); } catch (RuntimeException re) { if(DEBUG) { - System.err.println("X11GLXContext.createContextARB glXCreateContextAttribsARB failed: "+re+", with "+getGLVersion(major, minor, ctp, "@creation")); + System.err.println("Warning: X11GLXContext.createContextARB glXCreateContextAttribsARB failed: "+re+", with "+getGLVersion(major, minor, ctp, "@creation")); re.printStackTrace(); } } @@ -335,7 +335,7 @@ public abstract class X11GLXContext extends GLContextImpl { if (!glXMakeContextCurrent(dpy, drawable.getHandle(), drawableRead.getHandle(), contextHandle)) { throw new GLException("Error making context current: "+this); } - if (DEBUG && (VERBOSE || isCreated())) { + if (DEBUG && (VERBOSE || newCreated)) { System.err.println(getThreadName() + ": glXMakeCurrent(display " + toHexString(dpy)+ ", drawable " + toHexString(drawable.getHandle()) + diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawableFactory.java index 4b84227c3..adf4d8e0d 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawableFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawableFactory.java @@ -53,8 +53,6 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { private static final DesktopGLDynamicLookupHelper x11GLXDynamicLookupHelper; static { - X11Util.initSingleton(); // ensure it's loaded and setup - DesktopGLDynamicLookupHelper tmp = null; try { tmp = new DesktopGLDynamicLookupHelper(new X11GLXDynamicLibraryBundleInfo()); @@ -80,35 +78,45 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { new X11GLXGraphicsConfigurationFactory(); try { ReflectionUtil.createInstance("com.jogamp.opengl.impl.x11.glx.awt.X11AWTGLXGraphicsConfigurationFactory", - new Object[] {}, getClass().getClassLoader()); + null, getClass().getClassLoader()); } catch (JogampRuntimeException jre) { /* n/a .. */ } // init shared resources .. - long tlsDisplay = X11Util.createThreadLocalDisplay(null); - X11GraphicsDevice sharedDevice = new X11GraphicsDevice(tlsDisplay); - vendorName = GLXUtil.getVendorName(sharedDevice.getHandle()); - isVendorATI = GLXUtil.isVendorATI(vendorName); - isVendorNVIDIA = GLXUtil.isVendorNVIDIA(vendorName); - sharedScreen = new X11GraphicsScreen(sharedDevice, 0); - sharedDrawable = new X11DummyGLXDrawable(sharedScreen, X11GLXDrawableFactory.this, GLProfile.getDefault()); - if(isVendorATI() && GLProfile.isAWTAvailable()) { - X11Util.markThreadLocalDisplayUncloseable(tlsDisplay); // failure to close with ATI and AWT usage - } - if(null==sharedScreen || null==sharedDrawable) { - throw new GLException("Couldn't init shared screen("+sharedScreen+")/drawable("+sharedDrawable+")"); - } - // We have to keep this within this thread, - // since we have a 'chicken-and-egg' problem otherwise on the <init> lock of this thread. - try{ - X11GLXContext ctx = (X11GLXContext) sharedDrawable.createContext(null); - ctx.makeCurrent(); - ctx.release(); - sharedContext = ctx; - } catch (Throwable t) { - throw new GLException("X11GLXDrawableFactory - Could not initialize shared resources", t); - } - if(null==sharedContext) { - throw new GLException("X11GLXDrawableFactory - Shared Context is null"); + NativeWindowFactory.getDefaultToolkitLock().lock(); // OK + try { + long tlsDisplay = X11Util.createThreadLocalDisplay(null); + X11Util.XLockDisplay(tlsDisplay); + try { + X11GraphicsDevice sharedDevice = new X11GraphicsDevice(tlsDisplay); + vendorName = GLXUtil.getVendorName(sharedDevice.getHandle()); + isVendorATI = GLXUtil.isVendorATI(vendorName); + isVendorNVIDIA = GLXUtil.isVendorNVIDIA(vendorName); + sharedScreen = new X11GraphicsScreen(sharedDevice, 0); + sharedDrawable = new X11DummyGLXDrawable(sharedScreen, X11GLXDrawableFactory.this, GLProfile.getDefault()); + if(isVendorATI() && GLProfile.isAWTAvailable()) { + X11Util.markThreadLocalDisplayUncloseable(tlsDisplay); // failure to close with ATI and AWT usage + } + if(null==sharedScreen || null==sharedDrawable) { + throw new GLException("Couldn't init shared screen("+sharedScreen+")/drawable("+sharedDrawable+")"); + } + // We have to keep this within this thread, + // since we have a 'chicken-and-egg' problem otherwise on the <init> lock of this thread. + try{ + X11GLXContext ctx = (X11GLXContext) sharedDrawable.createContext(null); + ctx.makeCurrent(); + ctx.release(); + sharedContext = ctx; + } catch (Throwable t) { + throw new GLException("X11GLXDrawableFactory - Could not initialize shared resources", t); + } + if(null==sharedContext) { + throw new GLException("X11GLXDrawableFactory - Shared Context is null"); + } + } finally { + X11Util.XUnlockDisplay(tlsDisplay); + } + } finally { + NativeWindowFactory.getDefaultToolkitLock().unlock(); // OK } if (DEBUG) { System.err.println("!!! Vendor: "+vendorName+", ATI: "+isVendorATI+", NV: "+isVendorNVIDIA); @@ -122,9 +130,9 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { private boolean isVendorATI; private boolean isVendorNVIDIA; - public String getVendorName() { return vendorName; } - public boolean isVendorATI() { return isVendorATI; } - public boolean isVendorNVIDIA() { return isVendorNVIDIA; } + protected String getVendorName() { return vendorName; } + protected boolean isVendorATI() { return isVendorATI; } + protected boolean isVendorNVIDIA() { return isVendorNVIDIA; } private X11DummyGLXDrawable sharedDrawable=null; private X11GLXContext sharedContext=null; @@ -165,14 +173,14 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { X11Util.shutdown( false, DEBUG ); } - public GLDrawableImpl createOnscreenDrawable(NativeSurface target) { + protected GLDrawableImpl createOnscreenDrawableImpl(NativeSurface target) { if (target == null) { throw new IllegalArgumentException("Null target"); } return new X11OnscreenGLXDrawable(this, target); } - protected GLDrawableImpl createOffscreenDrawable(NativeSurface target) { + protected GLDrawableImpl createOffscreenDrawableImpl(NativeSurface target) { if (target == null) { throw new IllegalArgumentException("Null target"); } @@ -185,7 +193,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { private boolean glxVersionsQueried = false; private int glxVersionMajor=0, glxVersionMinor=0; - public boolean glxVersionGreaterEqualThan(AbstractGraphicsDevice device, int majorReq, int minorReq) { + protected final boolean glxVersionGreaterEqualThan(AbstractGraphicsDevice device, int majorReq, int minorReq) { if (!glxVersionsQueried) { if(null == device) { device = (X11GraphicsDevice) sharedScreen.getDevice(); @@ -193,19 +201,24 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { if(null == device) { throw new GLException("FIXME: No AbstractGraphicsDevice (passed or shared-device"); } - long display = device.getHandle(); - int[] major = new int[1]; - int[] minor = new int[1]; - - GLXUtil.getGLXVersion(display, major, minor); - if (DEBUG) { - System.err.println("!!! GLX version: major " + major[0] + - ", minor " + minor[0]); - } + device.lock(); // OK + try { + long display = device.getHandle(); + int[] major = new int[1]; + int[] minor = new int[1]; + + GLXUtil.getGLXVersion(display, major, minor); + if (DEBUG) { + System.err.println("!!! GLX version: major " + major[0] + + ", minor " + minor[0]); + } - glxVersionMajor = major[0]; - glxVersionMinor = minor[0]; - glxVersionsQueried = true; + glxVersionMajor = major[0]; + glxVersionMinor = minor[0]; + glxVersionsQueried = true; + } finally { + device.unlock(); // OK + } } return ( glxVersionMajor > majorReq ) || ( glxVersionMajor == majorReq && glxVersionMinor >= minorReq ) ; } @@ -239,7 +252,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { } - protected NativeSurface createOffscreenSurface(GLCapabilities capabilities, GLCapabilitiesChooser chooser, int width, int height) { + protected NativeSurface createOffscreenSurfaceImpl(GLCapabilities capabilities, GLCapabilitiesChooser chooser, int width, int height) { ProxySurface ns = new ProxySurface(X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capabilities, chooser, sharedScreen)); if(ns != null) { ns.setSize(width, height); @@ -247,7 +260,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { return ns; } - public GLContext createExternalGLContext() { + protected GLContext createExternalGLContextImpl() { return X11ExternalGLXContext.create(this, null); } @@ -255,7 +268,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { return canCreateGLPbuffer(device); } - public GLDrawable createExternalGLDrawable() { + protected GLDrawable createExternalGLDrawableImpl() { return X11ExternalGLXDrawable.create(this, null); } @@ -282,9 +295,9 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { long display = sharedScreen.getDevice().getHandle(); int[] size = new int[1]; - boolean res = X11Lib.XF86VidModeGetGammaRampSize(display, - X11Lib.DefaultScreen(display), - size, 0); + boolean res = X11Util.XF86VidModeGetGammaRampSize(display, + X11Util.DefaultScreen(display), + size, 0); if (!res) { return 0; } @@ -301,8 +314,8 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { } long display = sharedScreen.getDevice().getHandle(); - boolean res = X11Lib.XF86VidModeSetGammaRamp(display, - X11Lib.DefaultScreen(display), + boolean res = X11Util.XF86VidModeSetGammaRamp(display, + X11Util.DefaultScreen(display), rampData.length, rampData, 0, rampData, 0, @@ -323,8 +336,8 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { rampData.limit(3 * size); ShortBuffer blueRampData = rampData.slice(); long display = sharedScreen.getDevice().getHandle(); - boolean res = X11Lib.XF86VidModeGetGammaRamp(display, - X11Lib.DefaultScreen(display), + boolean res = X11Util.XF86VidModeGetGammaRamp(display, + X11Util.DefaultScreen(display), size, redRampData, greenRampData, @@ -354,8 +367,8 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { rampData.limit(3 * size); ShortBuffer blueRampData = rampData.slice(); long display = sharedScreen.getDevice().getHandle(); - X11Lib.XF86VidModeSetGammaRamp(display, - X11Lib.DefaultScreen(display), + X11Util.XF86VidModeSetGammaRamp(display, + X11Util.DefaultScreen(display), size, redRampData, greenRampData, diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfiguration.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfiguration.java index 589d7b2db..3df9ee541 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfiguration.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfiguration.java @@ -339,7 +339,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem int[] count = new int[1]; XVisualInfo template = XVisualInfo.create(); template.setVisualid(visualID); - XVisualInfo[] infos = X11Lib.XGetVisualInfo(display, X11Lib.VisualIDMask, template, count, 0); + XVisualInfo[] infos = X11Util.XGetVisualInfo(display, X11Lib.VisualIDMask, template, count, 0); if (infos == null || infos.length == 0) { return null; } diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java index 9884db288..8dbd69dce 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java @@ -53,9 +53,8 @@ public class X11GLXGraphicsConfigurationFactory extends GraphicsConfigurationFac GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.x11.X11GraphicsDevice.class, this); } - public AbstractGraphicsConfiguration chooseGraphicsConfiguration(Capabilities capabilities, - CapabilitiesChooser chooser, - AbstractGraphicsScreen absScreen) { + protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl( + Capabilities capabilities, CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen) { if (!(absScreen instanceof X11GraphicsScreen)) { throw new IllegalArgumentException("Only X11GraphicsScreen are allowed here"); } @@ -95,7 +94,7 @@ public class X11GLXGraphicsConfigurationFactory extends GraphicsConfigurationFac int screen = x11Screen.getIndex(); boolean isMultisampleAvailable = GLXUtil.isMultisampleAvailable(display); - long visID = X11Lib.DefaultVisualID(display, x11Screen.getIndex()); + long visID = X11Util.DefaultVisualID(display, x11Screen.getIndex()); xvis = X11GLXGraphicsConfiguration.XVisualID2XVisualInfo(display, visID); caps = X11GLXGraphicsConfiguration.XVisualInfo2GLCapabilities(glProfile, display, xvis, onscreen, usePBuffer, isMultisampleAvailable); @@ -140,7 +139,8 @@ public class X11GLXGraphicsConfigurationFactory extends GraphicsConfigurationFac caps2.setDoubleBuffered(false); } - X11GLXGraphicsConfiguration res = chooseGraphicsConfigurationFBConfig(caps2, chooser, x11Screen); + X11GLXGraphicsConfiguration res; + res = chooseGraphicsConfigurationFBConfig(caps2, chooser, x11Screen); if(null==res) { if(usePBuffer) { throw new GLException("Error: Couldn't create X11GLXGraphicsConfiguration based on FBConfig for "+caps2); @@ -156,7 +156,7 @@ public class X11GLXGraphicsConfigurationFactory extends GraphicsConfigurationFac return res; } - protected static X11GLXGraphicsConfiguration chooseGraphicsConfigurationFBConfig(GLCapabilities capabilities, + private static X11GLXGraphicsConfiguration chooseGraphicsConfigurationFBConfig(GLCapabilities capabilities, GLCapabilitiesChooser chooser, X11GraphicsScreen x11Screen) { long recommendedFBConfig = 0; @@ -277,7 +277,7 @@ public class X11GLXGraphicsConfigurationFactory extends GraphicsConfigurationFac return new X11GLXGraphicsConfiguration(x11Screen, caps[chosen], capabilities, chooser, retXVisualInfo, fbcfgsL.get(chosen), retFBID); } - protected static X11GLXGraphicsConfiguration chooseGraphicsConfigurationXVisual(GLCapabilities capabilities, + private static X11GLXGraphicsConfiguration chooseGraphicsConfigurationXVisual(GLCapabilities capabilities, GLCapabilitiesChooser chooser, X11GraphicsScreen x11Screen) { if (chooser == null) { @@ -315,7 +315,7 @@ public class X11GLXGraphicsConfigurationFactory extends GraphicsConfigurationFac int[] count = new int[1]; XVisualInfo template = XVisualInfo.create(); template.setScreen(screen); - infos = X11Lib.XGetVisualInfo(display, X11Lib.VisualScreenMask, template, count, 0); + infos = X11Util.XGetVisualInfo(display, X11Lib.VisualScreenMask, template, count, 0); if (infos == null || infos.length<1) { throw new GLException("Error while enumerating available XVisualInfos"); } diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java index 3be34eb6a..f46bdbb75 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java @@ -56,7 +56,7 @@ public class X11OffscreenGLXDrawable extends X11GLXDrawable { if(realized) { create(); } else { - destroy(); + destroyImpl(); } } @@ -74,14 +74,14 @@ public class X11OffscreenGLXDrawable extends X11GLXDrawable { long dpy = aDevice.getHandle(); int screen = aScreen.getIndex(); - pixmap = X11Lib.XCreatePixmap(dpy, X11Lib.RootWindow(dpy, screen), + pixmap = X11Util.XCreatePixmap(dpy, X11Util.RootWindow(dpy, screen), surface.getWidth(), surface.getHeight(), bitsPerPixel); if (pixmap == 0) { throw new GLException("XCreatePixmap failed"); } long drawable = GLX.glXCreateGLXPixmap(dpy, vis, pixmap); if (drawable == 0) { - X11Lib.XFreePixmap(dpy, pixmap); + X11Util.XFreePixmap(dpy, pixmap); pixmap = 0; throw new GLException("glXCreateGLXPixmap failed"); } @@ -93,7 +93,7 @@ public class X11OffscreenGLXDrawable extends X11GLXDrawable { } } - public void destroy() { + protected void destroyImpl() { if (pixmap == 0) return; NativeSurface ns = getNativeSurface(); @@ -122,7 +122,7 @@ public class X11OffscreenGLXDrawable extends X11GLXDrawable { GLX.glXMakeCurrent(display, 0, 0); GLX.glXDestroyGLXPixmap(display, drawable); - X11Lib.XFreePixmap(display, pixmap); + X11Util.XFreePixmap(display, pixmap); drawable = 0; pixmap = 0; ((SurfaceChangeable)ns).setSurfaceHandle(0); diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXDrawable.java index ce9e6d75d..b86394cc6 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXDrawable.java @@ -65,7 +65,7 @@ public class X11PbufferGLXDrawable extends X11GLXDrawable { if(realized) { createPbuffer(); } else { - destroy(); + destroyImpl(); } } @@ -73,7 +73,7 @@ public class X11PbufferGLXDrawable extends X11GLXDrawable { return new X11PbufferGLXContext(this, shareWith); } - public void destroy() { + protected void destroyImpl() { NativeSurface ns = getNativeSurface(); if (ns.getSurfaceHandle() != 0) { GLX.glXDestroyPbuffer(ns.getDisplayHandle(), ns.getSurfaceHandle()); diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/awt/X11AWTGLXGraphicsConfigurationFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/awt/X11AWTGLXGraphicsConfigurationFactory.java index de55a3148..99791b43e 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/awt/X11AWTGLXGraphicsConfigurationFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/awt/X11AWTGLXGraphicsConfigurationFactory.java @@ -32,6 +32,7 @@ package com.jogamp.opengl.impl.x11.glx.awt; +import com.jogamp.nativewindow.impl.jawt.JAWTUtil; import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; import javax.media.nativewindow.*; @@ -50,9 +51,8 @@ public class X11AWTGLXGraphicsConfigurationFactory extends GraphicsConfiguration GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.awt.AWTGraphicsDevice.class, this); } - public AbstractGraphicsConfiguration chooseGraphicsConfiguration(Capabilities capabilities, - CapabilitiesChooser chooser, - AbstractGraphicsScreen absScreen) { + protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl( + Capabilities capabilities, CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen) { GraphicsDevice device = null; if (absScreen != null && !(absScreen instanceof AWTGraphicsScreen)) { @@ -93,7 +93,7 @@ public class X11AWTGLXGraphicsConfigurationFactory extends GraphicsConfiguration System.err.println("X11AWTGLXGraphicsConfigurationFactory: using AWT X11 display 0x"+Long.toHexString(displayHandle)); } } - ((AWTGraphicsDevice)awtScreen.getDevice()).setHandle(displayHandle); + ((AWTGraphicsDevice)awtScreen.getDevice()).setSubType(NativeWindowFactory.TYPE_X11, displayHandle); X11GraphicsDevice x11Device = new X11GraphicsDevice(displayHandle); X11GraphicsScreen x11Screen = new X11GraphicsScreen(x11Device, awtScreen.getIndex()); |