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.BufferSource
private GpuTexture
private GpuTextureView
private final CachedOrthoProjectionMatrixBuffer
private GpuTexture
private GpuTextureView
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
PictureInPictureRenderer
(MultiBufferSource.BufferSource pBufferSource) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
blitTexture
(T pRenderState, GuiRenderState pGuiRenderState) boolean
canBeReusedFor
(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.void
close()
protected abstract String
protected float
getTranslateY
(int pHeight, int pGuiScale) void
prepare
(T pRenderState, GuiRenderState pGuiRenderState, int pGuiScale) private void
prepareTexturesAndProjection
(boolean pResetTexture, int pWidth, int pHeight) protected abstract void
renderToTexture
(T pRenderState, PoseStack pPoseStack) protected boolean
textureIsReadyToBlit
(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:
close
in 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.
-