简体   繁体   中英

DirectX11 - Is it possible to render 2D graphics using D3DX11CreateTextureFromFile?

Like in the question, is it possible to do this? If not what can be good thing to render 2D sprites from files in DirectX11? If it is possible then how can i do this? I found some things in the web like Render a BMP, JPEG, or PNG Image with DirectX? (from this question i got the idea). I also saw some resources at microsoft website, however i have no idea how to use theese things.

Use DirectX Tool Kit .

  • DDSTextureLoader.h has functions for loading textures from DDS files
  • WICTextureLoader.h has functions for loading textures from image files using Windows Imaging Component such as PNG, JPEG, BMP, etc.
  • SpriteBatch is a class for drawing 2D sprites using Direct3D 11 textures

Note that D3DX11CreateTextureFromFile is part of the deprecated D3DX11 library which is only available in the legacy DirectX SDK. See MSDN , Where is the DirectX SDK? , and Living without D3DX .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM