Skip to content

Commit d2bbde4

Browse files
committed
Move _setupDone=true after settle loop to prevent early setProjection crash on Windows
1 parent a294cfb commit d2bbde4

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

mode/CppMode.jar

0 Bytes
Binary file not shown.

src/Processing.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3498,9 +3498,7 @@ void PApplet::run(){
34983498
// fully resize the window first. winsize_cb fires during these polls and
34993499
// sets the correct viewport. After settling, this->setup() and this->draw() use the
35003500
// correct dimensions from the start -- no shifted first frame.
3501-
_setupDone = true; // enable winsize_cb to update projection during settle
3502-
// Initialize the framebuffer before the settle loop -- required on Windows
3503-
// to avoid swapping an uninitialized back buffer which crashes the driver.
3501+
// Initialize the framebuffer
35043502
glClearColor(0.8f,0.8f,0.8f,1);
35053503
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
35063504
glfwSwapBuffers(gWindow);
@@ -3513,6 +3511,7 @@ void PApplet::run(){
35133511
glfwSwapBuffers(gWindow);
35143512
}
35153513
#endif
3514+
_setupDone = true; // enable winsize_cb to update projection after settle
35163515
if (!defaultP3D) setProjection(winWidth, winHeight);
35173516

35183517
this->setup();

0 commit comments

Comments
 (0)