GLuint makeSphere(int texNum, double radius, int slices, int stacks )
{
	GLUquadricObj* q = gluNewQuadric();
	GLuint sphereObj = glGenLists(1);

	glNewList( sphereObj, GL_COMPILE );

	// sphere
	if (textureNum != -1) {
		glBindTexture(GL_TEXTURE_2D, textureNum);
		gluQuadricTexture( q, GL_TRUE );
	}
	else
		gluQuadricTexture( q, GL_FALSE);
	
	gluSphere(q, radius, slices, stacks);
	glEndList();
	gluDeleteQuadric( q );
	
	return sphereObj;
}
