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 pEventHandler, ScreenManager pScreenManager, DisplayData pDisplayData, String pPreferredFullscreenVideoMode, String pTitle) -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
bootCrash
(int p_85413_, long p_85414_) int
calculateScale
(int pGuiScale, boolean pForceUnicode) void
static void
checkGlfwError
(BiConsumer<Integer, String> pErrorConsumer) void
close()
void
defaultErrorCallback
(int p_85383_, long p_85384_) int
double
int
int
int
static String
int
int
int
int
getWidth()
long
int
getX()
int
getY()
boolean
private void
onEnter
(long p_85420_, boolean p_85421_) private void
onFocus
(long p_85393_, boolean p_85394_) private void
onFramebufferResize
(long p_85416_, int p_85417_, int p_85418_) private void
onMove
(long p_85389_, int p_85390_, int p_85391_) private void
onResize
(long p_85428_, int p_85429_, int p_85430_) private void
private void
void
void
setErrorSection
(String pErrorSection) void
setFramerateLimit
(int pLimit) void
setGuiScale
(double pScaleFactor) void
setHeight
(int pFramebufferHeight) void
setIcon
(PackResources pPackResources, IconSet pIconSet) private void
setMode()
void
setPreferredFullscreenVideoMode
(Optional<VideoMode> pPreferredFullscreenVideoMode) void
void
setWidth
(int pFramebufferWidth) void
setWindowed
(int pWindowedWidth, int pWindowedHeight) boolean
void
void
private void
updateFullscreen
(boolean pVsyncEnabled) void
updateRawMouseInput
(boolean pEnableRawMouseMotion) void
updateVsync
(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 -
framerateLimit
private int framerateLimit -
vsync
private boolean vsync
-
-
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 p_85413_, long p_85414_) -
defaultErrorCallback
public void defaultErrorCallback(int p_85383_, long p_85384_) -
setDefaultErrorCallback
public void setDefaultErrorCallback() -
updateVsync
public void updateVsync(boolean pVsync) -
close
public void close()- Specified by:
close
in 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_) - Parameters:
p_85421_
-true
if the cursor entered the window,false
if the cursor left
-
setFramerateLimit
public void setFramerateLimit(int pLimit) -
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 pWindowedWidth, int pWindowedHeight) -
updateFullscreen
private void updateFullscreen(boolean pVsyncEnabled) -
calculateScale
public int calculateScale(int pGuiScale, boolean pForceUnicode) -
setGuiScale
public void setGuiScale(double pScaleFactor) -
setTitle
-
getWindow
public long getWindow() -
isFullscreen
public boolean isFullscreen() -
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)
-