mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-02-23 08:04:38 +01:00
fix: isClosedRequested now sets flag to false after call
added support for isFocused
This commit is contained in:
parent
bd9b01eaf8
commit
1080e1344b
|
|
@ -37,6 +37,9 @@ public abstract class Window {
|
|||
|
||||
/** Whether the window is currently minimized */
|
||||
private boolean minimized;
|
||||
|
||||
/** Whether the window has focus */
|
||||
private boolean focused = true;
|
||||
|
||||
/** Whether the window has been asked to close by the user or underlying OS */
|
||||
private boolean closeRequested;
|
||||
|
|
@ -131,13 +134,16 @@ public abstract class Window {
|
|||
*/
|
||||
private native void nSetTitle(String title);
|
||||
|
||||
/**
|
||||
* @return true if the user or operating system has asked the window to close
|
||||
*/
|
||||
public final boolean isCloseRequested() {
|
||||
assert isCreated();
|
||||
return closeRequested;
|
||||
}
|
||||
/**
|
||||
* @return true if the user or operating system has asked the window to close
|
||||
*/
|
||||
public final boolean isCloseRequested() {
|
||||
assert isCreated();
|
||||
|
||||
boolean currentValue = closeRequested;
|
||||
closeRequested = false;
|
||||
return currentValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if the window is minimized or otherwise not visible
|
||||
|
|
@ -146,6 +152,14 @@ public abstract class Window {
|
|||
assert isCreated();
|
||||
return minimized;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if window is focused
|
||||
*/
|
||||
public final boolean isFocused() {
|
||||
assert isCreated();
|
||||
return focused;
|
||||
}
|
||||
|
||||
/**
|
||||
* Minimize the game and allow the operating system's default display to become
|
||||
|
|
|
|||
Loading…
Reference in a new issue