@Environment(value=CLIENT) public final class Window extends Object implements AutoCloseable
Modifier and Type | Class and Description |
---|---|
static class |
Window.GlErroredException |
Modifier and Type | Field and Description |
---|---|
private boolean |
currentFullscreen |
private org.lwjgl.glfw.GLFWErrorCallback |
errorCallback |
private WindowEventHandler |
eventHandler |
private int |
framebufferHeight |
private int |
framebufferWidth |
private int |
framerateLimit |
private boolean |
fullscreen |
private long |
handle |
private int |
height |
private static Logger |
LOGGER |
private MonitorTracker |
monitorTracker |
private String |
phase |
private int |
scaledHeight |
private int |
scaledWidth |
private double |
scaleFactor |
private Optional<VideoMode> |
videoMode |
private boolean |
videoModeDirty |
private boolean |
vsync |
private int |
width |
private int |
windowedHeight |
private int |
windowedWidth |
private int |
windowedX |
private int |
windowedY |
private int |
x |
private int |
y |
Constructor and Description |
---|
Window(WindowEventHandler eventHandler,
MonitorTracker monitorTracker,
WindowSettings settings,
String videoMode,
String title) |
Modifier and Type | Method and Description |
---|---|
static void |
acceptError(BiConsumer<Integer,String> consumer) |
void |
applyVideoMode() |
int |
calculateScaleFactor(int guiScale,
boolean forceUnicodeFont) |
void |
close() |
int |
getFramebufferHeight() |
int |
getFramebufferWidth() |
int |
getFramerateLimit() |
long |
getHandle() |
int |
getHeight() |
Monitor |
getMonitor() |
int |
getRefreshRate() |
int |
getScaledHeight() |
int |
getScaledWidth() |
double |
getScaleFactor() |
Optional<VideoMode> |
getVideoMode() |
int |
getWidth() |
int |
getX() |
int |
getY() |
boolean |
isFullscreen() |
void |
logGlError(int error,
long description) |
void |
logOnGlError() |
private void |
onCursorEnterChanged(long window,
boolean entered) |
private void |
onFramebufferSizeChanged(long window,
int width,
int height) |
private void |
onWindowFocusChanged(long window,
boolean focused) |
private void |
onWindowPosChanged(long window,
int x,
int y) |
private void |
onWindowSizeChanged(long window,
int width,
int height) |
private ByteBuffer |
readImage(InputStream in,
IntBuffer x,
IntBuffer y,
IntBuffer channels) |
void |
setFramerateLimit(int framerateLimit) |
void |
setIcon(InputStream icon16,
InputStream icon32) |
void |
setPhase(String phase) |
void |
setRawMouseMotion(boolean rawMouseMotion) |
void |
setScaleFactor(double scaleFactor) |
void |
setTitle(String title) |
void |
setVideoMode(Optional<VideoMode> videoMode) |
void |
setVsync(boolean vsync) |
boolean |
shouldClose() |
void |
swapBuffers() |
private static void |
throwGlError(int error,
long description) |
private void |
throwOnGlError() |
void |
toggleFullscreen() |
private void |
updateFramebufferSize() |
private void |
updateFullscreen(boolean vsync) |
private void |
updateWindowRegion() |
private static final Logger LOGGER
private final org.lwjgl.glfw.GLFWErrorCallback errorCallback
private final WindowEventHandler eventHandler
private final MonitorTracker monitorTracker
private final long handle
private int windowedX
private int windowedY
private int windowedWidth
private int windowedHeight
private boolean fullscreen
private boolean currentFullscreen
private int x
private int y
private int width
private int height
private int framebufferWidth
private int framebufferHeight
private int scaledWidth
private int scaledHeight
private double scaleFactor
private String phase
private boolean videoModeDirty
private int framerateLimit
private boolean vsync
public Window(WindowEventHandler eventHandler, MonitorTracker monitorTracker, WindowSettings settings, @Nullable String videoMode, String title)
public int getRefreshRate()
public boolean shouldClose()
public static void acceptError(BiConsumer<Integer,String> consumer)
public void setIcon(InputStream icon16, InputStream icon32)
@Nullable private ByteBuffer readImage(InputStream in, IntBuffer x, IntBuffer y, IntBuffer channels) throws IOException
IOException
public void setPhase(String phase)
private void throwOnGlError()
private static void throwGlError(int error, long description)
public void logGlError(int error, long description)
public void logOnGlError()
public void setVsync(boolean vsync)
public void close()
close
in interface AutoCloseable
private void onWindowPosChanged(long window, int x, int y)
private void onFramebufferSizeChanged(long window, int width, int height)
private void updateFramebufferSize()
private void onWindowSizeChanged(long window, int width, int height)
private void onWindowFocusChanged(long window, boolean focused)
private void onCursorEnterChanged(long window, boolean entered)
public void setFramerateLimit(int framerateLimit)
public int getFramerateLimit()
public void swapBuffers()
public void applyVideoMode()
private void updateWindowRegion()
public void toggleFullscreen()
private void updateFullscreen(boolean vsync)
public int calculateScaleFactor(int guiScale, boolean forceUnicodeFont)
public void setScaleFactor(double scaleFactor)
public void setTitle(String title)
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 getX()
public int getY()
public double getScaleFactor()
public void setRawMouseMotion(boolean rawMouseMotion)