

There are two types of Direct2D resources: device-independent resources and device-dependent resources. All other Direct2D objects inherit from the ID2D1Resource interface. An ID2D1Factory object creates ID2D1Resource objects and serves as the starting point for using Direct2D. Direct2D InterfacesĪt the root of the Direct2D API are the ID2D1Factory and ID2D1Resource interfaces. The following sections describe some of the common interfaces provided by the Direct2D API. You can find d2d1.h and d2d1.lib in Windows Software Development Kit (SDK) for Windows 7. To compile a Direct2D application, add d2d1.lib to the list of libraries. To use Direct2D, your application should include the d2d1.h header file. This header is included with d2d1.h.ĭefines C and C++ versions of the primary Direct2D API for Windows 8 and later.ĭefines C++ helper functions, classes, and structures for Windows 8 and later.ĭefines C and C++ versions of the image effects part of the Direct2D API for Windows 8 and later.ĭefines C++ helper functions, classes, and structures of the image effects part of the Direct2D API for Windows 8 and later.

This header is included with d2d1.h.ĭefines the error codes for Direct2D. Header fileĭefines C and C++ versions of the primary Direct2D API.ĭefines C++ helper functions, classes, and structures.ĭefines drawing primitives for Direct2D, such as points and rectangles. The Direct2D API is defined by the following header files. This topic provides an overview of the objects that make up the Direct2D API.


Provisions for using graphical content created using GDI or Direct3D.Rendering functionality for bitmaps, geometries, and text.Representations for geometric data, and functions for geometry processing.Objects for managing drawing state such as coordinate space transforms and antialiasing modes.Render targets for display and off-screen rendering using Direct2D, Direct3D, or GDI.The API exposes a variety of drawing-related functionality: Direct2D provides an API, similar to Direct3D, for use with C or C++.
