fixed bug in opengl sample 2