Skip to content

Commit 99f5f08

Browse files
committed
getCanvas() in PGL so libraries can access the native surface
1 parent 728feda commit 99f5f08

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

core/src/processing/opengl/PGL.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,13 @@ public PGL(PGraphicsOpenGL pg) {
334334
}
335335

336336

337+
/**
338+
* Return the native canvas the OpenGL context associated to this PGL object
339+
* is rendering to (if any).
340+
*/
341+
public abstract Object getCanvas();
342+
343+
337344
protected abstract void setFps(float fps);
338345

339346

core/src/processing/opengl/PJOGL.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,17 @@ public PJOGL(PGraphicsOpenGL pg) {
213213
}
214214

215215

216+
@Override
217+
public Canvas getCanvas() {
218+
return canvas;
219+
}
220+
221+
222+
// public Object getCanvas() {
223+
// return canvas;
224+
// }
225+
226+
216227
@Override
217228
protected void setFps(float fps) {
218229
if (!setFps || targetFps != fps) {

0 commit comments

Comments
 (0)