mirror of
https://github.com/processing/processing4.git
synced 2026-01-28 19:01:08 +01:00
draw exit label in PGL
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user