OpenGL error 1282 at top endDraw(): invalid operation

edited February 2014 in Programming Questions

I've been making some research about this issue for a day or 2 already, and the only thing I got from the Processing forum and from this page (https://github.com/processing/processing/issues/2246) is that I need to update my video card. What I'm really wondering about is that I'm using the same basic code that I had when I was still using P5 1.5.1., which works perfectly by the way. And now with the latest P5 2.1.1, the issue is quite confusing.

current setup: macbook pro late 2011 running mavericks

Any help or explanation will be greatly appreciated. Thanks!

Answers

  • edited February 2014

    Example: http://forum.processing.org/two/discussion/2855/hi-resolution-saving-function-does-not-work-#Item_6

    Code below still yield the same problem:

    void setup()
    {
      size(1024, 768, P3D);
    }
    void draw()
    {
    }
    void keyPressed() {
      if (keyCode == ENTER) {
        PGraphics PGpx = createGraphics(width, height, P3D);
        beginRecord(PGpx);
        endRecord();
        PGpx.save("myImage.jpg");
      }
    }
    
  • edited February 2014

    Anyone? :)

  • Hi guys! Could anyone have any idea about this issue? Thanks!

  • "What I'm really wondering about is that I'm using the same basic code that I had when I was still using P5 1.5.1., which works perfectly by the way. And now with the latest P5 2.1.1, the issue is quite confusing."
    That's why I asked which version of Processing you were using in the other thread (this one is kind of duplicate, BTW). In Processing 1.5, P3D was 3D made "by hand", while in 2.0, it is handled by OpenGL, in a version quite demanding on the video card (ie. low end cards just suffer or fail).
    An update of the video driver might help (more or less).

  • edited February 2014

    Hi PhiLho. Like what I've mentioned above, I'm using a Maverick OS which includes the latest driver of my graphics AMD Radeon HD 6750M.

    If I'm using already the latest driver, and a macbook pro that has a decent graphics that could handle some good amount of processing, does this mean that if it won't work, I could never use my processing 1.5.1 program in my current workstation, using 2.1.1?

    On the other hand, my apologies if this thread turned out to be a duplicate for you. Though my code example here is somewhat similar to that of the other thread, my concern here is the OpenGL error in 2.1.1, while that thread discusses the thread starter's issue with his hi-res saving function in 1.5.1. I just thought of starting this thread hoping that it would help also other members here later if they'll encounter the same issue as mine.

  • edited February 2014

    Hello! Just an update. I tried the code in 2.1.1 running in Windows 7 using a very high end graphic card with latest driver, getting the same error/outcome.

  • Hi guys! Could anyone please check the code below in your machine if it works without the OpenGL error after pressing the 'Enter' key? If the error is there, please let me know. Thanks!

    void setup()
    {
      size(1024, 768, P3D);
    }
    void draw()
    {
    }
    void keyPressed() {
      if (keyCode == ENTER) {
        PGraphics PGpx = createGraphics(width, height, P3D);
        beginRecord(PGpx);
        endRecord();
        PGpx.save("myImage.jpg");
      }
    }
    
  • I do get the same error when running all the code in one frame on Ubuntu.

    If I save() on a different frame it gives no error.

    PGraphics PGpx;
    void setup() {
      size(1024, 768, P3D);
      PGpx = createGraphics(width, height, P3D);
      beginRecord(PGpx);
      background(50);
      ellipse(200, 200, 200, 200);
      endRecord();
    }
    void draw() { }
    void keyPressed() {
      PGpx.save("myImage.jpg");
    }
    
  • Hi Hamoid. Thank you so much for checking the code.

    Unfortunately I have to use draw() always. And even if I use a different keyPressed() for recording and another for saving to save on a different frame, the error is still there.

    PGraphics PGpx;
    
    void setup()
    {
      size(1024, 768, P3D);
    }
    void draw()
    {
    }
    void keyPressed() {
      if (keyCode == ENTER) {
        PGpx = createGraphics(width, height, P3D);
        beginRecord(PGpx);
        endRecord();
        println("done recording");
      }
    
      if (keyCode == TAB)
      {
        PGpx.save("myImage.jpg");
      }
    }
    
  • I also get the error, but it works nonetheless. The image is correctly saved.

    Calls to background(...) seem to be ignored, but I can use fill() and rect() as a workaround.

  • Even though P2D and P3D have good stuff (like PShape) I ALWAYS run into problems when I try something a little big. However it is true my graphics card probably is not too good.

Sign In or Register to comment.