mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
check thread after init
This commit is contained in:
@@ -1461,11 +1461,6 @@ public class PGraphicsOpenGL extends PGraphics {
|
||||
|
||||
@Override
|
||||
public void beginDraw() {
|
||||
if (!pgl.threadIsCurrent()) {
|
||||
PGraphics.showWarning(GL_THREAD_NOT_CURRENT);
|
||||
return;
|
||||
}
|
||||
|
||||
if (primaryGraphics) {
|
||||
if (!initialized) {
|
||||
initPrimary();
|
||||
@@ -1476,6 +1471,11 @@ public class PGraphicsOpenGL extends PGraphics {
|
||||
getPrimaryPG().setCurrentPG(this);
|
||||
}
|
||||
|
||||
if (!pgl.threadIsCurrent()) {
|
||||
PGraphics.showWarning(GL_THREAD_NOT_CURRENT);
|
||||
return;
|
||||
}
|
||||
|
||||
// This has to go after the surface initialization, otherwise offscreen
|
||||
// surfaces will have a null gl object.
|
||||
report("top beginDraw()");
|
||||
|
||||
Reference in New Issue
Block a user