From b7244795d44ab06ea32d68136cdb1408804514cc Mon Sep 17 00:00:00 2001
From: Kenneth Russel <kbrussel@alum.mit.edu>
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
---
 src/classes/javax/media/opengl/GLContext.java | 30 +++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

(limited to 'src/classes/javax/media/opengl/GLContext.java')

diff --git a/src/classes/javax/media/opengl/GLContext.java b/src/classes/javax/media/opengl/GLContext.java
index b6bc7c66d..a70e131c8 100644
--- a/src/classes/javax/media/opengl/GLContext.java
+++ b/src/classes/javax/media/opengl/GLContext.java
@@ -111,6 +111,36 @@ public abstract class GLContext {
    */
   public abstract void release() throws GLException;
 
+  /**
+   * Copies selected groups of OpenGL state variables from the
+   * supplied source context into this one. The <code>mask</code>
+   * parameter indicates which groups of state variables are to be
+   * copied. <code>mask</code> contains the bitwise OR of the same
+   * symbolic names that are passed to the GL command {@link
+   * GL#glPushAttrib glPushAttrib}. The single symbolic constant
+   * {@link GL#GL_ALL_ATTRIB_BITS GL_ALL_ATTRIB_BITS} can be used to
+   * copy the maximum possible portion of rendering state. <P>
+   *
+   * Not all values for GL state can be copied. For example, pixel
+   * pack and unpack state, render mode state, and select and feedback
+   * state are not copied. The state that can be copied is exactly the
+   * state that is manipulated by the GL command {@link
+   * GL#glPushAttrib glPushAttrib}. <P>
+   *
+   * On most platforms, this context may not be current to any thread,
+   * including the calling thread, when this method is called. Some
+   * platforms have additional requirements such as whether this
+   * context or the source context must occasionally be made current
+   * in order for the results of the copy to be seen; these
+   * requirements are beyond the scope of this specification.
+   *
+   * @param source the source OpenGL context from which to copy state
+   * @param mask a mask of symbolic names indicating which groups of state to copy
+
+   * @throws GLException if an OpenGL-related error occurred
+   */
+  public abstract void copy(GLContext source, int mask) throws GLException;
+
   /**
    * Returns the context which is current on the current thread. If no
    * context is current, returns null.
-- 
cgit v1.2.3