Class PictureInPictureRenderer<T extends PictureInPictureRenderState>
java.lang.Object
net.minecraft.client.gui.render.pip.PictureInPictureRenderer<T>
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
GuiBannerResultRenderer,GuiBookModelRenderer,GuiEntityRenderer,GuiProfilerChartRenderer,GuiSignRenderer,GuiSkinRenderer,OversizedItemRenderer
public abstract class PictureInPictureRenderer<T extends PictureInPictureRenderState>
extends Object
implements AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final MultiBufferSource.BufferSourceprivate GpuTextureprivate GpuTextureViewprivate final CachedOrthoProjectionMatrixBufferprivate GpuTextureprivate GpuTextureView -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPictureInPictureRenderer(MultiBufferSource.BufferSource pBufferSource) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidblitTexture(T pRenderState, GuiRenderState pGuiRenderState) booleancanBeReusedFor(T state, int textureWidth, int textureHeight) Neo: This is used to check if this renderer can be reused for a given state, texture width and texture height on a subsequent frame.voidclose()protected abstract Stringprotected floatgetTranslateY(int pHeight, int pGuiScale) voidprepare(T pRenderState, GuiRenderState pGuiRenderState, int pGuiScale) private voidprepareTexturesAndProjection(boolean pResetTexture, int pWidth, int pHeight) protected abstract voidrenderToTexture(T pRenderState, PoseStack pPoseStack) protected booleantextureIsReadyToBlit(T pRenderState)
-
Field Details
-
bufferSource
-
texture
-
textureView
-
depthTexture
-
depthTextureView
-
projectionMatrixBuffer
-
-
Constructor Details
-
PictureInPictureRenderer
-
-
Method Details
-
prepare
-
blitTexture
-
prepareTexturesAndProjection
private void prepareTexturesAndProjection(boolean pResetTexture, int pWidth, int pHeight) -
textureIsReadyToBlit
-
getTranslateY
protected float getTranslateY(int pHeight, int pGuiScale) -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
getRenderStateClass
-
renderToTexture
-
getTextureLabel
-
canBeReusedFor
Neo: This is used to check if this renderer can be reused for a given state, texture width and texture height on a subsequent frame. In Vanilla, a renderer would be used for multiple different states even within the same frame, leading to crashes and the last state being used for all blits of that renderer in that frame.
-