Updated opengl example to handle resizing