diff options
author | Sven Gothel <[email protected]> | 2012-10-19 07:46:31 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-10-19 07:46:31 +0200 |
commit | 416c7fc1b90cd7b34c251268bb83ebeea61d17d6 (patch) | |
tree | 331fb09271fc49c0f876879f3d3577e27a7319ed /src/newt/classes | |
parent | 1aea29bb5d253600213024fd2c12a91bf3599202 (diff) |
NEWT / BCM-VC-IV: Fix transparency according to given capabilities
Tested manual w/ TestGearsES2NEWT on Raspberry Pi
Diffstat (limited to 'src/newt/classes')
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java index 7b8d2e958..21fbea9ac 100644 --- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java @@ -53,20 +53,19 @@ public class WindowDriver extends WindowImpl { if(0!=getParentWindowHandle()) { throw new RuntimeException("Window parenting not supported (yet)"); } - // FIXME: Hack - Native BCM_VC_IV code CreateWindow() uses the default alpha value setting, - // which is alpha:8 ! Hence we require to chose alpha from the egl configurations. - // TODO: Properly select the alpha mode in CreateWindow()! This will allow this hack. - final Capabilities capsChosen = (Capabilities) capsRequested.cloneMutable(); - capsChosen.setAlphaBits(1); final AbstractGraphicsConfiguration cfg = GraphicsConfigurationFactory.getFactory(getScreen().getDisplay().getGraphicsDevice(), capsRequested).chooseGraphicsConfiguration( - capsChosen, capsRequested, capabilitiesChooser, getScreen().getGraphicsScreen(), VisualIDHolder.VID_UNDEFINED); + capsRequested, capsRequested, capabilitiesChooser, getScreen().getGraphicsScreen(), VisualIDHolder.VID_UNDEFINED); if (null == cfg) { throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this); } + final Capabilities chosenCaps = (Capabilities) cfg.getChosenCapabilities(); + // FIXME: Pass along opaque flag, since EGL doesn't determine it + if(capsRequested.isBackgroundOpaque() != chosenCaps.isBackgroundOpaque()) { + chosenCaps.setBackgroundOpaque(capsRequested.isBackgroundOpaque()); + } setGraphicsConfiguration(cfg); - - nativeWindowHandle = CreateWindow(getWidth(), getHeight()); + nativeWindowHandle = CreateWindow(getWidth(), getHeight(), chosenCaps.isBackgroundOpaque(), chosenCaps.getAlphaBits()); if (nativeWindowHandle == 0) { throw new NativeWindowException("Error creating egl window: "+cfg); } @@ -139,7 +138,7 @@ public class WindowDriver extends WindowImpl { // protected static native boolean initIDs(); - private native long CreateWindow(int width, int height); + private native long CreateWindow(int width, int height, boolean opaque, int alphaBits); private native long RealizeWindow(long eglWindowHandle); private native int CloseWindow(long eglWindowHandle, long userData); private native void setVisible0(long eglWindowHandle, boolean visible); |