|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jogamp.newt.util.MainThread
public class MainThread
NEWT Utility class MainThread
FIXME: Update this documentation! This class just provides a main-thread utility, forking of a main java class on another thread while being able to continue doing platform specific things on the main-thread. The latter is essential for eg. MacOSX, where we continue to run NSApp.run().
This class provides a startup singleton main thread, from which a new thread with the users main class is launched.invoke(..)
,
have a look at the NEWT Mac OSX Window
driver implementation.
If your platform is not Mac OS X, but you want to test your code without modifying
this class, you have to set the system property newt.MainThread.force
to true
.
The code is compatible with all other platform, which support multithreaded windowing handling.
Since those platforms won't trigger the main thread serialization, the main method
will be simply executed, in case you haven't set newt.MainThread.force
to true
.
Test case on Mac OS X (or any other platform):
java -XstartOnFirstThread com.jogamp.newt.util.MainThread demos.es1.RedSquare -GL2 -GL2 -GL2 -GL2Which starts 4 threads, each with a window and OpenGL rendering.
Field Summary | |
---|---|
static boolean |
HINT_USE_MAIN_THREAD
if true, use the main thread EDT, otherwise AWT's EDT |
static boolean |
useMainThread
|
Constructor Summary | |
---|---|
MainThread()
|
Method Summary | |
---|---|
static MainThread |
getSingleton()
|
static void |
main(String[] args)
Your new java application main entry, which pipelines your application |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean HINT_USE_MAIN_THREAD
public static boolean useMainThread
Constructor Detail |
---|
public MainThread()
Method Detail |
---|
public static void main(String[] args) throws SecurityException, NoSuchMethodException, ClassNotFoundException
ClassNotFoundException
NoSuchMethodException
SecurityException
public static MainThread getSingleton()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |