Updated the code to work for the latest glfw.