GlyphRenderState .java

net.minecraft.client.renderer.state.gui.GlyphRenderState (record): members: pose, renderable, scissorArea, buildVertices, textureSetup, pipeline, bounds.

net.minecraft.client.renderer.state.guirecord38 linesclient1.3 KB

Implements

API Surface (3)

void buildVertices(final VertexConsumer vertexConsumer)
RenderPipeline pipeline()
TextureSetup textureSetup()

Full Source

GlyphRenderState.java38 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.client.renderer.state.gui;
2
3
import com.mojang.blaze3d.systems.RenderSystem;
4
import com.mojang.blaze3d.vertex.VertexConsumer;
5
import com.mojang.renderpearl.api.pipeline.RenderPipeline;
6
import com.mojang.renderpearl.api.textures.FilterMode;
7
import net.fabricmc.api.EnvType;
8
import net.fabricmc.api.Environment;
9
import net.minecraft.client.gui.font.TextRenderable;
10
import net.minecraft.client.gui.navigation.ScreenRectangle;
11
import net.minecraft.client.gui.render.TextureSetup;
12
import org.joml.Matrix3x2fc;
13
import org.joml.Matrix4f;
14
import org.jspecify.annotations.Nullable;
15
16
@Environment(EnvType.CLIENT)
17
public record GlyphRenderState(Matrix3x2fc pose, TextRenderable renderable, @Nullable ScreenRectangle scissorArea) implements GuiElementRenderState {
18
	@Override
19
	public void buildVertices(final VertexConsumer vertexConsumer) {
20
		this.renderable.render(new Matrix4f().mul(this.pose), vertexConsumer, 15728880, true);
21
	}
22
23
	@Override
24
	public RenderPipeline pipeline() {
25
		return this.renderable.guiPipeline();
26
	}
27
28
	@Override
29
	public TextureSetup textureSetup() {
30
		return TextureSetup.singleTextureWithLightmap(this.renderable.textureView(), RenderSystem.getSamplerCache().getClampToEdge(FilterMode.NEAREST));
31
	}
32
33
	@Override
34
	public @Nullable ScreenRectangle bounds() {
35
		return null;
36
	}
37
}
38

Decompiled Minecraft 26.3 source of GlyphRenderState (net/minecraft/client/renderer/state/gui/GlyphRenderState.java) with Mojang official mappings, stored verbatim on the site.