Class FramebufferManager

java.lang.Object
net.neoforged.neoforge.resource.ContextAwareReloadListener
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

    Fields
    Modifier and Type
    Field
    Description
    static 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

    Constructors
    Constructor
    Description
    Creates a new instance of the framebuffer manager.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected 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
     
    void
     
    @Nullable AdvancedFbo
    getFramebuffer(net.minecraft.resources.ResourceLocation name)
    Retrieves a framebuffer 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
    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 net.neoforged.neoforge.resource.ContextAwareReloadListener

    getContext, getRegistryLookup, injectContext, makeConditionalOps

    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()
    • setFramebuffer

      public void setFramebuffer(net.minecraft.resources.ResourceLocation name, AdvancedFbo fbo)
      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 add
      fbo - 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
    • getFramebuffers

      public Map<net.minecraft.resources.ResourceLocation,AdvancedFbo> 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 class net.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,FramebufferDefinition>>
    • free

      public void free()
      Specified by:
      free in interface org.lwjgl.system.NativeResource