aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt
diff options
context:
space:
mode:
Diffstat (limited to 'src/newt')
-rw-r--r--src/newt/classes/com/jogamp/newt/opengl/GLWindow.java4
-rw-r--r--src/newt/classes/jogamp/newt/WindowImpl.java2
-rw-r--r--src/newt/classes/jogamp/newt/driver/macosx/MacWindow.java5
-rw-r--r--src/newt/classes/jogamp/newt/driver/windows/WindowsWindow.java9
4 files changed, 11 insertions, 9 deletions
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
index b94bc0f27..bff1efcb5 100644
--- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
@@ -995,12 +995,12 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer, FPSC
//
@Override
- public final int lockSurface() {
+ public final int lockSurface() throws NativeWindowException, RuntimeException {
return window.lockSurface();
}
@Override
- public final void unlockSurface() throws NativeWindowException {
+ public final void unlockSurface() {
window.unlockSurface();
}
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java
index 34f248121..45745e89c 100644
--- a/src/newt/classes/jogamp/newt/WindowImpl.java
+++ b/src/newt/classes/jogamp/newt/WindowImpl.java
@@ -563,7 +563,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
//
@Override
- public final int lockSurface() {
+ public final int lockSurface() throws NativeWindowException, RuntimeException {
windowLock.lock();
surfaceLock.lock();
int res = surfaceLock.getHoldCount() == 1 ? LOCK_SURFACE_NOT_READY : LOCK_SUCCESS; // new lock ?
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/MacWindow.java b/src/newt/classes/jogamp/newt/driver/macosx/MacWindow.java
index b45c60e69..942994c13 100644
--- a/src/newt/classes/jogamp/newt/driver/macosx/MacWindow.java
+++ b/src/newt/classes/jogamp/newt/driver/macosx/MacWindow.java
@@ -104,7 +104,10 @@ public class MacWindow extends WindowImpl implements SurfaceChangeable, DriverCl
@Override
protected void unlockSurfaceImpl() {
if(!isOffscreenInstance) {
- unlockSurface0(getWindowHandle());
+ final long h = getWindowHandle();
+ if(0 != h) {
+ unlockSurface0(h);
+ }
}
}
diff --git a/src/newt/classes/jogamp/newt/driver/windows/WindowsWindow.java b/src/newt/classes/jogamp/newt/driver/windows/WindowsWindow.java
index a30aa133c..5e636d982 100644
--- a/src/newt/classes/jogamp/newt/driver/windows/WindowsWindow.java
+++ b/src/newt/classes/jogamp/newt/driver/windows/WindowsWindow.java
@@ -87,12 +87,11 @@ public class WindowsWindow extends WindowImpl {
@Override
protected void unlockSurfaceImpl() {
- if (0 == hdc) {
- throw new InternalError("surface not acquired");
+ if (0 != hdc) {
+ GDI.ReleaseDC(getWindowHandle(), hdc);
+ hdc_old = hdc;
+ hdc=0;
}
- GDI.ReleaseDC(getWindowHandle(), hdc);
- hdc_old = hdc;
- hdc=0;
}
@Override