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/WindowsWGLGraphicsConfigurationFactory.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/WindowsWGLGraphicsConfigurationFactory.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java index 1c607d2c7..178f2777c 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java @@ -42,6 +42,7 @@ import javax.media.nativewindow.GraphicsConfigurationFactory; import javax.media.nativewindow.CapabilitiesImmutable; import javax.media.nativewindow.NativeSurface; import javax.media.nativewindow.NativeWindowFactory; +import javax.media.opengl.GLCapabilities; import javax.media.opengl.GLCapabilitiesImmutable; import javax.media.opengl.GLCapabilitiesChooser; import javax.media.opengl.GLContext; @@ -298,9 +299,14 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat } GLCapabilitiesImmutable capsChosen = (GLCapabilitiesImmutable) config.getChosenCapabilities(); + boolean isOpaque = capsChosen.isBackgroundOpaque() && GDI.DwmIsCompositionEnabled(); boolean onscreen = capsChosen.isOnscreen(); boolean usePBuffer = capsChosen.isPBuffer(); GLProfile glProfile = capsChosen.getGLProfile(); + + if(DEBUG) { + System.err.println("!!! translucency requested: "+(!capsChosen.isBackgroundOpaque())+", compositioning enabled: "+GDI.DwmIsCompositionEnabled()+" -> translucency "+(!isOpaque)); + } WGLGLCapabilities pixelFormatCaps = null; // chosen or preset PFD ID's caps boolean pixelFormatSet = false; // indicates a preset PFD ID [caps] @@ -316,6 +322,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat } pixelFormatSet = true; pixelFormatCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(sharedResource, hdc, presetPFDID, glProfile, onscreen, usePBuffer); + pixelFormatCaps = (WGLGLCapabilities) GLGraphicsConfigurationUtil.fixOpaqueGLCapabilities(pixelFormatCaps, isOpaque); } else { int recommendedIndex = -1; // recommended index @@ -393,6 +400,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat " chosen pfdID: native recommended "+ (recommendedIndex+1) + " chosen idx "+chosenIndex); } + pixelFormatCaps = (WGLGLCapabilities) GLGraphicsConfigurationUtil.fixOpaqueGLCapabilities(pixelFormatCaps, isOpaque); if (DEBUG) { System.err.println("!!! chosen pfdID (ARB): native recommended "+ (recommendedIndex+1) + " chosen "+pixelFormatCaps); |