Jump to content
  • Advertisement

Archived

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

insomniac2846

This problem with DevIL is Killing me!

This topic is 5216 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

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
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...

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!