diff --git a/app/src/processing/mode/java/JavaBuild.java b/app/src/processing/mode/java/JavaBuild.java index e6db686ba..1f7462ba5 100644 --- a/app/src/processing/mode/java/JavaBuild.java +++ b/app/src/processing/mode/java/JavaBuild.java @@ -531,6 +531,8 @@ public class JavaBuild { if (pkg.startsWith("processing.data.")) return true; if (pkg.startsWith("processing.event.")) return true; if (pkg.startsWith("processing.opengl.")) return true; + +// if (pkg.startsWith("com.jogamp.")) return true; // // ignore core, data, and opengl packages // String[] coreImports = preprocessor.getCoreImports(); diff --git a/app/src/processing/mode/java/runner/Runner.java b/app/src/processing/mode/java/runner/Runner.java index 118376dd3..9bea617b5 100644 --- a/app/src/processing/mode/java/runner/Runner.java +++ b/app/src/processing/mode/java/runner/Runner.java @@ -923,7 +923,7 @@ public class Runner implements MessageConsumer { ObjectReference ref = (ObjectReference)val; method = ((ClassType) ref.referenceType()).concreteMethodByName("getFileName", "()Ljava/lang/String;"); StringReference strref = (StringReference) ref.invokeMethod(thread, method, new ArrayList(), ObjectReference.INVOKE_SINGLE_THREADED); - String filename = strref.value(); + String filename = strref == null ? "Unknown Source" : strref.value(); method = ((ClassType) ref.referenceType()).concreteMethodByName("getLineNumber", "()I"); IntegerValue intval = (IntegerValue) ref.invokeMethod(thread, method, new ArrayList(), ObjectReference.INVOKE_SINGLE_THREADED); int lineNumber = intval.intValue() - 1; diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index 90f78a4fd..b16bad1b1 100755 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -10299,7 +10299,7 @@ public class PApplet extends Applet //revalidate(); // let the layout manager do its work if (revalidateMethod != null) { try { - revalidateMethod.invoke(this); + revalidateMethod.invoke(PApplet.this); } catch (Exception ex) { ex.printStackTrace(); revalidateMethod = null; diff --git a/core/src/processing/opengl/PGraphicsOpenGL.java b/core/src/processing/opengl/PGraphicsOpenGL.java index 53d22b6e0..799f1ca40 100644 --- a/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/core/src/processing/opengl/PGraphicsOpenGL.java @@ -2610,14 +2610,15 @@ public class PGraphicsOpenGL extends PGraphics { raw.noStroke(); raw.beginShape(TRIANGLES); - sortTriangles(); + + //sortTriangles(); float[] vertices = tessGeo.polyVertices; int[] color = tessGeo.polyColors; float[] uv = tessGeo.polyTexCoords; - //short[] indices = tessGeo.polyIndices; // unused [fry] - + short[] indices = tessGeo.polyIndices; // unused [fry] +/* sortTriangles(); for (int i = 0; i < sortedTriangleCount; i++) { Triangle tri = sortedPolyTriangles[i]; @@ -2697,9 +2698,9 @@ public class PGraphicsOpenGL extends PGraphics { } } +*/ -/* for (int i = 0; i < texCache.size; i++) { PImage textureImage = texCache.getTextureImage(i); @@ -2791,7 +2792,7 @@ public class PGraphicsOpenGL extends PGraphics { } } } -*/ + raw.endShape(); } diff --git a/core/src/processing/opengl/PJOGL.java b/core/src/processing/opengl/PJOGL.java index 0bff30395..7b890f474 100644 --- a/core/src/processing/opengl/PJOGL.java +++ b/core/src/processing/opengl/PJOGL.java @@ -369,6 +369,7 @@ public class PJOGL extends PGL { canvasAWT = null; } + pg.parent.defaultSize = false; registerListeners(); fboLayerCreated = false; @@ -384,6 +385,7 @@ public class PJOGL extends PGL { fboLayerCreated = false; fboLayerInUse = false; firstFrame = true; + pg.parent.defaultSize = false; } diff --git a/core/src/processing/opengl/PShader.java b/core/src/processing/opengl/PShader.java index 97dbbc891..0f2c92490 100644 --- a/core/src/processing/opengl/PShader.java +++ b/core/src/processing/opengl/PShader.java @@ -116,7 +116,7 @@ public class PShader implements PConstants { protected int transformMatLoc; protected int modelviewMatLoc; protected int projectionMatLoc; - protected int bufferLoc; + protected int ppixelsLoc; protected int bufferUnit; protected int viewportLoc; @@ -1158,7 +1158,7 @@ public class PShader implements PConstants { projectionMatLoc = getUniformLoc("projectionMatrix"); viewportLoc = getUniformLoc("viewport"); - bufferLoc = getUniformLoc("buffer"); + ppixelsLoc = getUniformLoc("ppixels"); normalMatLoc = getUniformLoc("normalMatrix"); @@ -1209,9 +1209,9 @@ public class PShader implements PConstants { setUniformValue(viewportLoc, x, y, w, h); } - if (-1 < bufferLoc) { + if (-1 < ppixelsLoc) { bufferUnit = getLastTexUnit() + 1; - setUniformValue(bufferLoc, bufferUnit); + setUniformValue(ppixelsLoc, bufferUnit); pgl.activeTexture(PGL.TEXTURE0 + bufferUnit); currentPG.bindFrontTexture(); } else { @@ -1304,7 +1304,7 @@ public class PShader implements PConstants { if (-1 < texCoordLoc) pgl.disableVertexAttribArray(texCoordLoc); if (-1 < normalLoc) pgl.disableVertexAttribArray(normalLoc); - if (-1 < bufferLoc) { + if (-1 < ppixelsLoc) { pgl.requestFBOLayer(); pgl.activeTexture(PGL.TEXTURE0 + bufferUnit); currentPG.unbindFrontTexture(); diff --git a/java/examples/Topics/Shaders/Conway/Conway.pde b/java/examples/Topics/Shaders/Conway/Conway.pde index 472b6c758..529f821b0 100644 --- a/java/examples/Topics/Shaders/Conway/Conway.pde +++ b/java/examples/Topics/Shaders/Conway/Conway.pde @@ -1,7 +1,7 @@ // GLSL version of Conway's game of life, ported from GLSL sandbox: // http://glsl.heroku.com/e#207.3 -// Exemplifies the use of the buffer uniform in the shader, that gives -// access to the previous frame. +// Exemplifies the use of the ppixels uniform in the shader, that gives +// access to the pixels of the previous frame. PShader conway; PGraphics pg; diff --git a/java/examples/Topics/Shaders/Conway/data/conway.glsl b/java/examples/Topics/Shaders/Conway/data/conway.glsl index dca8dfd7f..694491ef0 100644 --- a/java/examples/Topics/Shaders/Conway/data/conway.glsl +++ b/java/examples/Topics/Shaders/Conway/data/conway.glsl @@ -9,7 +9,7 @@ precision highp float; uniform float time; uniform vec2 mouse; uniform vec2 resolution; -uniform sampler2D buffer; +uniform sampler2D ppixels; vec4 live = vec4(0.5,1.0,0.7,1.); vec4 dead = vec4(0.,0.,0.,1.); @@ -28,15 +28,15 @@ void main( void ) { } } else { float sum = 0.; - sum += texture2D(buffer, position + pixel * vec2(-1., -1.)).g; - sum += texture2D(buffer, position + pixel * vec2(-1., 0.)).g; - sum += texture2D(buffer, position + pixel * vec2(-1., 1.)).g; - sum += texture2D(buffer, position + pixel * vec2(1., -1.)).g; - sum += texture2D(buffer, position + pixel * vec2(1., 0.)).g; - sum += texture2D(buffer, position + pixel * vec2(1., 1.)).g; - sum += texture2D(buffer, position + pixel * vec2(0., -1.)).g; - sum += texture2D(buffer, position + pixel * vec2(0., 1.)).g; - vec4 me = texture2D(buffer, position); + sum += texture2D(ppixels, position + pixel * vec2(-1., -1.)).g; + sum += texture2D(ppixels, position + pixel * vec2(-1., 0.)).g; + sum += texture2D(ppixels, position + pixel * vec2(-1., 1.)).g; + sum += texture2D(ppixels, position + pixel * vec2(1., -1.)).g; + sum += texture2D(ppixels, position + pixel * vec2(1., 0.)).g; + sum += texture2D(ppixels, position + pixel * vec2(1., 1.)).g; + sum += texture2D(ppixels, position + pixel * vec2(0., -1.)).g; + sum += texture2D(ppixels, position + pixel * vec2(0., 1.)).g; + vec4 me = texture2D(ppixels, position); if (me.g <= 0.1) { if ((sum >= 2.9) && (sum <= 3.1)) { diff --git a/java/examples/Topics/Shaders/DomeProjection/DomeProjection.pde b/java/examples/Topics/Shaders/DomeProjection/DomeProjection.pde index 226f18275..2c39c08cc 100644 --- a/java/examples/Topics/Shaders/DomeProjection/DomeProjection.pde +++ b/java/examples/Topics/Shaders/DomeProjection/DomeProjection.pde @@ -21,7 +21,7 @@ IntBuffer envMapTextureID; int envMapSize = 1024; void setup() { - size(640, 640, P3D); + size(640, 640, P3D); initCubeMap(); } @@ -32,6 +32,7 @@ void draw() { void drawScene() { background(0); + stroke(255, 0, 0); strokeWeight(2); for (int i = -width; i < 2 * width; i += 50) { @@ -46,6 +47,6 @@ void drawScene() { translate(mouseX, mouseY, 200); rotateX(frameCount * 0.01); rotateY(frameCount * 0.01); - box(100); + box(100); }