diff options
author | Sven Gothel <[email protected]> | 2012-07-24 00:14:02 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-07-24 00:14:02 +0200 |
commit | 00bef95008b02cc71e166da122884402e9381f44 (patch) | |
tree | 8a7a1c961b462a0d8cac49d02b1010d04ca30e38 /make/config | |
parent | 90f2156e4c48386eb2ee06acc1169a7557851e88 (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 'make/config')
-rw-r--r-- | make/config/nativewindow/x11-CustomJavaCode.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/make/config/nativewindow/x11-CustomJavaCode.java b/make/config/nativewindow/x11-CustomJavaCode.java index 73439fcc7..56aec4725 100644 --- a/make/config/nativewindow/x11-CustomJavaCode.java +++ b/make/config/nativewindow/x11-CustomJavaCode.java @@ -24,7 +24,9 @@ /** Entry point to C language function: <code> XVisualInfo * XGetVisualInfo(Display * , long, XVisualInfo * , int * ); </code> */ private static native java.nio.ByteBuffer XGetVisualInfo1(long arg0, long arg1, java.nio.ByteBuffer arg2, Object arg3, int arg3_byte_offset); - public static native long DefaultVisualID(long display, int screen); + public static native int GetVisualIDFromWindow(long display, long window); + + public static native int DefaultVisualID(long display, int screen); public static native long CreateDummyWindow(long display, int screen_index, int visualID, int width, int height); public static native void DestroyDummyWindow(long display, long window); |