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 booleanstatic final intstatic final intprivate final org.lwjgl.glfw.GLFWErrorCallbackprivate booleanprivate Stringprivate final WindowEventHandlerprivate intprivate intprivate booleanprivate doubleprivate intprivate intprivate intprivate booleanprivate static final org.slf4j.Loggerprivate booleanprivate final ScreenManagerprivate booleanprivate intprivate final longprivate intprivate intprivate intprivate intprivate intprivate int -
Constructor Summary
ConstructorsConstructorDescriptionWindow(WindowEventHandler pEventHandler, ScreenManager pScreenManager, DisplayData pDisplayData, String pPreferredFullscreenVideoMode, String pTitle) -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidbootCrash(int pError, long pDescription) intcalculateScale(int pGuiScale, boolean pForceUnicode) voidstatic voidcheckGlfwError(BiConsumer<Integer, String> pErrorConsumer) voidclose()voiddefaultErrorCallback(int pError, long pDescription) doubleintintintstatic StringintintintintgetWidth()longintgetX()intgetY()booleanbooleanbooleanprivate voidonEnter(long pWindow, boolean pCursorEntered) private voidonFocus(long pWindow, boolean pHasFocus) private voidonFramebufferResize(long pWindow, int pFramebufferWidth, int pFramebufferHeight) private voidonIconify(long pWindow, boolean pIconified) private voidonMove(long pWindow, int pX, int pY) private voidonResize(long pWindow, int pWidth, int pHeight) private voidprivate voidvoidvoidsetErrorSection(String pErrorSection) voidsetGuiScale(double pScaleFactor) voidsetHeight(int pFramebufferHeight) voidsetIcon(PackResources pPackResources, IconSet pIconSet) private voidsetMode()voidsetPreferredFullscreenVideoMode(Optional<VideoMode> pPreferredFullscreenVideoMode) voidvoidsetWidth(int pFramebufferWidth) voidsetWindowCloseCallback(Runnable pWindowCloseCallback) voidsetWindowed(int pWindowedWidth, int pWindowedHeight) booleanvoidvoidupdateDisplay(TracyFrameCapture pTracyFrameCapture) private voidupdateFullscreen(boolean pVsyncEnabled, TracyFrameCapture pTracyFrameCapture) voidupdateRawMouseInput(boolean pEnableRawMouseMotion) voidupdateVsync(boolean pVsync)
-
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
-
window
private final long window -
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 double guiScale -
errorSection
-
dirty
private boolean dirty -
vsync
private boolean vsync -
iconified
private boolean iconified -
minimized
private boolean minimized
-
-
Constructor Details
-
Window
public Window(WindowEventHandler pEventHandler, ScreenManager pScreenManager, DisplayData pDisplayData, @Nullable String pPreferredFullscreenVideoMode, String pTitle)
-
-
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 pError, long pDescription) -
defaultErrorCallback
public void defaultErrorCallback(int pError, long pDescription) -
setDefaultErrorCallback
public void setDefaultErrorCallback() -
updateVsync
public void updateVsync(boolean pVsync) -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
onMove
private void onMove(long pWindow, int pX, int pY) -
onFramebufferResize
private void onFramebufferResize(long pWindow, int pFramebufferWidth, int pFramebufferHeight) -
refreshFramebufferSize
private void refreshFramebufferSize() -
onResize
private void onResize(long pWindow, int pWidth, int pHeight) -
onFocus
private void onFocus(long pWindow, boolean pHasFocus) -
onEnter
private void onEnter(long pWindow, boolean pCursorEntered) - Parameters:
pCursorEntered-trueif the cursor entered the window,falseif the cursor left
-
onIconify
private void onIconify(long pWindow, boolean pIconified) -
updateDisplay
-
getPreferredFullscreenVideoMode
-
setPreferredFullscreenVideoMode
-
changeFullscreenVideoMode
public void changeFullscreenVideoMode() -
setMode
private void setMode() -
toggleFullScreen
public void toggleFullScreen() -
setWindowed
public void setWindowed(int pWindowedWidth, int pWindowedHeight) -
updateFullscreen
private void updateFullscreen(boolean pVsyncEnabled, @Nullable TracyFrameCapture pTracyFrameCapture) -
calculateScale
public int calculateScale(int pGuiScale, boolean pForceUnicode) -
setGuiScale
public void setGuiScale(double pScaleFactor) -
setTitle
-
getWindow
public long getWindow() -
isFullscreen
public boolean isFullscreen() -
isIconified
public boolean isIconified() -
getWidth
public int getWidth() -
getHeight
public int getHeight() -
setWidth
public void setWidth(int pFramebufferWidth) -
setHeight
public void setHeight(int pFramebufferHeight) -
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
-
updateRawMouseInput
public void updateRawMouseInput(boolean pEnableRawMouseMotion) -
setWindowCloseCallback
-
isMinimized
public boolean isMinimized()
-