public static void main(String[] argv) throws IOException {

        //First, get the command line parameters.
        ICommandLineManager clm = new CommandLine(argv);

        // Handles variables and settings from default.cfg
        IVariablesManager vm = new VarsManager(clm);

        // load before initing other systems, but don't apply them yet.
        System.out.print("M_LoadDefaults: Load system defaults.\n");
        vm.LoadDefaults(vm.getDefaultFile());

        bpp = BppMode.Indexed;

        if (vm.isSettingLiteral("color_depth", "hicolor"))
            bpp = BppMode.HiColor;
        if (vm.isSettingLiteral("color_depth", "truecolor"))
            bpp = BppMode.TrueColor;

        if (clm.CheckParmBool("-hicolor")) bpp = BppMode.HiColor;
        else if (clm.CheckParmBool("-truecolor")) bpp = BppMode.TrueColor;


        // Here we create DOOM
        DoomMain<?, ?> dm = null;
        // Create a dummy. This will force static init to run.

        switch (bpp) {
            case Indexed:
                System.out.println("Indexed 8-bit mode selected...");
                dm = new DoomMain.Indexed();
                break;
            case HiColor:
                System.out.println("HiColor (Alpha) 16-bit mode selected...");
                dm = new DoomMain.HiColor();
                break;
            case TrueColor:
                System.out.println("TrueColor (extended colormaps) 24-bit mode selected...");
                dm = new DoomMain.TrueColor();
                break;

        }

        dm.setCommandLineArgs(clm);
        dm.registerVariableManager(vm);
        dm.Init();
        dm.Start();

        return;
    }