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 booleanprivate final GpuBackendstatic final intstatic final intprivate CursorTypeprivate final org.lwjgl.glfw.GLFWErrorCallbackprivate booleanprivate Stringprivate final WindowEventHandlerprivate booleanprivate intprivate intprivate booleanprivate intprivate intprivate intprivate final longprivate intprivate booleanprivate booleanprivate static final org.slf4j.Loggerprivate booleanprivate final ScreenManagerprivate booleanprivate intprivate intprivate intprivate intprivate intprivate intprivate int -
Constructor Summary
ConstructorsConstructorDescriptionWindow(WindowEventHandler eventHandler, DisplayData displayData, @Nullable String fullscreenVideoModeString, String title, GpuBackend backend) -
Method Summary
Modifier and TypeMethodDescriptionprivate static intallowedWindowMinSize(int size) backend()private static voidbootCrash(int error, long description) intcalculateScale(int maxScale, boolean enforceUnicode) voidstatic voidcheckGlfwError(BiConsumer<Integer, String> errorConsumer) voidclose()static longcreateGlfwWindow(int width, int height, String title, long monitor, GpuBackend backend) private longcreateWindow(GpuBackend backend, int width, int height, String title, long initialMonitor) voiddefaultErrorCallback(int errorCode, long description) @Nullable Monitorfloatintintintintstatic StringintintintintgetWidth()intgetX()intgetY()longhandle()booleanbooleanbooleanbooleanbooleanprivate voidonEnter(long handle, boolean entered) private voidonFocus(long handle, boolean focused) private voidonFramebufferResize(long handle, int newWidth, int newHeight) private voidonIconify(long handle, boolean iconified) private voidonMove(long handle, int x, int y) private voidonResize(long handle, int newWidth, int newHeight) private voidvoidvoidselectCursor(CursorType cursor) voidsetAllowCursorChanges(boolean value) private voidvoidvoidsetErrorSection(String string) voidsetGuiScale(int guiScale) voidsetHeight(int height) voidsetIcon(PackResources resources, IconSet iconSet) private voidsetMode()voidsetPreferredFullscreenVideoMode(Optional<VideoMode> preferredFullscreenVideoMode) voidvoidsetWidth(int width) voidvoidsetWindowed(int width, int height) booleanvoidprivate voidupdateFullscreen(boolean enableVsync) voidvoidupdateRawMouseInput(boolean value) voidupdateVsync(boolean enableVsync)
-
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 -
isResized
private boolean isResized -
guiScale
private int guiScale -
errorSection
-
dirty
private boolean dirty -
vsync
private boolean vsync -
iconified
private boolean iconified -
focused
private boolean focused -
minimized
private boolean minimized -
allowCursorChanges
private boolean allowCursorChanges -
currentCursor
-
backend
-
-
Constructor Details
-
Window
public Window(WindowEventHandler eventHandler, DisplayData displayData, @Nullable String fullscreenVideoModeString, String title, GpuBackend backend) throws BackendCreationException - Throws:
BackendCreationException
-
-
Method Details
-
createGlfwWindow
public static long createGlfwWindow(int width, int height, String title, long monitor, GpuBackend backend) throws BackendCreationException - Throws:
BackendCreationException
-
createWindow
private long createWindow(GpuBackend backend, int width, int height, String title, long initialMonitor) throws BackendCreationException - Throws:
BackendCreationException
-
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 errorCode, long description) -
setDefaultErrorCallback
public void setDefaultErrorCallback() -
updateVsync
public void updateVsync(boolean enableVsync) -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
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) -
onIconify
private void onIconify(long handle, boolean iconified) -
updateFullscreenIfChanged
public void updateFullscreenIfChanged() -
getPreferredFullscreenVideoMode
-
setPreferredFullscreenVideoMode
-
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) -
calculateScale
public int calculateScale(int maxScale, boolean enforceUnicode) -
setGuiScale
public void setGuiScale(int guiScale) -
setTitle
-
handle
public long handle() -
isFullscreen
public boolean isFullscreen() -
isIconified
public boolean isIconified() -
isFocused
public boolean isFocused() -
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
-
updateRawMouseInput
public void updateRawMouseInput(boolean value) -
setWindowCloseCallback
-
isResized
public boolean isResized() -
resetIsResized
public void resetIsResized() -
isMinimized
public boolean isMinimized() -
setAllowCursorChanges
public void setAllowCursorChanges(boolean value) -
selectCursor
-
getAppropriateLineWidth
public float getAppropriateLineWidth() -
backend
-
allowedWindowMinSize
private static int allowedWindowMinSize(int size)
-