If I close the following sketch using the close mark:
Then it doesn't go so well...
#
A fatal error has been detected by the Java Runtime Environment:
#
SIGSEGV (0xb) at pc=0x00007fff941ef4bd, pid=1563, tid=66307
#
JRE version: Java(TM) SE Runtime Environment (8.0_51-b16) (build 1.8.0_51-b16)
Java VM: Java HotSpot(TM) 64-Bit Server VM (25.51-b03 mixed mode bsd-amd64 compressed oops)
Problematic frame:
C [libGL.dylib+0x14bd] glDeleteTextures+0x12
#
Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
An error report file with more information is saved as:
/Users/doekewartena/hs_err_pid1563.log
#
If you would like to submit a bug report, please visit:
http://bugreport.java.com/bugreport/crash.jsp
The crash happened outside the Java Virtual Machine in native code.
See problematic frame for where to report the bug.
# Could not run the sketch (Target VM failed to initialize). Make sure that you haven't set the maximum available memory too high. For more information, read revisions.txt and Help → Troubleshooting.
PShader psBlendLightest;
PGraphics pg;
PGraphics textureB;
void settings() {
size(512, 512, P2D);
}
void setup() {
pg = createGraphics(512, 512, P2D);
pg.beginDraw();
pg.background(0);
pg.fill(255);
pg.quad(25, 25, 400, 40, 450, 500, 40, 300);
pg.endDraw();
textureB = createGraphics(512, 512, P2D);
textureB.beginDraw();
textureB.background(0);
textureB.fill(255);
textureB.ellipse(256, 256, 400, 400);
textureB.endDraw();
psBlendLightest = new PShader(this, "blend_lightest.vert", "blend_lightest.frag");
}
void draw() {
image(pg, 0, 0);
psBlendLightest.set("texMapB", textureB);
filter(psBlendLightest);
}
shader vert
#version 410
uniform mat4 transform;
in vec4 vertex;
in vec4 color;
in vec4 texCoord;
out vec4 vertColor;
out vec4 vertTexCoord;
void main() {
gl_Position = transform * vertex;
vertColor = color;
vertTexCoord = texCoord;
}
shader frag
#version 410
uniform sampler2D texture;
uniform sampler2D texMapB;
in vec4 vertTexCoord;
out vec4 fragColor;
void main() {
fragColor = max(texture(texture, vertTexCoord.xy).rgba, texture(texMapB, vertTexCoord.xy).rgba);
}
Mac OS X.
Is this something wrong on my side or is this a processing bug?