Class Window

java.lang.Object
dev.prozilla.pine.core.Window
All Implemented Interfaces:
Lifecycle

public class Window extends Object implements Lifecycle
Represents a GLFW window object.
  • Field Details

    • id

      public long id
      Handle of the window
    • width

      public int width
    • height

      public int height
  • Constructor Details

  • Method Details

    • init

      public void init() throws RuntimeException
      Sets the window hints and creates a GLFW window object.
      Specified by:
      init in interface Lifecycle
      Throws:
      RuntimeException
    • update

      public void update()
      Swaps the buffers and polls the events each frame.
      Specified by:
      update in interface Lifecycle
    • destroy

      public void destroy()
      Destroys the window.
      Specified by:
      destroy in interface Lifecycle
    • 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

      public void setTitle(String title)
      Updates the title of this window.
      Parameters:
      title - Title
    • setIcons

      public void setIcons(Image[] images)
      Updates the icons of this window. Uses the first element of the images array as the default icon.
      Parameters:
      images - Array of icon images