From aacc8afdca0b1376f91dcc68aa3ae3b39c7aba51 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Tue, 1 Sep 2015 02:05:50 +0200
Subject: Bug 1202: Fix vsync regression on OSX when using CALayer

On OSX using CALayer for onscreen rendering,
the drawable is utilizing an offscreen FBO.

Hence we need to move the vsync-skip-operation criteria,
i.e. skip if offscreen, down to the implementation.
---
 src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java')

diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
index 4c9469f17..fd0db7c04 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
@@ -524,6 +524,9 @@ public class WindowsWGLContext extends GLContextImpl {
 
   @Override
   protected final Integer setSwapIntervalImpl2(final int interval) {
+    if( !drawable.getChosenGLCapabilities().isOnscreen() ) {
+        return null;
+    }
     if( 0 == hasSwapInterval ) {
         try {
             if ( isExtensionAvailable(GLXExtensions.WGL_EXT_swap_control) ) {
-- 
cgit v1.2.3