From 61854b023858b2eb98a47d267a29a27e9ccff676 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Sat, 20 Jun 2015 18:07:38 -0400 Subject: [PATCH] getNative() returns the GLWindow object --- core/src/processing/opengl/PSurfaceJOGL.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/core/src/processing/opengl/PSurfaceJOGL.java b/core/src/processing/opengl/PSurfaceJOGL.java index bea3e521a..7a8b4e701 100644 --- a/core/src/processing/opengl/PSurfaceJOGL.java +++ b/core/src/processing/opengl/PSurfaceJOGL.java @@ -92,7 +92,6 @@ public class PSurfaceJOGL implements PSurface { if (window != null) { canvas = new NewtCanvasAWT(window); canvas.setBounds(0, 0, window.getWidth(), window.getHeight()); -// canvas.setBackground(new Color(pg.backgroundColor, true)); canvas.setFocusable(true); } } @@ -112,8 +111,11 @@ public class PSurfaceJOGL implements PSurface { public Object getNative() { - System.err.println("PSurfaceJOGL.getNative() not implemented"); - return null; +// if (canvas == null) { +// initOffscreen(sketch); +// } +// return canvas; + return window; } @@ -539,8 +541,8 @@ public class PSurfaceJOGL implements PSurface { public void setLocation(int x, int y) { - // TODO implement me! - System.err.println("PSurfaceJOGL.setLocation() not yet implemented."); + if (window == null) return; + window.setTopLevelPosition(x, y); } @@ -606,6 +608,7 @@ public class PSurfaceJOGL implements PSurface { } public void requestFocus() { + if (window == null) return; window.requestFocus(); } @@ -965,10 +968,12 @@ public class PSurfaceJOGL implements PSurface { } public void showCursor() { + if (window == null) return; window.setPointerVisible(true); } public void hideCursor() { + if (window != null) return; window.setPointerVisible(false); } }