From c18ddffdc0b1cc59417ef3a8e6e1e0d86826608f Mon Sep 17 00:00:00 2001 From: codeanticode Date: Wed, 20 Nov 2013 18:57:18 -0500 Subject: [PATCH] getCanvas() in PGL so libraries can access the native surface --- core/src/processing/opengl/PGL.java | 7 +++++++ core/src/processing/opengl/PJOGL.java | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/core/src/processing/opengl/PGL.java b/core/src/processing/opengl/PGL.java index 58405b745..0a302c1e4 100644 --- a/core/src/processing/opengl/PGL.java +++ b/core/src/processing/opengl/PGL.java @@ -334,6 +334,13 @@ public abstract class PGL { } + /** + * Return the native canvas the OpenGL context associated to this PGL object + * is rendering to (if any). + */ + public abstract Object getCanvas(); + + protected abstract void setFps(float fps); diff --git a/core/src/processing/opengl/PJOGL.java b/core/src/processing/opengl/PJOGL.java index 597d63ae3..4ebb60f6e 100644 --- a/core/src/processing/opengl/PJOGL.java +++ b/core/src/processing/opengl/PJOGL.java @@ -213,6 +213,17 @@ public class PJOGL extends PGL { } + @Override + public Canvas getCanvas() { + return canvas; + } + + +// public Object getCanvas() { +// return canvas; +// } + + @Override protected void setFps(float fps) { if (!setFps || targetFps != fps) {