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 bufferSource) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidblitTexture(T renderState, GuiRenderState guiRenderState) 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 height, int guiScale) voidprepare(T renderState, GuiRenderState guiRenderState, int guiScale) private voidprepareTexturesAndProjection(boolean resetTexture, int width, int height) protected abstract voidrenderToTexture(T renderState, PoseStack poseStack) protected booleantextureIsReadyToBlit(T renderState)
-
Field Details
-
bufferSource
-
texture
-
textureView
-
depthTexture
-
depthTextureView
-
projectionMatrixBuffer
-
-
Constructor Details
-
PictureInPictureRenderer
-
-
Method Details
-
prepare
-
blitTexture
-
prepareTexturesAndProjection
private void prepareTexturesAndProjection(boolean resetTexture, int width, int height) -
textureIsReadyToBlit
-
getTranslateY
protected float getTranslateY(int height, int guiScale) -
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.
-