Interface OGLNode<GL extends OGLGraphics>

Type Parameters:
GL - the graphics object to call.
All Known Implementing Classes:
OGLClearNode, OGLInitNode, OGLMultiNode, OGLTriggeredNode, OGLWorkerNode

public interface OGLNode<GL extends OGLGraphics>
A significant entry point whose methods that get executed upon the graphics system requesting a framebuffer redraw or resize.

Nodes are added to a OGLSystem, and are drawn in the order in which they were added. They may also receive other events.

Author:
Matthew Tropiano
  • Method Summary

    Modifier and Type
    Method
    Description
    default int
    Gets the number of polygonal objects rendered in this layer.
    default long
    Returns the length of time it took to render this node, in nanoseconds.
    default void
    Displays this node.
    default void
    onFramebufferResize(int newWidth, int newHeight)
    Called when the system canvas gets resized, or once this node gets added to the system.
  • Method Details

    • onDisplay

      default void onDisplay(GL gl)
      Displays this node. The rendering thread for the target window enters this method, so it is safe to call all OGLGraphics functions here.
      Parameters:
      gl - the graphics object used for issuing commands to OpenGL.
    • onFramebufferResize

      default void onFramebufferResize(int newWidth, int newHeight)
      Called when the system canvas gets resized, or once this node gets added to the system.
      Parameters:
      newWidth - the new framebuffer width.
      newHeight - the new framebuffer height.
    • getRenderTimeNanos

      default long getRenderTimeNanos()
      Returns the length of time it took to render this node, in nanoseconds. Results of this call should not be considered accurate until the node has had onDisplay(OGLGraphics) called on it.
      Returns:
      the length of time it took to render this node, in nanoseconds.
    • getPolygonsRendered

      default int getPolygonsRendered()
      Gets the number of polygonal objects rendered in this layer.

      This is mostly for statistical purposes. Results of this call should not be considered accurate until the node has had onDisplay(OGLGraphics) called on it.

      Returns:
      the number of polygonal objects rendered in this layer.