Create a sphere?

Hi, I need to create a custom function for a sphere, so I can add textures… How can I do it?

What’s wrong with GLUT’s quadrics? They have automatic texture coord generation.