add: IsFullScreen
fix: better error message on assertion failure
This commit is contained in:
parent
a0bed5c78e
commit
96bd0737e9
|
@ -99,6 +99,7 @@ public final class Window {
|
||||||
* @return the width of the window
|
* @return the width of the window
|
||||||
*/
|
*/
|
||||||
public static int getWidth() {
|
public static int getWidth() {
|
||||||
|
assert isCreated() : "Cannot get width on uncreated window";
|
||||||
return width;
|
return width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,6 +107,7 @@ public final class Window {
|
||||||
* @return the height of the window
|
* @return the height of the window
|
||||||
*/
|
*/
|
||||||
public static int getHeight() {
|
public static int getHeight() {
|
||||||
|
assert isCreated() : "Cannot get height on uncreated window";
|
||||||
return height;
|
return height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,15 +115,24 @@ public final class Window {
|
||||||
* @return the title of the window
|
* @return the title of the window
|
||||||
*/
|
*/
|
||||||
public static String getTitle() {
|
public static String getTitle() {
|
||||||
|
assert isCreated() : "Cannot get title on uncreated window";
|
||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return whether this window is in fullscreen mode
|
||||||
|
*/
|
||||||
|
public static boolean IsFullscreen() {
|
||||||
|
assert isCreated() : "Cannot determine state of uncreated window";
|
||||||
|
return fullscreen;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the title of the window. This may be ignored by the underlying OS.
|
* Set the title of the window. This may be ignored by the underlying OS.
|
||||||
* @param newTitle The new window title
|
* @param newTitle The new window title
|
||||||
*/
|
*/
|
||||||
public static void setTitle(String newTitle) {
|
public static void setTitle(String newTitle) {
|
||||||
assert isCreated();
|
assert isCreated() : "Cannot set title of uncreated window";
|
||||||
title = newTitle;
|
title = newTitle;
|
||||||
nSetTitle(title);
|
nSetTitle(title);
|
||||||
}
|
}
|
||||||
|
@ -136,7 +147,7 @@ public final class Window {
|
||||||
* @return true if the user or operating system has asked the window to close
|
* @return true if the user or operating system has asked the window to close
|
||||||
*/
|
*/
|
||||||
public static boolean isCloseRequested() {
|
public static boolean isCloseRequested() {
|
||||||
assert isCreated();
|
assert isCreated() : "Cannot determine state of uncreated window";
|
||||||
return nIsCloseRequested();
|
return nIsCloseRequested();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,7 +157,7 @@ public final class Window {
|
||||||
* @return true if the window is minimized or otherwise not visible
|
* @return true if the window is minimized or otherwise not visible
|
||||||
*/
|
*/
|
||||||
public static boolean isMinimized() {
|
public static boolean isMinimized() {
|
||||||
assert isCreated();
|
assert isCreated() : "Cannot determine state of uncreated window";
|
||||||
return nIsMinimized();
|
return nIsMinimized();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,7 +167,7 @@ public final class Window {
|
||||||
* @return true if window is focused
|
* @return true if window is focused
|
||||||
*/
|
*/
|
||||||
public static boolean isFocused() {
|
public static boolean isFocused() {
|
||||||
assert isCreated();
|
assert isCreated() : "Cannot determine state of uncreated window";
|
||||||
return nIsFocused();
|
return nIsFocused();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,7 +201,7 @@ public final class Window {
|
||||||
* and needs to repaint itself
|
* and needs to repaint itself
|
||||||
*/
|
*/
|
||||||
public static boolean isDirty() {
|
public static boolean isDirty() {
|
||||||
assert isCreated();
|
assert isCreated() : "Cannot determine state of uncreated window";
|
||||||
return nIsDirty();
|
return nIsDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,7 +211,7 @@ public final class Window {
|
||||||
* Paint the window. This clears the dirty flag and swaps the buffers.
|
* Paint the window. This clears the dirty flag and swaps the buffers.
|
||||||
*/
|
*/
|
||||||
public static void paint() {
|
public static void paint() {
|
||||||
assert isCreated();
|
assert isCreated() : "Cannot paint uncreated window";
|
||||||
swapBuffers();
|
swapBuffers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue