We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › PGraphics to image fails with OpenGL
Page Index Toggle Pages: 1
PGraphics to image fails with OpenGL (Read 694 times)
PGraphics to image fails with OpenGL
Sep 3rd, 2009, 5:53am
 
Using the example from the PGraphics help, but with OPENGL instead of P3D:

PGraphics pg;

void setup() {
 size(100, 100);
 pg = createGraphics(80, 80, OPENGL);
}

void draw() {
 pg.beginDraw();
 pg.background(102);
 pg.stroke(255);
 pg.line(40, 40, mouseX, mouseY);
 pg.endDraw();
 image(pg, 10, 10);
}

I get the output as posted below.

I'm using OSX 10.5.8, Macbook pro 3.06GHz 9400/9600 graphics. I've tried this with both graphics cards. The first frame is constructed and displayed correctly so it seems. I guess the exception occurs after that.

Should I file a bug report or am I missing something?

...

Exception in thread "Animation Thread" java.lang.RuntimeException: Image width and height cannot be larger than 0 with your graphics card.
     at processing.opengl.PGraphicsOpenGL$ImageCache.rebind(PGraphicsOpenGL.java:836)
     at processing.opengl.PGraphicsOpenGL.bindTexture(PGraphicsOpenGL.java:767)
     at processing.opengl.PGraphicsOpenGL.renderTriangles(PGraphicsOpenGL.java:690)
     at processing.core.PGraphics3D.endShape(PGraphics3D.java:627)
     at processing.core.PGraphics.endShape(PGraphics.java:1153)
     at processing.core.PGraphics.imageImpl(PGraphics.java:2293)
     at processing.core.PGraphics.image(PGraphics.java:2182)
     at processing.core.PApplet.image(PApplet.java:7124)
     at wavedisplay$WaveformRenderer.draw(wavedisplay.java:244)
     at wavedisplay.draw(wavedisplay.java:99)
     at processing.core.PApplet.handleDraw(PApplet.java:1423)
     at processing.core.PApplet.run(PApplet.java:1328)
     at java.lang.Thread.run(Thread.java:613)
Page Index Toggle Pages: 1