diff options
author | Sven Gothel <[email protected]> | 2011-09-04 10:51:16 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-09-04 10:51:16 +0200 |
commit | c8e147620c55ff16e9d687bb36a4374e97e82176 (patch) | |
tree | 3151189f2750801baf6ae1918adc3ff17b9c6833 /src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java | |
parent | 3ea949b6a14c1ba631cb41b7439af86b21db4c05 (diff) |
Complete translucency support for Win32 - tested w/ NEWT
https://jogamp.org/bugzilla/show_bug.cgi?id=517
- Adding some Windows DWM entries to GDI (manual) for translucency support
- Add translucency setting in WindowsWGLGraphicsConfiguration*
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java index a82a7a38c..989906514 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java @@ -48,7 +48,9 @@ import javax.media.opengl.GLException; import javax.media.opengl.GLPbuffer; import javax.media.opengl.GLProfile; +import jogamp.nativewindow.windows.DWM_BLURBEHIND; import jogamp.nativewindow.windows.GDI; +import jogamp.nativewindow.windows.MARGINS; import jogamp.nativewindow.windows.PIXELFORMATDESCRIPTOR; import jogamp.opengl.GLGraphicsConfigurationUtil; @@ -164,9 +166,27 @@ public class WindowsWGLGraphicsConfiguration extends DefaultGraphicsConfiguratio " for device context " + toHexString(hdc) + ": error code " + GDI.GetLastError()); } + if(!caps.isBackgroundOpaque()) { + final long hwnd = GDI.WindowFromDC(hdc); + DWM_BLURBEHIND bb = DWM_BLURBEHIND.create(); + bb.setDwFlags(GDI.DWM_BB_ENABLE); + bb.setFEnable(1); + boolean ok = GDI.DwmEnableBlurBehindWindow(hwnd, bb); + if(ok) { + MARGINS m = MARGINS.create(); + m.setCxLeftWidth(-1); + m.setCxRightWidth(-1); + m.setCyBottomHeight(-1); + m.setCyTopHeight(-1); + ok = GDI.DwmExtendFrameIntoClientArea(hwnd, m); + } + if(DEBUG) { + System.err.println("!!! translucency enabled on wnd: 0x"+Long.toHexString(hwnd)+" - ok: "+ok); + } + } if (DEBUG) { System.err.println("!!! setPixelFormat (ARB): hdc "+toHexString(hdc) +", "+caps); - } + } setCapsPFD(caps); } |