View | Details | Raw Unified | Return to bug 1078
Collapse All | Expand All

(-)a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java (-4 / +4 lines)
Lines 123-129 Link Here
123
        final WGLExt wglExt = ((WindowsWGLContext)sharedResource.getContext()).getWGLExt();
123
        final WGLExt wglExt = ((WindowsWGLContext)sharedResource.getContext()).getWGLExt();
124
124
125
        if (DEBUG) {
125
        if (DEBUG) {
126
            System.out.println(getThreadName()+": Pbuffer config: " + config);
126
            System.err.println(getThreadName()+": Pbuffer config: " + config);
127
        }
127
        }
128
128
129
        final int winattrPbuffer = GLGraphicsConfigurationUtil.getExclusiveWinAttributeBits(false /* onscreen */, false /* fbo */, true /* pbuffer */, false /* bitmap */);
129
        final int winattrPbuffer = GLGraphicsConfigurationUtil.getExclusiveWinAttributeBits(false /* onscreen */, false /* fbo */, true /* pbuffer */, false /* bitmap */);
Lines 138-145 Link Here
138
        final AbstractGraphicsDevice device = config.getScreen().getDevice();
138
        final AbstractGraphicsDevice device = config.getScreen().getDevice();
139
139
140
        if (DEBUG) {
140
        if (DEBUG) {
141
          System.out.println(getThreadName()+": Pbuffer parentHdc = " + toHexString(sharedHdc));
141
          System.err.println(getThreadName()+": Pbuffer parentHdc = " + toHexString(sharedHdc));
142
          System.out.println(getThreadName()+": Pbuffer chosenCaps: " + chosenCaps);
142
          System.err.println(getThreadName()+": Pbuffer chosenCaps: " + chosenCaps);
143
        }
143
        }
144
144
145
        if( !WindowsWGLGraphicsConfiguration.GLCapabilities2AttribList( sharedResource, chosenCaps,
145
        if( !WindowsWGLGraphicsConfiguration.GLCapabilities2AttribList( sharedResource, chosenCaps,
Lines 162-168 Link Here
162
        if (DEBUG) {
162
        if (DEBUG) {
163
          System.err.println("" + nformats + " suitable pixel formats found");
163
          System.err.println("" + nformats + " suitable pixel formats found");
164
          for (int i = 0; i < nformats; i++) {
164
          for (int i = 0; i < nformats; i++) {
165
            final WGLGLCapabilities dbgCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(sharedResource, device, glProfile,
165
            final WGLGLCapabilities dbgCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilitiesNoCheck(sharedResource, device, glProfile,
166
                                          sharedHdc, pformats.get(i), winattrPbuffer);
166
                                          sharedHdc, pformats.get(i), winattrPbuffer);
167
            System.err.println("pixel format " + pformats.get(i) + " (index " + i + "): " + dbgCaps);
167
            System.err.println("pixel format " + pformats.get(i) + " (index " + i + "): " + dbgCaps);
168
          }
168
          }
(-)a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java (-1 / +56 lines)
Lines 321-326 Link Here
321
        }
321
        }
322
        return AttribList2GLCapabilities(device, glp, hdc, pfdID, iattributes, niattribs, iresults, winattrbits);
322
        return AttribList2GLCapabilities(device, glp, hdc, pfdID, iattributes, niattribs, iresults, winattrbits);
323
    }
323
    }
324
    
325
	static WGLGLCapabilities wglARBPFID2GLCapabilitiesNoCheck(final WindowsWGLDrawableFactory.SharedResource sharedResource,
326
			final AbstractGraphicsDevice device, final GLProfile glp, final long hdc, final int pfdID,
327
			final int winattrbits) {
328
		if (!sharedResource.hasARBPixelFormat()) {
329
			return null;
330
		}
331
332
		final IntBuffer iattributes = Buffers.newDirectIntBuffer(2 * MAX_ATTRIBS);
333
		final IntBuffer iresults = Buffers.newDirectIntBuffer(2 * MAX_ATTRIBS);
334
		final int niattribs = fillAttribsForGeneralWGLARBQuery(sharedResource, iattributes);
335
336
		if (!((WindowsWGLContext) sharedResource.getContext()).getWGLExt().wglGetPixelFormatAttribivARB(hdc, pfdID, 0,
337
				niattribs, iattributes, iresults)) {
338
			throw new GLException("wglARBPFID2GLCapabilities: Error getting pixel format attributes for pixel format "
339
					+ pfdID + " of device context " + toHexString(hdc) + ", werr " + GDI.GetLastError());
340
		}
341
		return AttribList2GLCapabilitiesNoCheck(device, glp, hdc, pfdID, iattributes, niattribs, iresults, winattrbits);
342
	}
324
343
325
    static int[] wglChoosePixelFormatARB(final WindowsWGLDrawableFactory.SharedResource sharedResource, final AbstractGraphicsDevice device,
344
    static int[] wglChoosePixelFormatARB(final WindowsWGLDrawableFactory.SharedResource sharedResource, final AbstractGraphicsDevice device,
326
                                         final GLCapabilitiesImmutable capabilities,
345
                                         final GLCapabilitiesImmutable capabilities,
Lines 396-402 Link Here
396
                        break;
415
                        break;
397
                    }
416
                    }
398
                } else if(DEBUG) {
417
                } else if(DEBUG) {
399
                    final GLCapabilitiesImmutable skipped = AttribList2GLCapabilities(device, glp, hdc, pfdIDs[i], iattributes, niattribs, iresults, GLGraphicsConfigurationUtil.ALL_BITS);
418
                    final GLCapabilitiesImmutable skipped = AttribList2GLCapabilitiesNoCheck(device, glp, hdc, pfdIDs[i], iattributes, niattribs, iresults, GLGraphicsConfigurationUtil.ALL_BITS);
400
                    System.err.println("wglARBPFIDs2GLCapabilities: bucket["+i+" -> skip]: pfdID "+pfdIDs[i]+", "+skipped+", winattr "+GLGraphicsConfigurationUtil.winAttributeBits2String(null, winattrbits).toString());
419
                    System.err.println("wglARBPFIDs2GLCapabilities: bucket["+i+" -> skip]: pfdID "+pfdIDs[i]+", "+skipped+", winattr "+GLGraphicsConfigurationUtil.winAttributeBits2String(null, winattrbits).toString());
401
                }
420
                }
