Image width and height cannot be larger than 0 with this graphics card. OPENGL
in
Core Library Questions
•
2 years ago
I have run into this error with multiple sketches:
"Image width and height cannot be larger than 0 with this graphics card."
I am trying to use OPENGL because of the smooth drawing results. I need to set up separate buffers to draw to, combining the buffers to a finished image with alpha.
I use several machines but these are the primary...
The PC graphics card is a NVIDIA Quadro FX 4600
The Mac graphics card is a NVIDIA GeForce 9400M
The following code is distilled to the minimum example.
The error occurs within the image call. Sometimes it successfully draws the ellipse before failing.
I have tried to trace this down, with little success. Below is the code...
Thanks in advance!
//------------------------------------------------------
import processing.opengl.*;
PGraphics g;
void setup(){
size(800,800,OPENGL);
hint(DISABLE_OPENGL_2X_SMOOTH);
g = createGraphics(width, height, OPENGL);
}
void draw(){
g.beginDraw();
g.background(0);
g.noFill();
g.stroke(color(0,180,255),125);
g.ellipse(width*0.5, height*0.5, 300, 300);
g.endDraw();
image(g,0,0);
noLoop();
}
//------------------------------------------------------
1