GLFWErrorCapture.java

com.mojang.blaze3d.GLFWErrorCapture

信息

  • 全限定名:com.mojang.blaze3d.GLFWErrorCapture
  • 类型:public class
  • 包:com.mojang.blaze3d
  • 源码路径:src/main/java/com/mojang/blaze3d/GLFWErrorCapture.java
  • 起始行号:L15
  • 实现:GLFWErrorCallbackI, Iterable<GLFWErrorCapture.Error>
  • 职责:

    TODO

字段/常量

  • errors
    • 类型: List<GLFWErrorCapture.Error>
    • 修饰符: private
    • 源码定位: L16
    • 说明:

      TODO

内部类/嵌套类型

  • com.mojang.blaze3d.GLFWErrorCapture.Error
    • 类型: record
    • 修饰符: public
    • 源码定位: L37
    • 说明:

      TODO

构造器

方法

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

public void invoke(int error, long description) @ L18

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

参数:

  • error: int
  • description: long

说明:

TODO

public Iterator<GLFWErrorCapture.Error> iterator() @ L27

  • 方法名:iterator
  • 源码定位:L27
  • 返回类型:Iterator<GLFWErrorCapture.Error>
  • 修饰符:public

参数:

说明:

TODO

public GLFWErrorCapture.Error firstError() @ L32

  • 方法名:firstError
  • 源码定位:L32
  • 返回类型:GLFWErrorCapture.Error
  • 修饰符:public

参数:

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public class GLFWErrorCapture implements GLFWErrorCallbackI, Iterable<GLFWErrorCapture.Error> {
    private @Nullable List<GLFWErrorCapture.Error> errors;
 
    @Override
    public void invoke(int error, long description) {
        if (this.errors == null) {
            this.errors = new ArrayList<>();
        }
 
        this.errors.add(new GLFWErrorCapture.Error(error, MemoryUtil.memUTF8(description)));
    }
 
    @Override
    public Iterator<GLFWErrorCapture.Error> iterator() {
        return this.errors == null ? Collections.emptyIterator() : this.errors.iterator();
    }
 
    public GLFWErrorCapture.@Nullable Error firstError() {
        return this.errors == null ? null : this.errors.getFirst();
    }
 
    @OnlyIn(Dist.CLIENT)
    public record Error(int error, String description) {
        @Override
        public String toString() {
            return String.format(Locale.ROOT, "[GLFW 0x%X] %s", this.error, this.description);
        }
    }
}

引用的其他类