processing/processing4

Copying PGraphics to PImage using .get() or .copy() clears PGraphics object, if the renderer is P2D

Open

#681 ouverte le 2 mars 2023

Voir sur GitHub
 (3 commentaires) (0 réactions) (0 assignés)Java (176 forks)auto 404
help wantedopengl

Métriques du dépôt

Stars
 (439 stars)
Métriques de merge PR
 (Métriques PR en attente)

Description

Created by: agrshch

Description

An attempt of copying information from PGraphics to PImage using get() or copy() clears the PGraphics object if P2D renderer is used. It makes impossible many things, for example using PGraphics (or its copy) as a texture for the shader.

Expected Behavior

successful copying, like with default renderer

Current Behavior

both PGraphics and PImage are empty.

Steps to Reproduce

PGraphics img1;

void setup() { size(300, 300, P2D);

img1 = createGraphics(200, 200, P2D);

img1.beginDraw(); img1.background(120); img1.endDraw();

PImage img2 = img1.get(); // if comment out this line — grey rectangle appears }

void draw() { background(255); image(img1, 100, 20); }

Your Environment

  • Processing version: 4.2
  • Operating System and OS version: Mac OS 10.15.7
  • Other information:

Guide contributeur