summaryrefslogtreecommitdiffstats
path: root/src/net/java/games/jogl/GLCanvas.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2003-06-26 13:21:12 +0000
committerKenneth Russel <[email protected]>2003-06-26 13:21:12 +0000
commit0a6e191eaebcc8edc2611dbedab6fd04a615fc2f (patch)
tree7f8a9b8e88a6bc6662827d3f092b943b1ea893fb /src/net/java/games/jogl/GLCanvas.java
parent2b54833bb15d6cae356fa0c5777d11e152d774cb (diff)
Initial Mac OS X port of Jogl by Gerard Ziemski and Kenneth Russell,
subsuming the previous prototype implementation (no GLCanvas support) done by Marc Downie. Added user's guide (HTML format) under doc/userguide/index.html. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@13 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/net/java/games/jogl/GLCanvas.java')
-rw-r--r--src/net/java/games/jogl/GLCanvas.java24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/net/java/games/jogl/GLCanvas.java b/src/net/java/games/jogl/GLCanvas.java
index 21c06ee3f..adee0315d 100644
--- a/src/net/java/games/jogl/GLCanvas.java
+++ b/src/net/java/games/jogl/GLCanvas.java
@@ -60,6 +60,10 @@ public final class GLCanvas extends Canvas implements GLDrawable {
private GLDrawableHelper drawableHelper = new GLDrawableHelper();
private GLContext context;
+
+ // FIXME: Temporary workaround for JAWT bug in Panther developer release.
+ // This workaround makes things quite a bit slower
+ private static final boolean isOSX = System.getProperty("os.name").equals("Mac OS X");
GLCanvas(GLCapabilities capabilities, GLCapabilitiesChooser chooser) {
super();
@@ -72,14 +76,24 @@ public final class GLCanvas extends Canvas implements GLDrawable {
}
public void display() {
- context.invokeGL(displayAction, false, initAction);
+ if (isOSX) {
+ // Temporary workaround for JAWT bug in Panther developer release.
+ // All OpenGL rendering must occur on the AWT event thread.
+ repaint();
+ } else {
+ displayImpl();
+ }
}
/** Overridden from Canvas; calls {@link #display}. Should not be
invoked by applications directly. */
public void paint(Graphics g) {
- if (!context.getNoAutoRedrawMode()) {
- display();
+ if (isOSX) {
+ displayImpl();
+ } else {
+ if (!context.getNoAutoRedrawMode()) {
+ display();
+ }
}
}
@@ -161,6 +175,10 @@ public final class GLCanvas extends Canvas implements GLDrawable {
// Internals only below this point
//
+ private void displayImpl() {
+ context.invokeGL(displayAction, false, initAction);
+ }
+
class InitAction implements Runnable {
public void run() {
drawableHelper.init(GLCanvas.this);