mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-04-05 06:25:46 +00:00
*** empty log message ***
This commit is contained in:
parent
6e73a7a953
commit
e143541c01
4 changed files with 43 additions and 24 deletions
|
|
@ -120,6 +120,7 @@ public abstract class Window {
|
|||
* @param newTitle The new window title
|
||||
*/
|
||||
public final void setTitle(String newTitle) {
|
||||
assert isCreated();
|
||||
title = newTitle;
|
||||
nSetTitle(title);
|
||||
}
|
||||
|
|
@ -134,6 +135,7 @@ public abstract class Window {
|
|||
* @return true if the user or operating system has asked the window to close
|
||||
*/
|
||||
public final boolean isCloseRequested() {
|
||||
assert isCreated();
|
||||
return closeRequested;
|
||||
}
|
||||
|
||||
|
|
@ -141,6 +143,7 @@ public abstract class Window {
|
|||
* @return true if the window is minimized or otherwise not visible
|
||||
*/
|
||||
public final boolean isMinimized() {
|
||||
assert isCreated();
|
||||
return minimized;
|
||||
}
|
||||
|
||||
|
|
@ -172,6 +175,7 @@ public abstract class Window {
|
|||
* and needs to repaint itself
|
||||
*/
|
||||
public final boolean isDirty() {
|
||||
assert isCreated();
|
||||
return dirty;
|
||||
}
|
||||
|
||||
|
|
@ -179,6 +183,7 @@ public abstract class Window {
|
|||
* Paint the window. This clears the dirty flag and swaps the buffers.
|
||||
*/
|
||||
public final void paint() {
|
||||
assert isCreated();
|
||||
dirty = false;
|
||||
doPaint();
|
||||
}
|
||||
|
|
@ -194,7 +199,8 @@ public abstract class Window {
|
|||
doCreate();
|
||||
currentWindow = this;
|
||||
created = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the window (derived classes).
|
||||
|
|
@ -205,7 +211,7 @@ public abstract class Window {
|
|||
/**
|
||||
* Destroy the window.
|
||||
*/
|
||||
public final synchronized void destroy() {
|
||||
public final void destroy() {
|
||||
if (!created)
|
||||
return;
|
||||
doDestroy();
|
||||
|
|
@ -237,16 +243,7 @@ public abstract class Window {
|
|||
* 'Tick' the window. This must be called at least once per video frame
|
||||
* to handle window close requests, moves, paints, etc.
|
||||
*/
|
||||
public final native void tick();
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#finalize()
|
||||
*/
|
||||
protected void finalize() throws Throwable {
|
||||
super.finalize();
|
||||
|
||||
destroy();
|
||||
}
|
||||
public native void tick();
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
|
|
|
|||
|
|
@ -344,18 +344,20 @@ public class Keyboard {
|
|||
/**
|
||||
* Enable keyboard translation. Must be called after the keyboard is created,
|
||||
* and keyboard buffering must be enabled.
|
||||
* @return false if translation cannot be enabled; true if it can
|
||||
*/
|
||||
public static void enableTranslation() {
|
||||
public static boolean enableTranslation() {
|
||||
assert created : "The keyboard has not been created.";
|
||||
assert readBuffer != null : "Keyboard buffering has not been enabled.";
|
||||
nEnableTranslation();
|
||||
translationEnabled = true;
|
||||
|
||||
translationEnabled = nEnableTranslation();
|
||||
return translationEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Native method to enable the translation buffer
|
||||
*/
|
||||
private static native void nEnableTranslation();
|
||||
private static native boolean nEnableTranslation();
|
||||
|
||||
/**
|
||||
* Enable keyboard buffering. Must be called after the keyboard is created.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue