diff options
author | Kenneth Russel <[email protected]> | 2008-06-26 04:54:44 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2008-06-26 04:54:44 +0000 |
commit | f287efc004e6932cbb2efdf777798a381994ca48 (patch) | |
tree | ce9a159f1e05cd234dddd64dffbb22ccb5e7163e /src/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java | |
parent | 2a07b5aad1d5dcf9c699e74c7e94d98f827fd4f9 (diff) |
Added getSurfaceHandle() to NativeWindow abstraction in support of
Windows platform where there is a distinction between the window
handle (HWND) and window surface (HDC). WGL implementation now refers
to window surface instead of window handle. JAWT implementation
returns same value for both window handle and window surface. Newt
creates window surface on demand; unneeded for EGL binding. RedSquare
demo now runs on Windows with Newt + GL2.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1695 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java')
-rw-r--r-- | src/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java index 84928ae6c..9f47a03d6 100644 --- a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java +++ b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java @@ -94,7 +94,7 @@ public class WindowsOffscreenWGLDrawable extends WindowsWGLDrawable { System.out.println("LastError: " + WGL.GetLastError()); throw new GLException("Error creating device context for offscreen OpenGL context"); } - nw.setWindowHandle(hdc); + nw.setSurfaceHandle(hdc); hbitmap = WGL.CreateDIBSection(hdc, info, WGL.DIB_RGB_COLORS, 0, 0, 0); if (hbitmap == 0) { @@ -121,14 +121,14 @@ public class WindowsOffscreenWGLDrawable extends WindowsWGLDrawable { getFactory().lockToolkit(); try { NullWindow nw = (NullWindow) getNativeWindow(); - if (nw.getWindowHandle() != 0) { + if (nw.getSurfaceHandle() != 0) { // Must destroy bitmap and device context - WGL.SelectObject(nw.getWindowHandle(), origbitmap); + WGL.SelectObject(nw.getSurfaceHandle(), origbitmap); WGL.DeleteObject(hbitmap); - WGL.DeleteDC(nw.getWindowHandle()); + WGL.DeleteDC(nw.getSurfaceHandle()); origbitmap = 0; hbitmap = 0; - nw.setWindowHandle(0); + nw.setSurfaceHandle(0); setChosenGLCapabilities(null); } } finally { |