Package heronarts.glx
Class View
java.lang.Object
heronarts.glx.View
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final GLXprotected intprotected final org.joml.Matrix4fprotected final FloatBufferprotected shortprotected final org.joml.Matrix4fprotected final FloatBufferprotected intprotected intprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbind()bind(short viewId) voiddispose()floatintshortgetId()org.joml.Matrix4forg.joml.Matrix4fintgetWidth()image(UI2dContext context) Renders the given 2d context into this viewsetCamera(org.joml.Vector3f eye, org.joml.Vector3f center, org.joml.Vector3f up) setClearColor(int rgba) setClearDepth(float clearDepth) setClearFlags(int clearFlags) setId(short viewId) setOrthographic(float x1, float x2, float y1, float y2, float z1, float z2) setPerspective(float radians, float aspectRatio, float zNear, float zFar) setRect(int x, int y, int width, int height) Sets the coordinates of this view in framebuffer coordinate space, independent of content scaling.setScreenOrtho(float width, float height) touch()
-
Field Details
-
glx
-
viewId
protected short viewId -
x
protected int x -
y
protected int y -
width
protected int width -
height
protected int height -
viewMatrix
protected final org.joml.Matrix4f viewMatrix -
viewMatrixBuf
-
projectionMatrix
protected final org.joml.Matrix4f projectionMatrix -
projectionMatrixBuf
-
-
Constructor Details
-
View
Constructs a default view of the entire framebuffer- Parameters:
glx- GLX instance
-
View
Constructs a view of the given bounds. Bounds are expressed in framebuffer coordinate space, with no awareness of content-scaling- Parameters:
glx- LX instancex- Top-left x position in framebuffer coordinatesy- Top-left y position in framebuffer coordinatesw- Width in framebuffer coordinatesh- Height in framebuffer coordinates
-
-
Method Details
-
getId
public short getId() -
setId
-
bind
-
bind
-
touch
-
getWidth
public int getWidth() -
getHeight
public int getHeight() -
getAspectRatio
public float getAspectRatio() -
getViewMatrix
public org.joml.Matrix4f getViewMatrix() -
getProjectionMatrix
public org.joml.Matrix4f getProjectionMatrix() -
setCamera
-
setOrthographic
-
setPerspective
-
setScreenOrtho
-
setScreenOrtho
-
setRect
Sets the coordinates of this view in framebuffer coordinate space, independent of content scaling.- Parameters:
x- Top-left x in framebuffer pixelsy- Top-left y in framebuffer pixelswidth- Width in framebuffer pixelsheight- Height in framebuffer pixels- Returns:
- this
-
setClearColor
-
setClearFlags
-
setClearDepth
-
image
Renders the given 2d context into this view- Parameters:
context- rendered 2d view- Returns:
- this
-
dispose
public void dispose()
-