mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-04-06 15:04:41 +00:00
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
1 changed files with 9 additions and 6 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue