aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/opengl/impl/windows/WindowsGLContext.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2007-01-07 18:15:52 +0000
committerKenneth Russel <[email protected]>2007-01-07 18:15:52 +0000
commitb7244795d44ab06ea32d68136cdb1408804514cc (patch)
tree69aec31745365cb17d5eaf07e79bf45ed5f5b147 /src/classes/com/sun/opengl/impl/windows/WindowsGLContext.java
parenta38af8cf1605adaf23ab43fb93feaf7d8bbce98e (diff)
Fixed Issue 259: need a copy context
Added and specified GLContext.copy() and supplied implementations on Windows, X11 and Mac OS X platforms. New code is untested at this time. May need to make subsequent changes on X11 and Mac platforms where new code has not been compiled yet. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@1075 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/opengl/impl/windows/WindowsGLContext.java')
-rw-r--r--src/classes/com/sun/opengl/impl/windows/WindowsGLContext.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/classes/com/sun/opengl/impl/windows/WindowsGLContext.java b/src/classes/com/sun/opengl/impl/windows/WindowsGLContext.java
index 7a4b73351..1276aea92 100644
--- a/src/classes/com/sun/opengl/impl/windows/WindowsGLContext.java
+++ b/src/classes/com/sun/opengl/impl/windows/WindowsGLContext.java
@@ -207,6 +207,20 @@ public class WindowsGLContext extends GLContextImpl {
return (hglrc != 0);
}
+ public void copy(GLContext source, int mask) throws GLException {
+ long dst = getHGLRC();
+ long src = ((WindowsGLContext) source).getHGLRC();
+ if (src == 0) {
+ throw new GLException("Source OpenGL context has not been created");
+ }
+ if (dst == 0) {
+ throw new GLException("Destination OpenGL context has not been created");
+ }
+ if (!WGL.wglCopyContext(src, dst, mask)) {
+ throw new GLException("wglCopyContext failed");
+ }
+ }
+
protected void resetGLFunctionAvailability() {
super.resetGLFunctionAvailability();
if (DEBUG) {