Jump to content
  • Advertisement
Sign in to follow this  

devIL and OpenGL

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

Can I just replace the: (TextureImage[0]=LoadBMP("Data/Ocean.bmp")) in Nehe's basecode to use devILs image loading like below: (TextureImage[0]=ilLoad(IL_PNG, "Ocean.png"); and not have to worry about changing anything else in my program? If so, can anyone tell me how to get devIL up and running on Dev C++, all the tutorials I have found are for MSDEVC++.

Share this post


Link to post
Share on other sites
Advertisement
In NeHe tutorial 6, TextureImage[0] is defined like this:

AUX_RGBImageRec *TextureImage[1];


So it will almost certainly not work with out changing this definition. Also you will most likely have to change this line:


glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data);

Because Png data is stored differently - notably it usually has as alpha component.

Share this post


Link to post
Share on other sites
I hope that this will help you.

// init DevIL
ilInit();
iluInit();
ilutRenderer(ILUT_OPENGL);
ilutInit();

then to load a texture

unsigned int id = ilutGLLoadImage(strFile);

After this you are ready to bind id using glBindTexture()

Share this post


Link to post
Share on other sites
You are using DevC++, well apparently DevC++ does not have an official release and is also not supported officially. However bcos Ogre uses Devil as well, some users of Ogre had come up with a DevC++ DevPak which contained pre-compiled dlls/.a files for DevC++. Unfortunately the DevPak link is down and you will have to ask for it in Devil's forums. Ill try to look for it and post a link here if i can locate it.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!