2

I'm just a beginner trying to understand the path to follow for creating graphical applications (not games!!). Since I'm very addicted to Windows I chosen to try DirectX as graphic library, with C++. The point is: DirectX 9, 10, 11 (and further more to come from Microsoft..): which one do I choose? I know that programming in DX9 is forward compatible with DX10/11, but is it DX11 backward compatible with DX10/9? And I don't mean that solely for a programming level compatibility, but an actual runtime compatibility: if a user runs a DX11 made application on a DX9 environment, would it work just fine? If not, how may I make a DX "universal" application?

Also, an Off-topic question (answering that is fully optional): I read a lot of good about Qt and WxWidgets. Would you suggest to use one of those instead of DirectX? Right now I have no plans for portability on other operating systems, still, would it be better to get ready just in case I change my mind?

Many thanks to anyone who'll answer :)

T3STY
  • 103
  • 7
  • DirectX is meant to create games and graphic-intensive applications, not "regular" graphical applications - they are of a quite different target, you get lots of performance and freedom in graphics, but you don't get any of the "standard stuff" that "regular" applications are built on (standard controls/widgets, just to say one thing). So, if you want to build graphic applications you should move to some widget-oriented toolkit; IMHO if you are doing C++ development Qt currently is one of the best, but there are several other quality alternatives (with different strenghts/weaknesses). – Matteo Italia Jul 05 '13 at 02:47
  • I was fearing someone would answer this. In fact, almost all tutorials I've read on the web are games-oriented. A few show how to implement simple paint-like (drawing) applications which have controls too, but I suppose controls aren't made in DX. – T3STY Jul 05 '13 at 02:57
  • You *can* build controls in DirectX - actually, WPF provide many controls and is built over DirectX - but DirectX does not provide them, you have to write them from scratch, which usually is not a good idea at all (you waste a lot of time to obtain suboptimal results). – Matteo Italia Jul 05 '13 at 02:58

1 Answers1

1

Regarding your first question, you can code to DX11 and target DX9 level hardware. More information is available on this MSDN overview page.

Reading your second question, however, makes me wonder if you really want to be using DirectX for your purposes. DirectX is typically used for the Direct3D graphics and input APIs. You may find that WPF or GDI+ is acceptable (and in fact, WPF is accelerated by DirectX so you gain some of the performance benefits.)

Qt and wxWidgets are both portable UI SDK/libraries. You can certainly use these, however if your are targetting Windows platforms only, then the portability isn't of much use. If you are sticking with C++ over C#, then Qt is not a bad choice for a UI library.

Edit: If Win8 only, consider using a C++/XAML combo

holtavolt
  • 4,378
  • 1
  • 26
  • 40
  • 1
    ... but notice that WPF and GDI+ require C++/CLI (although GDI+ can be used from COM, but it's quite less pleasant because - well, you have to deal with COM). – Matteo Italia Jul 05 '13 at 03:00
  • Based on your answer and on Matteo's answer before you, I made a wrong decision about DirectX because it's 3D high speed render oriented (like games). My target is to create an Explorer replacement for Windows; I would like to ad some nice graphic effects in it and having custom themeable controls. I'm not sure I'll need 3D but awesome effects can be done in 2D as well. So what do you suggest me to do? EDIT yeah, I read a lot about COM, I'll try to avoid it whenever possible – T3STY Jul 05 '13 at 03:06
  • Qt is certainly suitable for this task (I've worked on commercial Windows-only apps for that were Qt-based.) It supports themes/skins and provides a good set of widgets and drawing primitives. Most of these bottom out to the Win32 API, although you can create an OpenGL canvas if needed. That said - if I were writing a new C++, windows-only application today, I'd probably research using C++/Metro as my first choice. WPF/XAML is a much richer and faster UI than Win32, providing a lot of "nice effects" and utilizing GPU acceleration. (Windows 8 only) – holtavolt Jul 05 '13 at 03:40