DirectXTK samples?

Lots of people asking for samples for the DirectX Tool Kit - sorry I haven't had a chance to work on such a thing yet  (I'm kinda busy right now getting Windows Phone 8 finished 🙂

Would appreciate feedback on what platform you most want to see samples for (Win8 Metro? Classic Desktop?) and which areas of DirectXTK to prioritize (SpriteBatch? BasicEffect? DDS loading? other?)


Comments (15)

  1. Ryan Gadz says:

    BasicEffect is primary for me, but recently a friend has been trying to talk me out of C++ / directX and move to SharpDX (I'm coming from XNA) due to some memory management concerns with using unmanaged code.

  2. Tomas Slavicek says:

    Hopefully there is a MonoGame framework available on CodePlex. The develop3D branch looks usable now even for Windows 8 metro, thanks to Sickhead Games team (and many other people). Until there is an official support for Win8/WP8, the spirit of the XNA will continue in MonoGame 🙂

  3. Scott says:

    Please do something with sharpdx

  4. MikeBMcL says:

    As far as a platform, Win8 Metro with designs focused for easy portability to Windows Phone 8 once the SDK is out. To the extent you can abstract away the platform (or at least decouple it) so that it could also work on Classic Desktop, that would be cool since people who want to target multiple stores (Windows Store, Steam, etc.) would likely find that of most use.

    In terms of areas to prioritize, if you mean in terms of samples, I think the most helpful would be "ports" of existing samples so that people can compare and contrast. Perhaps something like a port of your Reach Graphics Demo Windows Phone sample from MIX10 –…/mix-demo-released.aspx . Doing something like that might also generate some more ideas for posts in terms of how to go about porting XNA C# code to Metro style C++/DirectX and any pitfalls and pleasant surprises you encounter along the way. If you aren't interested in doing ports then I'd lean towards samples using the DirectXTK effects (BasicEffect, DualTextureEffect, etc.) since using those is, to me, more different from XNA than SpriteBatch is and WIC and DDS loading seem pretty straightforward.

    If you meant areas to prioritize in terms of things to consider adding/focusing on, a pipeline for loading skinned models to use with SkinnedEffect. I know that SDKMesh isn't meant to be a "real" 3D model format, but something that serves as a replacement for the X format (or even an X file loader which uses Metro-safe APIs seeing as its easy enough to find tools that still support it) without the need for the 800 lb. gorilla that is the FBX SDK would be good. Something that simplifies getting 3D models into games to the point where micro ISVs and other indies/hobbyists can do it and have some understanding of what's going on. Something which also makes it possible to share samples with that model importing code without licensing concerns beyond "do you accept the terms of the MsPL" and "these assets are for learning only and you can't use them in your game". To me the loss of the (relative) simplicity of using 3D models in XNA is the biggest hurdle (once you get past the C# to C++ learning curve) in coming to C++/DirectX and Metro style game development.

  5. ShawnHargreaves says:

    Thank you Mike for that thoughtful feedback!

    I'm interested in feedback on both samples and future things to do with DirectXTK.  Samples probably higher priority as they are smaller in scope and thus more achievable in the near term, but input in both areas is useful.

    The interesting thing about Metro <-> classic Desktop portability is that this is actually quite easy to achieve for a library (DirectXTK itself is a good example of how to set up such a thing) but very challenging for a complete application. The biggest differences are outside of the scope of D3D/DirectXTK, affecting Visual Studio project systems, packaging, how the process launches, creates a window, responds to events, etc. It might be possible to build something along the lines of the XNA Game class to abstract this away, but I'm a little skeptical how useful that would be in practice. The Game abstraction worked ok for a simple, fullscreen application model, but that's not really true of Metro what with docking, sidebars, interacting with Charms etc. And it's definitely not true of classic Desktop if you are building something like a level editor with multiple windows! I have a feeling that trying to abstract over these might end up hiding too many important things and thus complicating as much as it helped. Perhaps a better approach might be more like DirectXTK itself, to build shared functionality into a lib and then consume this lib from a platform specific shell app?

  6. ShawnHargreaves says:

    btw. on the subject of SharpDX:

    From what I've seen that is a great project, and I wish the people working on it the best of luck, but I have no interest or time (not to mention legal ability) to get involved in that myself.

    My day job is making graphics work on Windows Phone. My hobby project is DirectXTK, which is all about C++ programming with D3D11. If you have suggestions about these areas, this is a good place to give them, but if your ideas are about some other technology such as SharpDX, you should discuss them with the people who make SharpDX (or, since it is an open source project, get involved and implement these ideas yourself!)

  7. Mike says:

    Thank you for making DirectXTK.  The XNA framework is extremely well designed, and it's great that we'll now be able to use many of the classes in C++ on Windows 8 Metro.

  8. Glen says:

    What about some Windows 7 demos with SpriteBatch and Fonts.

  9. Shaun says:

    Hi Shawn.  It is kind of you to provide Metro developers tools for advancing their craft.  While I am grateful, I can honestly say that XNA is/was the best game API ever imagined.  I look forward to the day when the XNA API along with content pipeline comes to WinRT.

  10. Mark Gossage says:

    Hello Paul,

    Simple answer: you want DirectXTK used? Give us simple clear example programs like XNA did.

    Take a look at the current offerings on the WinRT-C++-DirectX, they are dire! A few hundred LOC for a hello world.

    Allegro had such great examples, it made it easy to pick up, XNA too.

    Write some neat, simple examples, or just take some of the XNA examples & port them. That would be useful.

  11. Tomas, Shaun, Mark, I know how you feel.

    I think that the clear message from Microsoft is "Never depend on us". No matter how much some product is used or loved, MS will still kill it. Especially if it's .Net-related. When it was announced that Zune HD will be left with the artificially restricted version of XNA 3.1 and XNA 4 was only for the shiny new Windows Phone, I wrote that this is a troubling trust-breaking sign. Well, turns out I was right – both WP7 and XNA were killed in a couple of years.

    RIP Managed DirectX, XNA, Silverlight, WPF.

    RIP C# for hassle-free game development. (We all must learn to love C++)

    RIP .Net. (MS will surely kill it in favor of WinRT)

  12. Artur says:

    I think it would be really useful if someone produced some kind of guide about the fastest/best way to port a XNA game to DirectX 11 using DirectXTK and/or other similar libraries. Maybe it doesn't need to be very detailed, it should at least provide general guidance about rendering states, BasicEffect, SpriteBatch, SpriteFont, etc.

    In my opinion SpriteBatch and BasicEffect should be top priorities.

  13. Lance says:

    How about some tips on making a kind of content library for the DirectXTK for 3D assets, such as using FBX, or something on those lines. That is the feature I will miss the most that XNA has, as a hobbyist programmer. I don't know where to start in turning any of my XNA games that use 3D assets into DirectXTK.

  14. Chuck Walbourn (MSFT) says:

    I've put a page on the CodePlex docs for linking to the various known samples and walkthrough posts for DirectXTK.

    We have two basic ones on MSDN Code Gallery as well (Windows Phone 8 version coming soon)

  15. walbourn says:

    Windows phone 8 version of the DirectXTK Simple Sample

Skip to main content