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
    • handle

      private final long handle
    • 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 int guiScale
    • errorSection

      private String errorSection
    • dirty

      private boolean dirty
    • vsync

      private boolean vsync
    • iconified

      private boolean iconified
    • minimized

      private boolean minimized
    • allowCursorChanges

      private boolean allowCursorChanges
    • currentCursor

      private CursorType currentCursor
  • Constructor Details

  • Method Details

    • initializeBackend

      private WindowAndDevice initializeBackend(GpuBackend[] backends, int width, int height, String title, long initialMonitor, ShaderSource defaultShaderSource, GpuDebugOptions debugOptions)
    • 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 resources, IconSet iconSet) throws IOException
      Throws:
      IOException
    • setErrorSection

      public void setErrorSection(String string)
    • setBootErrorCallback

      private void setBootErrorCallback()
    • bootCrash

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

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

      public void setDefaultErrorCallback()
    • updateVsync

      public void updateVsync(boolean enableVsync)
    • close

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

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

      private void onFramebufferResize(long handle, int newWidth, int newHeight)
    • refreshFramebufferSize

      private void refreshFramebufferSize()
    • onResize

      private void onResize(long handle, int newWidth, int newHeight)
    • onFocus

      private void onFocus(long handle, boolean focused)
    • onEnter

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

      private void onIconify(long handle, boolean iconified)
    • updateDisplay

      public void updateDisplay(@Nullable TracyFrameCapture tracyFrameCapture)
    • 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 width, int height)
    • updateFullscreen

      private void updateFullscreen(boolean enableVsync, @Nullable TracyFrameCapture tracyFrameCapture)
    • calculateScale

      public int calculateScale(int maxScale, boolean enforceUnicode)
    • setGuiScale

      public void setGuiScale(int guiScale)
    • setTitle

      public void setTitle(String title)
    • handle

      public long handle()
    • isFullscreen

      public boolean isFullscreen()
    • isIconified

      public boolean isIconified()
    • getWidth

      public int getWidth()
    • getHeight

      public int getHeight()
    • setWidth

      public void setWidth(int width)
    • setHeight

      public void setHeight(int height)
    • 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 int getGuiScale()
    • findBestMonitor

      public @Nullable Monitor findBestMonitor()
    • updateRawMouseInput

      public void updateRawMouseInput(boolean value)
    • setWindowCloseCallback

      public void setWindowCloseCallback(Runnable task)
    • isMinimized

      public boolean isMinimized()
    • setAllowCursorChanges

      public void setAllowCursorChanges(boolean value)
    • selectCursor

      public void selectCursor(CursorType cursor)
    • getAppropriateLineWidth

      public float getAppropriateLineWidth()