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, GuiSkinRenderer, OversizedItemRenderer
public abstract class PictureInPictureRenderer<T extends PictureInPictureRenderState>
extends Object
implements AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate @Nullable GpuTextureprivate @Nullable GpuTextureViewprivate final Projectionprivate final ProjectionMatrixBufferprivate final SubmitNodeStorageprivate @Nullable GpuTextureprivate @Nullable GpuTextureView -
Constructor Summary
Constructors -
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, FeatureRenderDispatcher featureRenderDispatcher, int guiScale) private voidprepareTexturesAndProjection(boolean needsAResize, int width, int height) protected abstract voidrenderToTexture(T renderState, PoseStack poseStack, SubmitNodeCollector submitNodeCollector) protected booleantextureIsReadyToBlit(T renderState)
-
Field Details
-
texture
-
textureView
-
depthTexture
-
depthTextureView
-
projection
-
projectionMatrixBuffer
-
submitNodeStorage
-
-
Constructor Details
-
PictureInPictureRenderer
public PictureInPictureRenderer()
-
-
Method Details
-
prepare
public void prepare(T renderState, GuiRenderState guiRenderState, FeatureRenderDispatcher featureRenderDispatcher, int guiScale) -
blitTexture
-
prepareTexturesAndProjection
private void prepareTexturesAndProjection(boolean needsAResize, int width, int height) -
textureIsReadyToBlit
-
getTranslateY
protected float getTranslateY(int height, int guiScale) -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
getRenderStateClass
-
renderToTexture
protected abstract void renderToTexture(T renderState, PoseStack poseStack, SubmitNodeCollector submitNodeCollector) -
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.
-