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:
parent
7c34e2cddb
commit
d281f8848c
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue