aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-04-17 15:03:46 +0200
committerSven Gothel <[email protected]>2013-04-17 15:03:46 +0200
commit61a47e07975eb2fd8b1f5f60552935c993a6eef6 (patch)
treec4b7d48ab285ac050529c8065add6f75620f4537 /src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
parent6dd851e74dde28d24a2d2bb6e788a78bc7fedd76 (diff)
Bug 718: Windows BITMAP Offscreen Fails w/ GLCaps other than simple RGB888 - Filter invalid PFD configs
- Filter invalid PFD configs - WindowsBitmapWGLDrawable: Clip chosenCaps to RGBA888[0|8] - WindowsBitmapWGLDrawable: Only use BITMAPINFOHEADER.BiBitCount=24 - WindowsWGLGraphicsConfiguration: Only allow GDI BITMAP PFD's w/ RGB888 w/ alpha <= red, others may fail - WindowsWGLGraphicsConfigurationFactory.getAvailableGLCapabilities() - Fetch ARB caps w/o BITMAP - Concat GDI [BITMAP] caps
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java15
1 files changed, 14 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 7709e5884..fdff20daa 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
@@ -684,15 +684,28 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
if(null == pfd) {
return null;
}
- if ((pfd.getDwFlags() & GDI.PFD_SUPPORT_OPENGL) == 0) {
+ if ( (pfd.getDwFlags() & GDI.PFD_SUPPORT_OPENGL) == 0) {
return null;
}
final int allDrawableTypeBits = PFD2DrawableTypeBits(pfd);
final int drawableTypeBits = winattrmask & allDrawableTypeBits;
if( 0 == drawableTypeBits ) {
+ if(DEBUG) {
+ System.err.println("Drop [drawableType mismatch]: " + WGLGLCapabilities.PFD2String(pfd, pfdID));
+ }
return null;
}
+ if( GLGraphicsConfigurationUtil.BITMAP_BIT == drawableTypeBits ) {
+ // BITMAP exclusive PFD SafeGuard: Only accept BITMAP compatible color formats!
+ final int pfdColorBits = pfd.getCColorBits();
+ if ( pfdColorBits != 24 || pfd.getCRedBits() < pfd.getCAlphaBits() ) { // Allowed: RGB888 && alpha <= red
+ if(DEBUG) {
+ System.err.println("Drop [color bits excl BITMAP]: " + WGLGLCapabilities.PFD2String(pfd, pfdID));
+ }
+ return null;
+ }
+ }
final WGLGLCapabilities res = new WGLGLCapabilities(pfd, pfdID, glp);
res.setValuesByGDI();