summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-10-02 23:47:40 +0200
committerSven Gothel <[email protected]>2014-10-02 23:47:40 +0200
commit8413bddbf6611e0d93d2aad1ab1bb5e115316908 (patch)
tree1f0d89db7000dbc1bf1214bb47e34ec532ab4200
parent650862cc994b1a3ee6d2af970b5b1d8d73ccd2a8 (diff)
parent4b044d4de5272d45ec9b0b7b12ed40fa806d36e1 (diff)
Merge remote-tracking branch 'gouessej/master'
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java8
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java39
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java10
3 files changed, 49 insertions, 8 deletions
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java
index 5d925fe03..775e2936c 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java
@@ -123,7 +123,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
final WGLExt wglExt = ((WindowsWGLContext)sharedResource.getContext()).getWGLExt();
if (DEBUG) {
- System.out.println(getThreadName()+": Pbuffer config: " + config);
+ System.err.println(getThreadName()+": Pbuffer config: " + config);
}
final int winattrPbuffer = GLGraphicsConfigurationUtil.getExclusiveWinAttributeBits(false /* onscreen */, false /* fbo */, true /* pbuffer */, false /* bitmap */);
@@ -138,8 +138,8 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
final AbstractGraphicsDevice device = config.getScreen().getDevice();
if (DEBUG) {
- System.out.println(getThreadName()+": Pbuffer parentHdc = " + toHexString(sharedHdc));
- System.out.println(getThreadName()+": Pbuffer chosenCaps: " + chosenCaps);
+ System.err.println(getThreadName()+": Pbuffer parentHdc = " + toHexString(sharedHdc));
+ System.err.println(getThreadName()+": Pbuffer chosenCaps: " + chosenCaps);
}
if( !WindowsWGLGraphicsConfiguration.GLCapabilities2AttribList( sharedResource, chosenCaps,
@@ -162,7 +162,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
if (DEBUG) {
System.err.println("" + nformats + " suitable pixel formats found");
for (int i = 0; i < nformats; i++) {
- final WGLGLCapabilities dbgCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(sharedResource, device, glProfile,
+ final WGLGLCapabilities dbgCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilitiesNoCheck(sharedResource, device, glProfile,
sharedHdc, pformats.get(i), winattrPbuffer);
System.err.println("pixel format " + pformats.get(i) + " (index " + i + "): " + dbgCaps);
}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
index 24d44b5dd..5c5441c07 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
@@ -321,6 +321,25 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
}
return AttribList2GLCapabilities(device, glp, hdc, pfdID, iattributes, niattribs, iresults, winattrbits);
}
+
+ static WGLGLCapabilities wglARBPFID2GLCapabilitiesNoCheck(final WindowsWGLDrawableFactory.SharedResource sharedResource,
+ final AbstractGraphicsDevice device, final GLProfile glp, final long hdc, final int pfdID,
+ final int winattrbits) {
+ if (!sharedResource.hasARBPixelFormat()) {
+ return null;
+ }
+
+ final IntBuffer iattributes = Buffers.newDirectIntBuffer(2 * MAX_ATTRIBS);
+ final IntBuffer iresults = Buffers.newDirectIntBuffer(2 * MAX_ATTRIBS);
+ final int niattribs = fillAttribsForGeneralWGLARBQuery(sharedResource, iattributes);
+
+ if (!((WindowsWGLContext) sharedResource.getContext()).getWGLExt().wglGetPixelFormatAttribivARB(hdc, pfdID, 0,
+ niattribs, iattributes, iresults)) {
+ throw new GLException("wglARBPFID2GLCapabilities: Error getting pixel format attributes for pixel format "
+ + pfdID + " of device context " + toHexString(hdc) + ", werr " + GDI.GetLastError());
+ }
+ return AttribList2GLCapabilitiesNoCheck(device, glp, hdc, pfdID, iattributes, niattribs, iresults, winattrbits);
+ }
static int[] wglChoosePixelFormatARB(final WindowsWGLDrawableFactory.SharedResource sharedResource, final AbstractGraphicsDevice device,
final GLCapabilitiesImmutable capabilities,
@@ -396,7 +415,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
break;
}
} else if(DEBUG) {
- final GLCapabilitiesImmutable skipped = AttribList2GLCapabilities(device, glp, hdc, pfdIDs[i], iattributes, niattribs, iresults, GLGraphicsConfigurationUtil.ALL_BITS);
+ final GLCapabilitiesImmutable skipped = AttribList2GLCapabilitiesNoCheck(device, glp, hdc, pfdIDs[i], iattributes, niattribs, iresults, GLGraphicsConfigurationUtil.ALL_BITS);
System.err.println("wglARBPFIDs2GLCapabilities: bucket["+i+" -> skip]: pfdID "+pfdIDs[i]+", "+skipped+", winattr "+GLGraphicsConfigurationUtil.winAttributeBits2String(null, winattrbits).toString());
}
} else if (DEBUG) {
@@ -564,6 +583,24 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
res.setValuesByARB(iattribs, niattribs, iresults);
return (WGLGLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, res);
}
+
+ static WGLGLCapabilities AttribList2GLCapabilitiesNoCheck(final AbstractGraphicsDevice device, final GLProfile glp,
+ final long hdc, final int pfdID, final IntBuffer iattribs, final int niattribs, final IntBuffer iresults,
+ final int winattrmask) {
+ final int allDrawableTypeBits = AttribList2DrawableTypeBits(iattribs, niattribs, iresults);
+ int drawableTypeBits = winattrmask & allDrawableTypeBits;
+
+ if (0 == drawableTypeBits) {
+ return null;
+ }
+ final PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor();
+
+ WGLUtil.DescribePixelFormat(hdc, pfdID, PIXELFORMATDESCRIPTOR.size(), pfd);
+ final WGLGLCapabilities res = new WGLGLCapabilities(pfd, pfdID, glp);
+ res.setValuesByARB(iattribs, niattribs, iresults);
+ return (WGLGLCapabilities) GLGraphicsConfigurationUtil
+ .fixWinAttribBitsAndHwAccel(device, drawableTypeBits, res);
+ }
//
// GDI PIXELFORMAT
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
index ea92b38fd..03d14f758 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
@@ -521,9 +521,13 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
if( 0 <= chosenIdx ) {
if( _skipCapsChooser ) {
final WGLGLCapabilities caps = WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(device, glProfile, hdc, chosenPFDID, winattrmask);
- availableCaps.add(caps);
- recommendedIndex = 0;
- skipCapsChooser = true;
+ if(null != caps) {
+ availableCaps.add(caps);
+ recommendedIndex = 0;
+ skipCapsChooser = true;
+ } else {
+ skipCapsChooser = false;
+ }
} else {
skipCapsChooser = false;
}