Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


FreeImage lib, how to build textures?

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

Hi! maybe some of you know the library FreeImage. I integrated it in my code and wanted to create a ogl-texture out of the bitmaps i´ve loaded in. The code looks like this: bitmap = FreeImage_LoadJPEG(TexName, JPEG_ACCURATE); width = FreeImage_GetWidth(bitmap); height = FreeImage_GetHeight(bitmap); bpp = FreeImage_GetBPP(bitmap); glGenTextures(1, &TexID); // Create The Texture // Typical Texture Generation Using Data From The Bitmap glBindTexture(GL_TEXTURE_2D, TexID); glTexImage2D(GL_TEXTURE_2D, 0, 3, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, bitmap->data); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); Everything is compiled fine, but when i use the texture the colours are false and also the geometry, something must be wrong... Thnx, Max

Share this post

Link to post
Share on other sites

  • 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!