OpenGL example: made the render function save/restore OpenGL state properly-ish