From be8176ce8cc66d4ff38ea21157c5c7ec16484a10 Mon Sep 17 00:00:00 2001 From: benfry Date: Thu, 9 Feb 2012 21:35:19 +0000 Subject: [PATCH] hint() and begin/endPGL bits --- .../src/processing/opengl/PGraphicsOpenGL.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java b/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java index d2d1c0b46..2c858505d 100644 --- a/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java +++ b/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java @@ -1496,6 +1496,17 @@ public class PGraphicsOpenGL extends PGraphics { } + public PGL beginPGL() { + saveGLState(); + return pgl; + } + + + public void endPGL() { + restoreGLState(); + } + + public void updatePGL() { if (primarySurface) { pgl.updatePrimary(); @@ -1681,10 +1692,10 @@ public class PGraphicsOpenGL extends PGraphics { // HINTS public void hint(int which) { - boolean oldValue = which > 0 ? hints[which] : hints[-which]; + boolean oldValue = hints[Math.abs(which)]; super.hint(which); - boolean newValue = which > 0 ? hints[which] : hints[-which]; - + boolean newValue = hints[Math.abs(which)]; + if (oldValue == newValue) { return; }