Skip to content

GlfwWindowBridge

final class GlfwWindowBridge
Implements: IWindowBridge
Package: dev.joid.base.lwjgl3.glfw · Module: base-lwjgl3-glfw · Source: GlfwWindowBridge.java
Backends: LWJGL 3 Vulkan

The window bridge of a GLFW window, which reads its size, mouse, keys, clipboard and cursor in screen pixels.

The LWJGL 3 and Vulkan backends create it from the handle of your window.

ReturnsSignatureSummary
GlfwWindowBridge(long window)Creates the bridge of an existing GLFW window, from its handle.

ReturnsSignatureSummary
voiddestroy()Destroys the cursors that the bridge created; call it before you destroy the window.
intgetWidth()Returns the width of the framebuffer of the window, in screen pixels.
intgetHeight()Returns the height of the framebuffer of the window, in screen pixels.
doublegetMouseX()Returns the horizontal position of the cursor, converted from window coordinates to screen pixels; while the input forwarder forwards a mouse event, the position of that event.
doublegetMouseY()Returns the vertical position of the cursor, converted from window coordinates to screen pixels; while the input forwarder forwards a mouse event, the position of that event.
booleanisMouseGrabbed()If true, the cursor mode of the window is GLFW_CURSOR_DISABLED.
booleanisKeyDown(Key physicalKey)If true, GLFW reports the key at that physical position as pressed; a key that GLFW does not know is never down.
StringgetClipboard()Returns the clipboard of GLFW, or an empty string when it holds no text.
voidsetClipboard(String text)Puts the text in the clipboard of GLFW.

GlfwWindowBridge(long window)

Creates the bridge of an existing GLFW window, from its handle.

void destroy()

Destroys the cursors that the bridge created; call it before you destroy the window.

int getWidth()

Returns the width of the framebuffer of the window, in screen pixels.

int getHeight()

Returns the height of the framebuffer of the window, in screen pixels.

double getMouseX()

Returns the horizontal position of the cursor, converted from window coordinates to screen pixels; while the input forwarder forwards a mouse event, the position of that event.

double getMouseY()

Returns the vertical position of the cursor, converted from window coordinates to screen pixels; while the input forwarder forwards a mouse event, the position of that event.

boolean isMouseGrabbed()

If true, the cursor mode of the window is GLFW_CURSOR_DISABLED.

boolean isKeyDown(Key physicalKey)

If true, GLFW reports the key at that physical position as pressed; a key that GLFW does not know is never down.

String getClipboard()

Returns the clipboard of GLFW, or an empty string when it holds no text.

void setClipboard(String text)

Puts the text in the clipboard of GLFW.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page