Class FramebufferManager
java.lang.Object
net.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,FramebufferDefinition>>
foundry.veil.api.CodecReloadListener<FramebufferDefinition>
foundry.veil.api.client.render.framebuffer.FramebufferManager
- All Implemented Interfaces:
AutoCloseable,net.minecraft.server.packs.resources.PreparableReloadListener,org.lwjgl.system.NativeResource
public class FramebufferManager
extends CodecReloadListener<FramebufferDefinition>
implements org.lwjgl.system.NativeResource
Manages all framebuffers and custom definitions specified in files.
All framebuffers except for the main one can be customized from the
modid:pinwheel/framebuffers folder in the assets.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
net.minecraft.server.packs.resources.PreparableReloadListener.PreparationBarrier -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<net.minecraft.resources.ResourceLocation> static final net.minecraft.resources.FileToIdConverterFields inherited from class foundry.veil.api.CodecReloadListener
codec, converter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapply(@NotNull Map<net.minecraft.resources.ResourceLocation, FramebufferDefinition> data, @NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull net.minecraft.util.profiling.ProfilerFiller profilerFiller) voidclear()voidfree()@Nullable AdvancedFbogetFramebuffer(net.minecraft.resources.ResourceLocation name) Retrieves a framebuffer by the specified name.@Nullable FramebufferDefinitiongetFramebufferDefinition(net.minecraft.resources.ResourceLocation name) Retrieves a framebuffer definition by the specified name.Map<net.minecraft.resources.ResourceLocation, AdvancedFbo> @Nullable AdvancedFboremoveFramebuffer(net.minecraft.resources.ResourceLocation name) Removes the specified manual framebuffer without freeing it.voidresizeFramebuffers(int width, int height) voidsetDefinition(net.minecraft.resources.ResourceLocation name, FramebufferDefinition definition) Updates a single framebuffer definition and initializes a new framebuffer.voidsetFramebuffer(net.minecraft.resources.ResourceLocation name, AdvancedFbo fbo) Sets the value of the specified framebuffer to a manually defined buffer.Methods inherited from class foundry.veil.api.CodecReloadListener
prepareMethods inherited from class net.minecraft.server.packs.resources.SimplePreparableReloadListener
reloadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.lwjgl.system.NativeResource
closeMethods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
getName
-
Field Details
-
FRAMEBUFFER_CODEC
public static final com.mojang.serialization.Codec<net.minecraft.resources.ResourceLocation> FRAMEBUFFER_CODEC -
FRAMEBUFFER_LISTER
public static final net.minecraft.resources.FileToIdConverter FRAMEBUFFER_LISTER
-
-
Constructor Details
-
FramebufferManager
public FramebufferManager()Creates a new instance of the framebuffer manager.
-
-
Method Details
-
resizeFramebuffers
@Internal public void resizeFramebuffers(int width, int height) -
clear
@Internal public void clear() -
setDefinition
public void setDefinition(net.minecraft.resources.ResourceLocation name, FramebufferDefinition definition) Updates a single framebuffer definition and initializes a new framebuffer.- Parameters:
name- The name of the framebuffer to setdefinition- The new definition
-
setFramebuffer
Sets the value of the specified framebuffer to a manually defined buffer. Old buffers defined using the data-driven API will be overwritten and deleted.- Parameters:
name- The name of the framebuffer to addfbo- The framebuffer to add
-
removeFramebuffer
@Nullable public @Nullable AdvancedFbo removeFramebuffer(net.minecraft.resources.ResourceLocation name) Removes the specified manual framebuffer without freeing it.- Parameters:
name- The name of the framebuffer to remove- Returns:
- The framebuffer previously defined or
nullif there was no manual buffer defined
-
getFramebuffer
@Nullable public @Nullable AdvancedFbo getFramebuffer(net.minecraft.resources.ResourceLocation name) Retrieves a framebuffer by the specified name.- Parameters:
name- The name of the framebuffer to retrieve- Returns:
- The framebuffer by that name
-
getFramebufferDefinition
@Nullable public @Nullable FramebufferDefinition getFramebufferDefinition(net.minecraft.resources.ResourceLocation name) Retrieves a framebuffer definition by the specified name.- Parameters:
name- The name of the definition to retrieve- Returns:
- The definition by that name
-
getFramebuffers
- Returns:
- An immutable view of all custom framebuffers loaded
-
apply
protected void apply(@NotNull @NotNull Map<net.minecraft.resources.ResourceLocation, FramebufferDefinition> data, @NotNull @NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull @NotNull net.minecraft.util.profiling.ProfilerFiller profilerFiller) - Specified by:
applyin classnet.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,FramebufferDefinition>>
-
free
public void free()- Specified by:
freein interfaceorg.lwjgl.system.NativeResource
-