mirror of
https://github.com/processing/processing4.git
synced 2026-02-02 13:21:07 +01:00
added PShape.setTexture(), PShape.setTextureMode()
This commit is contained in:
@@ -184,7 +184,6 @@ public class PShapeOpenGL extends PShape {
|
||||
|
||||
// Modes inherited from renderer
|
||||
|
||||
protected int textureMode;
|
||||
protected int rectMode;
|
||||
protected int ellipseMode;
|
||||
protected int shapeMode;
|
||||
@@ -725,7 +724,13 @@ public class PShapeOpenGL extends PShape {
|
||||
// Drawing methods
|
||||
|
||||
|
||||
public void textureMode(int mode) {
|
||||
@Override
|
||||
public void setTextureMode(int mode) {
|
||||
if (openShape) {
|
||||
PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setTextureMode()");
|
||||
return;
|
||||
}
|
||||
|
||||
if (family == GROUP) {
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
PShapeOpenGL child = (PShapeOpenGL) children[i];
|
||||
@@ -738,7 +743,12 @@ public class PShapeOpenGL extends PShape {
|
||||
|
||||
|
||||
@Override
|
||||
public void texture(PImage tex) {
|
||||
public void setTexture(PImage tex) {
|
||||
if (openShape) {
|
||||
PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setTexture()");
|
||||
return;
|
||||
}
|
||||
|
||||
if (family == GROUP) {
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
PShapeOpenGL child = (PShapeOpenGL) children[i];
|
||||
@@ -760,26 +770,6 @@ public class PShapeOpenGL extends PShape {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void noTexture() {
|
||||
if (family == GROUP) {
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
PShapeOpenGL child = (PShapeOpenGL) children[i];
|
||||
child.noTexture();
|
||||
}
|
||||
} else {
|
||||
PImage tex0 = image;
|
||||
image = null;
|
||||
if (tex0 != null && parent != null) {
|
||||
((PShapeOpenGL)parent).removeTexture(tex0);
|
||||
if (is2D()) {
|
||||
((PShapeOpenGL)parent).strokedTexture(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void addTexture(PImage tex) {
|
||||
if (textures == null) {
|
||||
textures = new HashSet<PImage>();
|
||||
|
||||
Reference in New Issue
Block a user