From 05ad8604b58f355890f0e3804906c7e8d598edfa Mon Sep 17 00:00:00 2001
From: Kenneth Russel <kbrussel@alum.mit.edu>
Date: Tue, 3 Aug 2004 17:50:18 +0000
Subject: Bug fix from user GKW on the JOGL forums for problems reported by
 users in JOGL 1.1 betas where the code path for wglChoosePixelFormatARB
 (supporting full-scene antialiasing) was failing on older cards. The old
 drivers expect an OpenGL context to be current while the
 wglChoosePixelFormatARB and associated calls are being made, even though the
 documentation explicitly states that this is not necessary. GKW's fix creates
 a native window synchronously (independent of the AWT) and associates an
 OpenGL context with it which is used to choose pixel formats for other
 windows on the same GraphicsDevice. Upon VM shutdown, a native message pump
 is started which causes proper disposal of the native window and its OpenGL
 contexts.

There is currently no bug ID associated with this fix, although it may
be a component of completely addressing several open bugs.

Also includes a bug fix from GKW and kbr for:
Issue 98: Just 1st frame rendering on ATI Radeon

This was a race condition between JOGL's automatic discovery that the
ATI_WORKAROUND was needed and the creation of the first GLCanvas and
associated Animator. The need for disabling the setRenderingThread
optimization was computed too late, incorrectly locking out other
threads (in particular, the AWT event queue thread) from performing
rendering of the component.


git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@144 232f8b59-042b-4e1e-8c03-345bb8c30851
---
 src/net/java/games/jogl/impl/windows/WindowsOnscreenGLContext.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/net/java/games/jogl/impl/windows/WindowsOnscreenGLContext.java')

diff --git a/src/net/java/games/jogl/impl/windows/WindowsOnscreenGLContext.java b/src/net/java/games/jogl/impl/windows/WindowsOnscreenGLContext.java
index 5bcdb4559..3bfdee5d1 100644
--- a/src/net/java/games/jogl/impl/windows/WindowsOnscreenGLContext.java
+++ b/src/net/java/games/jogl/impl/windows/WindowsOnscreenGLContext.java
@@ -136,7 +136,7 @@ public class WindowsOnscreenGLContext extends WindowsGLContext {
   }
 
   public synchronized void swapBuffers() throws GLException {
-    if (!WGL.SwapBuffers(hdc)) {
+    if (!WGL.SwapBuffers(hdc) && (WGL.GetLastError() != 0)) {
       throw new GLException("Error swapping buffers");
     }
   }
-- 
cgit v1.2.3