Raise correct error messages when surface is OPENGL.