Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenGL error 1282 at top endDraw(): invalid operation #2

Open
clankill3r opened this issue Jul 18, 2020 · 0 comments
Open

OpenGL error 1282 at top endDraw(): invalid operation #2

clankill3r opened this issue Jul 18, 2020 · 0 comments

Comments

@clankill3r
Copy link
Owner

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant