Direct2D Fundamentals

Learn how to use Direct2D to perform high quality and high-performance rendering in your applications.
Course info
Rating
(161)
Level
Intermediate
Updated
Nov 29, 2012
Duration
3h 25m
Table of contents
Introduction
Getting Ready
Rendering in a Desktop App
Brushes
Geometries
Bitmaps
Transforms
Text
Description
Course info
Rating
(161)
Level
Intermediate
Updated
Nov 29, 2012
Duration
3h 25m
Description

Direct2D is a native, immediate-mode, graphics rendering library that provides uncompromising performance. Its focus is on two-dimensional rendering, providing a rich array of primitives for rendering vector graphics, bitmaps and text. It’s designed to squeeze as much out of the underlying Direct3D-based GPU as humanly possible while retaining a surprisingly enjoyable API surface. In this course, you’ll learn the fundamentals of Direct2D programming and be well on your way to building rich user experiences using the same rendering engine as Internet Explorer 10.

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

Introduction
Kenny Kerr: Welcome to Direct2D Fundamentals, on Pluralsight. My name is Kenny Kerr, and in this course I'm going to teach you everything you need to know to create stunning graphically rich applications with exceptional performance, without compromising on efficiency and battery life. In this first module, I'm going to introduce you to what has become one of the key graphics technologies on Windows. Direct2D is at the heart of the cutting edge graphics available applications in Windows 7 and Windows 8, playing a critical role in enabling the rich rendering capabilities of both Metro (phonetic) or Windows store apps, as well as desktop applications.

Getting Ready
Welcome back to Direct2D Fundamentals in Pluralsight. My name is Kenny Kerr. And in this module I'm going to help you get started with Direct2D development. Unlike previous versions, Visual Studio 2012 includes everything you need to write DirectX applications. All the headers and loops are there. I'm going to assume that you have already installed Visual Studio 2012 and know how to create basic C++ projects. Direct2D provides a native API designed for C++. It also works with C and you can even wrap it up to use it from C#. But the focus of this course is on the Core API from a C++ perspective. I won't assume you know anything about Direct2D or COM but I will assume that you are a competent C++ programmer and familiar with one C++ techniques such as smart pointers.

Rendering in a Desktop App
Welcome back to Direct2D Fundamentals on Pluralsight. My name is Kenny Kerr and in this module I'm going to show you how to render inside a traditional desktop application window. Everything I will be describing here works equally well on Windows 7 and 8. Direct2D supports a number of different render targets, but the one you use to render directly to a top level or a desktop window is about the simplest way to get something on the screen. So I'll be using this Window Target for many of the examples in this course even though much of what I described here will work with any rendered target.

Brushes
Welcome back to Direct2D Fundamentals on Pluralsight. My name is Kenny Kerr. And in this module, I'm going to show you how to create and use brushes to draw in full shapes, more generally, to paint an area of the render target. Everything I will be describing here works equally well regardless of what version of windows you're targeting or even what type of render target you happened to be using. Direct2D provides a powerful collection of brushes, without which not much can be rendered. Unlike some other graphics APIs, Direct2D does not distinguish between pins and brushes. It only provides brushes which are used for both filling and drawing or stroke in different shapes, geometries and text. Most of the Direct2D brushes paned with colors, so let's start there.

Geometries
Welcome back to Direct2D Fundamentals on Pluralsight. My name is Kenny Kerr and in this module I'm going to show you how to create new geometries. Everything I'll be describing here works equally well regardless of what version of Windows you're targeting or even what type of render target you happen to be using. Direct2D provides a powerful collection of geometries and geometry building blocks that you can use directly to draw in full shapes. We can also use another powerful ways such as hit testing, masking or cropping for composition, and much, much more. But firstly, let me introduce you to some basic shapes.

Bitmaps
Welcome back to Direct2D Fundamentals on Pluralsight. My name is Kenny Kerr. And in this module, I'm going to show you how to create and use Bitmaps. Everything I'll be describing here works equally well regardless of what versions of Windows you're targeting, or at least any versions that supports Direct2D as I mentioned in the introduction to this course. Direct2D provides an amazing array of features and capabilities in and around support for Bitmaps. In this module I'm only going to focus on some of the most common tasks that you might want to perform with bitmaps. This should give you a good taste of its capabilities and get you started nicely.

Transforms
Kenny Kerr: Welcome back to Direct2D Fundamentals in Pluralsight. My name is Kenny Kerr, and in this module I'm going to show you how to work with transforms. Transforms unlock a whole world of potential that would otherwise be very difficult to achieve. Transforms are one of those mathematical prerequisites that are just essential for modern graphics. Unless otherwise noted, everything I'll be describing here works equally well regardless of what version of Windows you're targeting, or even what type of render (phonetic) target you happen to be using.

Text
Welcome back to Direct2D fundamentals on Pluralsight, my name is Kenny Kerr and in this module, I'm going to show you how to render text. Everything I'll be describing here works equally well regardless of what version you're using or even what type of render target you happen to be using. Direct 2D doesn't itself provide support for text layout, clear type, kerning, glyphs and so on, rather it provides negative support for the hardware accelerated rendering of text layouts provided by its sister API, DirectWrite. As with Direct2D's relationship with the Window's imaging component, Direct2D and DirectWrite work incredibly well together to provide the best possible text rendering experience. This module is not meant to be an exhaustive look at DirectWrite, being a completely separate API with many of its own unique features and capabilities, it deserves to be studied as a subject on its own right. But no discussion of Direct2D would be complete without at least mentioning DirectWrite and its text layout capabilities.