OpenGL DevIL crashes application

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

Recommended Posts

alright i know its not open gl in particular but i guess a lot of people who are using opengl are using DevIL aswell so my proplem is the following, loading a texture using devIL works fine without the exceptions etc the devIL related code basically is
	ILuint image;
ilGenImages(1, & image);
ilBindImage(image);

(.. some error handling, etc)

ilDeleteImages(1, & image);

now, if i add the following 2 lines
	ILuint image;
ilGenImages(1, & image);
ilBindImage(image);

ILinfo imageInformation;
iluGetImageInfo(&imageInformation);

(.. some error handling, etc)

ilDeleteImages(1, & image);

my application crashes on "iluGetImageInfo" with an unhandled win32 exception i have tried calling another ilu function to check if maybe its a problem with the whole ilu module but if i do "iluFlipImage();" it flips the image properly also prior to the loading i call the 3 initialization functions "ilInit" "iuInit" and "ilutInit" my library version is 1.6.8

Share on other sites
Not familiar with Devil, but is didLoadImage true? Should the iluGetImageInfo function be called if not?
I know a crash isn't the best behaviour for a lib, but still...

Share on other sites
ye it is true, i throw and log an exception if the image wont load so when the code reaches the getimageinfo thing the image has been loaded properly

if nobody knows any way to fix that call

do you guys maybe have suggestions about a different approach using devIL to find out if the image has an alpha value so i can pass the according GL_RGB / GL_RGBA parameter to opengl when feeding it with the image data

Share on other sites
I have had (different) problems (incorrect values) when querying image information using iluGetImageInfo and ilInfo. I avoided the problems by not using ilInfo and instead retrieve the values using ilGetInteger with proper constants (e.g. IL_IMAGE_BYTES_PER_PIXEL). Maybe you can do the same?

Share on other sites
Quote:
 Original post by Vevusio ILuint image; ilGenImages(1, & image); ilBindImage(image); ILboolean didLoadImage = ilLoadImage(aFilePath); ILinfo imageInformation; iluGetImageInfo(&imageInformation); (.. some error handling, etc) ilDeleteImages(1, & image);

I have been using very similar code with v1.6.7 of the lib for some time now and I don't get any error. Are you sure you are not making a mistake somewhere else?

Try using the older version.
Hope that helps.

Share on other sites
sigh ok ill use bytes per pixel to check for alpha then, thanks

• Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 9
• 11
• 15
• 21
• 26