From 4abaf513bcc91a2d4b3ec4842c532807cbe66167 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 21 Aug 2012 15:55:37 +0200 Subject: Fix/Workaround: For BCM_VC_IV EGL (alpha) configuration 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. --- src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') 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 6d4f36964..7b8d2e958 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 @@ -29,6 +29,7 @@ package jogamp.newt.driver.bcm.vc.iv; import javax.media.nativewindow.AbstractGraphicsConfiguration; +import javax.media.nativewindow.Capabilities; import javax.media.nativewindow.GraphicsConfigurationFactory; import javax.media.nativewindow.NativeWindowException; import javax.media.nativewindow.VisualIDHolder; @@ -52,8 +53,14 @@ 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( - capsRequested, capsRequested, capabilitiesChooser, getScreen().getGraphicsScreen(), VisualIDHolder.VID_UNDEFINED); + capsChosen, capsRequested, capabilitiesChooser, getScreen().getGraphicsScreen(), VisualIDHolder.VID_UNDEFINED); if (null == cfg) { throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this); } -- cgit v1.2.3