402
            } else if (DEBUG) {
421
            } else if (DEBUG) {
Lines 560-569 Link Here
560
            }
579
            }
561
            // non displayable requested (pbuffer)
580
            // non displayable requested (pbuffer)
562
        }
581
        }
582
		if (/*
583
			 * (GLGraphicsConfigurationUtil.BITMAP_BIT & drawableTypeBits) != 0
584
			 * &&
585
			 *//*
586
				 * GLRendererQuirks.existStickyDeviceQuirk(device,
587
				 * GLRendererQuirks.NoPBufferWithAccum) &&
588
				 */(pfd.getCAccumAlphaBits() != 0 || pfd.getCAccumRedBits() != 0 || pfd.getCAccumGreenBits() != 0 || pfd
589
				.getCAccumBlueBits() != 0)) {
590
			return null;
591
		}
592
        
563
        final WGLGLCapabilities res = new WGLGLCapabilities(pfd, pfdID, glp);
593
        final WGLGLCapabilities res = new WGLGLCapabilities(pfd, pfdID, glp);
564
        res.setValuesByARB(iattribs, niattribs, iresults);
594
        res.setValuesByARB(iattribs, niattribs, iresults);
565
        return (WGLGLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, res);
595
        return (WGLGLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, res);
566
    }
596
    }
597
    
598
	static WGLGLCapabilities AttribList2GLCapabilitiesNoCheck(final AbstractGraphicsDevice device, final GLProfile glp,
599
			final long hdc, final int pfdID, final IntBuffer iattribs, final int niattribs, final IntBuffer iresults,
600
			final int winattrmask) {
601
		final int allDrawableTypeBits = AttribList2DrawableTypeBits(iattribs, niattribs, iresults);
602
		int drawableTypeBits = winattrmask & allDrawableTypeBits;
603
604
		if (0 == drawableTypeBits) {
605
			return null;
606
		}
607
		final PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor();
608
609
		WGLUtil.DescribePixelFormat(hdc, pfdID, PIXELFORMATDESCRIPTOR.size(), pfd);
610
		final WGLGLCapabilities res = new WGLGLCapabilities(pfd, pfdID, glp);
611
		res.setValuesByARB(iattribs, niattribs, iresults);
612
		return (WGLGLCapabilities) GLGraphicsConfigurationUtil
613
				.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, res);
614
	}
567
615
568
    //
616
    //
569
    // GDI PIXELFORMAT
617
    // GDI PIXELFORMAT
Lines 624-629 Link Here
624
                return null;
672
                return null;
625
            }
673
            }
626
        }
674
        }
675
        if (/* (GLGraphicsConfigurationUtil.BITMAP_BIT & drawableTypeBits) != 0 && *//*(GLRendererQuirks.existStickyDeviceQuirk(device, GLRendererQuirks.NoPBufferWithAccum)) &&*/ (pfd.getCAccumAlphaBits() != 0 || pfd.getCAccumRedBits() != 0 || pfd.getCAccumGreenBits() != 0 || pfd.getCAccumBlueBits() != 0) ) {
676
    	    if(DEBUG) {
677
    	    	System.err.println("Quirks: " + GLRendererQuirks.getStickyDeviceQuirks(device) + " on device " + device);
678
                System.err.println("Drop [accum bits PBUFFER]: " + WGLGLCapabilities.PFD2String(pfd, pfdID));
679
            }
680
    	    return null;
681
        }
627
682
628
        final WGLGLCapabilities res = new WGLGLCapabilities(pfd, pfdID, glp);
683
        final WGLGLCapabilities res = new WGLGLCapabilities(pfd, pfdID, glp);
629
        res.setValuesByGDI();
684
        res.setValuesByGDI();
(-)a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java (-3 / +7 lines)
Lines 521-529 Link Here
521
                if( 0 <= chosenIdx ) {
521
                if( 0 <= chosenIdx ) {
522
                    if( _skipCapsChooser ) {
522
                    if( _skipCapsChooser ) {
523
                        final WGLGLCapabilities caps = WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(device, glProfile, hdc, chosenPFDID, winattrmask);
523
                        final WGLGLCapabilities caps = WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(device, glProfile, hdc, chosenPFDID, winattrmask);
524
                        availableCaps.add(caps);
524
                        if(null != caps) {
525
                        recommendedIndex = 0;
525
                            availableCaps.add(caps);
526
                        skipCapsChooser = true;
526
                            recommendedIndex = 0;
527
                            skipCapsChooser = true;
528
                        } else {
529
                        	skipCapsChooser = false;
530
                        }
527
                    } else {
531
                    } else {
528
                        skipCapsChooser = false;
532
                        skipCapsChooser = false;
529
                    }
533
                    }

Return to bug 1078