diff --git a/core/src/processing/opengl/PGL.java b/core/src/processing/opengl/PGL.java index 5db34b953..b0e719dcd 100644 --- a/core/src/processing/opengl/PGL.java +++ b/core/src/processing/opengl/PGL.java @@ -580,6 +580,7 @@ public abstract class PGL { } + int labelTex = -1; protected void endDraw(boolean clear0) { if (fboLayerInUse) { syncBackTexture(); @@ -596,6 +597,21 @@ public abstract class PGL { clearDepth(1); clearColor(r, g, b, a); clear(COLOR_BUFFER_BIT | DEPTH_BUFFER_BIT); + + if (labelTex == -1) { +// labelTex = new Texture(pg); +// labelTex.init(100, 50, +// glColorTex.get(backTex), TEXTURE_2D, RGBA, +// fboWidth, fboHeight, NEAREST, NEAREST, +// CLAMP_TO_EDGE, CLAMP_TO_EDGE); + } + + // Don't use presentMode offset! +// drawTexture2D(labelTex, int texW, int texH, int scrW, int scrH, +// int texX0, int texY0, int texX1, int texY1, +// int scrX0, int scrY0, int scrX1, int scrY1); + + } else { clearDepth(1); clearColor(0, 0, 0, 0); diff --git a/java/libraries/lwjgl/src/processing/lwjgl/PSurfaceLWJGL.java b/java/libraries/lwjgl/src/processing/lwjgl/PSurfaceLWJGL.java index 3aa0d2726..f40701b56 100644 --- a/java/libraries/lwjgl/src/processing/lwjgl/PSurfaceLWJGL.java +++ b/java/libraries/lwjgl/src/processing/lwjgl/PSurfaceLWJGL.java @@ -426,8 +426,6 @@ public class PSurfaceLWJGL implements PSurface { label.setLocation(20, screenRect.height - labelSize.height - 20); } */ - - } @Override @@ -1007,6 +1005,15 @@ public class PSurfaceLWJGL implements PSurface { } } else if (pressed) { action = MouseEvent.RELEASE; + + if (presentMode) { + if (20 < Mouse.getX() && Mouse.getX() < 20 + 100 && + 20 < Mouse.getY() && Mouse.getY() < 20 + 50) { + System.err.println("clicked on exit button"); + sketch.exit(); + } + } + pressed = false; } else { action = MouseEvent.MOVE;