diff options
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/x11')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java | 49 |
1 files changed, 30 insertions, 19 deletions
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java index 8d9de8144..48f9dd875 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java @@ -289,27 +289,36 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { } public final String getGLXVendorName(AbstractGraphicsDevice device) { - SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(device); - if(null!=sr) { - return ((SharedResource)sr).getGLXVendorName(); + if(null != device) { + SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(device); + if(null!=sr) { + return ((SharedResource)sr).getGLXVendorName(); + } + return GLXUtil.getVendorName(device.getHandle()); } - return GLXUtil.getVendorName(device.getHandle()); + return null; } public final boolean isGLXVendorATI(AbstractGraphicsDevice device) { - SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(device); - if(null!=sr) { - return ((SharedResource)sr).isGLXVendorATI(); + if(null != device) { + SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(device); + if(null!=sr) { + return ((SharedResource)sr).isGLXVendorATI(); + } + return GLXUtil.isVendorATI(device.getHandle()); } - return GLXUtil.isVendorATI(device.getHandle()); + return false; } public final boolean isGLXVendorNVIDIA(AbstractGraphicsDevice device) { - SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(device); - if(null!=sr) { - return ((SharedResource)sr).isGLXVendorNVIDIA(); + if(null != device) { + SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(device); + if(null!=sr) { + return ((SharedResource)sr).isGLXVendorNVIDIA(); + } + return GLXUtil.isVendorNVIDIA(device.getHandle()); } - return GLXUtil.isVendorNVIDIA(device.getHandle()); + return false; } protected final void shutdownInstance() { @@ -366,13 +375,15 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { } public final boolean isGLXVersionGreaterEqualOneThree(AbstractGraphicsDevice device) { - SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device); - if(null!=sr) { - return sr.isGLXVersionGreaterEqualOneThree(); - } - if( device instanceof X11GraphicsDevice ) { - VersionNumber v = getGLXVersion( (X11GraphicsDevice) device); - return ( null != v ) ? v.compareTo(versionOneThree) >= 0 : false ; + if(null != device) { + SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device); + if(null!=sr) { + return sr.isGLXVersionGreaterEqualOneThree(); + } + if( device instanceof X11GraphicsDevice ) { + VersionNumber v = getGLXVersion( (X11GraphicsDevice) device); + return ( null != v ) ? v.compareTo(versionOneThree) >= 0 : false ; + } } return false; } |