locked
Direct2D with DirectX11 or GDI+ with DirectX11

    Question

  • I'm making a 3D Game Engine and I want to draw Textures and lines on one of the user interface windows .Now how can I draw Textures and lines ?

    I have 3 Choices :

      • Operate Direct2D and Directx10.1 and share the resource between DirectX10.1 and DirectX11.
      • Use the GDI+ with DirectX11 throw DXGI.
      • Make my own sprite drawer that draw lines and textures using DirectX11.

    Can any one help me with this choice please?

    And is there any choice better than those ?

    thanks


    Watershed Game Development

    Thursday, September 27, 2012 1:21 AM

Answers

  • As with every question about peformance, "it depends".

    XAML/Direct2D is a great choice if you are writing a complex HUD, need full localization font support, need full localized chat input, etc. Keep in mind that on Windows 8, Direct2D interops directly with Direct3D 11.0 eliminating the need to use shared surfaces via  Direct3D 10.1 device--this is still required if you are targeting a Win32 desktop application on Windows 7 or Windows Vista.

    You can also consider using DirectXTK's SpriteFont and SpriteBatch as well if you have more basic HUD needs, which supports Windows Store apps, Windows 8 Win32 desktop apps, Windows 7, and Windows Vista with the Direct3D 11.0 Runtime.

    Monday, October 01, 2012 9:41 PM

All replies

  • Since you're posting in the Windows Store apps forum I assume you're asking about writing a Windows Store app. Windows Store apps always use DX11, not earlier versions, and they cannot use GDI+.

    Your options are to use your own engine purely in Direct3D, interop between Direct2D and Direct3D, or interop between Xaml and Direct3D. My personal choice for the HUD would be to use Xaml.

    See Direct2D and Direct3D Interoperability Overview and DirectX and XAML interop

    --Rob

    Thursday, September 27, 2012 4:51 AM
    Owner
  • Ok but is using the Xaml or Direct2D is to much for HUD in the engine editor program ?

    I mean for the performance .


    Watershed Game Development

    Thursday, September 27, 2012 5:38 AM
  • As with every question about peformance, "it depends".

    XAML/Direct2D is a great choice if you are writing a complex HUD, need full localization font support, need full localized chat input, etc. Keep in mind that on Windows 8, Direct2D interops directly with Direct3D 11.0 eliminating the need to use shared surfaces via  Direct3D 10.1 device--this is still required if you are targeting a Win32 desktop application on Windows 7 or Windows Vista.

    You can also consider using DirectXTK's SpriteFont and SpriteBatch as well if you have more basic HUD needs, which supports Windows Store apps, Windows 8 Win32 desktop apps, Windows 7, and Windows Vista with the Direct3D 11.0 Runtime.

    Monday, October 01, 2012 9:41 PM