Jump to content
  • Advertisement
Sign in to follow this  
Vevusio

OpenGL DevIL crashes application

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

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

Share this post


Link to post
Share on other sites
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...

Share this post


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


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


Link to post
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 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!