Class VanillaAdvancedFboWrapper
java.lang.Object
foundry.veil.impl.client.render.wrapper.VanillaAdvancedFboWrapper
- All Implemented Interfaces:
AdvancedFbo
,AutoCloseable
,org.lwjgl.system.NativeResource
Wraps any render target with an
AdvancedFbo
.-
Nested Class Summary
Nested classes/interfaces inherited from interface foundry.veil.api.client.render.framebuffer.AdvancedFbo
AdvancedFbo.Builder
-
Constructor Summary
ConstructorDescriptionVanillaAdvancedFboWrapper
(Supplier<com.mojang.blaze3d.pipeline.RenderTarget> renderTargetSupplier) -
Method Summary
Modifier and TypeMethodDescriptionvoid
bind
(boolean setViewport) Binds this framebuffer for read and draw requests.void
bindDraw
(boolean setViewport) Binds this framebuffer for draw requests.void
bindRead()
Binds this framebuffer for read requests.void
clear()
Clears the buffers in this framebuffer.void
create()
Creates the framebuffer and all attachments.void
free()
int
getColorAttachment
(int attachment) Checks the attachments for the specified slot.int
int[]
int
int
getId()
int
getWidth()
boolean
hasColorAttachment
(int attachment) Checks to see if the provided attachment has been added to this framebuffer.boolean
com.mojang.blaze3d.pipeline.RenderTarget
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface foundry.veil.api.client.render.framebuffer.AdvancedFbo
draw, getColorRenderAttachment, getColorTextureAttachment, getDepthRenderAttachment, getDepthTextureAttachment, isColorRenderAttachment, isColorTextureAttachment, isDepthMutableTextureAttachment, isDepthRenderAttachment, isDepthTextureAttachment, isMutableColorTextureAttachment, resolveToAdvancedFbo, resolveToAdvancedFbo, resolveToFbo, resolveToFramebuffer, resolveToFramebuffer, resolveToScreen, resolveToScreen, setColorAttachmentTexture, setColorAttachmentTexture, setDepthAttachmentTexture, setDepthAttachmentTexture
Methods inherited from interface org.lwjgl.system.NativeResource
close
-
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 interfaceAdvancedFbo
-
clear
public void clear()Description copied from interface:AdvancedFbo
Clears the buffers in this framebuffer.- Specified by:
clear
in interfaceAdvancedFbo
-
bind
public void bind(boolean setViewport) Description copied from interface:AdvancedFbo
Binds this framebuffer for read and draw requests.- Specified by:
bind
in interfaceAdvancedFbo
- 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 interfaceAdvancedFbo
-
bindDraw
public void bindDraw(boolean setViewport) Description copied from interface:AdvancedFbo
Binds this framebuffer for draw requests.- Specified by:
bindDraw
in interfaceAdvancedFbo
- Parameters:
setViewport
- Whether to set the viewport to fit the bounds of this framebuffer
-
getId
public int getId()- Specified by:
getId
in interfaceAdvancedFbo
- Returns:
- The id of this framebuffer or -1 if it has been deleted
-
getWidth
public int getWidth()- Specified by:
getWidth
in interfaceAdvancedFbo
- Returns:
- The width of this framebuffer
-
getHeight
public int getHeight()- Specified by:
getHeight
in interfaceAdvancedFbo
- Returns:
- The height of this framebuffer
-
getColorAttachments
public int getColorAttachments()- Specified by:
getColorAttachments
in interfaceAdvancedFbo
- Returns:
- The amount of color attachments in this framebuffer
-
getClearMask
public int getClearMask()- Specified by:
getClearMask
in interfaceAdvancedFbo
- Returns:
- The mak used while clearing the buffer
-
getDrawBuffers
public int[] getDrawBuffers()- Specified by:
getDrawBuffers
in interfaceAdvancedFbo
- 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 interfaceAdvancedFbo
- 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 interfaceAdvancedFbo
- Returns:
- Whether there is a depth attachment added to this framebuffer
-
getColorAttachment
Description copied from interface:AdvancedFbo
Checks the attachments for the specified slot. If the amount of attachments is unknown, useAdvancedFbo.hasColorAttachment(int)
to verify before calling this.- Specified by:
getColorAttachment
in interfaceAdvancedFbo
- Parameters:
attachment
- The attachment to get- Returns:
- The attachment in the specified attachment slot
-
getDepthAttachment
- Specified by:
getDepthAttachment
in interfaceAdvancedFbo
- Returns:
- The depth attachment of this framebuffer
-
toRenderTarget
public com.mojang.blaze3d.pipeline.RenderTarget toRenderTarget()- Specified by:
toRenderTarget
in interfaceAdvancedFbo
- Returns:
- A
RenderTarget
that uses this advanced fbo as the target
-
free
public void free()- Specified by:
free
in interfaceorg.lwjgl.system.NativeResource
-