diff options
author | Sven Gothel <[email protected]> | 2010-04-24 05:11:29 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-04-24 05:11:29 +0200 |
commit | 1ad8c39df6b097c80ba7a85badf555e7f669cc3f (patch) | |
tree | 740606f85dafdef5d5958498b080873c7bf188dd /src/jogl/classes/com/jogamp/opengl/impl/x11/glx | |
parent | 778225504c00c7ca03386b6eabfbda929542130f (diff) |
NEWT/AWT Interoperability
- Moved all event classes to
com.jogamp.newt.event
and the new AWT event helper to
com.jogamp.newt.awt.event
- Added Newt<Type>Adapter for convenience
- Added AWT<Type>Adapter for
- Using AWT agnostic NEWT event listener
see com.jogamp.test.junit.jogl.demos.gl2.gears.TestGearsNEWT
even for AWT
see com.jogamp.test.junit.jogl.demos.gl2.gears.TestGearsAWT
(Nice idea by mbien)
- Forwarding AWT events to NEWT (refactoring)
Misc
- GLDrawableFactory.shutdown() is now protected and called
by the JVM shutdown hook. Hence removing the validate().
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/impl/x11/glx')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawableFactory.java | 23 |
1 files changed, 4 insertions, 19 deletions
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 d8e5f7646..9a0edcfbb 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 @@ -104,17 +104,14 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl implements Dyna private X11GLXContext sharedContext=null; protected final GLDrawableImpl getSharedDrawable() { - validate(); return sharedDrawable; } protected final GLContextImpl getSharedContext() { - validate(); return sharedContext; } - public void shutdown() { - super.shutdown(); + protected void shutdown() { if (DEBUG) { System.err.println("!!! Shutdown Shared:"); System.err.println("!!! CTX : "+sharedContext); @@ -131,16 +128,14 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl implements Dyna } if(null!=sharedScreen) { X11GraphicsDevice sharedDevice = (X11GraphicsDevice) sharedScreen.getDevice(); - if(null!=sharedDevice) { - X11Util.closeThreadLocalDisplay(null); - } sharedScreen = null; } - X11Util.shutdown( !isVendorATI(), DEBUG ); + // X11Util.shutdown( !isVendorATI(), DEBUG ); // works NV .. but .. + // X11Util.shutdown( true, DEBUG ); // fails ATI, works NV .. but + X11Util.shutdown( false, DEBUG ); } public GLDrawableImpl createOnscreenDrawable(NativeWindow target) { - validate(); if (target == null) { throw new IllegalArgumentException("Null target"); } @@ -151,7 +146,6 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl implements Dyna } protected GLDrawableImpl createOffscreenDrawable(NativeWindow target) { - validate(); if (target == null) { throw new IllegalArgumentException("Null target"); } @@ -162,14 +156,12 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl implements Dyna } public boolean canCreateGLPbuffer(AbstractGraphicsDevice device) { - validate(); return glxVersionGreaterEqualThan(device, 1, 3); } private boolean glxVersionsQueried = false; private int glxVersionMajor=0, glxVersionMinor=0; public boolean glxVersionGreaterEqualThan(AbstractGraphicsDevice device, int majorReq, int minorReq) { - validate(); if (!glxVersionsQueried) { if(null == device) { device = (X11GraphicsDevice) sharedScreen.getDevice(); @@ -195,7 +187,6 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl implements Dyna } protected GLDrawableImpl createGLPbufferDrawableImpl(final NativeWindow target) { - validate(); if (target == null) { throw new IllegalArgumentException("Null target"); } @@ -228,7 +219,6 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl implements Dyna protected NativeWindow createOffscreenWindow(GLCapabilities capabilities, GLCapabilitiesChooser chooser, int width, int height) { - validate(); NullWindow nw = null; X11Lib.XLockDisplay(sharedScreen.getDevice().getHandle()); try{ @@ -243,22 +233,18 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl implements Dyna } public GLContext createExternalGLContext() { - validate(); return X11ExternalGLXContext.create(this, null); } public boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device) { - validate(); return canCreateGLPbuffer(device); } public GLDrawable createExternalGLDrawable() { - validate(); return X11ExternalGLXDrawable.create(this, null); } public void loadGLULibrary() { - validate(); X11Lib.dlopen("/usr/lib/libGLU.so"); } @@ -273,7 +259,6 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl implements Dyna } public boolean canCreateContextOnJava2DSurface(AbstractGraphicsDevice device) { - validate(); return false; } |