From 8eb1d7838ad069e125376d709f0cd67f821799f2 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Tue, 8 Feb 2011 05:35:21 +0000 Subject: [PATCH] Replaced beginProjection()/endProjection() API with matrixMode() --- core/src/processing/core/PApplet.java | 18 ++++++------------ core/src/processing/core/PConstants.java | 5 +++++ core/src/processing/core/PGraphics.java | 21 ++++++--------------- 3 files changed, 17 insertions(+), 27 deletions(-) diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index c58230324..f70e44711 100644 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -9265,18 +9265,6 @@ public class PApplet extends Applet } - public void beginProjection() { - if (recorder != null) recorder.beginProjection(); - g.beginProjection(); - } - - - public void endProjection() { - if (recorder != null) recorder.endProjection(); - g.endProjection(); - } - - public void beginCamera() { if (recorder != null) recorder.beginCamera(); g.beginCamera(); @@ -10233,6 +10221,12 @@ public class PApplet extends Applet } + public void matrixMode(int mode) { + if (recorder != null) recorder.matrixMode(mode); + g.matrixMode(mode); + } + + public void texture(PImage image0, PImage image1) { if (recorder != null) recorder.texture(image0, image1); g.texture(image0, image1); diff --git a/core/src/processing/core/PConstants.java b/core/src/processing/core/PConstants.java index 05a272366..c976be34d 100644 --- a/core/src/processing/core/PConstants.java +++ b/core/src/processing/core/PConstants.java @@ -290,6 +290,11 @@ public interface PConstants { static final int PROBLEM = 2; + // types of transformation matrices + + static final int PROJECTION = 0; + static final int MODELVIEW = 1; + // types of projection matrices static final int CUSTOM = 0; // user-specified fanciness diff --git a/core/src/processing/core/PGraphics.java b/core/src/processing/core/PGraphics.java index d35daed04..bc0c53e1f 100644 --- a/core/src/processing/core/PGraphics.java +++ b/core/src/processing/core/PGraphics.java @@ -4109,20 +4109,6 @@ public class PGraphics extends PImage implements PConstants { } - ////////////////////////////////////////////////////////////// - - // PROJECTION - - public void beginProjection() { - showMethodWarning("beginProjection"); - } - - - public void endProjection() { - showMethodWarning("endProjection"); - } - - ////////////////////////////////////////////////////////////// // CAMERA @@ -6001,7 +5987,12 @@ public class PGraphics extends PImage implements PConstants { public void autoNormal(boolean auto) { this.autoNormal = auto; } - + + + public void matrixMode(int mode) { + showMissingWarning("setting matrix mode requires OPENGL2"); + } + public void texture(PImage image0, PImage image1) { showMissingWarning("multitexturing requires OPENGL2");