diff --git a/processing/app/PdeBase.java b/processing/app/PdeBase.java index d41f5f828..521c332b0 100644 --- a/processing/app/PdeBase.java +++ b/processing/app/PdeBase.java @@ -45,7 +45,7 @@ import com.ice.jni.registry.*; * files and images, etc) that comes from that. */ public class PdeBase { - static final String VERSION = "0076 Alpha"; + static final String VERSION = "0077 Alpha"; static String openedAtStartup; diff --git a/processing/core/PApplet.java b/processing/core/PApplet.java index 531dc1ce6..55e3df330 100644 --- a/processing/core/PApplet.java +++ b/processing/core/PApplet.java @@ -502,6 +502,7 @@ public class PApplet extends Applet insets.top + ((winH - insets.top - insets.bottom) - height)/2, winW, winH); } else { + //System.out.println("frame was null"); setBounds(0, 0, width, height); } } @@ -4579,13 +4580,13 @@ v PApplet.this.stop(); } - public void vertex(float x, float y, float u, float v) { - g.vertex(x, y, u, v); + public void vertex(float x, float y, float z) { + g.vertex(x, y, z); } - public void vertex(float x, float y, float z) { - g.vertex(x, y, z); + public void vertex(float x, float y, float u, float v) { + g.vertex(x, y, u, v); } diff --git a/processing/core/PGraphics.java b/processing/core/PGraphics.java index c5d1fc889..fe0d1a240 100644 --- a/processing/core/PGraphics.java +++ b/processing/core/PGraphics.java @@ -447,15 +447,15 @@ public class PGraphics extends PImage implements PConstants { public void normal(float nx, float ny, float nz) { - // not supported in 2D + throw new RuntimeException("normal() can only be used with depth()"); } public void textureMode(int mode) { - // not supported in 2D + throw new RuntimeException("textureMode() can only be used with depth()"); } public void texture(PImage image) { - // not supported in 2D + throw new RuntimeException("texture() can only be used with depth()"); } @@ -597,16 +597,21 @@ public class PGraphics extends PImage implements PConstants { } - public void vertex(float x, float y, float u, float v) { - // not supported in 2D + public void vertex(float x, float y, float z) { + throw new RuntimeException("vertex(x, y, z) can only be used with " + + "depth(), use vertex(x, y) instead."); } - public void vertex(float x, float y, float z) { - // not supported in 2D + + public void vertex(float x, float y, float u, float v) { + throw new RuntimeException("vertex() with u, v coordinates " + + "can only be used with depth()"); } + public void vertex(float x, float y, float z, float u, float v) { - // not supported in 2D + throw new RuntimeException("vertex() with u, v coordinates " + + "can only be used with depth()"); } @@ -657,7 +662,8 @@ public class PGraphics extends PImage implements PConstants { * See notes with the bezier() function. */ public void bezierVertex(float x, float y, float z) { - // not supported in 2D + throw new RuntimeException("bezierVertex(x, y, z) can only be used with " + + "depth(), use bezierVertex(x, y) instead."); } @@ -665,6 +671,7 @@ public class PGraphics extends PImage implements PConstants { * See notes with the curve() function. */ public void curveVertex(float x, float y) { + //throw new RuntimeException("curveVertex() temporarily disabled"); // TODO get matrix setup happening } @@ -673,7 +680,8 @@ public class PGraphics extends PImage implements PConstants { * See notes with the curve() function. */ public void curveVertex(float x, float y, float z) { - // not supported in 2D + throw new RuntimeException("curveVertex(x, y, z) can only be used with " + + "depth(), use curveVertex(x, y) instead."); } @@ -747,7 +755,8 @@ public class PGraphics extends PImage implements PConstants { public void point(float x, float y, float z) { - // not supported in 2D + throw new RuntimeException("point(x, y, z) can only be used with " + + "depth(), use point(x, y) instead."); } @@ -758,7 +767,8 @@ public class PGraphics extends PImage implements PConstants { public void line(float x1, float y1, float z1, float x2, float y2, float z2) { - // not supported in 2D + throw new RuntimeException("line(x1, y1, z1, x2, y2, z2) " + + "can only be used with depth()"); } @@ -915,18 +925,23 @@ public class PGraphics extends PImage implements PConstants { public void box(float size) { + throw new RuntimeException("box() can only be used with depth()"); } public void box(float w, float h, float d) { + throw new RuntimeException("box() can only be used with depth()"); } public void sphereDetail(int res) { + throw new RuntimeException("sphereDetail() can only be used with depth()"); } public void sphere(float r) { + throw new RuntimeException("sphere() can only be used with depth()"); } public void sphere(float x, float y, float z, float r) { + throw new RuntimeException("sphere() can only be used with depth()"); } @@ -1046,7 +1061,8 @@ public class PGraphics extends PImage implements PConstants { float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4) { - // not implemented in 2D + throw new RuntimeException("bezier() with z coordinates " + + "can only be used with depth()"); } @@ -1191,12 +1207,8 @@ public class PGraphics extends PImage implements PConstants { float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4) { - beginShape(LINE_STRIP); - curveVertex(x1, y1, z1); - curveVertex(x2, y2, z2); - curveVertex(x3, y3, z3); - curveVertex(x4, y4, z4); - endShape(); + throw new RuntimeException("curve() with z coordinates " + + "can only be used with depth()"); } @@ -1570,7 +1582,8 @@ public class PGraphics extends PImage implements PConstants { public void translate(float tx, float ty, float tz) { - // not supported in 2D + throw new RuntimeException("translate() with a z coordinate " + + "can only be used with depth()"); } @@ -1596,20 +1609,21 @@ public class PGraphics extends PImage implements PConstants { public void rotateX(float angle) { - // not supported in 2D + throw new RuntimeException("rotateX() can only be used with depth()"); } public void rotateY(float angle) { - // not supported in 2D + throw new RuntimeException("rotateX() can only be used with depth()"); } public void rotateZ(float angle) { - // not supported in 2D + throw new RuntimeException("rotateX() can only be used with depth()"); } public void rotate(float angle, float vx, float vy, float vz) { - // not supported in 2D + throw new RuntimeException("rotate(angle, x, y, z) " + + "can only be used with depth()"); } @@ -1630,7 +1644,8 @@ public class PGraphics extends PImage implements PConstants { public void scale(float x, float y, float z) { - // not supported in 2D + throw new RuntimeException("scale() with a z coordinate " + + "can only be used with depth()"); } @@ -1700,7 +1715,8 @@ public class PGraphics extends PImage implements PConstants { float n10, float n11, float n12, float n13, float n20, float n21, float n22, float n23, float n30, float n31, float n32, float n33) { - // not supported in 2D + throw new RuntimeException("applyMatrix() with a 4x4 matrix " + + "can only be used with depth()"); } @@ -1743,32 +1759,40 @@ public class PGraphics extends PImage implements PConstants { public void cameraMode(int mode) { + throw new RuntimeException("cameraMode() can only be used with depth()"); } public void beginCamera() { + throw new RuntimeException("beginCamera() can only be used with depth()"); } public void endCamera() { + throw new RuntimeException("endCamera() can only be used with depth()"); } public void ortho(float left, float right, float bottom, float top, float near, float far) { + throw new RuntimeException("ortho() can only be used with depth()"); } public void perspective(float fovy, float aspect, float zNear, float zFar) { + throw new RuntimeException("perspective() can only be used with depth()"); } public void frustum(float left, float right, float bottom, float top, float znear, float zfar) { + throw new RuntimeException("frustum() can only be used with depth()"); } public void lookat(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ) { + throw new RuntimeException("lookat() can only be used with depth()"); } public void printCamera() { + throw new RuntimeException("printCamera() can only be used with depth()"); } @@ -1789,27 +1813,29 @@ public class PGraphics extends PImage implements PConstants { public float screenX(float x, float y, float z) { - return 0; + throw new RuntimeException("screenX(x, y, z) can only be used " + + "with depth(), use screenX(x, y) instead"); } public float screenY(float x, float y, float z) { - return 0; + throw new RuntimeException("screenY(x, y, z) can only be used " + + "with depth(), use screenY(x, y) instead"); } public float screenZ(float x, float y, float z) { - return 0; + throw new RuntimeException("screenZ() can only be used with depth()"); } public float objectX(float x, float y, float z) { - return 0; + throw new RuntimeException("objectX() can only be used with depth()"); } public float objectY(float x, float y, float z) { - return 0; + throw new RuntimeException("objectY() can only be used with depth()"); } public float objectZ(float x, float y, float z) { - return 0; + throw new RuntimeException("objectZ() can only be used with depth()"); } @@ -1820,31 +1846,44 @@ public class PGraphics extends PImage implements PConstants { public void lights() { + throw new RuntimeException("lights() can only be used with depth()"); } public void noLights() { + throw new RuntimeException("noLights() can only be used with depth()"); } public void light(int num, float x, float y, float z, float red, float green, float blue) { + throw new RuntimeException("light() can only be used with depth()"); } public void lightEnable(int num) { + throw new RuntimeException("lightEnable() can only be used with depth()"); } public void lightDisable(int num) { + throw new RuntimeException("lightDisable() can only be used with depth()"); } public void lightPosition(int num, float x, float y, float z) { + throw new RuntimeException("lightPosition() " + + "can only be used with depth()"); } public void lightAmbient(int num, float x, float y, float z) { + throw new RuntimeException("lightAmbient() " + + "can only be used with depth()"); } public void lightDiffuse(int num, float x, float y, float z) { + throw new RuntimeException("lightDiffuse() " + + "can only be used with depth()"); } public void lightSpecular(int num, float x, float y, float z) { + throw new RuntimeException("lightSpecular() " + + "can only be used with depth()"); } diff --git a/processing/core/todo.txt b/processing/core/todo.txt index fc7b8cdcb..a8d0e8fd9 100644 --- a/processing/core/todo.txt +++ b/processing/core/todo.txt @@ -2,6 +2,12 @@ X bring back pmouseX/Y using a tricky method of storing separate X values for inside draw() versus inside the event handler versions X debug handling, and make firstMouse public +X explicitly state depth()/nodepth() +X don't allocate zbuffer & stencil until depth() is called +X arc with stroke only draws the arc shape itself +X may need a 'wedge' function to draw a stroke around the whole thing +X only allocate stencil and zbuffer on first call to depth() +X this will require changes to PTriangle and PLine inside their loops covered in previous X before graphics engine change, attach jogl stuff @@ -32,110 +38,111 @@ X add gzipInput and gzipOutput X light(x, y, z, c1, c2, c3, TYPE) X also BLight with same constructor, and on() and off() fxn -image stuff -o could also do PImage2, which would need a getPixels() before messing w/ it -o bad idea, distinction not clear -o even in java 1.1, could use regular java.awt.Image and require getPixels() -o -> 1.1 wouldn't help anything, because needs pixels to render, oops - api changes X removed circle.. it's dumb when ellipse() is in there X (it's not like we have square() in the api) X arcMode is gone.. just uses ellipseMode() X save tga and tif methods are static and public X imageMode(CORNER) and CORNERS are the only usable versions +X alpha(PImage) is now called mask() instead +X already have an alpha() function that gets alpha bits +X on start, mouseX is 0.. how to avoid? +X use firstMouse variable.. figure out naming -_ alpha(PImage) is now called mask() instead? -_ already have an alpha() function that gets alpha bits -_ sphere x,y,z,r or box w,h,d.. need to make them consistent -_ should we switch to curveVertex(1,2,3) (ala curveto) -_ because some confusion with mixing types of curves - -_ the updatePixels() in PGraphics has to be overridden (from PImage) -_ to make itself actually update on-screen -_ actually, should be no different than the check_image function -_ PGraphics2 and PGraphicsGL will need loadPixels() to be called -_ in order to read pixels from the buffer -_ loadPixels() and updatePixels() prolly should be shut off in opengl -_ make people use get() instead to grab sub-images -_ PGraphicsGL.copy() needs to be overridden.. use glDrawBitmap - +image stuff +o could also do PImage2, which would need a getPixels() before messing w/ it +o bad idea, distinction not clear +o even in java 1.1, could use regular java.awt.Image and require getPixels() +o -> 1.1 wouldn't help anything, because needs pixels to render, oops +X the updatePixels() in PGraphics has to be overridden (from PImage) +X to make itself actually update on-screen +X actually, should be no different than the check_image function +X PGraphics2 and PGraphicsGL will need loadPixels() to be called +X in order to read pixels from the buffer +X loadPixels() and updatePixels() prolly should be shut off in opengl +X make people use get() instead to grab sub-images +X PGraphicsGL.copy() needs to be overridden.. use glDrawBitmap o loadImage() needs to handle 1.1 vs 1.3 loading o set image.format to be BUFFERED? no.. just use RGBA always o have a flag to always use the cache, i.e. with BufferedImage o turn that off when someone modifies it (nope, no need to) X PImage.getPixels(), updatePixels(), updatePixels(x, y, w, h), o PImage.setPixels(int another[]); +X imageMode(CENTER) is weird for copy() and updatePixels() +X perhaps copy() and get() ignore imageMode and use xywh or x1y1x2y2? +X or disallow imageMode(CENTER) altogether? +o in java 1.3, getPixels() can call getRGB() via reflection +o cache.getClass().getName().equals("BufferedImage") +X readPixels/writePixels? +X has to happen, since this is so fundamental to gl as well +X loadImage in 1.3 leaves pixels[] null (not in 1.1) +X 1.3 plus gl is a problem, since conflicting caches +X gl has no need for a bufferedimage tho +X so maybe checks to see if the cache is a BufferedImage +X if it is, calls getPixels to set the int array +X then replaces cache with glimageache +X pappletgl loadimage could take care of this instead +X calls super.loadImage(), if cache != null, proceed.. +X this is prolly a mess +X PImage.getPixels() and PImage.getPixels(x, y, w, h) -> +X (the xywh version still allocates the entire array, but only updates those) +X only needed for java2d +X not (necessarily) needed when loading images, +X but definitely needed when setting pixels on PGraphics +X PImage.updatePixels() and PImage.updatePixels(x, y, w, h) +X (this is actually just setModified) +X in opengl, marks all or some as modified +X so next time it's drawn, the texture is updated PGraphicsGL.image() +X in java2d, updates the BufferedImage on next draw +X can't use regular getPixels() on PGraphics, because its image isn't 'cache' +X also, the cache may be used to draw the whole surface as a gl texture (?) +X not a problem for the main PGraphics, but for any others created to draw on -readPixels/writePixels? -has to happen, since this is so fundamental to gl as well -loadImage in 1.3 leaves pixels[] null (not in 1.1) - 1.3 plus gl is a problem, since conflicting caches - gl has no need for a bufferedimage tho - so maybe checks to see if the cache is a BufferedImage - if it is, calls getPixels to set the int array - then replaces cache with glimageache - pappletgl loadimage could take care of this instead - calls super.loadImage(), if cache != null, proceed.. - this is prolly a mess -PImage.getPixels() and PImage.getPixels(x, y, w, h) -> - (the xywh version still allocates the entire array, but only updates those) - only needed for java2d - not (necessarily) needed when loading images, - but definitely needed when setting pixels on PGraphics -PImage.updatePixels() and PImage.updatePixels(x, y, w, h) - (this is actually just setModified) - in opengl, marks all or some as modified - so next time it's drawn, the texture is updated PGraphicsGL.image() - in java2d, updates the BufferedImage on next draw -can't use regular getPixels() on PGraphics, because its image isn't 'cache' - also, the cache may be used to draw the whole surface as a gl texture (?) - not a problem for the main PGraphics, but for any others created to draw on - -_ imageMode(CENTER) is weird for copy() and updatePixels() -_ perhaps copy() and get() ignore imageMode and use xywh or x1y1x2y2? -_ or disallow imageMode(CENTER) altogether? - -_ in java 1.3, getPixels() can call getRGB() via reflection -_ cache.getClass().getName().equals("BufferedImage") - -_ beginShape() -_ don't allow you to draw stroked items unless stroke() is called -_ don't allow beginShape() if shape is already set -_ (otherwise will cause some very strange errors) - -_ PFont.list() to return string list of all the available fonts -_ textFont with a named font can use the renderer/os font -_ for postscript, can grab the real font -_ -> altho problem here is that really the fonts just need a name -_ since needs to render to screen as well - -_ get regular graphics engine working again -_ smooth is no longer working -_ ellipses aren't handled - -_ default to single byte input from serial port -_ and add serial.setBuffer() for message length as alternative -_ or serial.setDelimiter() to fire message on delim +api todos +_ sphere x,y,z,r or box w,h,d.. need to make them consistent +_ look at curve functions more closely +_ should we switch to curveVertex(1,2,3) (ala curveto) +_ because some confusion with mixing types of curves _ move textMode and textSpace back out of PFont _ use die() to fail in font situations _ can't, just use a RuntimeException +_ get regular graphics engine working again +_ smooth is no longer working +_ ellipses aren't handled + +_ get frame recording working +_ also have a simple way to hook in triangle leeches to PGraphics3 + +_ default to single byte input from serial port +_ and add serial.setBuffer() for message length as alternative +_ or serial.setDelimiter() to fire message on delim + _ die() may need to throw a RuntimeException +_ textFont with a named font can use the renderer/os font +_ PFont.list() to return string list of all the available fonts +_ for postscript, can grab the real font +_ -> altho problem here is that really the fonts just need a name +_ since needs to render to screen as well + _ make light() functions actually do something in PGraphicsGL _ make lights half do something in PGraphics3 too _ bring in materials for opengl as well? _ don't include a class, just make it similar to the light functions +// + +_ remove SCREEN_SPACE altogether? + _ be consistent about getXxx() methods -_ on start, mouseX is 0.. how to avoid? -_ use firstMouse variable.. figure out naming - -// +_ beginShape() +_ don't allow you to draw stroked items unless stroke() is called +_ don't allow beginShape() if shape is already set +_ (otherwise will cause some very strange errors) _ basic sample audio playback needed for p5 _ make separate java 1.1 and java 1.3 classes @@ -149,12 +156,6 @@ _ figure out how to handle cached images, multiple images _ MediaTracker blocking is prolly making jar download really slow _ http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1089914280;start=0 -_ arc with stroke only draws the arc shape itself -_ may need a 'wedge' function to draw a stroke around the whole thing - -_ explicitly state depth()/nodepth() -_ don't allocate zbuffer & stencil until depth() is called - _ image(String name) and textFont(String name) _ do we change to font(arial, 12) ? _ loadImage() is broken on some machines @@ -236,14 +237,15 @@ _ bring screen space and font size settings back in to PGraphics _ causing too much trouble to be stuck down in PFont postscript -_ keep hints about type of geometry used to reconstruct -_ no special class, just uses public vars from PGraphics -_ how to hook into curve rendering so that curve segments are drawn -_ maybe lines are rendered and sorted, -_ but they point to an original version of the curve geometry -_ that can be re-rendered -_ also integrate catmull-rom -> bezier inverse matrices -_ even with the general catmull-rom, to render via ai beziers +X pushing all intelligence down into class that implements PMethods +o keep hints about type of geometry used to reconstruct +o no special class, just uses public vars from PGraphics +o how to hook into curve rendering so that curve segments are drawn +o maybe lines are rendered and sorted, +o but they point to an original version of the curve geometry +o that can be re-rendered +o also integrate catmull-rom -> bezier inverse matrices +o even with the general catmull-rom, to render via ai beziers random tasks _ someone to figure out a good model for adaptive sizing of circles @@ -268,9 +270,6 @@ _ fishwick bug with text() and shapes _ ellipses no longer completed when g.dimensions = 2 or 3, _ or not even drawn.. what a mess. -_ only allocate stencil and zbuffer on first call to depth() -_ this will require changes to PTriangle and PLine inside their loops - _ break apart functions into local (placement) and override (blitting) _ just have a "thin_flat_line" option in opengl code