Skip to content

Commit 9782271

Browse files
committed
check thread after init
1 parent 44387f1 commit 9782271

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

core/src/processing/opengl/PGraphicsOpenGL.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,11 +1461,6 @@ protected boolean pointBuffersContextIsOutdated() {
14611461

14621462
@Override
14631463
public void beginDraw() {
1464-
if (!pgl.threadIsCurrent()) {
1465-
PGraphics.showWarning(GL_THREAD_NOT_CURRENT);
1466-
return;
1467-
}
1468-
14691464
if (primaryGraphics) {
14701465
if (!initialized) {
14711466
initPrimary();
@@ -1476,6 +1471,11 @@ public void beginDraw() {
14761471
getPrimaryPG().setCurrentPG(this);
14771472
}
14781473

1474+
if (!pgl.threadIsCurrent()) {
1475+
PGraphics.showWarning(GL_THREAD_NOT_CURRENT);
1476+
return;
1477+
}
1478+
14791479
// This has to go after the surface initialization, otherwise offscreen
14801480
// surfaces will have a null gl object.
14811481
report("top beginDraw()");

0 commit comments

Comments
 (0)