public void start(String[] args) {
        Config.parseCommandLineArguments(args);
        try {
            Display.setTitle(windowTitle);
            Display.setFullscreen(fullscreen);
            Display.setVSyncEnabled(vsync);
            if (!fullscreen) {
                Display.setDisplayMode(new DisplayMode(width, height));
            }
            Display.setResizable(!fullscreen);

            final PixelFormat pixelFormat = new PixelFormat()
                .withBitsPerPixel(Display.getDesktopDisplayMode().getBitsPerPixel())
                .withSamples(sampleCount)
                .withSRGB(useSRGB);

            final ContextAttribs contextAttribs = new ContextAttribs(openGLMajor, openGLMinor)
                .withDebug(useDebug);

            Display.create(pixelFormat, contextAttribs);

            if (useDebug && GLContext.getCapabilities().GL_ARB_debug_output) {
                glDebugMessageCallbackARB(new ARBDebugOutputCallback());
            }

            setMatrices();

            glClearDepth(1);
            glDepthFunc(GL_LEQUAL);
            glEnable(GL_DEPTH_TEST);
            glShadeModel(GL_SMOOTH);
        }
        catch (LWJGLException e) {
            e.printStackTrace();
        }

        Mouse.setGrabbed(true);
        MapGenerator generator = new MapGenerator(512);
        map = generator.generate();
        gameLoop();
        Display.destroy();
    }