Package com.badlogic.gdx.backends.lwjgl3
Class Lwjgl3WindowConfiguration
- java.lang.Object
-
- com.badlogic.gdx.backends.lwjgl3.Lwjgl3WindowConfiguration
-
- Direct Known Subclasses:
Lwjgl3ApplicationConfiguration
public class Lwjgl3WindowConfiguration extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Lwjgl3WindowConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidsetAutoIconify(boolean autoIconify)voidsetDecorated(boolean decorated)voidsetFullscreenMode(com.badlogic.gdx.Graphics.DisplayMode mode)Sets the app to use fullscreen mode.voidsetInitialBackgroundColor(com.badlogic.gdx.graphics.Color color)Sets the initial background color.voidsetInitialVisible(boolean visibility)voidsetMaximized(boolean maximized)voidsetMaximizedMonitor(com.badlogic.gdx.Graphics.Monitor monitor)voidsetResizable(boolean resizable)voidsetTitle(java.lang.String title)Sets the window title.voidsetWindowedMode(int width, int height)Sets the app to use windowed mode.voidsetWindowIcon(com.badlogic.gdx.Files.FileType fileType, java.lang.String... filePaths)Sets the icon that will be used in the window's title bar.voidsetWindowIcon(java.lang.String... filePaths)Sets the icon that will be used in the window's title bar.voidsetWindowListener(Lwjgl3WindowListener windowListener)Sets theLwjgl3WindowListenerwhich will be informed about iconficiation, focus loss and window close events.voidsetWindowPosition(int x, int y)Sets the position of the window in windowed mode.voidsetWindowSizeLimits(int minWidth, int minHeight, int maxWidth, int maxHeight)Sets minimum and maximum size limits for the window.voiduseVsync(boolean vsync)Sets whether to use vsync.
-
-
-
Method Detail
-
setInitialVisible
public void setInitialVisible(boolean visibility)
- Parameters:
visibility- whether the window will be visible on creation. (default true)
-
setWindowedMode
public void setWindowedMode(int width, int height)Sets the app to use windowed mode.- Parameters:
width- the width of the window (default 640)height- the height of the window (default 480)
-
setResizable
public void setResizable(boolean resizable)
- Parameters:
resizable- whether the windowed mode window is resizable (default true)
-
setDecorated
public void setDecorated(boolean decorated)
- Parameters:
decorated- whether the windowed mode window is decorated, i.e. displaying the title bars (default true)
-
setMaximized
public void setMaximized(boolean maximized)
- Parameters:
maximized- whether the window starts maximized. Ignored if the window is full screen. (default false)
-
setMaximizedMonitor
public void setMaximizedMonitor(com.badlogic.gdx.Graphics.Monitor monitor)
- Parameters:
monitor- what monitor the window should maximize to
-
setAutoIconify
public void setAutoIconify(boolean autoIconify)
- Parameters:
autoIconify- whether the window should automatically iconify and restore previous video mode on input focus loss. (default true) Does nothing in windowed mode.
-
setWindowPosition
public void setWindowPosition(int x, int y)Sets the position of the window in windowed mode. Default -1 for both coordinates for centered on primary monitor.
-
setWindowSizeLimits
public void setWindowSizeLimits(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. The default for all four parameters is -1, which means unrestricted.
-
setWindowIcon
public void setWindowIcon(java.lang.String... filePaths)
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:
filePaths- One or more internal image paths. Must be JPEG, PNG, or BMP format. The one closest to the system's desired size will be scaled. Good sizes include 16x16, 32x32 and 48x48.
-
setWindowIcon
public void setWindowIcon(com.badlogic.gdx.Files.FileType fileType, java.lang.String... filePaths)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:
fileType- The type of file handle the paths are relative to.filePaths- One or more image paths, relative to the given Files.FileType. Must be JPEG, PNG, or BMP format. The one closest to the system's desired size will be scaled. Good sizes include 16x16, 32x32 and 48x48.
-
setWindowListener
public void setWindowListener(Lwjgl3WindowListener windowListener)
Sets theLwjgl3WindowListenerwhich will be informed about iconficiation, focus loss and window close events.
-
setFullscreenMode
public void setFullscreenMode(com.badlogic.gdx.Graphics.DisplayMode mode)
Sets the app to use fullscreen mode. Use the static methods likeLwjgl3ApplicationConfiguration.getDisplayMode()on this class to enumerate connected monitors and their fullscreen display modes.
-
setTitle
public void setTitle(java.lang.String title)
Sets the window title. If null, the application listener's class name is used.
-
setInitialBackgroundColor
public void setInitialBackgroundColor(com.badlogic.gdx.graphics.Color color)
Sets the initial background color. Defaults to black.
-
useVsync
public void useVsync(boolean vsync)
Sets whether to use vsync. This setting can be changed anytime at runtime viaGraphics.setVSync(boolean). For multi-window applications, only one (the main) window should enable vsync. Otherwise, every window will wait for the vertical blank on swap individually, effectively cutting the frame rate to (refreshRate / numberOfWindows).
-
-