< prev index next >

src/java.desktop/share/classes/sun/java2d/opengl/OGLUtilities.java

Print this page




  34 
  35 /**
  36  * This class contains a number of static utility methods that may be
  37  * called (via reflection) by a third-party library, such as JOGL, in order
  38  * to interoperate with the OGL-based Java 2D pipeline.
  39  *
  40  * WARNING: These methods are being made available as a temporary measure
  41  * until we offer a more complete, public solution.  Like any sun.* class,
  42  * this class is not an officially supported public API; it may be modified
  43  * at will or removed completely in a future release.
  44  */
  45 class OGLUtilities {
  46 
  47     /**
  48      * These OGL-specific surface type constants are the same as those
  49      * defined in the OGLSurfaceData class and are duplicated here so that
  50      * clients of this API can access them more easily via reflection.
  51      */
  52     public static final int UNDEFINED       = OGLSurfaceData.UNDEFINED;
  53     public static final int WINDOW          = OGLSurfaceData.WINDOW;
  54     public static final int PBUFFER         = OGLSurfaceData.PBUFFER;
  55     public static final int TEXTURE         = OGLSurfaceData.TEXTURE;
  56     public static final int FLIP_BACKBUFFER = OGLSurfaceData.FLIP_BACKBUFFER;
  57     public static final int FBOBJECT        = OGLSurfaceData.FBOBJECT;
  58 
  59     private OGLUtilities() {
  60     }
  61 
  62     /**
  63      * Returns true if the current thread is the OGL QueueFlusher thread.
  64      */
  65     public static boolean isQueueFlusherThread() {
  66         return OGLRenderQueue.isQueueFlusherThread();
  67     }
  68 
  69     /**
  70      * Invokes the given Runnable on the OGL QueueFlusher thread with the
  71      * OpenGL context corresponding to the given Graphics object made
  72      * current.  It is legal for OpenGL code executed in the given
  73      * Runnable to change the current OpenGL context; it will be reset
  74      * once the Runnable completes.  No guarantees are made as to the




  34 
  35 /**
  36  * This class contains a number of static utility methods that may be
  37  * called (via reflection) by a third-party library, such as JOGL, in order
  38  * to interoperate with the OGL-based Java 2D pipeline.
  39  *
  40  * WARNING: These methods are being made available as a temporary measure
  41  * until we offer a more complete, public solution.  Like any sun.* class,
  42  * this class is not an officially supported public API; it may be modified
  43  * at will or removed completely in a future release.
  44  */
  45 class OGLUtilities {
  46 
  47     /**
  48      * These OGL-specific surface type constants are the same as those
  49      * defined in the OGLSurfaceData class and are duplicated here so that
  50      * clients of this API can access them more easily via reflection.
  51      */
  52     public static final int UNDEFINED       = OGLSurfaceData.UNDEFINED;
  53     public static final int WINDOW          = OGLSurfaceData.WINDOW;

  54     public static final int TEXTURE         = OGLSurfaceData.TEXTURE;
  55     public static final int FLIP_BACKBUFFER = OGLSurfaceData.FLIP_BACKBUFFER;
  56     public static final int FBOBJECT        = OGLSurfaceData.FBOBJECT;
  57 
  58     private OGLUtilities() {
  59     }
  60 
  61     /**
  62      * Returns true if the current thread is the OGL QueueFlusher thread.
  63      */
  64     public static boolean isQueueFlusherThread() {
  65         return OGLRenderQueue.isQueueFlusherThread();
  66     }
  67 
  68     /**
  69      * Invokes the given Runnable on the OGL QueueFlusher thread with the
  70      * OpenGL context corresponding to the given Graphics object made
  71      * current.  It is legal for OpenGL code executed in the given
  72      * Runnable to change the current OpenGL context; it will be reset
  73      * once the Runnable completes.  No guarantees are made as to the


< prev index next >