APIdia Launch Partner
Top Fields Constructors Methods
com.badlogic.gdx.backends.lwjgl3

public Class Lwjgl3Window

extends Object
implements Disposable
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.utils.Disposable
Imports
java.nio.IntBuffer, com.badlogic.gdx.*, com.badlogic.gdx.utils.Os, .Array, .Disposable, .SharedLibraryLoader, org.lwjgl.BufferUtils, org.lwjgl.glfw.GLFW, .GLFWDropCallback, .GLFWImage, .GLFWWindowCloseCallback, .GLFWWindowFocusCallback, .GLFWWindowIconifyCallback, .GLFWWindowMaximizeCallback, .GLFWWindowRefreshCallback, com.badlogic.gdx.graphics.Pixmap

Field Summary

Modifier and TypeField and Description
pack-priv final Lwjgl3ApplicationBase
pack-priv boolean
private final GLFWWindowCloseCallback
private final Lwjgl3ApplicationConfiguration
private final GLFWDropCallback
private final Array<Runnable>
private final GLFWWindowFocusCallback
pack-priv boolean
private Lwjgl3Graphics
pack-priv boolean
private final GLFWWindowIconifyCallback
private Lwjgl3Input
private final Array<LifecycleListener>
pack-priv final ApplicationListener
private boolean
private final GLFWWindowMaximizeCallback
private final GLFWWindowRefreshCallback
private boolean
private final Array<Runnable>
private final IntBuffer
private final IntBuffer
private long
pack-priv Lwjgl3WindowListener

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
closeWindow()

Closes this window and pauses and disposes the associated ApplicationListener.

pack-priv void
create(long windowHandle)

public void
dispose()

Implements com.badlogic.gdx.utils.Disposable.dispose.

Releases all resources of this object.

public boolean
equals(Object obj)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public void
public void
focusWindow()

Brings the window to front and sets input focus.

pack-priv Lwjgl3ApplicationConfiguration
pack-priv Lwjgl3Graphics
pack-priv Lwjgl3Input
public ApplicationListener
getListener()

Returns: the ApplicationListener associated with this window

public int
getPositionX()

Returns: the window position in logical coordinates.

public int
getPositionY()

Returns: the window position in logical coordinates.

public long
public Lwjgl3WindowListener
getWindowListener()

Returns: the Lwjgl3WindowListener set on this window

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public void
iconifyWindow()

Minimizes (iconifies) the window.

pack-priv void
public boolean
public boolean
isIconified()

Whether the window is iconfieid

pack-priv boolean
pack-priv void
public void
maximizeWindow()

Maximizes the window.

public void
postRunnable(Runnable runnable)

Post a Runnable to this window's event queue.

pack-priv void
public void
restoreWindow()

De-minimizes (de-iconifies) and de-maximizes the window.

public void
setIcon(Pixmap...
One or more images. The one closest to the system's desired size will be scaled. Good sizes include 16x16, 32x32 and 48x48. Pixmap format RGBA8888 is preferred so the images will not have to be copied and converted. The chosen image is copied, and the provided Pixmaps are not disposed.
image
)

Sets the icon that will be used in the window's title bar.

pack-priv static void
setIcon(long windowHandle, String[] imagePaths, Files.FileType imageFileType)

pack-priv static void
setIcon(long windowHandle, Pixmap[] images)

public void
setPosition(int x, int y)

Sets the position of the window in logical coordinates.

public void
setSizeLimits(int minWidth, int minHeight, int maxWidth, int maxHeight)

Sets minimum and maximum size limits for the window.

pack-priv static void
setSizeLimits(long windowHandle, int minWidth, int minHeight, int maxWidth, int maxHeight)

public void
public void
setVisible(boolean visible)

Sets the visibility of the window.

public void
pack-priv boolean
pack-priv boolean
pack-priv void
windowHandleChanged(long windowHandle)

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

applicationback to summary
pack-priv final Lwjgl3ApplicationBase application
asyncResizedback to summary
pack-priv boolean asyncResized
closeCallbackback to summary
private final GLFWWindowCloseCallback closeCallback
configback to summary
private final Lwjgl3ApplicationConfiguration config
dropCallbackback to summary
private final GLFWDropCallback dropCallback
executedRunnablesback to summary
private final Array<Runnable> executedRunnables
focusCallbackback to summary
private final GLFWWindowFocusCallback focusCallback
focusedback to summary
pack-priv boolean focused
graphicsback to summary
private Lwjgl3Graphics graphics
iconifiedback to summary
pack-priv boolean iconified
iconifyCallbackback to summary
private final GLFWWindowIconifyCallback iconifyCallback
inputback to summary
private Lwjgl3Input input
lifecycleListenersback to summary
private final Array<LifecycleListener> lifecycleListeners
listenerback to summary
pack-priv final ApplicationListener listener
listenerInitializedback to summary
private boolean listenerInitialized
maximizeCallbackback to summary
private final GLFWWindowMaximizeCallback maximizeCallback
refreshCallbackback to summary
private final GLFWWindowRefreshCallback refreshCallback
requestRenderingback to summary
private boolean requestRendering
runnablesback to summary
private final Array<Runnable> runnables
tmpBufferback to summary
private final IntBuffer tmpBuffer
tmpBuffer2back to summary
private final IntBuffer tmpBuffer2
windowHandleback to summary
private long windowHandle
windowListenerback to summary
pack-priv Lwjgl3WindowListener windowListener

