locked
Difference between normal directX programming and Windows 8 directX

    Question

  • Hi,

    I want to ask if there is any difference between normal directX programming and Windows 8 directX. If I learn in older directX programming, would I be able to code for Windows 8 directX with Windows RT???

    Thanks


    • Edited by AtulMSDN Tuesday, January 15, 2013 1:06 PM
    Tuesday, January 15, 2013 1:05 PM

Answers

  • Windows 8 and Windows RT both include the Direct3D 11.1 Runtime. On Windows RT, this supports the Direct3D 11.0 and Direct3D 11.1 APIs. The Windows 8 DirectX 11.1 Runtime still supports older versions of Direct3D for backcompat for older games, but Direct3D 11.x is required for Windows Store apps. In other words, you cannot use Direct3D 10.1, Direct3D 10.0, Direct3D 9, or any older version of Direct3D in a Windows Store app. You can only write Windows Store apps for Windows RT.

    For a Windows Store app, you can mostly use Direct3D 11.0 APIs and don't need to make use of the newer Direct3D 11.1 APIs specifically, although you are free to. You do have to make use of DXGI 1.2 to setup the swap chain for the Windows Store app ICoreWindow but otherwise you can stick with Direct3D 11.0. Another big difference doing Direct3D 11.0 programming for the Windows Store apps compared to Direct3D 11.0 programming for a Win32 desktop app is the restrictions on 'utility' libraries (i.e. D3DX is not available for Windows Store apps). There are replacement technologies available such as DirectXTK, DirectXTex, and DirectXMath that will work for Win32 desktop and Windows Store apps on both Windows 8 and Windows RT.  Finally, while D3DCompile API is available for development purposes you cannot do 'runtime' HLSL shader compilation or reflection in a Windows Store app.

    If you are already familiar with DirectX 11.0 on Windows 7 or Windows Vista SP2+KB971644, then the version of Direct3D used for Windows Store apps on Windows 8 and Windows RT will be very familiar. If you have used Direct3D 10.x on Windows 7 or Windows Vista, then moving to Direct3D 11.0 is generally easy. IF you have only used older versions of Direct3D, then you need to do some learning.

    http://blogs.msdn.com/b/chuckw/archive/2011/07/11/getting-started-with-direct3d-11.aspx



    Tuesday, January 15, 2013 7:26 PM
  • DXUT and D3DX are 'utility' things, not part of the Direct3D API.

    There is a version of DXUT that works for Direct3D 11 in the legacy DirectX SDK , but it makes extensive use of the deprecated D3DX library and also offers Direct3D 9 dual use, neither of which are valid in a Windows Store app and are generally not recommend. You can't build the existing DXUT library using just the Windows 8.0 SDK, and have to at a minimum mix in the use of the legacy DirectX SDK.

    For Windows Store apps, the recommended UI solution is to use XAML.

    http://msdn.microsoft.com/en-us/magazine/jj651573.aspx

    http://blogs.msdn.com/b/windowsappdev/archive/2012/03/15/combining-xaml-and-directx.aspx

    Your questions are quickly moving out of the area of "DirectX" and into the general programming model for Windows Store apps. I'd recommend looking at the numerous MSDN articles on this general topic.

    DirectXTK offers solutions for sprites, basic shapes, loading textures, saving screenshots, etc. that will work for Windows Store apps, Windows phone 8 apps, and Win32 desktop apps. The swapchain and main render loop and things like UI, input, etc. are out of scope because they are not the same between Windows Store apps and Win32 desktop apps. If you are interested in the 'overlap' between Windows Store app and Win32 desktop programming, you should take a look at this article.

    For Win32 desktop apps, I'm working on a trimmed down revision of DXUT that uses DirectXTK rather than legacy D3DX and only supports Direct3D 11 as a side project. it will only require the Windows 8.0 SDK and not need any part of the legacy DirectX SDK. Keep an eye on my blog.








    Wednesday, January 16, 2013 8:00 PM

