Package dev.prozilla.pine.core
Class Window
java.lang.Object
dev.prozilla.pine.core.Window
- All Implemented Interfaces:
Lifecycle
Represents a GLFW window object.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Destroys the window.int
int
getWidth()
void
init()
Sets the window hints and creates a GLFW window object.void
Sets the size of the rendering viewport to match the window.void
Updates the icons of this window.void
Updates the title of this window.boolean
Determines whether the window should be closed.void
update()
Swaps the buffers and polls the events each frame.
-
Field Details
-
id
public long idHandle of the window -
width
public int width -
height
public int height
-
-
Constructor Details
-
Window
-
-
Method Details
-
init
Sets the window hints and creates a GLFW window object.- Specified by:
init
in interfaceLifecycle
- Throws:
RuntimeException
-
update
public void update()Swaps the buffers and polls the events each frame. -
destroy
public void destroy()Destroys the window. -
shouldClose
public boolean shouldClose()Determines whether the window should be closed.- Returns:
- True if the window should be closed
-
refreshSize
public void refreshSize()Sets the size of the rendering viewport to match the window. -
getWidth
public int getWidth() -
getHeight
public int getHeight() -
setTitle
Updates the title of this window.- Parameters:
title
- Title
-
setIcons
Updates the icons of this window. Uses the first element of the images array as the default icon.- Parameters:
images
- Array of icon images
-