Record Class FramebufferDefinition
java.lang.Object
java.lang.Record
foundry.veil.api.client.render.framebuffer.FramebufferDefinition
- Record Components:
width
- The width of the framebufferheight
- The height of the framebuffercolorBuffers
- The color attachments to adddepthBuffer
- The depth attachment to use ornull
to not add a depth bufferautoClear
- 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 Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<FramebufferDefinition> static final gg.moonflower.molangcompiler.api.MolangExpression
static final gg.moonflower.molangcompiler.api.MolangExpression
-
Constructor Summary
ConstructorDescriptionFramebufferDefinition
(gg.moonflower.molangcompiler.api.MolangExpression width, gg.moonflower.molangcompiler.api.MolangExpression height, FramebufferAttachmentDefinition[] colorBuffers, @Nullable FramebufferAttachmentDefinition depthBuffer, boolean autoClear) Creates a new framebuffer. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the value of theautoClear
record component.Returns the value of thecolorBuffers
record component.createBuilder
(int screenWidth, int screenHeight) Creates a new builder from this framebuffer.createBuilder
(gg.moonflower.molangcompiler.api.MolangEnvironment environment) Creates a new builder from this framebuffer.@Nullable FramebufferAttachmentDefinition
Returns the value of thedepthBuffer
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.gg.moonflower.molangcompiler.api.MolangExpression
height()
Returns the value of theheight
record component.final String
toString()
Returns a string representation of this record class.gg.moonflower.molangcompiler.api.MolangExpression
width()
Returns the value of thewidth
record component.
-
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
-
-
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
Creates a new builder from this framebuffer.- Parameters:
screenWidth
- The width of the screenscreenHeight
- 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
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. -
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. -
equals
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 withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
width
public gg.moonflower.molangcompiler.api.MolangExpression width()Returns the value of thewidth
record component.- Returns:
- the value of the
width
record component
-
height
public gg.moonflower.molangcompiler.api.MolangExpression height()Returns the value of theheight
record component.- Returns:
- the value of the
height
record component
-
colorBuffers
Returns the value of thecolorBuffers
record component.- Returns:
- the value of the
colorBuffers
record component
-
depthBuffer
Returns the value of thedepthBuffer
record component.- Returns:
- the value of the
depthBuffer
record component
-
autoClear
public boolean autoClear()Returns the value of theautoClear
record component.- Returns:
- the value of the
autoClear
record component
-