Package io.github.ocelot.window
Class WindowManager
java.lang.Object
io.github.ocelot.window.WindowManager
- All Implemented Interfaces:
AutoCloseable,org.lwjgl.system.NativeResource
Manages monitors and all windows created.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(int width, int height, boolean fullscreen) Creates a new window without initializing it.create(CharSequence title, int width, int height, boolean fullscreen) Creates a new window and initializes it.create(CharSequence title, int width, int height, boolean fullscreen, long share) Creates a new window and initializes it.@Nullable MonitorfindBestMonitor(Window window) Finds the best monitor to use for fullscreen based on how much each monitor covers the window.voidfree()static @Nullable String@Nullable MonitorgetMonitor(long handle) Retrieves the monitor with the specified id.voidupdate()Polls window events and updates all windows.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.lwjgl.system.NativeResource
close
-
Constructor Details
-
WindowManager
public WindowManager()
-
-
Method Details
-
getGLFWError
- Returns:
- The current GLFW error or
nullif there currently isn't one
-
update
public void update()Polls window events and updates all windows. -
create
Creates a new window without initializing it.Window.create(CharSequence)must be called for it to be valid.- Parameters:
width- The width of the windowheight- The height of the windowfullscreen- Whether to initialize in full screen or not- Returns:
- The window created
-
create
Creates a new window and initializes it.- Parameters:
title- The title of the windowwidth- The width of the windowheight- The height of the windowfullscreen- Whether to initialize in fullscreen or not- Returns:
- The window created
-
create
Creates a new window and initializes it.- Parameters:
title- The title of the windowwidth- The width of the windowheight- The height of the windowfullscreen- Whether to initialize in fullscreen or notshare- The id of the window to share context with- Returns:
- The window created
- See Also:
-
getMonitor
Retrieves the monitor with the specified id.- Parameters:
handle- The handle of the monitor- Returns:
- The monitor with that id or
nullif no monitor could be found
-
findBestMonitor
Finds the best monitor to use for fullscreen based on how much each monitor covers the window.- Parameters:
window- The window to test- Returns:
- The monitor the window best fits on or
nullif no monitor could be found
-
free
public void free()- Specified by:
freein interfaceorg.lwjgl.system.NativeResource
-