Skip to content

Calling PGraphics.background clears the primary surface on GLES2 #4523

@gohai

Description

@gohai

The following code works on OS X, but on the Raspberry Pi (GLES2 driver), the background doesn't accumulate over multiple frames. The call that triggers this is background() on an offscreen PGraphics object. It works fine without. @codeanticode Any ideas?

PGraphics pg;

void setup() {
  size(200, 200, P2D);
  pg = createGraphics(200, 200, P2D);
  background(0);
}

void draw() {
  // this shouldn't be required either, separate bug
  if (frameCount == 1) {
    background(0);
  }
  pg.beginDraw();
  pg.background(255, 0, 0);
  pg.endDraw();
  noStroke();
  fill(255);
  rect(frameCount, height/2-5, 10, 10);
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions