Making sure that a PImage always has a non-null parent when adding a texture

This commit is contained in:
codeanticode
2012-04-24 19:16:07 +00:00
parent 0eba7c327e
commit 7d675ec48c
@@ -40,9 +40,6 @@ import java.util.HashSet;
import java.util.Set;
import java.util.Stack;
// TODO:
// 2) non-interactive mode problem?
/**
* OpenGL renderer.
*
@@ -4943,6 +4940,9 @@ public class PGraphicsOpenGL extends PGraphics {
params = PTexture.newParameters();
img.setParams(pg, params);
}
if (img.parent == null) {
img.parent = parent;
}
PTexture tex = new PTexture(img.parent, img.width, img.height, params);
img.loadPixels();
if (img.pixels != null) tex.set(img.pixels);
@@ -6827,6 +6827,14 @@ public class PGraphicsOpenGL extends PGraphics {
}
}
void addPoint() {
}
void addLine() {
}
void addEllipse(int ellipseMode, float a, float b, float c, float d,
boolean fill, int fillColor,
boolean stroke, int strokeColor, float strokeWeight,