MSDN Documentation

Windows Graphics and Multimedia API Reference

Explore the comprehensive API reference for Windows graphics and multimedia development. This section provides detailed information on APIs for 2D and 3D graphics rendering, media playback and encoding, imaging, and more.

Introduction to Windows Graphics

The Windows operating system offers a rich set of APIs for developers to create visually stunning and interactive applications. From low-level hardware acceleration with DirectX to high-level drawing with GDI, Windows provides tools for every need.

DirectX

DirectX is a collection of APIs for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms. It includes DirectX Graphics (which is the successor to Direct3D), DirectX Input, DirectX Audio, DirectX Play, and DirectX Networking.

Direct3D 12

Direct3D 12 is the latest iteration of Microsoft's low-level graphics API, offering unprecedented performance and control for modern graphics hardware. It enables developers to reduce CPU overhead and manage resources more efficiently.

ID3D12Device::CreateCommandList HRESULT CreateCommandList(UINT nodeMask, D3D12_COMMAND_LIST_TYPE type, ID3D12CommandAllocator *pCommandAllocator, ID3D12PipelineState *pInitialState, REFIID riid, void **ppvCommandList);

Creates a command list. A command list is a sequence of commands that can be recorded and then executed by a command queue.

Keywords: CreateCommandList, ID3D12Device, command list, GPU commands

ID3D12GraphicsCommandList::DrawInstanced void DrawInstanced(UINT VertexCountPerInstance, UINT InstanceCount, UINT StartVertexLocation, UINT StartInstanceLocation);

Draws the specified number of instances, each consisting of a specified number of vertices.

Keywords: DrawInstanced, ID3D12GraphicsCommandList, instancing, drawing

Direct3D 11

Direct3D 11 is a powerful and widely used graphics API that provides a balance between performance and accessibility. It's suitable for a wide range of applications, from high-end games to business graphics.

ID3D11Device::CreateBuffer HRESULT CreateBuffer(const D3D11_BUFFER_DESC *pDesc, const D3D11_SUBRESOURCE_DATA *pInitialData, ID3D11Buffer **ppBuffer);

Creates a buffer resource.

Keywords: CreateBuffer, ID3D11Device, buffer, vertex buffer, index buffer

Direct2D

Direct2D is a hardware-accelerated, immediate-mode 2D graphics API that provides high performance and fidelity for 2D rendering on Windows.

ID2D1DeviceContext::DrawRectangle void DrawRectangle(const D2D_RECT_F *rect, ID2D1Brush *brush, FLOAT strokeWidth = 1.0f, ID2D1StrokeStyle *strokeStyle = NULL);

Draws a rectangle.

Keywords: DrawRectangle, ID2D1DeviceContext, 2D graphics, drawing

DirectWrite

DirectWrite is a text-handling API that provides high-quality text rendering, text measuring, and Unicode support.

IDWriteTextLayout::SetFontWeight HRESULT SetFontWeight(FLOAT fontWeight, DWRITE_TEXT_RANGE textRange);

Sets the font weight for a range of text.

Keywords: SetFontWeight, IDWriteTextLayout, text rendering, typography

DXGI (DirectX Graphics Infrastructure)

DXGI provides services that allow applications to use graphics hardware. It is used for managing adapters, enumerating output devices, and presenting rendered frames to the screen.

IDXGIFactory1::EnumAdapters1 HRESULT EnumAdapters1(UINT Adapter, IDXGIAdapter1 **ppAdapter);

Enumerates the display adapters (also known as video cards).

Keywords: EnumAdapters1, IDXGIFactory1, graphics adapter, hardware enumeration

Graphics Device Interface (GDI)

GDI is a Windows API that provides basic 2D graphics drawing capabilities. It's a foundational API for many Windows applications.

GDI+

GDI+ is an enhanced version of GDI, offering more advanced features such as gradients, transformations, and richer text rendering.

Graphics::DrawLine Status DrawLine(Pen *pen, INT x1, INT y1, INT x2, INT y2);

Draws a line from point (x1, y1) to point (x2, y2).

Keywords: DrawLine, Graphics, GDI+, drawing, vector graphics

Win32 GDI

The classic Windows GDI API for drawing primitives, text, and bitmaps.

CreateSolidBrush HBRUSH CreateSolidBrush(COLORREF color);

Creates a new solid brush with the specified color.

Keywords: CreateSolidBrush, GDI, brush, color

Imaging

APIs for working with image formats, decoding, encoding, and manipulating image data.

Windows Imaging Component (WIC)

WIC provides a framework for image codecs and image processing operations.

IWICBitmapDecoder::GetContainerFormat HRESULT GetContainerFormat(GUID *pguidContainerFormat);

Gets the container format of the bitmap.

Keywords: GetContainerFormat, IWICBitmapDecoder, WIC, image format

Media Foundation

Media Foundation (MF) is Microsoft's modern multimedia framework, supporting playback, encoding, decoding, and streaming of audio and video content.

IMFMediaSource::Start HRESULT Start(IMFStartTime *pstartTime);

Starts the media source.

Keywords: Start, IMFMediaSource, Media Foundation, playback control

Other Graphics APIs

This section covers other relevant graphics APIs available on Windows.

DComposition API

Provides direct manipulation of visual surfaces, enabling smooth and efficient composition of windows and visual elements.

Keywords: DComposition, visual effects, window composition, performance

DirectX Raytracing (DXR)

A DirectX 12 feature that enables hardware-accelerated ray tracing for realistic lighting and reflections.

Keywords: DXR, ray tracing, real-time rendering, shaders