updated to support newest glfw3 codes