Skip to content

Commit 63ead50

Browse files
committed
GLTexture renamed to PTexture
1 parent 5cf3c8c commit 63ead50

5 files changed

Lines changed: 44 additions & 44 deletions

File tree

android/core/src/processing/core/PApplet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ public PImage createImage(int wide, int high, int format, int filter) {
11061106
}
11071107

11081108

1109-
public PImage createImage(int wide, int high, GLTexture.Parameters params) {
1109+
public PImage createImage(int wide, int high, PTexture.Parameters params) {
11101110
PImage image = new PImage(wide, high, params.format);
11111111
image.parent = this; // make save() work
11121112
if (g instanceof PGraphicsAndroid3D) {

android/core/src/processing/core/PGraphicsAndroid3D.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ public void dispose() {
375375

376376

377377
public void recreateResources() {
378-
// Recreate the openGL resources of the registered GL objects (GLTexture, PShape3D)
378+
// Recreate the openGL resources of the registered GL objects (PTexture, PShape3D)
379379
for (int i = 0; i < recreateResourceMethods.size(); i++) {
380380
GLResource resource = (GLResource)recreateResourceMethods.get(i);
381381
try {
@@ -1373,7 +1373,7 @@ protected void addNewFace(boolean firstFace) {
13731373
protected void renderTriangles(int start, int stop) {
13741374
report("render_triangles in");
13751375

1376-
GLTexture tex = null;
1376+
PTexture tex = null;
13771377
boolean texturing = false;
13781378

13791379
// Last transformation: inversion of coordinate to make compatible with Processing's inverted Y axis.

android/core/src/processing/core/PImage.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public class PImage implements PConstants, Cloneable {
5858
public PApplet parent;
5959

6060
protected Bitmap bitmap;
61-
protected GLTexture texture;
61+
protected PTexture texture;
6262

6363

6464
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
@@ -192,19 +192,19 @@ public Bitmap getBitmap() {
192192

193193

194194
public void initTexture() {
195-
texture = new GLTexture(parent, width, height, new GLTexture.Parameters(format));
195+
texture = new PTexture(parent, width, height, new PTexture.Parameters(format));
196196
updateTexture();
197197
}
198198

199199

200200
public void initTexture(int filter) {
201-
texture = new GLTexture(parent, width, height, new GLTexture.Parameters(format, filter));
201+
texture = new PTexture(parent, width, height, new PTexture.Parameters(format, filter));
202202
updateTexture();
203203
}
204204

205205

206-
public void initTexture(GLTexture.Parameters params) {
207-
texture = new GLTexture(parent, width, height, params);
206+
public void initTexture(PTexture.Parameters params) {
207+
texture = new PTexture(parent, width, height, params);
208208
updateTexture();
209209
}
210210

@@ -215,12 +215,12 @@ public void updateTexture() {
215215
}
216216

217217

218-
public void setTexture(GLTexture texture) {
218+
public void setTexture(PTexture texture) {
219219
this.texture = texture;
220220
}
221221

222222

223-
public GLTexture getTexture() {
223+
public PTexture getTexture() {
224224
return texture;
225225
}
226226

android/core/src/processing/core/PShape3D.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public class PShape3D extends PShape implements PConstants {
6464
protected int updateElement;
6565
protected int firstUpdateIdx;
6666
protected int lastUpdateIdx;
67-
protected GLTexture updateTexture;
67+
protected PTexture updateTexture;
6868

6969
protected ArrayList<VertexGroup> groups;
7070
protected VertexGroup[] vertGroup;
@@ -157,7 +157,7 @@ protected void finalize() {
157157
// Textures
158158

159159

160-
public void setTexture(GLTexture tex) {
160+
public void setTexture(PTexture tex) {
161161
if (updateElement == -1) {
162162
for (int i = 0; i < groups.size(); i++) setGroupTexture(i, tex);
163163
} else if (updateElement == TEXTURES) {
@@ -166,7 +166,7 @@ public void setTexture(GLTexture tex) {
166166
}
167167

168168

169-
public GLTexture getTexture() {
169+
public PTexture getTexture() {
170170
return getGroupTexture(0);
171171
}
172172

@@ -884,7 +884,7 @@ public void setGroup(int gr, int idx0, int idx1) {
884884
}
885885

886886

887-
public void setGroup(int gr, int idx0, int idx1, GLTexture tex) {
887+
public void setGroup(int gr, int idx0, int idx1, PTexture tex) {
888888
if (updateElement != GROUPS) {
889889
throw new RuntimeException("PShape3D: update mode is not set to GROUPS");
890890
}
@@ -919,13 +919,13 @@ public int getGroupLast(int gr) {
919919
}
920920

921921

922-
public void setGroupTexture(int gr, GLTexture tex) {
922+
public void setGroupTexture(int gr, PTexture tex) {
923923
VertexGroup group = (VertexGroup)groups.get(gr);
924924
group.texture = tex;
925925
}
926926

927927

928-
public GLTexture getGroupTexture(int gr) {
928+
public PTexture getGroupTexture(int gr) {
929929
VertexGroup group = (VertexGroup)groups.get(gr);
930930
return group.texture;
931931
}
@@ -1018,7 +1018,7 @@ protected void initGroups() {
10181018
}
10191019

10201020

1021-
protected void addGroup(int idx0, int idx1, GLTexture tex) {
1021+
protected void addGroup(int idx0, int idx1, PTexture tex) {
10221022
if (0 <= idx0 && idx0 <= idx1) {
10231023
VertexGroup group = new VertexGroup(idx0, idx1, tex);
10241024
groups.add(group);
@@ -1466,7 +1466,7 @@ public void draw(PGraphics g, int gr) {
14661466

14671467
public void draw(PGraphics g, int gr0, int gr1) {
14681468
int texTarget = GL11.GL_TEXTURE_2D;
1469-
GLTexture tex;
1469+
PTexture tex;
14701470
float pointSize;
14711471

14721472
// Setting line width and point size from stroke value.
@@ -1620,17 +1620,17 @@ static public VertexGroup newVertexGroup(int n0, int n1) {
16201620
}
16211621

16221622

1623-
static public VertexGroup newVertexGroup(int n0, int n1, GLTexture tex) {
1623+
static public VertexGroup newVertexGroup(int n0, int n1, PTexture tex) {
16241624
return new VertexGroup(n0, n1, tex);
16251625
}
16261626

16271627

1628-
static public VertexGroup newVertexGroup(int n0, int n1, int mode, GLTexture tex) {
1628+
static public VertexGroup newVertexGroup(int n0, int n1, int mode, PTexture tex) {
16291629
return new VertexGroup(n0, n1, mode, tex);
16301630
}
16311631

16321632

1633-
static public VertexGroup newVertexGroup(int n0, int n1, int mode, float weight, GLTexture tex) {
1633+
static public VertexGroup newVertexGroup(int n0, int n1, int mode, float weight, PTexture tex) {
16341634
return new VertexGroup(n0, n1, mode, weight, tex);
16351635
}
16361636

@@ -1644,19 +1644,19 @@ static protected class VertexGroup {
16441644
texture = null;
16451645
}
16461646

1647-
VertexGroup(int n0, int n1, GLTexture tex) {
1647+
VertexGroup(int n0, int n1, PTexture tex) {
16481648
first = n0;
16491649
last = n1;
16501650
glMode = 0;
16511651
sw = 0;
16521652
texture = tex;
16531653
}
16541654

1655-
VertexGroup(int n0, int n1, int mode, GLTexture tex) {
1655+
VertexGroup(int n0, int n1, int mode, PTexture tex) {
16561656
this(n0, n1, mode, 0, tex);
16571657
}
16581658

1659-
VertexGroup(int n0, int n1, int mode, float weight, GLTexture tex) {
1659+
VertexGroup(int n0, int n1, int mode, float weight, PTexture tex) {
16601660
first = n0;
16611661
last = n1;
16621662
if (mode == POINTS) glMode = GL11.GL_POINTS;
@@ -1678,6 +1678,6 @@ static protected class VertexGroup {
16781678
int last;
16791679
int glMode;
16801680
float sw;
1681-
GLTexture texture;
1681+
PTexture texture;
16821682
}
16831683
}

android/core/src/processing/core/GLTexture.java renamed to android/core/src/processing/core/PTexture.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
*
3939
*/
4040
@SuppressWarnings("unused")
41-
public class GLTexture implements PConstants {
41+
public class PTexture implements PConstants {
4242
public int width, height;
4343

4444
protected PApplet parent;
@@ -69,26 +69,26 @@ public class GLTexture implements PConstants {
6969

7070

7171
/**
72-
* Creates an instance of GLTexture with size width x height. The texture is
72+
* Creates an instance of PTexture with size width x height. The texture is
7373
* initialized (empty) to that size.
7474
* @param parent PApplet
7575
* @param width int
7676
* @param height int
7777
*/
78-
public GLTexture(PApplet parent, int width, int height) {
78+
public PTexture(PApplet parent, int width, int height) {
7979
this(parent, width, height, new Parameters());
8080
}
8181

8282

8383
/**
84-
* Creates an instance of GLTexture with size width x height and with the specified parameters.
84+
* Creates an instance of PTexture with size width x height and with the specified parameters.
8585
* The texture is initialized (empty) to that size.
8686
* @param parent PApplet
8787
* @param width int
8888
* @param height int
8989
* @param params Parameters
9090
*/
91-
public GLTexture(PApplet parent, int width, int height, Parameters params) {
91+
public PTexture(PApplet parent, int width, int height, Parameters params) {
9292
this.parent = parent;
9393
this.width = width;
9494
this.height = height;
@@ -109,22 +109,22 @@ public GLTexture(PApplet parent, int width, int height, Parameters params) {
109109

110110

111111
/**
112-
* Creates an instance of GLTexture using image file filename as source.
112+
* Creates an instance of PTexture using image file filename as source.
113113
* @param parent PApplet
114114
* @param filename String
115115
*/
116-
public GLTexture(PApplet parent, String filename) {
116+
public PTexture(PApplet parent, String filename) {
117117
this(parent, filename, new Parameters());
118118
}
119119

120120

121121
/**
122-
* Creates an instance of GLTexture using image file filename as source and the specified texture parameters.
122+
* Creates an instance of PTexture using image file filename as source and the specified texture parameters.
123123
* @param parent PApplet
124124
* @param filename String
125125
* @param params Parameters
126126
*/
127-
public GLTexture(PApplet parent, String filename, Parameters params) {
127+
public PTexture(PApplet parent, String filename, Parameters params) {
128128
this.parent = parent;
129129

130130
a3d = (PGraphicsAndroid3D)parent.g;
@@ -243,7 +243,7 @@ public void set(PImage img, int x, int y, int w, int h) {
243243
}
244244

245245

246-
public void set(GLTexture tex) { // Ignore
246+
public void set(PTexture tex) { // Ignore
247247
// TODO:
248248
// It doesn't work yet because efficient texture copy requires either FBO or pbuffers
249249
// Read this thread for more info:
@@ -270,7 +270,7 @@ public void set(int[] pixels) {
270270
public void set(int[] intArray, int arrayFormat) {
271271

272272
if (intArray.length != width * height) {
273-
throw new RuntimeException("GLTexture: wrong length of pixels array");
273+
throw new RuntimeException("PTexture: wrong length of pixels array");
274274
}
275275

276276
if (glTextureID[0] == 0) {
@@ -893,21 +893,21 @@ static public class Parameters {
893893
* Creates an instance of GLTextureParameters, setting all the parameters to default values.
894894
*/
895895
public Parameters() {
896-
target = GLTexture.NORMAL_TEXTURE;
897-
format = GLTexture.ARGB;
898-
minFilter = GLTexture.LINEAR;
899-
magFilter = GLTexture.LINEAR;
896+
target = PTexture.NORMAL_TEXTURE;
897+
format = PTexture.ARGB;
898+
minFilter = PTexture.LINEAR;
899+
magFilter = PTexture.LINEAR;
900900
}
901901

902902
public Parameters(int format) {
903-
target = GLTexture.NORMAL_TEXTURE;
903+
target = PTexture.NORMAL_TEXTURE;
904904
this.format = format;
905-
minFilter = GLTexture.LINEAR;
906-
magFilter = GLTexture.LINEAR;
905+
minFilter = PTexture.LINEAR;
906+
magFilter = PTexture.LINEAR;
907907
}
908908

909909
public Parameters(int format, int filter) {
910-
target = GLTexture.NORMAL_TEXTURE;
910+
target = PTexture.NORMAL_TEXTURE;
911911
this.format = format;
912912
minFilter = filter;
913913
magFilter = filter;

0 commit comments

Comments
 (0)