DevIL crashes application

Started by
4 comments, last by Vevusio 16 years, 1 month ago
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);
	ILboolean didLoadImage = ilLoadImage(aFilePath);

        (.. some error handling, etc)

	ilDeleteImages(1, & image);
now, if i add the following 2 lines

	ILuint image;
	ilGenImages(1, & image);
	ilBindImage(image);
	ILboolean didLoadImage = ilLoadImage(aFilePath);

	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
Advertisement
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...
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
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?
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.
++ My::Game ++
sigh ok ill use bytes per pixel to check for alpha then, thanks

This topic is closed to new replies.

Advertisement