Skip to content

Commit 6a2c54a

Browse files
committed
PGraphics for Renderer
1 parent 1420123 commit 6a2c54a

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

src/monkstone/vecmath/AppRender.java

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
package monkstone.vecmath;
22

33
import processing.core.PApplet;
4+
import processing.core.PGraphics;
45

56
/**
6-
*
7-
* @author Martin Prout
7+
* Renderer
8+
* Copyright (c) 2018 Martin Prout
89
*/
910
public class AppRender implements JRender {
1011

11-
final PApplet app;
12+
final PGraphics g;
1213

1314
/**
1415
*
1516
* @param app PApplet
1617
*/
1718
public AppRender(final PApplet app) {
18-
this.app = app;
19+
this.g = app.g;
1920
}
2021

2122
/**
@@ -25,17 +26,17 @@ public AppRender(final PApplet app) {
2526
*/
2627
@Override
2728
public void vertex(double x, double y) {
28-
app.vertex((float) x, (float) y);
29+
g.vertex((float) x, (float) y);
2930
}
30-
31+
3132
/**
3233
*
3334
* @param x double
3435
* @param y double
3536
*/
3637
@Override
3738
public void curveVertex(double x, double y) {
38-
app.curveVertex((float) x, (float) y);
39+
g.curveVertex((float) x, (float) y);
3940
}
4041

4142
/**
@@ -46,7 +47,7 @@ public void curveVertex(double x, double y) {
4647
*/
4748
@Override
4849
public void vertex(double x, double y, double z) {
49-
app.vertex((float) x, (float) y, (float) z);
50+
g.vertex((float) x, (float) y, (float) z);
5051
}
5152

5253
/**
@@ -57,7 +58,7 @@ public void vertex(double x, double y, double z) {
5758
*/
5859
@Override
5960
public void normal(double x, double y, double z) {
60-
app.normal((float) x, (float) y, (float) z);
61+
g.normal((float) x, (float) y, (float) z);
6162
}
6263

6364
/**
@@ -70,9 +71,9 @@ public void normal(double x, double y, double z) {
7071
*/
7172
@Override
7273
public void vertex(double x, double y, double z, double u, double v) {
73-
app.vertex((float) x, (float) y, (float) z, (float) u, (float) v);
74+
g.vertex((float) x, (float) y, (float) z, (float) u, (float) v);
7475
}
75-
76+
7677
/**
7778
*
7879
* @param x double
@@ -81,6 +82,6 @@ public void vertex(double x, double y, double z, double u, double v) {
8182
*/
8283
@Override
8384
public void curveVertex(double x, double y, double z) {
84-
app.curveVertex((float) x, (float) y, (float) z);
85+
g.curveVertex((float) x, (float) y, (float) z);
8586
}
8687
}

0 commit comments

Comments
 (0)