Enhanced Graphics Platform
With that said, the new DirectX graphics stack in Windows 7 offers innovations and great tools for developers to easily create hardware-accelerated 2D and text applications, on top of the DirectX APIs. So we decided to write a little bit about the enhancements to the graphics platform in Windows 7 to at least provide a highlevel overview.
Before Windows 7
The Microsoft Windows graphics device interface (GDI) enables applications to use graphics and formatted text on both the video display and the printer. Windows-based applications do not access the graphics hardware directly. Instead, GDI interacts with device drivers on behalf of applications. Since Windows 3.0, developers have been using GDI, and since the release of Windows XP a lot of applications have been exploiting GDI+, which is a completely new set of APIs. Even higher abstraction layers, such as the .NET WinForms rendering, are based on GDI+. With that said, Windows application developers have long used DirectX to provide high-quality, hardware-accelerated, 3D graphics. When the technology debuted in 1995, developers could provide high-quality 3D graphics for games and engineering applications for gamers and professionals willing to pay extra for a 3D-graphics board. Now, even the most inexpensive PCs include capable 3D-graphics hardware. The WPF rendering engine uses DirectX and allows managed code developers to write cutting-edge graphical applications that are hardware accelerated.
In Windows Vista, the Windows Display Driver Model (WDDM) was introduced. The WDDM infrastructure for DirectX enabled multiple applications and services to share the resources of the Graphical Processing Unit (GPU). The Desktop Window Manager (DWM) uses this technology to animate task switching in 3D, to provide dynamic thumbnail images of application windows, and to provide Windows Aero glass effects for desktop applications.
New in Windows 7
In Windows 7, Microsoft introduced a more modern set of APIs, which we hope will eventually help replace GDI+. Windows 7 places more graphics capabilities into the hands of application developers. Through a new set of DirectX APIs, Win32, and managed code, developers can take advantage of the latest innovations in GPUs to add to their applications fast, scalable, high-quality, 2D and 3D graphics; text; and images. All these new technologies were designed to interoperate with GDI and GDI+, ensuring that developers can easily preserve their existing investment and providing a clear migration path.
These enhanced graphics capabilities are provided by the following COM-based APIs (and some are also available in managed code through the Windows API Code Pack):
- Direct2D for drawing 2D graphics
- DirectWrite for arranging and rendering text
- Windows Imaging Component (WIC) for processing and displaying images
- Direct3D 10 for drawing 3D graphics
- Direct3D 11 for drawing 3D graphics and providing access to next-generation GPU technologies, such as tessellation, limited support for texture streaming, and generalpurpose computing
- DirectX Graphics Infrastructure (DXGI) for managing devices and GPU resources and providing interoperability between DirectX and GDI
Built on Direct3D, Direct2D offers Win32 developers immediate-mode, resolutionindependent, 2D APIs that use the power of the graphics hardware. Direct2D provides highquality 2D rendering with performance superior to GDI and GDI+ even when using fullsoftware rendering without hardware acceleration. It provides Win32 and managed-code developers finer control over resources and their management and a higher abstraction of the complex DirectX APIs.
DirectWriteA great deal of Windows applications target worldwide users, which often means using multiple languages. This calls for a technology that supports high-quality text rendering, resolution independence, and Unicode text and layout. GDI and GDI+ do not provide these features, but DirectWrite, a new DirectX component, provides these features and more. DirectWrite provides the following capabilities:
- High-quality, sub-pixel, ClearType text rendering that can use GDI, Direct2D, or application-specific rendering technologies
- Hardware-accelerated text, when used with Direct2D
- A device-independent text layout system that improves text readability in documents and in the UI
- Support for multiformat text
- GDI-compatible layout and rendering
- Support for advanced typography features
The DirectWrite font system enables "any font, anywhere" font usage, where users don't have to perform a separate installation step just to use a font. It also has an improved structural hierarchy for font groupings to help with manual or programmatic font discovery. The APIs support measuring, drawing, and hit-testing of multiformat text.
The new graphics API in Windows 7 offer many existing GDI+-based applications clear and developer-friendly integration path to the newer APIs.