Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

FreeImage lib, how to build textures?

4: Adsense

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   

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




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.