com.sun.opengl.impl
Class GLWorkerThread

java.lang.Object
  extended by com.sun.opengl.impl.GLWorkerThread

public class GLWorkerThread
extends java.lang.Object

Singleton thread upon which all OpenGL work is performed by default. Unfortunately many vendors' OpenGL drivers are not really thread-safe and stability is much improved by performing OpenGL work on at most one thread. This is the default behavior of the GLAutoDrawable implementations according to the Threading class. The GLWorkerThread replaces the original AWT event queue thread-based mechanism for two reasons: first, more than one AWT event queue thread may be spawned, for example if a dialog is being shown; second, it avoids blocking the AWT event queue thread during OpenGL rendering.


Constructor Summary
GLWorkerThread()
           
 
Method Summary
static void invokeAndWait(java.lang.Runnable runnable)
           
static void invokeLater(java.lang.Runnable runnable)
           
static boolean isStarted()
          Indicates whether the OpenGL worker thread was started, i.e., whether it is currently in use.
static boolean isWorkerThread()
          Indicates whether the current thread is the OpenGL worker thread.
static void start()
          Should only be called by Threading class if creation of the GLWorkerThread was requested via the opengl.1thread system property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GLWorkerThread

public GLWorkerThread()
Method Detail

start

public static void start()
Should only be called by Threading class if creation of the GLWorkerThread was requested via the opengl.1thread system property.


invokeAndWait

public static void invokeAndWait(java.lang.Runnable runnable)
                          throws java.lang.reflect.InvocationTargetException,
                                 java.lang.InterruptedException
Throws:
java.lang.reflect.InvocationTargetException
java.lang.InterruptedException

invokeLater

public static void invokeLater(java.lang.Runnable runnable)

isStarted

public static boolean isStarted()
Indicates whether the OpenGL worker thread was started, i.e., whether it is currently in use.


isWorkerThread

public static boolean isWorkerThread()
Indicates whether the current thread is the OpenGL worker thread.



Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.