Tesselator.java

com.mojang.blaze3d.vertex.Tesselator

信息

  • 全限定名:com.mojang.blaze3d.vertex.Tesselator
  • 类型:public class
  • 包:com.mojang.blaze3d.vertex
  • 源码路径:src/main/java/com/mojang/blaze3d/vertex/Tesselator.java
  • 起始行号:L8
  • 职责:

    TODO

字段/常量

  • MAX_BYTES

    • 类型: int
    • 修饰符: private static final
    • 源码定位: L9
    • 说明:

      TODO

  • buffer

    • 类型: ByteBufferBuilder
    • 修饰符: private final
    • 源码定位: L10
    • 说明:

      TODO

  • instance

    • 类型: Tesselator
    • 修饰符: private static
    • 源码定位: L11
    • 说明:

      TODO

内部类/嵌套类型

构造器

public Tesselator(int size) @ L29

  • 构造器名:Tesselator
  • 源码定位:L29
  • 修饰符:public

参数:

  • size: int

说明:

TODO

public Tesselator() @ L33

  • 构造器名:Tesselator
  • 源码定位:L33
  • 修饰符:public

参数:

说明:

TODO

方法

下面的方法块按源码顺序生成。

public static void init() @ L13

  • 方法名:init
  • 源码定位:L13
  • 返回类型:void
  • 修饰符:public static

参数:

说明:

TODO

public static Tesselator getInstance() @ L21

  • 方法名:getInstance
  • 源码定位:L21
  • 返回类型:Tesselator
  • 修饰符:public static

参数:

说明:

TODO

public BufferBuilder begin(VertexFormat.Mode mode, VertexFormat format) @ L37

  • 方法名:begin
  • 源码定位:L37
  • 返回类型:BufferBuilder
  • 修饰符:public

参数:

  • mode: VertexFormat.Mode
  • format: VertexFormat

说明:

TODO

public void clear() @ L41

  • 方法名:clear
  • 源码定位:L41
  • 返回类型:void
  • 修饰符:public

参数:

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public class Tesselator {
    private static final int MAX_BYTES = 786432;
    private final ByteBufferBuilder buffer;
    private static @Nullable Tesselator instance;
 
    public static void init() {
        if (instance != null) {
            throw new IllegalStateException("Tesselator has already been initialized");
        } else {
            instance = new Tesselator();
        }
    }
 
    public static Tesselator getInstance() {
        if (instance == null) {
            throw new IllegalStateException("Tesselator has not been initialized");
        } else {
            return instance;
        }
    }
 
    public Tesselator(int size) {
        this.buffer = new ByteBufferBuilder(size);
    }
 
    public Tesselator() {
        this(786432);
    }
 
    public BufferBuilder begin(VertexFormat.Mode mode, VertexFormat format) {
        return new BufferBuilder(this.buffer, mode, format);
    }
 
    public void clear() {
        this.buffer.clear();
    }
}

引用的其他类