Reputation: 50026
Will the Windows 8 APIs allow me to write an app that uses XAML for the UI and DirectX for rendering 3D objects? Say I am writing a 3D modeling app. There are a lot of dialogs and UI elements that I would like to make in XAML, and a single rectangular window that I would render with DirectX. I prefer using C++. Is this possible?
Upvotes: 4
Views: 1223
Reputation: 569
Good news! It seems that the release version of Windows 8 will allow Metro/XAML and DirectX Interop!
This is a common theme that we heard after we released the Developer Preview. Developers like you wanted to combine the high-performance immediate-mode rendering capabilities of DirectX with the rich interactivity, control model, and design-time experience of XAML.
We heard you. With the Consumer Preview, you can now smoothly integrate XAML and DirectX 11 in the same Metro style app to create a fast and fluid experience. For example, you can now create a DirectX game and use XAML to process input, create graphics for heads-up displays and menus, or bind to your app’s data model.
To this end, we added 3 new XAML types to support a broad range of DirectX interop scenarios, each with different capabilities:
SurfaceImageSource enables full composition of DirectX content into a XAML app. This allows drawing DirectX content into the XAML visual tree, useful for complex image effects, data visualization, and other immediate-mode drawing scenarios.
VirtualSurfaceImageSource is used for large-scale virtualized content. This is targeted toward apps that require panning and
zooming of large content, like maps and document viewers.SwapChainBackgroundPanel targets full-screen, DirectX-focused scenarios. This is great for games and other low-latency, full-screen DirectX apps with a XAML overlay.
Take a look at this msdn page for more detail.
Depending on how well (or badly) this turns out, you still have the option of abandoning Metro for WPF, because WPF and Direct3D can interop.
Upvotes: 7