Package dev.kyzel.gfx

Class Window

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class Window extends JFrame
A class to handle creating and managing a Window.
See Also:
  • Field Details

    • render

      private final Renderer render
      The renderer of this Window.
    • gd

      private final GraphicsDevice gd
      The GraphicsDevice where the code runs on.
    • window

      public static Window window
      The only Window that should be used.
  • Constructor Details

    • Window

      private Window(int width, int height, int FPS)
      Creates a new Window. Construction should only be done with init(int, int, int) or init().
      Parameters:
      width - the width of the Window
      height - the height of the Window
      FPS - the desired frame rate (FPS)
  • Method Details

    • init

      public static Window init(int width, int height, int FPS)
      Creates a new Window if there is none available.
      Parameters:
      width - the width of the Window
      height - the height of the Window
      FPS - the desired frame rate (FPS)
      Returns:
      the available or newly created Window
    • init

      public static Window init()
      Creates a new Window with a dimension of 800x600 and 60 FPS, if there is none available.
      Returns:
      the available or newly created Window
    • setFullscreen

      public void setFullscreen()
      If the window is not in fullscreen mode, set it to fullscreen mode. If the window is in fullscreen mode, set it back to windowed mode.