Backporting changes from OPENGL2 to A3D

This commit is contained in:
codeanticode
2011-02-12 08:22:38 +00:00
parent e4a8aca378
commit 443c3f9037
4 changed files with 884 additions and 792 deletions
+26 -90
View File
@@ -6984,52 +6984,11 @@ public class PApplet extends Activity implements PConstants, Runnable {
}
public PShape beginRecord() {
if (g.is3D()) {
return ((PGraphicsAndroid3D) g).beginRecord();
} else {
throw new RuntimeException("The shapes recorder can only be used with the A3D renderer.");
}
}
public void beginShapesRecorder() {
if (g.is3D()) {
((PGraphicsAndroid3D) g).beginShapesRecorder();
} else {
throw new RuntimeException("The shapes recorder can only be used with the A3D renderer.");
}
}
public void beginShapeRecorder() {
if (g.is3D()) {
((PGraphicsAndroid3D) g).beginShapeRecorder();
} else {
throw new RuntimeException("The shape recorder can only be used with the A3D renderer.");
}
}
public void beginShapeRecorder(int kind) {
if (g.is3D()) {
((PGraphicsAndroid3D) g).beginShapeRecorder(kind);
} else {
throw new RuntimeException("The shape recorder can only be used with the A3D renderer.");
}
}
public void edge(boolean edge) {
g.edge(edge);
}
public void autoNormal(boolean auto) {
g.autoNormal(auto);
}
public void normal(float nx, float ny, float nz) {
g.normal(nx, ny, nz);
}
@@ -7090,42 +7049,6 @@ public class PApplet extends Activity implements PConstants, Runnable {
}
public void endRecord() {
if (g.is3D()) {
((PGraphicsAndroid3D) g).endRecord();
} else {
throw new RuntimeException("The shapes recorder can only be used with the A3D renderer.");
}
}
public PShape3D endShapesRecorder() {
if (g.is3D()) {
return ((PGraphicsAndroid3D) g).endShapesRecorder();
} else {
throw new RuntimeException("The shapes recorder can only be used with the A3D renderer.");
}
}
public PShape3D endShapeRecorder() {
if (g.is3D()) {
return ((PGraphicsAndroid3D) g).endShapeRecorder();
} else {
throw new RuntimeException("The shape recorder can only be used with the A3D renderer.");
}
}
public PShape3D endShapeRecorder(int mode) {
if (g.is3D()) {
return ((PGraphicsAndroid3D) g).endShapeRecorder(mode);
} else {
throw new RuntimeException("The shape recorder can only be used with the A3D renderer.");
}
}
public void bezierVertex(float x2, float y2,
float x3, float y3,
float x4, float y4) {
@@ -8158,50 +8081,62 @@ public class PApplet extends Activity implements PConstants, Runnable {
// New API:
public void blend(int mode) {
g.blend(mode);
public void screenBlend(int mode) {
g.screenBlend(mode);
}
public void noBlend() {
g.noBlend();
}
public void textureBlend(int mode) {
g.textureBlend(mode);
}
public void noTextureBlend() {
g.noTextureBlend();
}
public void mergeRecord() {
g.mergeRecord();
public PShape beginRecord() {
return g.beginRecord();
}
public void noMergeRecord() {
g.noMergeRecord();
public void endRecord() {
g.endRecord();
}
public void mergeShapes(boolean val) {
g.mergeShapes(val);
}
public void shapeName(String name) {
g.shapeName(name);
}
public void autoNormal(boolean auto) {
g.autoNormal(auto);
}
public void matrixMode(int mode) {
g.matrixMode(mode);
}
public void texture(PImage image0, PImage image1) {
g.texture(image0, image1);
}
public void texture(PImage image0, PImage image1, PImage image2) {
g.texture(image0, image1, image2);
}
public void texture(PImage image0, PImage image1, PImage image2, PImage image3) {
g.texture(image0, image1, image2, image3);
}
public void texture(PImage[] images) {
g.texture(images);
}
@@ -8210,6 +8145,7 @@ public class PApplet extends Activity implements PConstants, Runnable {
g.vertex(x, y, u0, v0, u1, v1);
}
public void vertex(float x, float y, float u0, float v0, float u1, float v1, float u2, float v2) {
g.vertex(x, y, u0, v0, u1, v1, u2, v2);
}
+26 -39
View File
@@ -857,14 +857,6 @@ public class PGraphics extends PImage implements PConstants {
this.edge = edge;
}
/**
* Sets the automatic normal calculation mode.
*/
public void autoNormal(boolean auto) {
this.autoNormal = auto;
}
/**
* Sets the current normal vector. Only applies with 3D rendering
@@ -5092,60 +5084,55 @@ public class PGraphics extends PImage implements PConstants {
// New API:
public void blend(int mode) {
if (!is3D()) {
showMissingWarning("blend");
}
}
public void noBlend() {
if (!is3D()) {
showMissingWarning("noBlend");
}
public void screenBlend(int mode) {
showMissingWarning("screen blending requires A3D");
}
public void textureBlend(int mode) {
if (!is3D()) {
showMissingWarning("blend");
}
showMissingWarning("texture blending requires A3D");
}
public void noTextureBlend() {
if (!is3D()) {
showMissingWarning("noBlend");
}
public PShape beginRecord() {
showMissingWarning("shape recording requires A3D");
return null;
}
public void mergeRecord() {
if (!is3D()) {
showMissingWarning("mergeRecord");
}
public void endRecord() {
showMissingWarning("shape recording requires A3D");
}
public void noMergeRecord() {
if (!is3D()) {
showMissingWarning("noMergeRecord");
}
public boolean isRecording() {
showMissingWarning("shape recording requires A3D");
return false;
}
public void mergeShapes(boolean val) {
showMissingWarning("shape recording requires A3D");
}
public void shapeName(String name) {
if (!is3D()) {
showMissingWarning("shapeName");
}
showMissingWarning("shape recording requires A3D");
}
public void autoNormal(boolean auto) {
this.autoNormal = auto;
}
public void matrixMode(int mode) {
showMissingWarning("setting matrix mode requires OPENGL2");
showMissingWarning("setting matrix mode requires A3D");
}
public void texture(PImage image0, PImage image1) {
if (!is3D()) {
showMissingWarning("texture(PImage image0, PImage image1)");
File diff suppressed because it is too large Load Diff
@@ -2356,7 +2356,7 @@ public class PShape3D extends PShape implements PConstants {
gl.glTexCoordPointer(2, GL11.GL_FLOAT, 0, 0);
}
if (1 < numTextures) {
a3d.setMultitextureBlend(renderTextures, numTextures);
a3d.setTextureBlend(renderTextures, numTextures);
}
}
}
@@ -2378,7 +2378,7 @@ public class PShape3D extends PShape implements PConstants {
if (0 < numTextures) {
if (1 < numTextures) {
a3d.clearMultitextureBlend(numTextures);
a3d.cleanupTextureBlend(numTextures);
}
if (pointSprites) {
gl.glDisable(GL11.GL_POINT_SPRITE_OES);