public final class MainWindow
extends java.lang.Object
implements java.lang.AutoCloseable
Modifier and Type | Class and Description |
---|---|
static class |
MainWindow.GlException |
Modifier and Type | Field and Description |
---|---|
private int |
framebufferHeight |
private int |
framebufferWidth |
private int |
framerateLimit |
private boolean |
fullscreen |
private double |
guiScaleFactor |
private long |
handle |
private int |
height |
private boolean |
lastFullscreen |
private static org.apache.logging.log4j.Logger |
LOGGER |
private org.lwjgl.glfw.GLFWErrorCallback |
loggingErrorCallback |
private IWindowEventListener |
mc |
private MonitorHandler |
monitorHandler |
private int |
prevWindowHeight |
private int |
prevWindowWidth |
private int |
prevWindowX |
private int |
prevWindowY |
private java.lang.String |
renderPhase |
private int |
scaledHeight |
private int |
scaledWidth |
private java.util.Optional<VideoMode> |
videoMode |
private boolean |
videoModeChanged |
private boolean |
vsync |
private int |
width |
private int |
windowX |
private int |
windowY |
Constructor and Description |
---|
MainWindow(IWindowEventListener p_i51170_1_,
MonitorHandler p_i51170_2_,
ScreenSize p_i51170_3_,
java.lang.String videoModeName,
java.lang.String titleIn) |
Modifier and Type | Method and Description |
---|---|
int |
calcGuiScale(int guiScaleIn,
boolean forceUnicode) |
static void |
checkGlfwError(java.util.function.BiConsumer<java.lang.Integer,java.lang.String> p_211162_0_) |
void |
close() |
void |
flipFrame() |
void |
func_230148_b_(java.lang.String p_230148_1_) |
int |
getFramebufferHeight() |
int |
getFramebufferWidth() |
double |
getGuiScaleFactor() |
long |
getHandle() |
int |
getHeight() |
int |
getLimitFramerate() |
Monitor |
getMonitor() |
int |
getRefreshRate() |
int |
getScaledHeight() |
int |
getScaledWidth() |
java.util.Optional<VideoMode> |
getVideoMode() |
int |
getWidth() |
int |
getWindowX() |
int |
getWindowY() |
boolean |
isFullscreen() |
private java.nio.ByteBuffer |
loadIcon(java.io.InputStream p_198111_1_,
java.nio.IntBuffer p_198111_2_,
java.nio.IntBuffer p_198111_3_,
java.nio.IntBuffer p_198111_4_) |
void |
logGlError(int error,
long description) |
private void |
onFramebufferSizeUpdate(long windowPointer,
int framebufferWidth,
int framebufferHeight) |
private void |
onWindowFocusUpdate(long windowPointer,
boolean hasFocus) |
private void |
onWindowPosUpdate(long windowPointer,
int windowXIn,
int windowYIn) |
private void |
onWindowSizeUpdate(long windowPointer,
int windowWidthIn,
int windowHeightIn) |
void |
setFramerateLimit(int p_216526_1_) |
void |
setGuiScale(double scaleFactor) |
void |
setLogOnGlError() |
void |
setRawMouseInput(boolean valueIn) |
void |
setRenderPhase(java.lang.String renderPhaseIn) |
private void |
setThrowExceptionOnGlError() |
void |
setVideoMode(java.util.Optional<VideoMode> fullscreenModeIn) |
void |
setVsync(boolean vsyncEnabled) |
void |
setWindowIcon(java.io.InputStream p_216529_1_,
java.io.InputStream p_216529_2_) |
boolean |
shouldClose() |
private static void |
throwExceptionForGlError(int error,
long description) |
void |
toggleFullscreen() |
private void |
toggleFullscreen(boolean vsyncEnabled) |
void |
update() |
private void |
updateFramebufferSize() |
private void |
updateVideoMode() |
private static final org.apache.logging.log4j.Logger LOGGER
private final org.lwjgl.glfw.GLFWErrorCallback loggingErrorCallback
private final IWindowEventListener mc
private final MonitorHandler monitorHandler
private final long handle
private int prevWindowX
private int prevWindowY
private int prevWindowWidth
private int prevWindowHeight
private java.util.Optional<VideoMode> videoMode
private boolean fullscreen
private boolean lastFullscreen
private int windowX
private int windowY
private int width
private int height
private int framebufferWidth
private int framebufferHeight
private int scaledWidth
private int scaledHeight
private double guiScaleFactor
private java.lang.String renderPhase
private boolean videoModeChanged
private int framerateLimit
private boolean vsync
public MainWindow(IWindowEventListener p_i51170_1_, MonitorHandler p_i51170_2_, ScreenSize p_i51170_3_, @Nullable java.lang.String videoModeName, java.lang.String titleIn)
public int getRefreshRate()
public boolean shouldClose()
public static void checkGlfwError(java.util.function.BiConsumer<java.lang.Integer,java.lang.String> p_211162_0_)
public void setWindowIcon(java.io.InputStream p_216529_1_, java.io.InputStream p_216529_2_)
@Nullable private java.nio.ByteBuffer loadIcon(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
java.io.IOException
public void setRenderPhase(java.lang.String renderPhaseIn)
private void setThrowExceptionOnGlError()
private static void throwExceptionForGlError(int error, long description)
public void logGlError(int error, long description)
public void setLogOnGlError()
public void setVsync(boolean vsyncEnabled)
public void close()
close
in interface java.lang.AutoCloseable
private void onWindowPosUpdate(long windowPointer, int windowXIn, int windowYIn)
private void onFramebufferSizeUpdate(long windowPointer, int framebufferWidth, int framebufferHeight)
private void updateFramebufferSize()
private void onWindowSizeUpdate(long windowPointer, int windowWidthIn, int windowHeightIn)
private void onWindowFocusUpdate(long windowPointer, boolean hasFocus)
public void setFramerateLimit(int p_216526_1_)
public int getLimitFramerate()
public void flipFrame()
public java.util.Optional<VideoMode> getVideoMode()
public void setVideoMode(java.util.Optional<VideoMode> fullscreenModeIn)
public void update()
private void updateVideoMode()
public void toggleFullscreen()
private void toggleFullscreen(boolean vsyncEnabled)
public int calcGuiScale(int guiScaleIn, boolean forceUnicode)
public void setGuiScale(double scaleFactor)
public void func_230148_b_(java.lang.String p_230148_1_)
public long getHandle()
public boolean isFullscreen()
public int getFramebufferWidth()
public int getFramebufferHeight()
public int getWidth()
public int getHeight()
public int getScaledWidth()
public int getScaledHeight()
public int getWindowX()
public int getWindowY()
public double getGuiScaleFactor()
@Nullable public Monitor getMonitor()
public void setRawMouseInput(boolean valueIn)