D3DXCreateTextureFromFile

Started by
5 comments, last by FrigidHelix 22 years, 10 months ago
In the SDK documentation, the function description for D3DXCreateTextureFromFile() is as follows:
quote:Creates a texture from a file specified by an ANSI string.
Until now, I assumed that this only worked with .bmp files (since this is the format used in the directX tutorials, and samples I looked at). However, I saw on another website, that this can also be used with jpeg files. Does the DirectX documentation suck, or am I not looking in the right place? I would like to know a full list of the supported imagetypes. Please let me know what these are, or where I can find out.
Advertisement
To my knowledge it supports .bmp and .dds files. It probably supports all the formats MSPaint supports as well.
Well, I suppose you could always try it if you are in doubt. It can probably handle just about any image type, except for the really rare ones.
.tga as well, I think gif too.

Jim


Jim Adams
home.att.net/~rpgbook
Programming Role-Playing Games with DirectX 8
Hi

The CreateTextureFromFile supports a lot more :
- BMP (normal and compressed format)
- TGA
- DDS (any format, even compressed DXT1, DXT3, DXT5, etc...)
- JPG, GIF, PNG : Good for the compression...

It converts internally to the texture to the best DX format.

If you want to choose yourself the format, pool, size of the loaded texture, use rather the D3DXCreateTextureFromFileEx...

Well hope this helps
Sylvain
TrueVision3D Programmer
http://www.truevision3dsdk.com
Thanks for the feedback.
I have had no luck with GIF.
However JPG and BMP work great.

This topic is closed to new replies.

Advertisement