Package limn.render3d

Enum Class MeshUsage

java.lang.Object
java.lang.Enum<MeshUsage>
limn.render3d.MeshUsage
All Implemented Interfaces:
Serializable, Comparable<MeshUsage>, Constable

public enum MeshUsage extends Enum<MeshUsage>
How often a mesh's contents change, declared at upload, because a GPU buffer's usage is fixed when it is allocated.

STATIC is written once and never again: geometry loaded from a file, a procedural primitive, anything whose shape outlives the frame that made it. DYNAMIC sizes its buffers from the first upload and can then be rewritten every frame through GpuMesh.update(limn.render3d.MeshData) without allocating, for geometry that is rebuilt rather than transformed (a particle batch, a live surface plot, a spline cage being dragged).

There is no third "stream" level. The distinction between "rewritten occasionally" and "rewritten every frame" has no portable meaning, and a hint nobody can reason about is a hint nobody should have to choose.

  • Enum Constant Details

  • Method Details

    • values

      public static MeshUsage[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MeshUsage valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null