Class FramebufferManager

java.lang.Object
net.neoforged.neoforge.resource.ContextAwareReloadListener
net.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,T>>
foundry.veil.resource.CodecReloadListener<FramebufferDefinition>
foundry.veil.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>
     

    Fields inherited from class foundry.veil.resource.CodecReloadListener

    codec, converter, logger

    Fields inherited from class net.neoforged.neoforge.resource.ContextAwareReloadListener

    conditionContext, registryAccess
  • 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
    Clears all framebuffers at the start of the next frame.
    void
     
    @Nullable AdvancedFbo
    getFramebuffer(net.minecraft.resources.ResourceLocation name)
    Retrieves a framebuffer by the specified name.
    Map<net.minecraft.resources.ResourceLocation,AdvancedFbo>
     
    void
    resizeFramebuffers(int width, int height)
     

    Methods inherited from class foundry.veil.resource.CodecReloadListener

    prepare

    Methods inherited from class net.minecraft.server.packs.resources.SimplePreparableReloadListener

    reload

    Methods inherited from class net.neoforged.neoforge.resource.ContextAwareReloadListener

    injectContext

    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
  • 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()
      Clears all framebuffers at the start of the next frame.
    • 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:
      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