Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Is there a C++ library that enables reading of .tga and .blp image formats on Windows?

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

For BLPs, you may check this source code example.

For TGAs, honestly I would just convert them to eg. PNGs offline, and then use plain GDI+ to load the PNGs. Is there a specific reason for using TGA? Anyway, you can use this full, annotated source code.

share|improve this answer
    
I have heard TGAs are more compact than PNGs. –  Oskar Jul 10 '12 at 9:36
1  
@Oskar this is almost never the case; TGAs are usually not compressed, and when they are they use RLE compression which is one of the most naive forms of compression. On the other hand, the PNG standard allows for many different optimisation and compression schemes that have made it the preferred lossless image format for the web and virtually any other application. –  Sam Hocevar Jul 10 '12 at 16:10
    
Thanks, I thought that .blp was more complex. I will se what can I dow with .tga. –  user629926 Jul 10 '12 at 21:58
add comment

For Targa (.tga) files, the FreeImage library may be useful.

share|improve this answer
add comment

I recommend using SOIL. I found it to be by far the easiest way of loading and saving texture to and from OpenGL. The last update was in 2008, though. It still works fine, but some people like to steer away from "old" software.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.