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 final org.lwjgl.glfw.GLFWErrorCallbackprivate booleanprivate Stringprivate final WindowEventHandlerprivate intprivate intprivate intprivate booleanprivate doubleprivate intprivate intprivate intprivate static final org.slf4j.Loggerprivate final ScreenManagerprivate booleanprivate intprivate final longprivate intprivate intprivate intprivate intprivate intprivate int -
Constructor Summary
ConstructorsConstructorDescriptionWindow(WindowEventHandler p_85372_, ScreenManager p_85373_, DisplayData p_85374_, String p_85375_, String p_85376_) -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidbootCrash(int p_85413_, long p_85414_) intcalculateScale(int p_85386_, boolean p_85387_) voidstatic voidcheckGlfwError(BiConsumer<Integer, String> p_85408_) voidclose()voiddefaultErrorCallback(int p_85383_, long p_85384_) intdoubleintintintintintintintgetWidth()longintgetX()intgetY()booleanprivate voidonEnter(long p_85420_, boolean p_85421_) private voidonFocus(long p_85393_, boolean p_85394_) private voidonFramebufferResize(long p_85416_, int p_85417_, int p_85418_) private voidonMove(long p_85389_, int p_85390_, int p_85391_) private voidonResize(long p_85428_, int p_85429_, int p_85430_) private ByteBufferreadIconPixels(InputStream p_85399_, IntBuffer p_85400_, IntBuffer p_85401_, IntBuffer p_85402_) private voidprivate voidvoidvoidsetErrorSection(String p_85404_) voidsetFramerateLimit(int p_85381_) voidsetGuiScale(double p_85379_) voidsetHeight(int p_166453_) voidsetIcon(InputStream p_85396_, InputStream p_85397_) private voidsetMode()voidsetPreferredFullscreenVideoMode(Optional<VideoMode> p_85406_) voidvoidsetWidth(int p_166451_) voidsetWindowed(int p_166448_, int p_166449_) booleanvoidvoidprivate voidupdateFullscreen(boolean p_85432_) voidupdateRawMouseInput(boolean p_85425_) voidupdateVsync(boolean p_85410_)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
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 -
framerateLimit
private int framerateLimit -
vsync
private boolean vsync
-
-
Constructor Details
-
Window
public Window(WindowEventHandler p_85372_, ScreenManager p_85373_, DisplayData p_85374_, @Nullable String p_85375_, String p_85376_)
-
-
Method Details
-
getRefreshRate
public int getRefreshRate() -
shouldClose
public boolean shouldClose() -
checkGlfwError
-
setIcon
-
readIconPixels
@Nullable private ByteBuffer readIconPixels(InputStream p_85399_, IntBuffer p_85400_, IntBuffer p_85401_, IntBuffer p_85402_) throws IOException - Throws:
IOException
-
setErrorSection
-
setBootErrorCallback
private void setBootErrorCallback() -
bootCrash
private static void bootCrash(int p_85413_, long p_85414_) -
defaultErrorCallback
public void defaultErrorCallback(int p_85383_, long p_85384_) -
setDefaultErrorCallback
public void setDefaultErrorCallback() -
updateVsync
public void updateVsync(boolean p_85410_) -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
onMove
private void onMove(long p_85389_, int p_85390_, int p_85391_) -
onFramebufferResize
private void onFramebufferResize(long p_85416_, int p_85417_, int p_85418_) -
refreshFramebufferSize
private void refreshFramebufferSize() -
onResize
private void onResize(long p_85428_, int p_85429_, int p_85430_) -
onFocus
private void onFocus(long p_85393_, boolean p_85394_) -
onEnter
private void onEnter(long p_85420_, boolean p_85421_) -
setFramerateLimit
public void setFramerateLimit(int p_85381_) -
getFramerateLimit
public int getFramerateLimit() -
updateDisplay
public void updateDisplay() -
getPreferredFullscreenVideoMode
-
setPreferredFullscreenVideoMode
-
changeFullscreenVideoMode
public void changeFullscreenVideoMode() -
setMode
private void setMode() -
toggleFullScreen
public void toggleFullScreen() -
setWindowed
public void setWindowed(int p_166448_, int p_166449_) -
updateFullscreen
private void updateFullscreen(boolean p_85432_) -
calculateScale
public int calculateScale(int p_85386_, boolean p_85387_) -
setGuiScale
public void setGuiScale(double p_85379_) -
setTitle
-
getWindow
public long getWindow() -
isFullscreen
public boolean isFullscreen() -
getWidth
public int getWidth() -
getHeight
public int getHeight() -
setWidth
public void setWidth(int p_166451_) -
setHeight
public void setHeight(int p_166453_) -
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 p_85425_)
-