DirectComposition in Action

Learn how to use DirectComposition to easily produce high-performance visual effects with the Windows composition engine.
Course info
Rating
(33)
Level
Intermediate
Updated
May 24, 2014
Duration
4h 12m
Table of contents
Description
Course info
Rating
(33)
Level
Intermediate
Updated
May 24, 2014
Duration
4h 12m
Description

DirectComposition is the primary API for the Windows composition engine. Have you ever wondered what the DWM process is up to? Did you wish you could tap into some of its power? Then this course is for you. The DirectComposition API enables you to build the highest-performance native graphics applications using a "retained mode" graphics API. The composition engine retains a visual tree of bitmaps that may be rendered with "immediate mode" graphics APIs such as Direct2D or Direct3D. You get the best of both worlds and can achieve visual effects at a performance level that was never possible prior to the introduction of the DirectComposition API. This course will give you a practical tour of the API by showing you how to build a DirectX-based card game from scratch, producing animated transitions for a visually engaging user interface.

About the author
About the author

Kenny Kerr is a computer programmer and recognized expert in Windows operating system development and programming languages.

More from the author
Windows Runtime Internals
Advanced
2h 41m
Jul 30, 2015
SQLite with Modern C++
Intermediate
2h 33m
Feb 18, 2015
The Essentials of the Windows Runtime
Intermediate
2h 48m
Sep 2, 2014
More courses by Kenny Kerr
Section Introduction Transcripts
Section Introduction Transcripts

Creating a Modern Desktop Window
Welcome back to DirectComposition in action. My name is Kenny Kerr and in this module we are going to start writing some code. To explore DirectComposition we need a window in which we can visualize bitmaps and other content. To start off I'm going to show you how to create a modern desktop window. By modern I just mean I'm going to show you how to create a desktop window the right way using the Windows API giving you an understanding of how Windows 8 and later versions handle window creation and management specifically, how to make your window DPI aware, handle painting and validation properly, and we will come to grips with window sizing and how it relates to physical and logical pixels. Some of what we will cover is as old as Windows itself, but a lot has changed or at least been tweaked over the years so this isn't the Windows you learned about from reading Petzold's book on programming Windows using the C programming language. This is the modern Windows desktop with modern C++.

Creating and Managing the Devices
Welcome back to DirectComposition in action. My name is Kenny Kerr and in this module we're going to dive into DirectX by examining the devices that need to be created in order to both render and compose your application. While DirectComposition doesn't offer rendering services directly, it still very much relies on a direct 3D backend, and as such requires a connection back to a Direct3D device, either through DXGI or Direct2D, at least if you want to use composition surfaces. It is notable that DirectComposition has first class support for not only DXGI in general, but Direct2D in particular. I've said it before, there's simply no better way to approach the rendering of your app than to use Direct2D. So having constructed a basic desktop window, the next step is to create a Direct3D device and that's up next.

Creating Visuals and Surfaces
Welcome back to DirectComposition in action. My name is Kenny Kerr and in this module we can finally being to explore the fundamental building blocks surrounding the content of the application window, the assets or visuals that the user will be looking at. DirectComposition represents quite a departure from traditional Direct3D and Direct2D content rendering, primarily because it offers a retained mode graphics API. Although it doesn't directly support rendering it does provide the infrastructure to retain and present rendered content independent of traditional painting loop where each frame is redrawn directly and completely by the graphics _____. To appreciate what this means, this module is going illustrate this very simply with one or two visuals and surfaces. What are visuals and surfaces? Keep watching.

Rendering for Composition
Welcome back to DirectComposition in action. My name is Kenny Kerr and in this module we're going to switch gears a bit and focus on building a more realistic application with DirectComposition. We are literally going to put DirectComposition in action by building the card game I demoed at the start of this course. In this module we'll look at creating and drawing the visuals that will represent the card faces and in the next module we'll consider interactivity, animation, and other techniques that will bring the game to life. In the following segment we are also going to fix a pesky problem with the DPI changed message so that we can confidently size our application window. That's up next.

Transforms and Animation
Welcome back to DirectComposition in action. My name is Kenny Kerr and in this module we're going to consider how we might add some interaction and perspective to the card game using transformations, both 2D and 3D transforms. We've already covered how to manipulate visuals in a number of ways, primarily with the use of offset properties to position a visuals content, effectively placing the content at some physical location relative to the top left corner of the window. Transforms in effect take it to the next level by allowing you to apply linear and perspective transforms to your visual content. We will also cover various techniques for adding fluid animation to your applications.