Sign in to follow this  
sand_man

DevIL help

Recommended Posts

sand_man    100
  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
sand_man    100
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this