updated code for glfw3 and stuff