Package heronarts.glx
Class View
java.lang.Object
heronarts.glx.View
-
Field Summary
Modifier and TypeFieldDescriptionprotected final GLX
protected int
protected final org.joml.Matrix4f
protected final FloatBuffer
protected short
protected final org.joml.Matrix4f
protected final FloatBuffer
protected int
protected int
protected int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbind()
bind
(short viewId) void
dispose()
float
int
short
getId()
org.joml.Matrix4f
org.joml.Matrix4f
int
getWidth()
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()
-