From 8883fa885e68cd21e8b8cd3343db0580913aebdf Mon Sep 17 00:00:00 2001
From: sg215889 <sg215889@phalanx.goethel.localnet>
Date: Wed, 29 Jul 2009 09:49:33 -0700
Subject: Fix: doxygen-all-pub.cfg; Add NativeWindow: surfaceSwap() and
 surfaceUpdated(); BroadcomEGL: Use custom surfaceSwap(); GLDrawableImpl's:
 Utilize NativeWindow's surfaceSwap() and surfaceUpdated(); Fix common enum of
 GL2ES1 and GL2GL3, merge them in GL

---
 .../windows/wgl/WindowsOffscreenWGLDrawable.java   |  2 +-
 .../windows/wgl/WindowsPbufferWGLDrawable.java     |  2 +-
 .../impl/windows/wgl/WindowsWGLDrawable.java       | 63 +++++++++++-----------
 3 files changed, 32 insertions(+), 35 deletions(-)

(limited to 'src/jogl/classes/com/sun/opengl/impl/windows/wgl')

diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java
index ecd4e1685..71d82e784 100644
--- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java
+++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java
@@ -127,7 +127,7 @@ public class WindowsOffscreenWGLDrawable extends WindowsWGLDrawable {
     }
   }
 
-  public void swapBuffers() throws GLException {
+  protected void swapBuffersImpl() {
   }
 
 }
diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java
index 6a03406f9..f54e8f1a0 100644
--- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java
+++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java
@@ -107,7 +107,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
     return floatMode;
   }
 
-  public void swapBuffers() throws GLException {
+  protected void swapBuffersImpl() {
   }
 
   private void createPbuffer(long parentHdc, WGLExt wglExt) {
diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java
index 3017d258b..01e259665 100644
--- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java
+++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java
@@ -82,44 +82,41 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
     }
   }
 
-  public void swapBuffers() throws GLException {
-    GLCapabilities caps = (GLCapabilities)getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
-    if (caps.getDoubleBuffered()) {
-        boolean didLock = false;
+  protected void swapBuffersImpl() {
+    boolean didLock = false;
 
-        try {
-            if ( !isSurfaceLocked() ) {
-                // Usually the surface shall be locked within [makeCurrent .. swap .. release]
-                if (lockSurface() == NativeWindow.LOCK_SURFACE_NOT_READY) {
-                    return;
-                }
-                didLock = true;
+    try {
+        if ( !isSurfaceLocked() ) {
+            // Usually the surface shall be locked within [makeCurrent .. swap .. release]
+            if (lockSurface() == NativeWindow.LOCK_SURFACE_NOT_READY) {
+                return;
             }
+            didLock = true;
+        }
 
-            long startTime = 0;
-            if (PROFILING) {
-              startTime = System.currentTimeMillis();
-            }
+        long startTime = 0;
+        if (PROFILING) {
+          startTime = System.currentTimeMillis();
+        }
 
-            if (!WGL.SwapBuffers(getNativeWindow().getSurfaceHandle()) && (WGL.GetLastError() != 0)) {
-              throw new GLException("Error swapping buffers");
-            }
+        if (!WGL.SwapBuffers(getNativeWindow().getSurfaceHandle()) && (WGL.GetLastError() != 0)) {
+          throw new GLException("Error swapping buffers");
+        }
 
-            if (PROFILING) {
-              long endTime = System.currentTimeMillis();
-              profilingSwapBuffersTime += (endTime - startTime);
-              int ticks = PROFILING_TICKS;
-              if (++profilingSwapBuffersTicks == ticks) {
-                System.err.println("SwapBuffers calls: " + profilingSwapBuffersTime + " ms / " + ticks + "  calls (" +
-                                   ((float) profilingSwapBuffersTime / (float) ticks) + " ms/call)");
-                profilingSwapBuffersTime = 0;
-                profilingSwapBuffersTicks = 0;
-              }
-            }
-        } finally {
-            if (didLock) {
-              unlockSurface();
-            }
+        if (PROFILING) {
+          long endTime = System.currentTimeMillis();
+          profilingSwapBuffersTime += (endTime - startTime);
+          int ticks = PROFILING_TICKS;
+          if (++profilingSwapBuffersTicks == ticks) {
+            System.err.println("SwapBuffers calls: " + profilingSwapBuffersTime + " ms / " + ticks + "  calls (" +
+                               ((float) profilingSwapBuffersTime / (float) ticks) + " ms/call)");
+            profilingSwapBuffersTime = 0;
+            profilingSwapBuffersTicks = 0;
+          }
+        }
+    } finally {
+        if (didLock) {
+          unlockSurface();
         }
     }
   }
-- 
cgit v1.2.3