This problem with DevIL is Killing me!

Started by
1 comment, last by insomniac2846 20 years ago

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.
With great power comes great reponsibility.
Advertisement
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...
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.
With great power comes great reponsibility.

This topic is closed to new replies.

Advertisement