private void init() throws LWJGLException {

		Log.setPrintToStdout(true);

		if (args.length == 0) {
			System.out.println("Args: folder/model.obj\n" +
					"SpriteGen operates in .spritegen folder.\n" +
					"There is a folder \".spritegen/models\", which contains subfolders with your models.\n" +
					"\n" +
					"Spritesheet settings are found in \"models/modelDir/config.ini\". This file will\n" +
					"be generated while creating first spritesheet from that folder.\n" +
					"\n" +
					"Output PNG image will be saved in \"models/modelDir/out\".\n" +
					"\n" +
					"Example usage: java -jar spritegen.jar turtle/turtle.obj");
		}

		File dir = Utils.getGameSubfolder("models");
		dir.mkdirs();

		if (args.length == 0) {
			exit();
			return;
		}

		modelFile = Utils.getGameSubfolder("models/" + args[0]);

		modelDir = modelFile.getParentFile();
		File out = new File(modelDir,"out");
		out.mkdirs();

		cfg = new SetupLoader(modelDir);
		Log.i("Output image size: " + cfg.img_size + "x" + cfg.img_size);

		// init display
		Display.setDisplayMode(new DisplayMode(ScreenSprites.FRAME_SIZE, ScreenSprites.FRAME_SIZE));
		Display.setResizable(false);
		Display.setVSyncEnabled(true);
		Display.setTitle(Constants.TITLEBAR);

		int samples = cfg.samples;
		while (true) {
			try {
				Display.create(new PixelFormat().withSamples(samples).withAlphaBits(4));
				Log.i("Created display with " + samples + "x multisampling.");
				break;
			} catch (LWJGLException e) {
				Log.w("Failed to create display with " + samples + "x multisampling, trying " + samples / 2 + "x.");
				if (samples >= 2) {
					samples /= 2;
				} else if (samples == 1) {
					samples = 0;
				} else if (samples == 0) {
					Log.e("Could not create display.", e);
					exit();
				}
			}
		}

		Mouse.create();
		Keyboard.create();
		Keyboard.enableRepeatEvents(false);

		StaticInitializer.initOnStartup();
	}