From b7244795d44ab06ea32d68136cdb1408804514cc Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Sun, 7 Jan 2007 18:15:52 +0000 Subject: 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 --- .../com/sun/opengl/impl/x11/X11GLContext.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/classes/com/sun/opengl/impl/x11/X11GLContext.java') diff --git a/src/classes/com/sun/opengl/impl/x11/X11GLContext.java b/src/classes/com/sun/opengl/impl/x11/X11GLContext.java index 0ed5eaebb..17b2cca40 100644 --- a/src/classes/com/sun/opengl/impl/x11/X11GLContext.java +++ b/src/classes/com/sun/opengl/impl/x11/X11GLContext.java @@ -193,6 +193,27 @@ public abstract class X11GLContext extends GLContextImpl { return (context != 0); } + public void copy(GLContext source, int mask) throws GLException { + long dst = getContext(); + long src = ((X11GLContext) source).getContext(); + 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 (mostRecentDisplay == 0) { + throw new GLException("Connection to X display not yet set up"); + } + lockToolkit(); + try { + GLX.glXCopyContext(mostRecentDisplay, src, dst, mask); + // Should check for X errors and raise GLException + } finally { + unlockToolkit(); + } + } + protected void resetGLFunctionAvailability() { super.resetGLFunctionAvailability(); if (DEBUG) { -- cgit v1.2.3