Package heronarts.glx

Class View

java.lang.Object
heronarts.glx.View

public class View extends Object
  • Field Details

    • glx

      protected final GLX 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

      protected final FloatBuffer viewMatrixBuf
    • projectionMatrix

      protected final org.joml.Matrix4f projectionMatrix
    • projectionMatrixBuf

      protected final FloatBuffer projectionMatrixBuf
  • Constructor Details

    • View

      public View(GLX glx)
      Constructs a default view of the entire framebuffer
      Parameters:
      glx - GLX instance
    • View

      public View(GLX glx, int x, int y, int w, int h)
      Constructs a view of the given bounds. Bounds are expressed in framebuffer coordinate space, with no awareness of content-scaling
      Parameters:
      glx - LX instance
      x - Top-left x position in framebuffer coordinates
      y - Top-left y position in framebuffer coordinates
      w - Width in framebuffer coordinates
      h - Height in framebuffer coordinates
  • Method Details

    • getId

      public short getId()
    • setId

      public View setId(short viewId)
    • bind

      public View bind(short viewId)
    • bind

      public View bind()
    • touch

      public View 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

      public View setCamera(org.joml.Vector3f eye, org.joml.Vector3f center, org.joml.Vector3f up)
    • setOrthographic

      public View setOrthographic(float x1, float x2, float y1, float y2, float z1, float z2)
    • setPerspective

      public View setPerspective(float radians, float aspectRatio, float zNear, float zFar)
    • setScreenOrtho

      public View setScreenOrtho()
    • setScreenOrtho

      public View setScreenOrtho(float width, float height)
    • setRect

      public View setRect(int x, int y, int width, int height)
      Sets the coordinates of this view in framebuffer coordinate space, independent of content scaling.
      Parameters:
      x - Top-left x in framebuffer pixels
      y - Top-left y in framebuffer pixels
      width - Width in framebuffer pixels
      height - Height in framebuffer pixels
      Returns:
      this
    • setClearColor

      public View setClearColor(int rgba)
    • setClearFlags

      public View setClearFlags(int clearFlags)
    • setClearDepth

      public View setClearDepth(float clearDepth)
    • image

      public View image(UI2dContext context)
      Renders the given 2d context into this view
      Parameters:
      context - rendered 2d view
      Returns:
      this
    • dispose

      public void dispose()