Class Window

java.lang.Object
dev.prozilla.pine.core.Window
All Implemented Interfaces:
Destructible, Initializable

public class Window extends Object implements Initializable, Destructible
Represents a GLFW window object.
  • Field Details

    • 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 Initializable
      Throws:
      RuntimeException
    • update

      public void update()
      Swaps the buffers and polls the events each frame.
    • destroy

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

      public long getId()
    • 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
    • setOpacity

      public void setOpacity(float opacity)
      Sets the opacity of the entire window
      Parameters:
      opacity - The opacity, in the range of 0f and 1f
    • setDecorated

      public void setDecorated(boolean decorated)
    • setVisible

      public void setVisible(boolean visible)
    • setEnableTransparentFramebuffer

      public void setEnableTransparentFramebuffer(boolean transparentFramebuffer)
    • setResizable

      public void setResizable(boolean resizable)
    • setFocused

      public void setFocused(boolean focused)
    • setFloating

      public void setFloating(boolean floating)
    • setMaximized

      public void setMaximized(boolean maximized)
    • setCenterCursor

      public void setCenterCursor(boolean centerCursor)
    • setHint

      public void setHint(WindowHint hint, boolean value)
    • setHint

      public void setHint(WindowHint hint, int value)
    • setHint

      public void setHint(int hint, boolean value)
    • setHint

      public void setHint(int hint, int value)
    • setDefaultHints

      public void setDefaultHints()
    • checkStatus

      protected void checkStatus() throws IllegalStateException
      Checks if the window has been initialized.
      Throws:
      IllegalStateException - If the window has not been initialized yet.