Package com.mojang.blaze3d.platform
Class Window
java.lang.Object
com.mojang.blaze3d.platform.Window
- All Implemented Interfaces:
AutoCloseable
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanstatic final intstatic final intprivate CursorTypeprivate final org.lwjgl.glfw.GLFWErrorCallbackprivate booleanprivate Stringprivate final WindowEventHandlerprivate intprivate intprivate booleanprivate intprivate intprivate intprivate final longprivate intprivate booleanprivate static final org.slf4j.Loggerprivate booleanprivate final ScreenManagerprivate booleanprivate intprivate intprivate intprivate intprivate intprivate intprivate int -
Constructor Summary
ConstructorsConstructorDescriptionWindow(WindowEventHandler eventHandler, ScreenManager screenManager, DisplayData displayData, String preferredFullscreenVideoMode, String title) -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidbootCrash(int error, long description) intcalculateScale(int guiScale, boolean forceUnicode) voidstatic voidcheckGlfwError(BiConsumer<Integer, String> errorConsumer) voidclose()voiddefaultErrorCallback(int error, long description) intintintintstatic StringintintintintgetWidth()intgetX()intgetY()longhandle()booleanbooleanbooleanprivate voidonEnter(long window, boolean cursorEntered) private voidonFocus(long window, boolean hasFocus) private voidonFramebufferResize(long window, int framebufferWidth, int framebufferHeight) private voidonIconify(long window, boolean iconified) private voidonMove(long window, int x, int y) private voidonResize(long window, int width, int height) private voidvoidselectCursor(CursorType cursor) voidsetAllowCursorChanges(boolean allowCursorChanges) private voidvoidvoidsetErrorSection(String errorSection) voidsetGuiScale(int guiScale) voidsetHeight(int framebufferHeight) voidsetIcon(PackResources packResources, IconSet iconSet) private voidsetMode()voidsetPreferredFullscreenVideoMode(Optional<VideoMode> preferredFullscreenVideoMode) voidvoidsetWidth(int framebufferWidth) voidsetWindowCloseCallback(Runnable windowCloseCallback) voidsetWindowed(int windowedWidth, int windowedHeight) booleanprivate longtakeOverWindow(EarlyLoadingScreenController earlyLoadingScreen, String title) voidvoidupdateDisplay(TracyFrameCapture tracyFrameCapture) private voidupdateFullscreen(boolean vsyncEnabled, TracyFrameCapture tracyFrameCapture) voidupdateRawMouseInput(boolean enableRawMouseMotion) voidupdateVsync(boolean vsync)
-
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
-
screenManager
-
handle
private final long handle -
windowedX
private int windowedX -
windowedY
private int windowedY -
windowedWidth
private int windowedWidth -
windowedHeight
private int windowedHeight -
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
-
dirty
private boolean dirty -
vsync
private boolean vsync -
iconified
private boolean iconified -
minimized
private boolean minimized -
allowCursorChanges
private boolean allowCursorChanges -
currentCursor
-
-
Constructor Details
-
Window
public Window(WindowEventHandler eventHandler, ScreenManager screenManager, DisplayData displayData, @Nullable String preferredFullscreenVideoMode, String title)
-
-
Method Details
-
getPlatform
-
getRefreshRate
public int getRefreshRate() -
shouldClose
public boolean shouldClose() -
checkGlfwError
-
setIcon
- Throws:
IOException
-
setErrorSection
-
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:
closein interfaceAutoCloseable
-
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-trueif the cursor entered the window,falseif the cursor left
-
onIconify
private void onIconify(long window, boolean iconified) -
updateDisplay
-
getPreferredFullscreenVideoMode
-
setPreferredFullscreenVideoMode
-
changeFullscreenVideoMode
public void changeFullscreenVideoMode() -
setMode
private void setMode() -
toggleFullScreen
public void toggleFullScreen() -
setWindowed
public void setWindowed(int windowedWidth, int windowedHeight) -
updateFullscreen
-
calculateScale
public int calculateScale(int guiScale, boolean forceUnicode) -
setGuiScale
public void setGuiScale(int guiScale) -
setTitle
-
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 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 int getGuiScale() -
findBestMonitor
-
updateRawMouseInput
public void updateRawMouseInput(boolean enableRawMouseMotion) -
setWindowCloseCallback
-
isMinimized
public boolean isMinimized() -
setAllowCursorChanges
public void setAllowCursorChanges(boolean allowCursorChanges) -
selectCursor
-
takeOverWindow
-