All replies

  • Windows 8 and Windows RT both include the Direct3D 11.1 Runtime. On Windows RT, this supports the Direct3D 11.0 and Direct3D 11.1 APIs. The Windows 8 DirectX 11.1 Runtime still supports older versions of Direct3D for backcompat for older games, but Direct3D 11.x is required for Windows Store apps. In other words, you cannot use Direct3D 10.1, Direct3D 10.0, Direct3D 9, or any older version of Direct3D in a Windows Store app. You can only write Windows Store apps for Windows RT.

    For a Windows Store app, you can mostly use Direct3D 11.0 APIs and don't need to make use of the newer Direct3D 11.1 APIs specifically, although you are free to. You do have to make use of DXGI 1.2 to setup the swap chain for the Windows Store app ICoreWindow but otherwise you can stick with Direct3D 11.0. Another big difference doing Direct3D 11.0 programming for the Windows Store apps compared to Direct3D 11.0 programming for a Win32 desktop app is the restrictions on 'utility' libraries (i.e. D3DX is not available for Windows Store apps). There are replacement technologies available such as DirectXTK, DirectXTex, and DirectXMath that will work for Win32 desktop and Windows Store apps on both Windows 8 and Windows RT.  Finally, while D3DCompile API is available for development purposes you cannot do 'runtime' HLSL shader compilation or reflection in a Windows Store app.

    If you are already familiar with DirectX 11.0 on Windows 7 or Windows Vista SP2+KB971644, then the version of Direct3D used for Windows Store apps on Windows 8 and Windows RT will be very familiar. If you have used Direct3D 10.x on Windows 7 or Windows Vista, then moving to Direct3D 11.0 is generally easy. IF you have only used older versions of Direct3D, then you need to do some learning.

    http://blogs.msdn.com/b/chuckw/archive/2011/07/11/getting-started-with-direct3d-11.aspx



    Tuesday, January 15, 2013 7:26 PM
  • I read the DirectXTK for a moment and found it was completely different from DXUT. So how can I migrate code of DXUT to DirectX 11? It seems I need to rewrite whole. 

    Moreover what is the standard/embedded UI in DirectX 11 if DXUT is depreciated?

    Wednesday, January 16, 2013 4:58 PM
  • DXUT and D3DX are 'utility' things, not part of the Direct3D API.

    There is a version of DXUT that works for Direct3D 11 in the legacy DirectX SDK , but it makes extensive use of the deprecated D3DX library and also offers Direct3D 9 dual use, neither of which are valid in a Windows Store app and are generally not recommend. You can't build the existing DXUT library using just the Windows 8.0 SDK, and have to at a minimum mix in the use of the legacy DirectX SDK.

    For Windows Store apps, the recommended UI solution is to use XAML.

    http://msdn.microsoft.com/en-us/magazine/jj651573.aspx

    http://blogs.msdn.com/b/windowsappdev/archive/2012/03/15/combining-xaml-and-directx.aspx

    Your questions are quickly moving out of the area of "DirectX" and into the general programming model for Windows Store apps. I'd recommend looking at the numerous MSDN articles on this general topic.

    DirectXTK offers solutions for sprites, basic shapes, loading textures, saving screenshots, etc. that will work for Windows Store apps, Windows phone 8 apps, and Win32 desktop apps. The swapchain and main render loop and things like UI, input, etc. are out of scope because they are not the same between Windows Store apps and Win32 desktop apps. If you are interested in the 'overlap' between Windows Store app and Win32 desktop programming, you should take a look at this article.

    For Win32 desktop apps, I'm working on a trimmed down revision of DXUT that uses DirectXTK rather than legacy D3DX and only supports Direct3D 11 as a side project. it will only require the Windows 8.0 SDK and not need any part of the legacy DirectX SDK. Keep an eye on my blog.








    Wednesday, January 16, 2013 8:00 PM
  • That is a very helpful introduction.

    "For Win32 desktop apps, I'm working on a trimmed down revision of DXUT that uses DirectXTK rather than legacy D3DX and only supports Direct3D 11 as a side project. it will only require the Windows 8.0 SDK and not need any part of the legacy DirectX SDK."

    That is a great News. I think DXUT is more like a framework instead of a utility. But D3DX is a little bit confusion. The implementation of DXUT in DirectX June 2010 SDK included both DirectX9 and DirectX11 that is not very helpful in upgrading. BTW in DXUT there are Core and Optional folder that will increase the complex of porting. DXUT is not big, one folder is enough so developers do not need to add extra folders in include and link in VS.     

    Thursday, January 17, 2013 2:22 PM
  • They should probably update that old DirectX SDK. I was hoping with the come of Windows 8 to see some DX11.1 samples and shader debugging specifically, unfortunately I have a lot of documentation to read before I can use all those :).
    Sunday, January 27, 2013 8:18 AM
  • The DirectX SDK is not going to be updated. I do understand it was nice to get the complete package of headers, libraries, utility code, documentation, and samples all in one download.

    http://blogs.msdn.com/b/chuckw/archive/2012/03/22/where-is-the-directx-sdk.aspx

    One of the biggest problems with the DirectX SDK was the REDIST, which over time has confused and complicated deployment of DirectX apps.

    http://blogs.msdn.com/b/chuckw/archive/2010/09/08/not-so-direct-setup.aspx

    The 'modern' solution is to use the Windows 8.0 SDK (which comes with VS 2012 anyhow) for the headers and libraries. The Windows 8.0 SDK includes the "Developer Runtime" for stuff like the REF device, SDKDebugLayers, etc. The Windows 8.0 SDK is how you obtain the HLSL compiler and the D3DCompiler API, which is the only really remaining 'add-on' DLL for DirectX (it is not included with the OS).

    You can find the documentation on MSDN.

    Samples are on MSDN Code Gallery. Most of them are Windows Store app samples, but over time the community and myself are contributing Win32 desktop samples as well.

    Replacements for much of what D3DX provided are available as 'shared source': DirectXMath (in the Windows 8.0 SDK), DirectXTK (on CodePlex), DirectXTex (on CodePlex), and even legacy Effects 11.

    The Shader Debugging API is really intended for tools like the VS Graphics Debugger, so there's not much of an audience for extensive samples for this niche technology.

    What "DX11.1" sample topics are you hoping to find?


    Tuesday, January 29, 2013 8:27 PM