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.
Description
Section titled “Description”The LWJGL 3 and Vulkan backends create it from the handle of your window.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
| GlfwWindowBridge(long window) | Creates the bridge of an existing GLFW window, from its handle. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
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. |
Creation details
Section titled “Creation details”GlfwWindowBridge
Section titled “GlfwWindowBridge”GlfwWindowBridge(long window)
Creates the bridge of an existing GLFW window, from its handle.
Method details
Section titled “Method details”destroy
Section titled “destroy”void destroy()
Destroys the cursors that the bridge created; call it before you destroy the window.
getWidth
Section titled “getWidth”int getWidth()
Returns the width of the framebuffer of the window, in screen pixels.
getHeight
Section titled “getHeight”int getHeight()
Returns the height of the framebuffer of the window, in screen pixels.
getMouseX
Section titled “getMouseX”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.
getMouseY
Section titled “getMouseY”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.
isMouseGrabbed
Section titled “isMouseGrabbed”boolean isMouseGrabbed()
If true, the cursor mode of the window is GLFW_CURSOR_DISABLED.
isKeyDown
Section titled “isKeyDown”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.
getClipboard
Section titled “getClipboard”String getClipboard()
Returns the clipboard of GLFW, or an empty string when it holds no text.
setClipboard
Section titled “setClipboard”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
