PImage.initTexture() renamed to PImage.loadTexture(). And it is called where it needed (getImpl, etc)

This commit is contained in:
codeanticode
2010-08-27 06:15:58 +00:00
parent 908de8988e
commit 56c5dddc31
3 changed files with 20 additions and 9 deletions
@@ -1508,7 +1508,7 @@ public class PApplet extends Activity implements PConstants, Runnable {
if (g instanceof PGraphicsAndroid3D) {
// TODO: Check why textures doesn't work in formats other than ARGB...
image.format = ARGB;
image.initTexture();
image.loadTexture();
}
return image;
}
@@ -1520,7 +1520,7 @@ public class PApplet extends Activity implements PConstants, Runnable {
if (g instanceof PGraphicsAndroid3D) {
// TODO: Check why textures doesn't work in formats other than ARGB...
image.format = ARGB;
image.initTexture(filter);
image.loadTexture(filter);
}
return image;
}
@@ -1532,7 +1532,7 @@ public class PApplet extends Activity implements PConstants, Runnable {
if (g instanceof PGraphicsAndroid3D) {
// TODO: Check why textures doesn't work in formats other than ARGB...
image.format = params.format;
image.initTexture(params);
image.loadTexture(params);
}
return image;
}
@@ -3313,7 +3313,7 @@ public class PApplet extends Activity implements PConstants, Runnable {
if (g instanceof PGraphicsAndroid3D) {
// TODO: Check why textures doesn't work in formats other than ARGB...
image.format = ARGB;
image.initTexture();
image.loadTexture();
}
return image;
}
@@ -4771,7 +4771,7 @@ public class PGraphicsAndroid3D extends PGraphics {
public void loadTexture() {
if (texture == null) {
initTexture(NEAREST);
loadTexture(NEAREST);
texture.setFlippedY(true);
}
+15 -4
View File
@@ -191,19 +191,19 @@ public class PImage implements PConstants, Cloneable {
}
public void initTexture() {
public void loadTexture() {
texture = new PTexture(parent, width, height, new PTexture.Parameters(format));
pixelsToTexture();
}
public void initTexture(int filter) {
public void loadTexture(int filter) {
texture = new PTexture(parent, width, height, new PTexture.Parameters(format, filter));
pixelsToTexture();
}
public void initTexture(PTexture.Parameters params) {
public void loadTexture(PTexture.Parameters params) {
texture = new PTexture(parent, width, height, params);
pixelsToTexture();
}
@@ -518,6 +518,11 @@ public class PImage implements PConstants, Cloneable {
index2 += w;
}
}
if (parent.g instanceof PGraphicsAndroid3D) {
// TODO: Check why textures doesn't work in formats other than ARGB...
newbie.format = ARGB;
newbie.loadTexture();
}
return newbie;
}
@@ -527,7 +532,13 @@ public class PImage implements PConstants, Cloneable {
*/
public PImage get() {
try {
return (PImage) clone();
PImage img = (PImage) clone();
if (parent.g instanceof PGraphicsAndroid3D) {
// TODO: Check why textures doesn't work in formats other than ARGB...
img.format = ARGB;
img.loadTexture();
}
return img;
} catch (CloneNotSupportedException e) {
return null;
}