0

I'm not sure how to texture a sphere in OpenGL without using external image loading libraries. Is this possible?

My sphere is as follows:

glPushMatrix();
    GLUquadricObj *qObj = gluNewQuadric();
    gluQuadricNormals(qObj, GLU_SMOOTH);
    gluQuadricTexture(qObj, GL_TRUE);
    glTranslatef(0, translation, 0);
    gluSphere(qObj, 1.0f, 24, 24);
glPopMatrix();

I'd like to only use built in libraries, which poses an issue when searching online for solutions.

Can anyone lead me in the right direction?

genpfault
  • 51,148
  • 11
  • 85
  • 139
DCo
  • 69
  • 2
  • 10
  • http://graphics.stanford.edu/courses/cs248-00/helpsession/opengl/code_example.html – engineerC Nov 24 '14 at 05:40
  • Yes, you could procedurally generate a texture or write your own image loading code. That could be simple for some formats (some raw format, windows bitmap etc) but [using a library is best](https://www.google.com.au/search?q=opengl+texture+loading+library). Raw files are huge. Decent formats such as png use zlib. You prob don't want to write that from scratch. BTW, "build in" - built-in to what? – jozxyqk Nov 24 '14 at 06:28

0 Answers0