title: How to texture a 3d tree in opengl
body: <p>I've tried to texture a tree with a *.bmp image and something I do wrong...Please help me...I have an error : undeclared identifier GL_TEXTURE_3D   </p>
  
  <pre><code>void myinit(void);
  void CALLBACK display(void);
  void CALLBACK myReshape(GLsizei w, GLsizei h);
  void load_texture(const char* s);
  float baseRadius = 0.10;
  float topRadius = 0.10;
  float height = 1.0;
  int slices=50, stacks=50;
  float pi = 3.14159265358979323846;
  
  GLuint IDtextura;
  
  void load_texture(const char* s)
  {   
      AUX_RGBImageRec *pImagineTextura = auxDIBImageLoad(s);
  
      if(pImagineTextura != NULL )
      {
          glGenTextures( 1, &amp;IDtextura );
  
          glBindTexture(GL_TEXTURE_3D, IDtextura);
  
          glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_REPEAT);
          glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_REPEAT);
          glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_REPEAT);
  
  
          glTexImage3D(GL_TEXTURE_3D, 0, 3, pImagineTextura-&gt;sizeX, pImagineTextura-&gt;sizeY,pImagineTextura-&gt;sizeZ,
              0, GL_RGB, GL_UNSIGNED_BYTE, pImagineTextura-&gt;data);
      }
  
      if(pImagineTextura)
      {
          if(pImagineTextura-&gt;data )
              free(pImagineTextura-&gt;data );
  
          free(pImagineTextura);
      }
  
  }
  void myinit (void)
  {    
      glClearColor(1.0, 1.0, 1.0, 1.0);
       glEnable(GL_TEXTURE_3D);
      glShadeModel(GL_FLAT);
  }
  
  void CALLBACK display(void)
  {
      GLUquadricObj* cilindru;
      cilindru = gluNewQuadric();
  
      glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  
      glTranslatef (0.0, 0.0, -5.0);
      const char* sir;
      GLuint ID1;
          glClearColor(1.0, 1.0, 1.0, 1.0);
      glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  
      sir=".\\mm.bmp";
      load_texture(sir);
      ID1=IDtextura;
  
  
      glBindTexture( GL_TEXTURE_3D, ID1);
      //glBegin(GL_QUADS);
          //????
      glEnd();
  
      glPushMatrix ();
      glRotated (0.0, 1.0, 0.0, 0.0);
      glTranslated (0.0, 0.0, 1.5);
      glDisable (GL_LIGHTING);
      glEnable (GL_LIGHTING);
      glPopMatrix ();
  
      //tree
      glPushMatrix();
          glRotatef(90, 1, 0, 0);
          gluQuadricDrawStyle(cilindru, GLU_FILL);
          gluCylinder(cilindru, baseRadius, topRadius, height, slices,stacks);
      glPopMatrix();
  
      ..........
  </code></pre>