diff options
author | Sven Gothel <sgothel@jausoft.com> | 2012-03-06 09:59:34 +0100 |
---|---|---|
committer | Sven Gothel <sgothel@jausoft.com> | 2012-03-06 09:59:34 +0100 |
commit | 3fbcf164be214f3c36bfc062e3ef63ddcc2e1687 (patch) | |
tree | 7172ac49435fc1cce26c82809b93322d1e72df0e /src/newt/classes/jogamp | |
parent | efa70cd39e1a2ac18c3e8660f8d57e4569b19018 (diff) |
NativeWindow public* reorg 3/3 ; NativeVisualID -> VisualIDHolder incl. proper utilization.
- VisualIDHolder: Update documentation (Exception case, etc)
- NativeVisualID -> VisualIDHolder (public)
- incl. generic Comparator
- better doc and enum values
- VID_UNDEFINED == 0
- methods shall not throw exception, but return UNDEFINED
- CapabilitiesImmutable extends VisualIDHolder
- All Capabilties impl.
- use VID_UNDEFINED for undef. value
- use final private (immutable) fields
- AbstractGraphicsConfiguration extends VisualIDHolder
- X11 CreateDummyWindow takes (int) visualID
Diffstat (limited to 'src/newt/classes/jogamp')
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/x11/X11Window.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/newt/classes/jogamp/newt/driver/x11/X11Window.java b/src/newt/classes/jogamp/newt/driver/x11/X11Window.java index ad691eb0b..703b18272 100644 --- a/src/newt/classes/jogamp/newt/driver/x11/X11Window.java +++ b/src/newt/classes/jogamp/newt/driver/x11/X11Window.java @@ -34,13 +34,12 @@ package jogamp.newt.driver.x11; -import jogamp.nativewindow.NativeVisualID; -import jogamp.nativewindow.NativeVisualID.NVIDType; import jogamp.nativewindow.x11.X11Lib; import jogamp.newt.DisplayImpl; import jogamp.newt.DisplayImpl.DisplayRunnable; import jogamp.newt.WindowImpl; import javax.media.nativewindow.*; +import javax.media.nativewindow.VisualIDHolder.VIDType; import javax.media.nativewindow.util.Insets; import javax.media.nativewindow.util.InsetsImmutable; import javax.media.nativewindow.util.Point; @@ -73,8 +72,11 @@ public class X11Window extends WindowImpl { if (null == cfg) { throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this); } + final int visualID = cfg.getVisualID(VIDType.NATIVE); + if(VisualIDHolder.VID_UNDEFINED == visualID) { + throw new NativeWindowException("Chosen Configuration w/o native visual ID: "+cfg); + } setGraphicsConfiguration(cfg); - final int visualID = ((NativeVisualID) cfg.getChosenCapabilities()).getVisualID(NVIDType.NATIVE_ID); final int flags = getReconfigureFlags(0, true) & ( FLAG_IS_ALWAYSONTOP | FLAG_IS_UNDECORATED ) ; setWindowHandle(CreateWindow0(getParentWindowHandle(), |