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 boolean
static final int
static final int
private final org.lwjgl.glfw.GLFWErrorCallback
private boolean
private String
private final WindowEventHandler
private int
private int
private int
private boolean
private double
private int
private int
private int
private static final org.slf4j.Logger
private final ScreenManager
private boolean
private int
private final long
private int
private int
private int
private int
private int
private int
-
Constructor Summary
ConstructorsConstructorDescriptionWindow
(WindowEventHandler eventHandler, ScreenManager screenManager, DisplayData displayData, String preferredFullscreenVideoMode, String title) -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
bootCrash
(int error, long description) int
calculateScale
(int guiScale, boolean forceUnicode) void
static void
checkGlfwError
(BiConsumer<Integer, String> errorConsumer) void
close()
void
defaultErrorCallback
(int error, long description) int
double
int
int
int
static String
int
int
int
int
getWidth()
long
int
getX()
int
getY()
boolean
private void
onEnter
(long window, boolean cursorEntered) private void
onFocus
(long window, boolean hasFocus) private void
onFramebufferResize
(long window, int framebufferWidth, int framebufferHeight) private void
onMove
(long window, int x, int y) private void
onResize
(long window, int width, int height) private void
private void
void
void
setErrorSection
(String errorSection) void
setFramerateLimit
(int limit) void
setGuiScale
(double scaleFactor) void
setHeight
(int framebufferHeight) void
setIcon
(PackResources packResources, IconSet iconSet) private void
setMode()
void
setPreferredFullscreenVideoMode
(Optional<VideoMode> preferredFullscreenVideoMode) void
void
setWidth
(int framebufferWidth) void
setWindowed
(int windowedWidth, int windowedHeight) boolean
void
void
private void
updateFullscreen
(boolean vsyncEnabled) void
updateRawMouseInput
(boolean enableRawMouseMotion) void
updateVsync
(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
-
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 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:
close
in 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
-true
if the cursor entered the window,false
if the cursor left
-
setFramerateLimit
public void setFramerateLimit(int limit) -
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 windowedWidth, int windowedHeight) -
updateFullscreen
private void updateFullscreen(boolean vsyncEnabled) -
calculateScale
public int calculateScale(int guiScale, boolean forceUnicode) -
setGuiScale
public void setGuiScale(double scaleFactor) -
setTitle
-
getWindow
public long getWindow() -
isFullscreen
public boolean isFullscreen() -
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 double getGuiScale() -
findBestMonitor
-
updateRawMouseInput
public void updateRawMouseInput(boolean enableRawMouseMotion)
-