public class Context
extends java.lang.Object
Constructor and Description |
---|
Context(long glfwWindow)
Instantiates a new Context.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
getContextData()
Gets context data.
|
Component |
getFocusedGui()
Gets focused gui.
|
org.joml.Vector2f |
getFramebufferSize()
Gets framebuffer size.
|
long |
getGlfwWindow()
Gets glfw window.
|
Component |
getMouseTargetGui()
Returns current mouse target component.
|
float |
getPixelRatio()
Gets pixel ratio.
|
org.joml.Vector2f |
getWindowPosition()
Gets window position.
|
org.joml.Vector2i |
getWindowSize()
Gets window size.
|
boolean |
isDebugEnabled()
Is debug enabled boolean.
|
boolean |
isIconified()
Returns window iconified state.
|
void |
setDebugEnabled(boolean debugEnabled)
Sets debug enabled.
|
void |
setFocusedGui(Component focusedGui)
Sets focused gui.
|
void |
setFramebufferSize(org.joml.Vector2f framebufferSize)
Sets framebuffer size.
|
void |
setIconified(boolean iconified)
Used to update state of window (in case of window iconified).
|
void |
setMouseTargetGui(Component mouseTargetGui)
Used to update current mouse target component.
|
void |
setPixelRatio(float pixelRatio)
Sets pixel ratio.
|
void |
setWindowPosition(org.joml.Vector2f windowPosition)
Sets window position.
|
void |
setWindowSize(org.joml.Vector2i windowSize)
Sets window size.
|
void |
update(int targetWidth,
int targetHeight,
int framebufferWidth,
int framebufferHeight,
int targetPosX,
int targetPosY,
boolean iconified)
Update.
|
void |
updateGlfwWindow()
Update glfw window.
|
public Context(long glfwWindow)
glfwWindow
- the glfw windowpublic boolean isDebugEnabled()
public void setDebugEnabled(boolean debugEnabled)
debugEnabled
- the debug enabledpublic java.util.Map<java.lang.String,java.lang.Object> getContextData()
public void updateGlfwWindow()
public void update(int targetWidth, int targetHeight, int framebufferWidth, int framebufferHeight, int targetPosX, int targetPosY, boolean iconified)
targetWidth
- the target widthtargetHeight
- the target heightframebufferWidth
- the framebuffer widthframebufferHeight
- the framebuffer heighttargetPosX
- the target pos xtargetPosY
- the target pos yiconified
- the iconifiedpublic float getPixelRatio()
public void setPixelRatio(float pixelRatio)
pixelRatio
- the pixel ratiopublic long getGlfwWindow()
public org.joml.Vector2f getWindowPosition()
public void setWindowPosition(org.joml.Vector2f windowPosition)
windowPosition
- the window positionpublic org.joml.Vector2i getWindowSize()
public void setWindowSize(org.joml.Vector2i windowSize)
windowSize
- the window sizepublic org.joml.Vector2f getFramebufferSize()
public void setFramebufferSize(org.joml.Vector2f framebufferSize)
framebufferSize
- the framebuffer sizepublic Component getFocusedGui()
public void setFocusedGui(Component focusedGui)
focusedGui
- the focused guipublic Component getMouseTargetGui()
public void setMouseTargetGui(Component mouseTargetGui)
mouseTargetGui
- new mouse target component.public boolean isIconified()
public void setIconified(boolean iconified)
iconified
- window state.