Java 类org.lwjgl.opengl.KHRDebug 实例源码

项目:OpenModsLib    文件:CommandGlDebug.java   
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
    if (args.length != 1) throw new CommandException("commands.generic.syntax");
    final String arg = args[0].toLowerCase(Locale.ROOT);
    if (arg.equals("disable")) {
        GL11.glDisable(KHRDebug.GL_DEBUG_OUTPUT);
    } else {
        final Set<Integer> allowedLevels = ALLOWED_LEVELS.get(arg);
        if (allowedLevels == null) throw new CommandException("commands.generic.syntax");

        GL11.glEnable(KHRDebug.GL_DEBUG_OUTPUT);
        for (int level : ALL_LEVELS) {
            final boolean isEnabled = allowedLevels.contains(level);
            KHRDebug.glDebugMessageControl(GL11.GL_DONT_CARE, GL11.GL_DONT_CARE, level, null, isEnabled);
        }
        KHRDebug.glDebugMessageCallback(new KHRDebugCallback());
    }

}