Jump to content
  • Advertisement
Sign in to follow this  
silverphyre673

Anyone used DevIL before? I need help.

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

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();

    void LoadImage(const char * filename);

    ILuint my_image_name;
};

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

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

void Image::LoadImage(const char * filename)
{
    ilBindImage(my_image_name);
    ilLoadImage(filename);
}

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 this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
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 this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
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


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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!