From 7d675ec48c1208d24a2a0dc08c231d564a91d7c8 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Tue, 24 Apr 2012 19:16:07 +0000 Subject: [PATCH] Making sure that a PImage always has a non-null parent when adding a texture --- .../src/processing/opengl/PGraphicsOpenGL.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java b/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java index 8b17e4673..1599f3bbb 100644 --- a/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java +++ b/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java @@ -40,9 +40,6 @@ import java.util.HashSet; import java.util.Set; import java.util.Stack; -// TODO: -// 2) non-interactive mode problem? - /** * OpenGL renderer. * @@ -4943,6 +4940,9 @@ public class PGraphicsOpenGL extends PGraphics { params = PTexture.newParameters(); img.setParams(pg, params); } + if (img.parent == null) { + img.parent = parent; + } PTexture tex = new PTexture(img.parent, img.width, img.height, params); img.loadPixels(); if (img.pixels != null) tex.set(img.pixels); @@ -6827,6 +6827,14 @@ public class PGraphicsOpenGL extends PGraphics { } } + void addPoint() { + + } + + void addLine() { + + } + void addEllipse(int ellipseMode, float a, float b, float c, float d, boolean fill, int fillColor, boolean stroke, int strokeColor, float strokeWeight,