Package net.minecraft.client
Class MainWindow
- java.lang.Object
-
- net.minecraft.client.MainWindow
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public final class MainWindow extends java.lang.Object implements java.lang.AutoCloseable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MainWindow.GlException
-
Field Summary
Fields Modifier and Type Field Description private boolean
actuallyFullscreen
private org.lwjgl.glfw.GLFWErrorCallback
defaultErrorCallback
private boolean
dirty
private java.lang.String
errorSection
private IWindowEventListener
eventHandler
private int
framebufferHeight
private int
framebufferWidth
private int
framerateLimit
private boolean
fullscreen
private double
guiScale
private int
guiScaledHeight
private int
guiScaledWidth
private int
height
private static org.apache.logging.log4j.Logger
LOGGER
private java.util.Optional<VideoMode>
preferredFullscreenVideoMode
private MonitorHandler
screenManager
private boolean
vsync
private int
width
private long
window
private int
windowedHeight
private int
windowedWidth
private int
windowedX
private int
windowedY
private int
x
private int
y
-
Constructor Summary
Constructors Constructor Description MainWindow(IWindowEventListener p_i51170_1_, MonitorHandler p_i51170_2_, ScreenSize p_i51170_3_, java.lang.String p_i51170_4_, java.lang.String p_i51170_5_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static void
bootCrash(int p_208034_0_, long p_208034_1_)
int
calculateScale(int p_216521_1_, boolean p_216521_2_)
void
changeFullscreenVideoMode()
static void
checkGlfwError(java.util.function.BiConsumer<java.lang.Integer,java.lang.String> p_211162_0_)
void
close()
void
defaultErrorCallback(int p_198084_1_, long p_198084_2_)
Monitor
findBestMonitor()
int
getFramerateLimit()
double
getGuiScale()
int
getGuiScaledHeight()
int
getGuiScaledWidth()
int
getHeight()
java.util.Optional<VideoMode>
getPreferredFullscreenVideoMode()
int
getRefreshRate()
int
getScreenHeight()
int
getScreenWidth()
int
getWidth()
long
getWindow()
int
getX()
int
getY()
boolean
isFullscreen()
private void
onEnter(long p_241553_1_, boolean p_241553_3_)
private void
onFocus(long p_198095_1_, boolean p_198095_3_)
private void
onFramebufferResize(long p_198102_1_, int p_198102_3_, int p_198102_4_)
private void
onMove(long p_198080_1_, int p_198080_3_, int p_198080_4_)
private void
onResize(long p_198089_1_, int p_198089_3_, int p_198089_4_)
private java.nio.ByteBuffer
readIconPixels(java.io.InputStream p_198111_1_, java.nio.IntBuffer p_198111_2_, java.nio.IntBuffer p_198111_3_, java.nio.IntBuffer p_198111_4_)
private void
refreshFramebufferSize()
private void
setBootErrorCallback()
void
setDefaultErrorCallback()
void
setErrorSection(java.lang.String p_227799_1_)
void
setFramerateLimit(int p_216526_1_)
void
setGuiScale(double p_216525_1_)
void
setIcon(java.io.InputStream p_216529_1_, java.io.InputStream p_216529_2_)
private void
setMode()
void
setPreferredFullscreenVideoMode(java.util.Optional<VideoMode> p_224797_1_)
void
setTitle(java.lang.String p_230148_1_)
boolean
shouldClose()
void
toggleFullScreen()
void
updateDisplay()
private void
updateFullscreen(boolean p_216527_1_)
void
updateRawMouseInput(boolean p_224798_1_)
void
updateVsync(boolean p_216523_1_)
-
-
-
Field Detail
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER
-
defaultErrorCallback
private final org.lwjgl.glfw.GLFWErrorCallback defaultErrorCallback
-
eventHandler
private final IWindowEventListener eventHandler
-
screenManager
private final MonitorHandler screenManager
-
window
private final long window
-
windowedX
private int windowedX
-
windowedY
private int windowedY
-
windowedWidth
private int windowedWidth
-
windowedHeight
private int windowedHeight
-
preferredFullscreenVideoMode
private java.util.Optional<VideoMode> 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
private java.lang.String errorSection
-
dirty
private boolean dirty
-
framerateLimit
private int framerateLimit
-
vsync
private boolean vsync
-
-
Constructor Detail
-
MainWindow
public MainWindow(IWindowEventListener p_i51170_1_, MonitorHandler p_i51170_2_, ScreenSize p_i51170_3_, @Nullable java.lang.String p_i51170_4_, java.lang.String p_i51170_5_)
-
-
Method Detail
-
getRefreshRate
public int getRefreshRate()
-
shouldClose
public boolean shouldClose()
-
checkGlfwError
public static void checkGlfwError(java.util.function.BiConsumer<java.lang.Integer,java.lang.String> p_211162_0_)
-
setIcon
public void setIcon(java.io.InputStream p_216529_1_, java.io.InputStream p_216529_2_)
-
readIconPixels
@Nullable private java.nio.ByteBuffer readIconPixels(java.io.InputStream p_198111_1_, java.nio.IntBuffer p_198111_2_, java.nio.IntBuffer p_198111_3_, java.nio.IntBuffer p_198111_4_) throws java.io.IOException
- Throws:
java.io.IOException
-
setErrorSection
public void setErrorSection(java.lang.String p_227799_1_)
-
setBootErrorCallback
private void setBootErrorCallback()
-
bootCrash
private static void bootCrash(int p_208034_0_, long p_208034_1_)
-
defaultErrorCallback
public void defaultErrorCallback(int p_198084_1_, long p_198084_2_)
-
setDefaultErrorCallback
public void setDefaultErrorCallback()
-
updateVsync
public void updateVsync(boolean p_216523_1_)
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
onMove
private void onMove(long p_198080_1_, int p_198080_3_, int p_198080_4_)
-
onFramebufferResize
private void onFramebufferResize(long p_198102_1_, int p_198102_3_, int p_198102_4_)
-
refreshFramebufferSize
private void refreshFramebufferSize()
-
onResize
private void onResize(long p_198089_1_, int p_198089_3_, int p_198089_4_)
-
onFocus
private void onFocus(long p_198095_1_, boolean p_198095_3_)
-
onEnter
private void onEnter(long p_241553_1_, boolean p_241553_3_)
-
setFramerateLimit
public void setFramerateLimit(int p_216526_1_)
-
getFramerateLimit
public int getFramerateLimit()
-
updateDisplay
public void updateDisplay()
-
getPreferredFullscreenVideoMode
public java.util.Optional<VideoMode> getPreferredFullscreenVideoMode()
-
setPreferredFullscreenVideoMode
public void setPreferredFullscreenVideoMode(java.util.Optional<VideoMode> p_224797_1_)
-
changeFullscreenVideoMode
public void changeFullscreenVideoMode()
-
setMode
private void setMode()
-
toggleFullScreen
public void toggleFullScreen()
-
updateFullscreen
private void updateFullscreen(boolean p_216527_1_)
-
calculateScale
public int calculateScale(int p_216521_1_, boolean p_216521_2_)
-
setGuiScale
public void setGuiScale(double p_216525_1_)
-
setTitle
public void setTitle(java.lang.String p_230148_1_)
-
getWindow
public long getWindow()
-
isFullscreen
public boolean isFullscreen()
-
getWidth
public int getWidth()
-
getHeight
public int getHeight()
-
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
@Nullable public Monitor findBestMonitor()
-
updateRawMouseInput
public void updateRawMouseInput(boolean p_224798_1_)
-
-