Change AWTGLCanvas paint() to make current and release the context to avoid problems with different AWT event threads calling paint()

This commit is contained in:
Elias Naur 2006-05-30 12:41:49 +00:00
parent 7c34e2cddb
commit d281f8848c
1 changed files with 9 additions and 6 deletions

View File

@ -270,13 +270,16 @@ public class AWTGLCanvas extends Canvas implements Drawable, ComponentListener,
context.makeCurrent();
initGL();
}
if (!context.isCurrent())
context.makeCurrent();
if (update_context) {
context.update();
update_context = false;
context.makeCurrent();
try {
if (update_context) {
context.update();
update_context = false;
}
paintGL();
} finally {
Context.releaseCurrentContext();
}
paintGL();
} finally {
peer_info.unlock();
}