From 5f0bcdc1d9977d1ae435bf17f0ed8b9a8a1e8f0d Mon Sep 17 00:00:00 2001 From: codeanticode Date: Sat, 22 Jan 2022 21:40:13 -0500 Subject: [PATCH] no need to initialize line and point buffers in 2D --- core/src/processing/opengl/PShapeOpenGL.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/src/processing/opengl/PShapeOpenGL.java b/core/src/processing/opengl/PShapeOpenGL.java index daca73bdc..8d4076b4e 100644 --- a/core/src/processing/opengl/PShapeOpenGL.java +++ b/core/src/processing/opengl/PShapeOpenGL.java @@ -4605,12 +4605,14 @@ public class PShapeOpenGL extends PShape { initPolyBuffers(); } - if (hasLines && (needBufferInit || outdated)) { - initLineBuffers(); - } + if (is3D()) { + if (hasLines && (needBufferInit || outdated)) { + initLineBuffers(); + } - if (hasPoints && (needBufferInit || outdated)) { - initPointBuffers(); + if (hasPoints && (needBufferInit || outdated)) { + initPointBuffers(); + } } needBufferInit = false;