Jump to content


load a tga in opengl from a custom resource


2 replies to this topic

#1 vash999

    New Member

  • Members
  • Pip
  • 2 posts

Posted 29 September 2008 - 05:40 PM

Hello i am new to the forums, i have been following the nehe tutorials, and other tutorials; i have a problem, what i want to do is have many tga files in one single file and then read that file and load the textures and displaying in the game.

i follow this tutorial
http://gpwiki.org/in..._Resource_Files
and get the char* buffer, but i dont know how to load that buffer into a texture.

sorry for my english i speak spanish.
i´m using c++ with visual studio .net, glut.

#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 4782 posts
  • LocationBellevue, WA

Posted 29 September 2008 - 06:04 PM

Please note, this question would have been more appropriately asked in the GPWiki forums, since it concerns a specific GPWiki tutorial.

However, the general answer is that the buffer will contain the binary data of a file, in your case a TGA file. You need to write a loader, just like loading a TGA file from disk, but reading the bytes from the memory buffer instead.

Also, some graphics libaries like SDL allow you to load an image file from a memory buffer as well.
reedbeta.com - developer blog, OpenGL demos, and other projects

#3 vash999

    New Member

  • Members
  • Pip
  • 2 posts

Posted 30 September 2008 - 12:24 AM

ok i will try that, i dosnt know that gpwiki have a forum, next time i will check up better.

thanks.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users