# Anyone used DevIL before? I need help.

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

## Recommended Posts

I'm using the DevIL image loading library for the loading of images into this image class I'm making. The class interfaces with the Win32 GDI in a fairly simple manner - it will only support loading images and blitting them to an HDC. Unfortunately, ilGenImages is making the program crash, and it seems to be a kind of neccessary function, you know? So here is what the program looks like (relevant to DevIL only and toned down for simplicity):
//Called once, when the program starts
Initialize()
{
ilInit();
iluInit();
ilutRenderer(ILUT_WIN32);
}


image.h and image.cpp
#include <IL\il.h>
#include <IL\ilu.h>
#include <IL\ilut.h>

struct Image
{
Image();
~Image();

ILuint my_image_name;
};

Image::Image()
{
ilGenImages(1, &my_image_name);
}

Image::~Image()
{
ilDeleteImages(1, &my_image_name);
}

{
ilBindImage(my_image_name);
}


The program crashes if any IL function calls are made. Any ideas why? This is ALL I do with IL, and as long as I comment out all the IL functions (except the init functions, which don't cause a crash), it runs. Also, if I hypothetically got it to load the image properly, how would I blit the image to an HDC? Thanks a ton!

##### Share on other sites
I'm pretty sure the opensource engine Ogre3d uses it...

##### Share on other sites
Which compiler are you using? Many people (including myslef) have had a hard time getting DevIL to work on GCC.

##### Share on other sites
I've just read in the docs of DevIL, that many functions will crash unless you compile using Multithreading DLLs , I suggest you to check your compile options on that.

-Vicviper

##### Share on other sites
Quote:
 Original post by Anonymous PosterI've just read in the docs of DevIL, that many functions will crash unless you compile using Multithreading DLLs , I suggest you to check your compile options on that.-Vicviper

How would you do that? I've not had experience with anything of that nature before. I'm using Mingw, with Dev-Cpp. I've gotten it to work before, but I was using it for OpenGL, instead of Win32 GDI. It seems to support OpenGL better. Hmmm...

1. 1
2. 2
3. 3
4. 4
Rutin
13
5. 5

• 26
• 10
• 9
• 9
• 11
×