FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

draw exit label in PGL · jgall/processing@a3136ab · GitHub

Repository navigation

Commit a3136ab

Browse files
committed
draw exit label in PGL
1 parent 19eb7c2 commit a3136ab

2 files changed

Lines changed: 25 additions & 2 deletions

File tree

‎core/src/processing/opengl/PGL.java‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@ protected void beginDraw(boolean clear0) {
580580
}
581581

582582

583+
int labelTex = -1;
583584
protected void endDraw(boolean clear0) {
584585
if (fboLayerInUse) {
585586
syncBackTexture();
@@ -596,6 +597,21 @@ protected void endDraw(boolean clear0) {
596597
clearDepth(1);
597598
clearColor(r, g, b, a);
598599
clear(COLOR_BUFFER_BIT | DEPTH_BUFFER_BIT);
600+
601+
if (labelTex == -1) {
602+
// labelTex = new Texture(pg);
603+
// labelTex.init(100, 50,
604+
// glColorTex.get(backTex), TEXTURE_2D, RGBA,
605+
// fboWidth, fboHeight, NEAREST, NEAREST,
606+
// CLAMP_TO_EDGE, CLAMP_TO_EDGE);
607+
}
608+
609+
// Don't use presentMode offset!
610+
// drawTexture2D(labelTex, int texW, int texH, int scrW, int scrH,
611+
// int texX0, int texY0, int texX1, int texY1,
612+
// int scrX0, int scrY0, int scrX1, int scrY1);
613+
614+
599615
} else {
600616
clearDepth(1);
601617
clearColor(0, 0, 0, 0);

‎java/libraries/lwjgl/src/processing/lwjgl/PSurfaceLWJGL.java‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,8 +426,6 @@ public void mousePressed(java.awt.event.MouseEvent e) {
426426
label.setLocation(20, screenRect.height - labelSize.height - 20);
427427
}
428428
*/
429-
430-
431429
}
432430

433431
@Override
@@ -1007,6 +1005,15 @@ public void run() {
10071005
}
10081006
} else if (pressed) {
10091007
action = MouseEvent.RELEASE;
1008+
1009+
if (presentMode) {
1010+
if (20 < Mouse.getX() && Mouse.getX() < 20 + 100 &&
1011+
20 < Mouse.getY() && Mouse.getY() < 20 + 50) {
1012+
System.err.println("clicked on exit button");
1013+
sketch.exit();
1014+
}
1015+
}
1016+
10101017
pressed = false;
10111018
} else {
10121019
action = MouseEvent.MOVE;

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL