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
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<net.minecraft.resources.ResourceLocation> static final net.minecraft.resources.FileToIdConverter
Fields inherited from class foundry.veil.api.CodecReloadListener
codec, converter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
apply
(@NotNull Map<net.minecraft.resources.ResourceLocation, FramebufferDefinition> data, @NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull net.minecraft.util.profiling.ProfilerFiller profilerFiller) void
clear()
void
free()
@Nullable AdvancedFbo
getFramebuffer
(net.minecraft.resources.ResourceLocation name) Retrieves a framebuffer by the specified name.@Nullable FramebufferDefinition
getFramebufferDefinition
(net.minecraft.resources.ResourceLocation name) Retrieves a framebuffer definition by the specified name.Map
<net.minecraft.resources.ResourceLocation, AdvancedFbo> @Nullable AdvancedFbo
removeFramebuffer
(net.minecraft.resources.ResourceLocation name) Removes the specified manual framebuffer without freeing it.void
resizeFramebuffers
(int width, int height) void
setDefinition
(net.minecraft.resources.ResourceLocation name, FramebufferDefinition definition) Updates a single framebuffer definition and initializes a new framebuffer.void
setFramebuffer
(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
prepare
Methods inherited from class net.minecraft.server.packs.resources.SimplePreparableReloadListener
reload
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.lwjgl.system.NativeResource
close
Methods 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
null
if 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:
apply
in classnet.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,
FramebufferDefinition>>
-
free
public void free()- Specified by:
free
in interfaceorg.lwjgl.system.NativeResource
-