DebugEntryGpuUtilization.java
net.minecraft.client.gui.components.debug.DebugEntryGpuUtilization
信息
- 全限定名:net.minecraft.client.gui.components.debug.DebugEntryGpuUtilization
- 类型:public class
- 包:net.minecraft.client.gui.components.debug
- 源码路径:src/main/java/net/minecraft/client/gui/components/debug/DebugEntryGpuUtilization.java
- 起始行号:L12
- 实现:DebugScreenEntry
- 职责:
TODO
字段/常量
- 无
内部类/嵌套类型
- 无
构造器
- 无
方法
下面的方法块按源码顺序生成。
public void display(DebugScreenDisplayer displayer, Level serverOrClientLevel, LevelChunk clientChunk, LevelChunk serverChunk) @ L13
- 方法名:display
- 源码定位:L13
- 返回类型:void
- 修饰符:public
参数:
- displayer: DebugScreenDisplayer
- serverOrClientLevel: Level
- clientChunk: LevelChunk
- serverChunk: LevelChunk
说明:
TODO
public boolean isAllowed(boolean reducedDebugInfo) @ L21
- 方法名:isAllowed
- 源码定位:L21
- 返回类型:boolean
- 修饰符:public
参数:
- reducedDebugInfo: boolean
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public class DebugEntryGpuUtilization implements DebugScreenEntry {
@Override
public void display(DebugScreenDisplayer displayer, @Nullable Level serverOrClientLevel, @Nullable LevelChunk clientChunk, @Nullable LevelChunk serverChunk) {
Minecraft minecraft = Minecraft.getInstance();
String gpuUtilizationString = "GPU: "
+ (minecraft.getGpuUtilization() > 100.0 ? ChatFormatting.RED + "100%" : Math.round(minecraft.getGpuUtilization()) + "%");
displayer.addLine(gpuUtilizationString);
}
@Override
public boolean isAllowed(boolean reducedDebugInfo) {
return true;
}
}引用的其他类
-
- 引用位置:
方法调用 - 关联成员:
Minecraft.getInstance()
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
实现
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
参数
- 引用位置: