Class Window

java.lang.Object
com.mojang.blaze3d.platform.Window
All Implemented Interfaces:
AutoCloseable

public final class Window extends Object implements AutoCloseable
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • BASE_WIDTH

      public static final int BASE_WIDTH
      See Also:
    • BASE_HEIGHT

      public static final int BASE_HEIGHT
      See Also:
    • defaultErrorCallback

      private final org.lwjgl.glfw.GLFWErrorCallback defaultErrorCallback
    • eventHandler

      private final WindowEventHandler eventHandler
    • screenManager

      private final ScreenManager screenManager
    • window

      private final long window
    • windowedX

      private int windowedX
    • windowedY

      private int windowedY
    • windowedWidth

      private int windowedWidth
    • windowedHeight

      private int windowedHeight
    • preferredFullscreenVideoMode

      private Optional<VideoMode> preferredFullscreenVideoMode
    • fullscreen

      private boolean fullscreen
    • actuallyFullscreen

      private boolean actuallyFullscreen
    • x

      private int x
    • y

      private int y
    • width

      private int width
    • height

      private int height
    • framebufferWidth

      private int framebufferWidth
    • framebufferHeight

      private int framebufferHeight
    • guiScaledWidth

      private int guiScaledWidth
    • guiScaledHeight

      private int guiScaledHeight
    • guiScale

      private double guiScale
    • errorSection

      private String errorSection
    • dirty

      private boolean dirty
    • framerateLimit

      private int framerateLimit
    • vsync

      private boolean vsync
  • Constructor Details

  • Method Details

    • getPlatform

      public static String getPlatform()
    • getRefreshRate

      public int getRefreshRate()
    • shouldClose

      public boolean shouldClose()
    • checkGlfwError

      public static void checkGlfwError(BiConsumer<Integer,String> errorConsumer)
    • setIcon

      public void setIcon(PackResources packResources, IconSet iconSet) throws IOException
      Throws:
      IOException
    • setErrorSection

      public void setErrorSection(String errorSection)
    • setBootErrorCallback

      private void setBootErrorCallback()
    • bootCrash

      private static void bootCrash(int error, long description)
    • defaultErrorCallback

      public void defaultErrorCallback(int error, long description)
    • setDefaultErrorCallback

      public void setDefaultErrorCallback()
    • updateVsync

      public void updateVsync(boolean vsync)
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • onMove

      private void onMove(long window, int x, int y)
    • onFramebufferResize

      private void onFramebufferResize(long window, int framebufferWidth, int framebufferHeight)
    • refreshFramebufferSize

      private void refreshFramebufferSize()
    • onResize

      private void onResize(long window, int width, int height)
    • onFocus

      private void onFocus(long window, boolean hasFocus)
    • onEnter

      private void onEnter(long window, boolean cursorEntered)
      Parameters:
      cursorEntered - true if the cursor entered the window, false if the cursor left
    • setFramerateLimit

      public void setFramerateLimit(int limit)
    • getFramerateLimit

      public int getFramerateLimit()
    • updateDisplay

      public void updateDisplay()
    • getPreferredFullscreenVideoMode

      public Optional<VideoMode> getPreferredFullscreenVideoMode()
    • setPreferredFullscreenVideoMode

      public void setPreferredFullscreenVideoMode(Optional<VideoMode> preferredFullscreenVideoMode)
    • changeFullscreenVideoMode

      public void changeFullscreenVideoMode()
    • setMode

      private void setMode()
    • toggleFullScreen

      public void toggleFullScreen()
    • setWindowed

      public void setWindowed(int windowedWidth, int windowedHeight)
    • updateFullscreen

      private void updateFullscreen(boolean vsyncEnabled)
    • calculateScale

      public int calculateScale(int guiScale, boolean forceUnicode)
    • setGuiScale

      public void setGuiScale(double scaleFactor)
    • setTitle

      public void setTitle(String title)
    • getWindow

      public long getWindow()
    • isFullscreen

      public boolean isFullscreen()
    • getWidth

      public int getWidth()
    • getHeight

      public int getHeight()
    • setWidth

      public void setWidth(int framebufferWidth)
    • setHeight

      public void setHeight(int framebufferHeight)
    • getScreenWidth

      public int getScreenWidth()
    • getScreenHeight

      public int getScreenHeight()
    • getGuiScaledWidth

      public int getGuiScaledWidth()
    • getGuiScaledHeight

      public int getGuiScaledHeight()
    • getX

      public int getX()
    • getY

      public int getY()
    • getGuiScale

      public double getGuiScale()
    • findBestMonitor

      @Nullable public Monitor findBestMonitor()
    • updateRawMouseInput

      public void updateRawMouseInput(boolean enableRawMouseMotion)