Archived

This topic is now archived and is closed to further replies.

insomniac2846

This problem with DevIL is Killing me!

Recommended Posts

class bmp_picture{
public:
      bmp_picture();//this Width and Height to automatic values;
      void LoadBMPFile(char *filename);// Load a .bmp image file.
      void draw_bitmap();      
   protected:
      GLuint ID;
      int imageWidth;                     // Width of a texture.
      int imageHeight;                    // Height of a texture.
};

void bmp_picture::LoadBMPFile(char* filename){   
    //this is so I can use the image as an OpenGL texture
    //this is initialization stuff
    ILuint temp;
    ilGenImages(1,&temp);
    ilBindImage(temp);
    ilLoadImage(filename);               //loads image from file
    imageWidth=ilGetInteger(IL_IMAGE_WIDTH);
    imageHeight=ilGetInteger(IL_IMAGE_HEIGHT);
    glGenTextures(1,&ID);
    ID=ilutGLBindTexImage();
    ilDeleteImages(1,&temp);
    
}
 
Im using opengl with DevIL. It compiles fine but when I run it I have those all too familiar "The instruction can not be found". Any help would be apprectiated With great power comes great reponsibility.

Share this post


Link to post
Share on other sites
Do you call ilInit() before running your LoadBMPFile-code ?
Not doing this led to crashes for me, although the DevIL documentation claims this shouldn''t happen...

Share this post


Link to post
Share on other sites
Yes I call all the init functions in a seperate initialization function to get it all out of the way. BTW, if this is in the wrong forum someone please tell me.

With great power comes great reponsibility.

Share this post


Link to post
Share on other sites