Sign in to follow this  
Lirben

OpenGL loading textures with devIL

Recommended Posts

hello, I'm new to openGL programming. I'm wondering how I can load a texture in my Borland 5cpp builder. I try this code char *FileName = "image1.bmp"; ilInit(); ilutInit(); ilutRenderer(ILUT_OPENGL); ilutEnable(ILUT_OPENGL_CONV); ilutGLLoadImage(FileName); and I get a weird error message. Project Unit1.exe raised exception class EAccesViolation with message 'Access Violation at address 00000000. Read of address 00000000'. Process stopped. Use step or Run to continue. I just don't get it because the file is right specified and it isn't opend in an other program. can someone help me?

Share this post


Link to post
Share on other sites
Greetings.

I think you need to init ILU before initializing ILUT.

Like this:

char *FileName = "image1.bmp";
ilInit();

iluInit(); // <------ add this.

ilutInit();
ilutRenderer(ILUT_OPENGL);
ilutEnable(ILUT_OPENGL_CONV);
ilutGLLoadImage(FileName);


Hope this helps. =)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this