From a32eca75cfa2de2d5aaafb748641a69bc89a1ec4 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Sun, 30 Jan 2022 09:08:28 -0500 Subject: [PATCH] deal with windows flickering during resize (fixes #386) --- core/src/processing/opengl/PSurfaceJOGL.java | 3 +++ core/todo.txt | 13 ++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/core/src/processing/opengl/PSurfaceJOGL.java b/core/src/processing/opengl/PSurfaceJOGL.java index b35a8a9b4..55f78e0b8 100644 --- a/core/src/processing/opengl/PSurfaceJOGL.java +++ b/core/src/processing/opengl/PSurfaceJOGL.java @@ -798,6 +798,9 @@ public class PSurfaceJOGL implements PSurface { if (display.getEDTUtil().isCurrentThreadEDT()) { // For some unknown reason, a few frames of the animator run on // the EDT. For those, we just skip this draw call to avoid badness. + // See below for explanation of this two line hack. + pgl.beginRender(); + pgl.endRender(sketch.sketchWindowColor()); return; } diff --git a/core/todo.txt b/core/todo.txt index 2590b4b53..a643f8d6f 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -6,6 +6,13 @@ X breaks on aarch64 X https://github.com/processing/processing4/issues/372 _ rename jAppleMenuBar, make part of build process +OpenGL resize and NPE sadness +X why does GL flash red when resizing? +X this may be because of gaps between EDT and updates +X fixing the surface.setSize() issue may fix it +X https://github.com/processing/processing4/issues/386 + + _ CODED is inconsistent between the default renderer and P2D/P3D _ includes recommendations how to fix _ https://github.com/processing/processing4/issues/376 @@ -18,6 +25,9 @@ _ https://github.com/processing/processing4/issues/128 _ https://forum.jogamp.org/JOGL-for-Mac-ARM-Silicon-td4040887.html _ https://github.com/jzy3d/jogl/blob/feature/macosx-arm64/HOW-TO-ADD-ARM64-TO-2.4.md +_ Sort out EDT issues inside OpenGL +_ https://github.com/processing/processing4/issues/385 + _ concurrent StringDict et al _ why no concurrent TreemMap? https://stackoverflow.com/a/17656453 _ https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentSkipListMap.html @@ -42,9 +52,6 @@ _ same goes for window resize events: queue them for when it's safe _ also probably need to be extending the display with the background color _ so that it's not neither stretching the viewport temporarily _ or leaving a gap at the edge of the window -_ why does GL flash red when resizing? -_ this may be because of gaps between EDT and updates -_ fixing the surface.setSize() issue may fix it _ fullScreen() not working on a second display with P2D or P3D _ https://github.com/processing/processing4/issues/352