Moved openGL intialisation code