• Advertisement
Sign in to follow this  

DevIL help

This topic is 4522 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

  ILuint image[2];
  GLuint id[2];

  ilGenImages(1,image); 
  
  ilBindImage(image[0]);
  ilLoadImage("test.tga");
  id[0] = ilutGLBindTexImage();

  /*ilBindImage(image[1]);
  ilLoadImage("test.bmp");
  id[1] = ilutGLBindTexImage();*/

  glEnable(GL_TEXTURE_2D);
  while (!done){    

    Events(&done, event);
    
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glLoadIdentity();

    glTranslatef(0.0f,0.0f,-20.0f);
    
    glBindTexture(GL_TEXTURE_2D,id[0]);
    
    glBegin(GL_QUADS);
      glTexCoord2f(0.0f,0.0f); glVertex3f(10.0f,0.0f,0.0f);
      glTexCoord2f(0.0f,1.0f); glVertex3f(10.0f,10.0f,0.0f);
      glTexCoord2f(1.0f,1.0f); glVertex3f(0.0f,10.0f,0.0f);
      glTexCoord2f(1.0f,0.0f); glVertex3f(0.0f,0.0f,0.0f);
    glEnd();
    
    SDL_GL_SwapBuffers(); 
  }   



As soon as I uncomment the block for loading a second image, the app just freezes up. I'm probably not loading multiple textures properly. Anybody know what is wrong?

Share this post


Link to post
Share on other sites
Advertisement
Sorry I did have that

ilGenImages(2,image);

I was trying other stuff and I just forgot to change it back when I posted it.

ilLoadImage is returning true because the quad is drawn and the image is shown but after that i have to kill the window process to close it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement