How DX11 like DX9 Sprite draw the picture with color parameter RRS feed

  • Question

  • the follow is the code of DX9
    LPD3DXSPRITE m_pSprite;
    If (FAILED (D3DXCreateSprite (m_pD3DDevice, &m_pSprite)))
    M_pRS->m_pSprite->Draw (m_pTex, &rc, NULL, NULL, color);

    I want some function in DX11 like DX9
    for example:
    my source image is a pure white rabbit on the transparent background.
    when I use the Draw function, the color parameter is 0xffffff00 (ARGB format).
    and then, the result of the Draw is a pure yellow rabbit on the transparent background at the surface.
    Wednesday, November 26, 2014 1:31 AM


All replies

  • You need implement your own SpriteBatch class to do this in DirectX11.

    Fortunately, there's a nice library DirectXTK which has implemented this feature.


    Wednesday, November 26, 2014 2:17 AM
  • which url can I download the sample for the use of SpriteBatch by the DirectXTK

    I has download the DirectXTK SDK package,
    but, in the package only has the SDK lib, no executeable sample programe.
    I want a executeable sample, so I can know how to use the SDK.

    Wednesday, November 26, 2014 2:58 AM
  • DirectXTK Simple Sample (Windows 8.1)

    DirectXTK Simple Sample (Windows 8.0)

    BTW, if you are using Windows 8.1, you can easily port your game to Windows phone 8.1.

    There are lots of same APIs between Windows 8.1 and Windows Phone 8.1 in DirectX.

    If you'll do this, please new a universal app in the VS

    • Edited by halcyons Wednesday, November 26, 2014 3:33 AM
    • Marked as answer by lihuipeng49 Wednesday, November 26, 2014 9:28 AM
    Wednesday, November 26, 2014 3:16 AM