1
\$\begingroup\$

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

\$\endgroup\$
1
\$\begingroup\$

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.

\$\endgroup\$
3
  • \$\begingroup\$ I have heard TGAs are more compact than PNGs. \$\endgroup\$ – Oskar Jul 10 '12 at 9:36
  • 1
    \$\begingroup\$ @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. \$\endgroup\$ – sam hocevar Jul 10 '12 at 16:10
  • \$\begingroup\$ Thanks, I thought that .blp was more complex. I will se what can I dow with .tga. \$\endgroup\$ – user629926 Jul 10 '12 at 21:58
0
\$\begingroup\$

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

\$\endgroup\$
0
\$\begingroup\$

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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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