p5_terminal_graphics
p5_terminal_graphics copied to clipboard
OpenGL error 1282 at top endDraw(): invalid operation
Right now the std_err.txt file always contains the following:
OpenGL error 1282 at top endDraw(): invalid operation The pixels array is null.
To explain the issue, I first will explain how this library is done.
The P5_Terminal_Graphics
extends the PGraphics3D
(better known as P3D
).
After a frame is done we draw the result on a smaller image:
resized_g.beginDraw();
resized_g.image(parent.g, 0, 0, resized_g.width, resized_g.height);
resized_g.endDraw();
And then we get the pixels of the smaller image:
resized_g.loadPixels();
This avoid loadPixels
on the main graphics, which can be really slow depending on the size.
However, it really screws up the renderer which makes it freeze the normal processing window.
The reason for this is that we do it in the post
method, which is not safe to draw in.
But it's the only way to get it working, or to get it working without loosing a lot of speed (I can't remember).