Record Class FramebufferDefinition

java.lang.Object
java.lang.Record
foundry.veil.api.client.render.framebuffer.FramebufferDefinition
Record Components:
width - The width of the framebuffer
height - The height of the framebuffer
colorBuffers - The color attachments to add
depthBuffer - The depth attachment to use or null to not add a depth buffer
autoClear - Whether the framebuffer should be cleared automatically at the start of the next frame

public record FramebufferDefinition(gg.moonflower.molangcompiler.api.MolangExpression width, gg.moonflower.molangcompiler.api.MolangExpression height, FramebufferAttachmentDefinition[] colorBuffers, @Nullable FramebufferAttachmentDefinition depthBuffer, boolean autoClear) extends Record
Represents a framebuffer definition that can be turned into a real framebuffer.
  • Field Details

    • DEFAULT_WIDTH

      public static final gg.moonflower.molangcompiler.api.MolangExpression DEFAULT_WIDTH
    • DEFAULT_HEIGHT

      public static final gg.moonflower.molangcompiler.api.MolangExpression DEFAULT_HEIGHT
    • CODEC

      public static final com.mojang.serialization.Codec<FramebufferDefinition> CODEC
  • Constructor Details

    • FramebufferDefinition

      public FramebufferDefinition(gg.moonflower.molangcompiler.api.MolangExpression width, gg.moonflower.molangcompiler.api.MolangExpression height, FramebufferAttachmentDefinition[] colorBuffers, @Nullable @Nullable FramebufferAttachmentDefinition depthBuffer, boolean autoClear)
      Creates a new framebuffer.
  • Method Details

    • createBuilder

      public AdvancedFbo.Builder createBuilder(int screenWidth, int screenHeight)
      Creates a new builder from this framebuffer.
      Parameters:
      screenWidth - The width of the screen
      screenHeight - The height of the screen
      Returns:
      A new AdvancedFbo.Builder that can be turned into a framebuffer. All defined attachments are created and added to the builder
    • createBuilder

      public AdvancedFbo.Builder createBuilder(gg.moonflower.molangcompiler.api.MolangEnvironment environment)
      Creates a new builder from this framebuffer.
      Parameters:
      environment - The environment to evaluate the size in
      Returns:
      A new AdvancedFbo.Builder that can be turned into a framebuffer. All defined attachments are created and added to the builder
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • width

      public gg.moonflower.molangcompiler.api.MolangExpression width()
      Returns the value of the width record component.
      Returns:
      the value of the width record component
    • height

      public gg.moonflower.molangcompiler.api.MolangExpression height()
      Returns the value of the height record component.
      Returns:
      the value of the height record component
    • colorBuffers

      public FramebufferAttachmentDefinition[] colorBuffers()
      Returns the value of the colorBuffers record component.
      Returns:
      the value of the colorBuffers record component
    • depthBuffer

      @Nullable public @Nullable FramebufferAttachmentDefinition depthBuffer()
      Returns the value of the depthBuffer record component.
      Returns:
      the value of the depthBuffer record component
    • autoClear

      public boolean autoClear()
      Returns the value of the autoClear record component.
      Returns:
      the value of the autoClear record component