public static void main(String[] args) {
        // Start the application
        Logger.log("Starting application...");
        
        // Create a new DisplayMode
        DisplayMode dm = Utils.findDisplayMode(desiredWidth, desiredHeight);

        // Try to create a game window and sound
        try {
            Display.setDisplayMode(dm);
            Display.setFullscreen(fullscreen);
            
            Display.setTitle("Patient 04");
            Display.setIcon(new ByteBuffer[] {
                Utils.loadIcon("resources/icon16.png"),
                Utils.loadIcon("resources/icon32.png")
            });
            
            Display.create();
            AL.create();
        } catch (LWJGLException e) {
            System.exit(0);
        }

        // Display OpenGL information
        Logger.debug("LWJGL version " + Sys.getVersion());
        Logger.debug("OS name " + System.getProperty("os.name"));
        Logger.debug("OS version " + System.getProperty("os.version"));
        Logger.debug("OpenGL version " + GL11.glGetString(GL11.GL_VERSION));
        Logger.debug("Display mode " + dm);
        
        // Check OpenGL extensions
        Logger.debug("ARB frame buffer object: " +
                GLContext.getCapabilities().GL_ARB_framebuffer_object);
        Logger.debug("ARB texture float: " +
                GLContext.getCapabilities().GL_ARB_texture_float);
        Logger.debug("ARB depth clamp: " +
                GLContext.getCapabilities().GL_ARB_depth_clamp);
        Logger.debug("NPOT textures: " +
                GLContext.getCapabilities().GL_ARB_texture_non_power_of_two);
        
        // Enable vsync
        Display.setVSyncEnabled(vsyncEnabled);
        
        // Set glClearColor to black
        GL11.glClearColor(0, 0, 0, 1);
        
        // Call the initialize method
        initialize();
        
        // Start the game loop
        while (!Display.isCloseRequested()) {
            // Transition to new state if needed
            if (currentState != nextState) {                
                // Destroy the old state
                if(currentState != null)
                    currentState.destroy();
                
                // Initialize the new state
                if (nextState != null)
                    nextState.initialize();
                
                // Set current state
                currentState = nextState;
            }
 
            // If there is a current state
            if (currentState != null) {
                // Update state
                currentState.update();
                
                // Render state
                currentState.render();
                
                // Flip the buffer and process input
                Display.update();
            } else
                break;
        }
 
        // If the game loop has been interrupted
        if (currentState != null)
            currentState.destroy();
        
        // Destroy the display and sound
        Display.destroy();
        AL.destroy();
        
        Logger.log("Application succesfully destroyed!");
    }