aboutsummaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-07-24 00:14:02 +0200
committerSven Gothel <[email protected]>2012-07-24 00:14:02 +0200
commit00bef95008b02cc71e166da122884402e9381f44 (patch)
tree8a7a1c961b462a0d8cac49d02b1010d04ca30e38 /src/nativewindow/classes/com/jogamp
parent90f2156e4c48386eb2ee06acc1169a7557851e88 (diff)
Fix GraphicsConfigurationFactory: Map factory to device-type _and_ capabilities-type; Add a pre-set nativeVisualID to chooseGraphicsConfiguration(..)
Map factory to device-type _and_ capabilities-type: - Allows using different GraphicsConfigurationFactory implementations for different capabilities-types. Previous impl. failed to use an OpenGL agnostic CapabilitiesImmutable for 'chooseGraphicsConfiguration(..)' since only the GL aware factory was mapped. The latter failed since it expected a GLCapabilitiesImmutable. - The passed capabilities-type as well as device-type given at getFactory(..) is traversed top-to-down to find a most suitable factory: For-All devT := getTopDownDeviceTypes(deviceType) For-All capsT := getTopDownCapabilitiesTypes(capabilitiesType) f = factory.get(devT, capsT); if(f) { return f; } end end Add a pre-set nativeVisualID to chooseGraphicsConfiguration(..) - In situations where a native visualID is already chosen [by external means for example], but we still need to query a matching GraphicsConfiguration - we require to pass a non VisualIDHolder.VID_UNDEFINED nativeVisualID. We had a hack implemented before within some implementations and their static calls, however an agnostic mechanism is required to implement new NativeSurface/Window's platform agnostic. - X11GLXGraphicsConfigurationFactory: respect a pre-set xvisualID - X11GLXDrawableFactory.createProxySurfaceImpl(..) queries the given windowHandle's visualID and 'chooses' the configuration accordingly. If the visualID is undefined an exception is thrown, since window is invalid. These mechanics are implicit for Windows and OSX. Fix X11GLXGraphicsConfiguration.updateGraphicsConfiguration(): - Skip any action if a valid X11GLCapabilities is already chosen, i.e. w/ visualID. Otherwise choose a suitable configuration incl. visualID. The latter is quite impossible and invalid, since visualID must be defined at window creation time and the update method is issued with a valid window. X11 - Misc: - Added 'int jogamp.nativewindow.x11.X11Lib.GetVisualIDFromWindow(..)' - All returned visualID's are of type 'int'
Diffstat (limited to 'src/nativewindow/classes/com/jogamp')
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java4
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java2
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java
index 61d5e5c0d..2a152ff35 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java
@@ -95,8 +95,8 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple
GraphicsConfiguration gc = awtGraphicsDevice.getDefaultConfiguration();
capsChosen = AWTGraphicsConfiguration.setupCapabilitiesRGBABits(capsRequested, gc);
}
- final GraphicsConfigurationFactory factory = GraphicsConfigurationFactory.getFactory(awtDevice);
- final AbstractGraphicsConfiguration config = factory.chooseGraphicsConfiguration(capsChosen, capsRequested, null, awtScreen);
+ final GraphicsConfigurationFactory factory = GraphicsConfigurationFactory.getFactory(awtDevice, capsChosen);
+ final AbstractGraphicsConfiguration config = factory.chooseGraphicsConfiguration(capsChosen, capsRequested, null, awtScreen, VisualIDHolder.VID_UNDEFINED);
if(config instanceof AWTGraphicsConfiguration) {
return (AWTGraphicsConfiguration) config;
}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java
index 7a98e3c25..5e4d6f41a 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java
@@ -88,7 +88,7 @@ public class X11GraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
// It still could be an AWT hold handle ..
final long display = getHandle();
final int scrnIdx = X11Lib.DefaultScreen(display);
- return (int) X11Lib.DefaultVisualID(display, scrnIdx);
+ return X11Lib.DefaultVisualID(display, scrnIdx);
}
@Override
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java
index 014f4f688..5f3c220ca 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java
@@ -58,7 +58,7 @@ public class X11GraphicsScreen extends DefaultGraphicsScreen implements Cloneabl
public int getVisualID() {
// It still could be an AWT hold handle ..
- return (int) X11Lib.DefaultVisualID(getDevice().getHandle(), getIndex());
+ return X11Lib.DefaultVisualID(getDevice().getHandle(), getIndex());
}
private static int fetchScreen(X11GraphicsDevice device, int screen) {