Constructor Detail

Lwjgl3Windowback to summary
pack-priv Lwjgl3Window(ApplicationListener listener, Array<LifecycleListener> lifecycleListeners, Lwjgl3ApplicationConfiguration config, Lwjgl3ApplicationBase application)

Method Detail

closeWindowback to summary
public void closeWindow()

Closes this window and pauses and disposes the associated ApplicationListener.

createback to summary
pack-priv void create(long windowHandle)
disposeback to summary
public void dispose()

Implements com.badlogic.gdx.utils.Disposable.dispose.

Doc from com.badlogic.gdx.utils.Disposable.dispose.

Releases all resources of this object.

Annotations
@Override
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
flashback to summary
public void flash()
focusWindowback to summary
public void focusWindow()

Brings the window to front and sets input focus. The window should already be visible and not iconified.

getConfigback to summary
pack-priv Lwjgl3ApplicationConfiguration getConfig()
getGraphicsback to summary
pack-priv Lwjgl3Graphics getGraphics()
getInputback to summary
pack-priv Lwjgl3Input getInput()
getListenerback to summary
public ApplicationListener getListener()
Returns:ApplicationListener

the ApplicationListener associated with this window

getPositionXback to summary
public int getPositionX()
Returns:int

the window position in logical coordinates. All monitors span a virtual surface together. The coordinates are relative to the first monitor in the virtual surface.

getPositionYback to summary
public int getPositionY()
Returns:int

the window position in logical coordinates. All monitors span a virtual surface together. The coordinates are relative to the first monitor in the virtual surface.

getWindowHandleback to summary
public long getWindowHandle()
getWindowListenerback to summary
public Lwjgl3WindowListener getWindowListener()
Returns:Lwjgl3WindowListener

the Lwjgl3WindowListener set on this window

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
iconifyWindowback to summary
public void iconifyWindow()

Minimizes (iconifies) the window. Iconified windows do not call their ApplicationListener until the window is restored.

initializeListenerback to summary
pack-priv void initializeListener()
isFocusedback to summary
public boolean isFocused()
isIconifiedback to summary
public boolean isIconified()

Whether the window is iconfieid

isListenerInitializedback to summary
pack-priv boolean isListenerInitialized()
makeCurrentback to summary
pack-priv void makeCurrent()
maximizeWindowback to summary
public void maximizeWindow()

Maximizes the window.

postRunnableback to summary
public void postRunnable(Runnable runnable)

Post a Runnable to this window's event queue. Use this if you access statics like Gdx#graphics in your runnable instead of Application#postRunnable(Runnable).

requestRenderingback to summary
pack-priv void requestRendering()
restoreWindowback to summary
public void restoreWindow()

De-minimizes (de-iconifies) and de-maximizes the window.

setIconback to summary
public void setIcon(Pixmap... image)

Sets the icon that will be used in the window's title bar. Has no effect in macOS, which doesn't use window icons.

Parameters
image:Pixmap[]

One or more images. The one closest to the system's desired size will be scaled. Good sizes include 16x16, 32x32 and 48x48. Pixmap format RGBA8888 is preferred so the images will not have to be copied and converted. The chosen image is copied, and the provided Pixmaps are not disposed.

setIconback to summary
pack-priv static void setIcon(long windowHandle, String[] imagePaths, Files.FileType imageFileType)
setIconback to summary
pack-priv static void setIcon(long windowHandle, Pixmap[] images)
setPositionback to summary
public void setPosition(int x, int y)

Sets the position of the window in logical coordinates. All monitors span a virtual surface together. The coordinates are relative to the first monitor in the virtual surface.

setSizeLimitsback to summary
public void setSizeLimits(int minWidth, int minHeight, int maxWidth, int maxHeight)

Sets minimum and maximum size limits for the window. If the window is full screen or not resizable, these limits are ignored. Use -1 to indicate an unrestricted dimension.

setSizeLimitsback to summary
pack-priv static void setSizeLimits(long windowHandle, int minWidth, int minHeight, int maxWidth, int maxHeight)
setTitleback to summary
public void setTitle(CharSequence title)
setVisibleback to summary
public void setVisible(boolean visible)

Sets the visibility of the window. Invisible windows will still call their ApplicationListener

setWindowListenerback to summary
public void setWindowListener(Lwjgl3WindowListener listener)
shouldCloseback to summary
pack-priv boolean shouldClose()
updateback to summary
pack-priv boolean update()
windowHandleChangedback to summary
pack-priv void windowHandleChanged(long windowHandle)