Jump to content

  • Log In with Google      Sign In   
  • Create Account

FreeImage lib, how to build textures?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 TheBlob   Members   -  Reputation: 122

Like
Likes
Like

Posted 31 July 2001 - 05:51 AM

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

Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS