Archived

This topic is now archived and is closed to further replies.

FrigidHelix

D3DXCreateTextureFromFile

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites