aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-01-23 22:03:45 +0100
committerSven Gothel <[email protected]>2015-01-23 22:03:45 +0100
commit2120be14c7525ef051d105f9bb02294f78d17d28 (patch)
tree7ee43c5ce7253fa85b75a417ae9279301867e484 /src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
parent474ada7c9fa2c9e47232abfde66353af58ea35f2 (diff)
Bug 1068 - Unify Surfaceless probing; Fix Surfaceless for OSX and Windows (probing, etc)
- Unify surfaceless probing GLDrawableFactoryImpl.probeSurfacelessCtx(..) implements surfaceless probing for all platforms - Fix Surfaceless for OSX (probing, etc) - Handle 'surfaceless' mode in MacOSXCGLContext impl - MacOSXCGLDrawableFactory.getOrCreateSharedResourceImpl adds surfaceless probing - Fix Surfaceless for Windows (probing, etc) - WindowsWGLContext.wglMakeContextCurrent(..) - Split release code into WindowsWGLContext.wglReleaseContext(..) allowing to handle zero HDC. - WindowsWGLGraphicsConfigurationFactory.updateGraphicsConfiguration(..) - Skip HDC -> PFD handling for - WindowsWGLDrawableFactory.createSharedResource adds surfaceless probing
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
index 7c387827a..b688b288c 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.nativewindow.ProxySurface;
import javax.media.nativewindow.VisualIDHolder;
import javax.media.opengl.GLCapabilitiesImmutable;
import javax.media.opengl.GLCapabilitiesChooser;
@@ -222,7 +223,11 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
try {
final long hdc = ns.getSurfaceHandle();
if (0 == hdc) {
- throw new GLException("Error: HDC is null");
+ if( !(ns instanceof ProxySurface) ||
+ !((ProxySurface)ns).containsUpstreamOptionBits( ProxySurface.OPT_UPSTREAM_SURFACELESS ) ) {
+ throw new GLException(String.format("non-surfaceless drawable has zero-handle (HDC): %s", ns.toString()));
+ }
+ return; // NOP .. will reach ns.unlockSurface()
}
final WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration) ns.getGraphicsConfiguration();