Modifying sample to use opengl