Class VanillaAdvancedFboWrapper

java.lang.Object
foundry.veil.impl.client.render.wrapper.VanillaAdvancedFboWrapper
All Implemented Interfaces:
AdvancedFbo, AutoCloseable, org.lwjgl.system.NativeResource

@Internal public class VanillaAdvancedFboWrapper extends Object implements AdvancedFbo
Wraps any render target with an AdvancedFbo.
  • Constructor Details

    • VanillaAdvancedFboWrapper

      public VanillaAdvancedFboWrapper(Supplier<com.mojang.blaze3d.pipeline.RenderTarget> renderTargetSupplier)
  • Method Details

    • create

      public void create()
      Description copied from interface: AdvancedFbo
      Creates the framebuffer and all attachments.
      Specified by:
      create in interface AdvancedFbo
    • clear

      public void clear()
      Description copied from interface: AdvancedFbo
      Clears the buffers in this framebuffer.
      Specified by:
      clear in interface AdvancedFbo
    • bind

      public void bind(boolean setViewport)
      Description copied from interface: AdvancedFbo
      Binds this framebuffer for read and draw requests.
      Specified by:
      bind in interface AdvancedFbo
      Parameters:
      setViewport - Whether to set the viewport to fit the bounds of this framebuffer
    • bindRead

      public void bindRead()
      Description copied from interface: AdvancedFbo
      Binds this framebuffer for read requests.
      Specified by:
      bindRead in interface AdvancedFbo
    • bindDraw

      public void bindDraw(boolean setViewport)
      Description copied from interface: AdvancedFbo
      Binds this framebuffer for draw requests.
      Specified by:
      bindDraw in interface AdvancedFbo
      Parameters:
      setViewport - Whether to set the viewport to fit the bounds of this framebuffer
    • getId

      public int getId()
      Specified by:
      getId in interface AdvancedFbo
      Returns:
      The id of this framebuffer or -1 if it has been deleted
    • getWidth

      public int getWidth()
      Specified by:
      getWidth in interface AdvancedFbo
      Returns:
      The width of this framebuffer
    • getHeight

      public int getHeight()
      Specified by:
      getHeight in interface AdvancedFbo
      Returns:
      The height of this framebuffer
    • getColorAttachments

      public int getColorAttachments()
      Specified by:
      getColorAttachments in interface AdvancedFbo
      Returns:
      The amount of color attachments in this framebuffer
    • getClearMask

      public int getClearMask()
      Specified by:
      getClearMask in interface AdvancedFbo
      Returns:
      The mak used while clearing the buffer
    • getDrawBuffers

      public int[] getDrawBuffers()
      Specified by:
      getDrawBuffers in interface AdvancedFbo
      Returns:
      The names of the default draw buffer state
    • hasColorAttachment

      public boolean hasColorAttachment(int attachment)
      Description copied from interface: AdvancedFbo
      Checks to see if the provided attachment has been added to this framebuffer.
      Specified by:
      hasColorAttachment in interface AdvancedFbo
      Parameters:
      attachment - The attachment to check
      Returns:
      Whether there is a valid attachment in the specified slot
    • hasDepthAttachment

      public boolean hasDepthAttachment()
      Specified by:
      hasDepthAttachment in interface AdvancedFbo
      Returns:
      Whether there is a depth attachment added to this framebuffer
    • getColorAttachment

      public AdvancedFboAttachment getColorAttachment(int attachment)
      Description copied from interface: AdvancedFbo
      Checks the attachments for the specified slot. If the amount of attachments is unknown, use AdvancedFbo.hasColorAttachment(int) to verify before calling this.
      Specified by:
      getColorAttachment in interface AdvancedFbo
      Parameters:
      attachment - The attachment to get
      Returns:
      The attachment in the specified attachment slot
    • getDepthAttachment

      public AdvancedFboAttachment getDepthAttachment()
      Specified by:
      getDepthAttachment in interface AdvancedFbo
      Returns:
      The depth attachment of this framebuffer
    • toRenderTarget

      public com.mojang.blaze3d.pipeline.RenderTarget toRenderTarget()
      Specified by:
      toRenderTarget in interface AdvancedFbo
      Returns:
      A RenderTarget that uses this advanced fbo as the target
    • free

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