Strange behavior from native OpenGL