SharpDX.DXGI

The interface represents a display sub-system (including one or more GPU's, DACs and video memory).

A display sub-system is often referred to as a video card, however, on some machines the display sub-system is part of the mother board.

To enumerate the display sub-systems, use . To get an interface to the adapter for a particular device, use . To create a software adapter, use .

bb174523 IDXGIAdapter IDXGIAdapter

An interface is a base interface for all DXGI objects; supports associating caller-defined (private data) with an object and retrieval of an interface to the parent object.

implements base class functionality for several other interfaces: , , ,

bb174541 IDXGIObject IDXGIObject
Gets the parent of the object. Type of the parent object Returns the parent object based on the GUID of the type of the parent object. bb174542 HRESULT IDXGIObject::GetParent([In] const GUID& riid,[Out] void** ppParent) IDXGIObject::GetParent Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets application-defined data to the object and associates that data with a .

A that identifies the data. Use this in a call to GetPrivateData to get the data.

The size of the object's data.

A reference to the object's data.

Returns one of the DXGI_ERROR values.

SetPrivateData makes a copy of the specified data and stores it with the object.

Private data that SetPrivateData stores in the object occupies the same storage space as private data that is stored by associated Direct3D objects (for example, by a Microsoft Direct3D?11 device through or by a Direct3D?11 child device through ).

The debug layer reports memory leaks by outputting a list of object interface references along with their friendly names. The default friendly name is "<unnamed>". You can set the friendly name so that you can determine if the corresponding object interface reference caused the leak. To set the friendly name, use the SetPrivateData method and the well-known private data () that is in D3Dcommon.h. For example, to give pContext a friendly name of My name, use the following code:

 static const char c_szName[] = "My name";	
            hr = pContext->SetPrivateData( , sizeof( c_szName ) - 1, c_szName );	
            

You can use to track down memory leaks and understand performance characteristics of your applications. This information is reflected in the output of the debug layer that is related to memory leaks () and with the event tracing for Windows events that we've added to Windows Developer Preview.

bb174544 HRESULT IDXGIObject::SetPrivateData([In] const GUID& Name,[In] unsigned int DataSize,[In, Buffer] const void* pData) IDXGIObject::SetPrivateData

Set an interface in the object's private data.

A identifying the interface.

The interface to set.

Returns one of the following DXGI_ERROR.

This API associates an interface reference with the object.

When the interface is set its reference count is incremented. When the data are overwritten (by calling SPD or SPDI with the same ) or the object is destroyed, ::Release() is called and the interface's reference count is decremented.

bb174545 HRESULT IDXGIObject::SetPrivateDataInterface([In] const GUID& Name,[In] const IUnknown* pUnknown) IDXGIObject::SetPrivateDataInterface

Get a reference to the object's data.

A identifying the data.

The size of the data.

Pointer to the data.

Returns one of the following DXGI_ERROR.

If the data returned is a reference to an , or one of its derivative classes, previously set by , then ::Release() must be called on the reference before the reference is freed to decrement the reference count.

bb174543 HRESULT IDXGIObject::GetPrivateData([In] const GUID& Name,[InOut] unsigned int* pDataSize,[Out, Buffer] void* pData) IDXGIObject::GetPrivateData

Gets the parent of the object.

The ID of the requested interface.

The address of a reference to the parent object.

Returns one of the DXGI_ERROR values.

bb174542 HRESULT IDXGIObject::GetParent([In] const GUID& riid,[Out] void** ppParent) IDXGIObject::GetParent
Checks to see if a device interface for a graphics component is supported by the system. The GUID of the interface of the device version for which support is being checked. For example, typeof(ID3D10Device).GUID. true if the interface is supported; otherwise, false. Bb174524 HRESULT IDXGIAdapter::CheckInterfaceSupport([In] const GUID& InterfaceName,[Out] LARGE_INTEGER* pUMDVersion) IDXGIAdapter::CheckInterfaceSupport Checks to see if a device interface for a graphics component is supported by the system. the interface of the device version for which support is being checked. true if the interface is supported; otherwise, false. Bb174524 HRESULT IDXGIAdapter::CheckInterfaceSupport([In] const GUID& InterfaceName,[Out] LARGE_INTEGER* pUMDVersion) IDXGIAdapter::CheckInterfaceSupport Checks to see if a device interface for a graphics component is supported by the system. the interface of the device version for which support is being checked. The user mode driver version of InterfaceName. This is only returned if the interface is supported. true if the interface is supported; otherwise, false. Bb174524 HRESULT IDXGIAdapter::CheckInterfaceSupport([In] const GUID& InterfaceName,[Out] LARGE_INTEGER* pUMDVersion) IDXGIAdapter::CheckInterfaceSupport Checks to see if a device interface for a graphics component is supported by the system. The GUID of the interface of the device version for which support is being checked. For example, typeof(ID3D10Device).GUID. The user mode driver version of InterfaceName. This is only returned if the interface is supported. true if the interface is supported; otherwise, false. Bb174524 HRESULT IDXGIAdapter::CheckInterfaceSupport([In] const GUID& InterfaceName,[Out] LARGE_INTEGER* pUMDVersion) IDXGIAdapter::CheckInterfaceSupport Gets an adapter (video card) outputs. The index of the output. An instance of HRESULT IDXGIAdapter::EnumOutputs([In] unsigned int Output,[Out] IDXGIOutput** ppOutput) When the EnumOutputs method succeeds and fills the ppOutput parameter with the address of the reference to the output interface, EnumOutputs increments the output interface's reference count. To avoid a memory leak, when you finish using the output interface, call the Release method to decrement the reference count.EnumOutputs first returns the output on which the desktop primary is displayed. This adapter corresponds with an index of zero. EnumOutputs then returns other outputs. if the index is greater than the number of outputs, result code bb174525 HRESULT IDXGIAdapter::EnumOutputs([In] unsigned int Output,[Out] IDXGIOutput** ppOutput) IDXGIAdapter::EnumOutputs Return the number of available outputs from this adapter. The number of outputs bb174525 HRESULT IDXGIAdapter::EnumOutputs([In] unsigned int Output,[Out] IDXGIOutput** ppOutput) IDXGIAdapter::EnumOutputs Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Enumerate adapter (video card) outputs.

The index of the output.

The address of a reference to an interface at the position specified by the Output parameter.

A code that indicates success or failure (see DXGI_ERROR). Will return if the index is greater than the number of outputs.

When the EnumOutputs method succeeds and fills the ppOutput parameter with the address of the reference to the output interface, EnumOutputs increments the output interface's reference count. To avoid a memory leak, when you finish using the output interface, call the Release method to decrement the reference count.

EnumOutputs first returns the output on which the desktop primary is displayed. This adapter corresponds with an index of zero. EnumOutputs then returns other outputs.

bb174525 HRESULT IDXGIAdapter::EnumOutputs([In] unsigned int Output,[Out] IDXGIOutput** ppOutput) IDXGIAdapter::EnumOutputs

Gets a DXGI 1.0 description of an adapter (or video card).

A reference to a structure that describes the adapter. This parameter must not be null.

Returns if successful; otherwise returns E_INVALIDARG if the pDesc parameter is null.

Graphics applications can use the DXGI API to retrieve an accurate set of graphics memory values on systems that have WDDM drivers. The following are the critical steps involved.

  • Graphics driver model determination ? Because DXGI is only available on systems with WDDM drivers, the application must first confirm the driver model by using the following API.
     HasWDDMDriver()	
                { LPDIRECT3DCREATE9EX pD3D9Create9Ex = null; HMODULE             hD3D9          = null; hD3D9 = LoadLibrary( L"d3d9.dll" ); if ( null == hD3D9 ) { return false; } // /*  Try to create  interface (also known as a DX9L interface). This interface can only be created if the driver is a WDDM driver. */ // pD3D9Create9Ex = (LPDIRECT3DCREATE9EX) GetProcAddress( hD3D9, "Direct3DCreate9Ex" ); return pD3D9Create9Ex != null;	
                } 
  • Retrieval of graphics memory values.? After the driver model is determined to be WDDM, the application can use the DirectX 10 or later API and DXGI to get the amount of graphics memory. After creating a Direct3D device the following code can be used to obtain a structure containing the amount of available graphics memory.
      * pDXGIDevice;	
                hr = g_pd3dDevice->QueryInterface(__uuidof(), (void **)&pDXGIDevice);	
                 * pDXGIAdapter;	
                pDXGIDevice->GetAdapter(&pDXGIAdapter);	
                 adapterDesc;	
                pDXGIAdapter->GetDesc(&adapterDesc); 
bb174526 HRESULT IDXGIAdapter::GetDesc([Out] DXGI_ADAPTER_DESC* pDesc) IDXGIAdapter::GetDesc

Checks whether the system supports a device interface for a graphics component.

The of the interface of the device version for which support is being checked. For example, __uuidof().

The user mode driver version of InterfaceName. This is returned only if the interface is supported. This parameter can be null.

indicates that the interface is supported, otherwise is returned (For more information, see DXGI_ERROR).

Note??You can use CheckInterfaceSupport only to check whether a Direct3D 10.x interface is supported, and only on Windows Vista SP1 and later versions of the operating system. If you try to use CheckInterfaceSupport to check whether a Direct3D 11.x and later version interface is supported, CheckInterfaceSupport returns . Therefore, do not use CheckInterfaceSupport. Instead, to verify whether the operating system supports a particular interface, try to create the interface. For example, if you call the method and it fails, the operating system does not support the interface.

Bb174524 HRESULT IDXGIAdapter::CheckInterfaceSupport([In] const GUID& InterfaceName,[Out] LARGE_INTEGER* pUMDVersion) IDXGIAdapter::CheckInterfaceSupport
Gets all outputs from this adapter. bb174525 HRESULT IDXGIAdapter::EnumOutputs([In] unsigned int Output,[Out] IDXGIOutput** ppOutput) IDXGIAdapter::EnumOutputs

Gets a DXGI 1.0 description of an adapter (or video card).

Graphics applications can use the DXGI API to retrieve an accurate set of graphics memory values on systems that have WDDM drivers. The following are the critical steps involved.

  • Graphics driver model determination ? Because DXGI is only available on systems with WDDM drivers, the application must first confirm the driver model by using the following API.
     HasWDDMDriver()	
                { LPDIRECT3DCREATE9EX pD3D9Create9Ex = null; HMODULE             hD3D9          = null; hD3D9 = LoadLibrary( L"d3d9.dll" ); if ( null == hD3D9 ) { return false; } // /*  Try to create  interface (also known as a DX9L interface). This interface can only be created if the driver is a WDDM driver. */ // pD3D9Create9Ex = (LPDIRECT3DCREATE9EX) GetProcAddress( hD3D9, "Direct3DCreate9Ex" ); return pD3D9Create9Ex != null;	
                } 
  • Retrieval of graphics memory values.? After the driver model is determined to be WDDM, the application can use the DirectX 10 or later API and DXGI to get the amount of graphics memory. After creating a Direct3D device the following code can be used to obtain a structure containing the amount of available graphics memory.
      * pDXGIDevice;	
                hr = g_pd3dDevice->QueryInterface(__uuidof(), (void **)&pDXGIDevice);	
                 * pDXGIAdapter;	
                pDXGIDevice->GetAdapter(&pDXGIAdapter);	
                 adapterDesc;	
                pDXGIAdapter->GetDesc(&adapterDesc); 
bb174526 GetDesc GetDesc HRESULT IDXGIAdapter::GetDesc([Out] DXGI_ADAPTER_DESC* pDesc)
The assembly provides managed DXGI API. hh404534 DXGI DXGI The namespace provides a managed DXGI API. hh404534 DXGI DXGI

An interface implements a derived class for DXGI objects that produce image data.

The interface is designed for use by DXGI objects that need access to other DXGI objects. This interface is useful to applications that do not use Direct3D to communicate with DXGI.

The object returned by the Direct3D create device functions implements the interface and can be queried for the device's corresponding interface. To retrieve the interface of a Direct3D device the following code can be used.

 * pDXGIDevice;	
            hr = g_pd3dDevice->QueryInterface(__uuidof(), (void **)&pDXGIDevice);	
            
bb174527 IDXGIDevice IDXGIDevice
Gets the residency status of an array of resources. The information returned by the pResidencyStatus argument array describes the residency status at the time that the QueryResourceResidency method was called. Note that the residency status will constantly change. If you call the QueryResourceResidency method during a device removed state, the pResidencyStatus argument will return the DXGI_RESIDENCY_EVICTED_TO_DISK flag. Note??This method should not be called every frame as it incurs a non-trivial amount of overhead. An array of interfaces. Returns an array of flags. Each element describes the residency status for corresponding element in the ppResources argument array. HRESULT IDXGIDevice::QueryResourceResidency([In, Buffer] const IUnknown** ppResources,[Out, Buffer] DXGI_RESIDENCY* pResidencyStatus,[None] int NumResources) Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Returns the adapter for the specified device.

The address of an interface reference to the adapter. This parameter must not be null.

Returns if successful; otherwise, returns one of the DXGI_ERROR that indicates failure. If the pAdapter parameter is null this method returns E_INVALIDARG.

If the GetAdapter method succeeds, the reference count on the adapter interface will be incremented. To avoid a memory leak, be sure to release the interface when you are finished using it.

bb174531 HRESULT IDXGIDevice::GetAdapter([Out] IDXGIAdapter** pAdapter) IDXGIDevice::GetAdapter

Returns a surface. This method is used internally and you should not call it directly in your application.

A reference to a structure that describes the surface.

The number of surfaces to create.

A DXGI_USAGE flag that specifies how the surface is expected to be used.

An optional reference to a structure that contains shared resource information for opening views of such resources.

The address of an interface reference to the first created surface.

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

The CreateSurface method creates a buffer to exchange data between one or more devices. It is used internally, and you should not directly call it.

The runtime automatically creates an interface when it creates a Direct3D resource object that represents a surface. For example, the runtime creates an interface when it calls or to create a 2D texture. To retrieve the interface that represents the 2D texture surface, call ID3D11Texture2D::QueryInterface or ID3D10Texture2D::QueryInterface. In this call, you must pass the identifier of . If the 2D texture has only a single MIP-map level and does not consist of an array of textures, QueryInterface succeeds and returns a reference to the interface reference. Otherwise, QueryInterface fails and does not return the reference to .

bb174530 HRESULT IDXGIDevice::CreateSurface([In] const DXGI_SURFACE_DESC* pDesc,[In] unsigned int NumSurfaces,[In] unsigned int Usage,[In, Optional] const DXGI_SHARED_RESOURCE* pSharedResource,[Out] IDXGISurface** ppSurface) IDXGIDevice::CreateSurface

Gets the residency status of an array of resources.

An array of interfaces.

An array of flags. Each element describes the residency status for corresponding element in the ppResources argument array.

The number of resources in the ppResources argument array and pResidencyStatus argument array.

Returns if successfull; otherwise, returns , E_INVALIDARG, or E_POINTER (see WinError.h for more information).

The information returned by the pResidencyStatus argument array describes the residency status at the time that the QueryResourceResidency method was called. Note that the residency status will constantly change.

If you call the QueryResourceResidency method during a device removed state, the pResidencyStatus argument will return the flag.

Note??This method should not be called every frame as it incurs a non-trivial amount of overhead.

bb174533 HRESULT IDXGIDevice::QueryResourceResidency([In, Buffer] const IUnknown** ppResources,[Out, Buffer] DXGI_RESIDENCY* pResidencyStatus,[In] unsigned int NumResources) IDXGIDevice::QueryResourceResidency

Gets the residency status of an array of resources.

An array of interfaces.

An array of flags. Each element describes the residency status for corresponding element in the ppResources argument array.

The number of resources in the ppResources argument array and pResidencyStatus argument array.

Returns if successfull; otherwise, returns , E_INVALIDARG, or E_POINTER (see WinError.h for more information).

The information returned by the pResidencyStatus argument array describes the residency status at the time that the QueryResourceResidency method was called. Note that the residency status will constantly change.

If you call the QueryResourceResidency method during a device removed state, the pResidencyStatus argument will return the flag.

Note??This method should not be called every frame as it incurs a non-trivial amount of overhead.

bb174533 HRESULT IDXGIDevice::QueryResourceResidency([In, Buffer] const IUnknown** ppResources,[Out, Buffer] DXGI_RESIDENCY* pResidencyStatus,[In] unsigned int NumResources) IDXGIDevice::QueryResourceResidency

Sets the GPU thread priority.

A value that specifies the required GPU thread priority. This value must be between -7 and 7, inclusive, where 0 represents normal priority.

Return if successful; otherwise, returns E_INVALIDARG if the Priority parameter is invalid.

The values for the Priority parameter function as follows:

  • Positive values increase the likelihood that the GPU scheduler will grant GPU execution cycles to the device when rendering.
  • Negative values lessen the likelihood that the device will receive GPU execution cycles when devices compete for them.
  • The device is guaranteed to receive some GPU execution cycles at all settings.

To use the SetGPUThreadPriority method, you should have a comprehensive understanding of GPU scheduling. You should profile your application to ensure that it behaves as intended. If used inappropriately, the SetGPUThreadPriority method can impede rendering speed and result in a poor user experience.

bb174534 HRESULT IDXGIDevice::SetGPUThreadPriority([In] int Priority) IDXGIDevice::SetGPUThreadPriority

Gets the GPU thread priority.

A reference to a variable that receives a value that indicates the current GPU thread priority. The value will be between -7 and 7, inclusive, where 0 represents normal priority.

Return if successful; otherwise, returns E_POINTER if the pPriority parameter is null.

Bb174532 HRESULT IDXGIDevice::GetGPUThreadPriority([Out] int* pPriority) IDXGIDevice::GetGPUThreadPriority

Returns the adapter for the specified device.

If the GetAdapter method succeeds, the reference count on the adapter interface will be incremented. To avoid a memory leak, be sure to release the interface when you are finished using it.

bb174531 GetAdapter GetAdapter HRESULT IDXGIDevice::GetAdapter([Out] IDXGIAdapter** pAdapter)

Gets or sets the GPU thread priority.

Bb174532 GetGPUThreadPriority / SetGPUThreadPriority GetGPUThreadPriority HRESULT IDXGIDevice::GetGPUThreadPriority([Out] int* pPriority)

Inherited from objects that are tied to the device so that they can retrieve a reference to it.

bb174528 IDXGIDeviceSubObject IDXGIDeviceSubObject
Retrieves the device. The interface that is returned can be any interface published by the device. The associated device. HRESULT IDXGIDeviceSubObject::GetDevice([In] GUID* riid,[Out] void** ppDevice) Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the device.

The reference id for the device.

The address of a reference to the device.

A code that indicates success or failure (see DXGI_ERROR).

The type of interface that is returned can be any interface published by the device. For example, it could be an * called pDevice, and therefore the REFIID would be obtained by calling __uuidof(pDevice).

bb174529 HRESULT IDXGIDeviceSubObject::GetDevice([In] const GUID& riid,[Out] void** ppDevice) IDXGIDeviceSubObject::GetDevice
Gets or sets the debug-name for this object. The debug name.

An interface implements methods for generating DXGI objects (which handle full screen transitions).

Create a factory by calling CreateDXGIFactory.

Because a Direct3D device can be created without creating a swap chain, you might need to retrieve the factory that is used to create the device in order to create a swap chain. This can be accomplished by requesting the interface from the Direct3D device and then using to locate the factory. The following code illustrates the process.

 * pDXGIDevice;	
            hr = g_pd3dDevice->QueryInterface(__uuidof(), (void **)&pDXGIDevice);  * pDXGIAdapter;	
            hr = pDXGIDevice->GetParent(__uuidof(), (void **)&pDXGIAdapter);  * pIDXGIFactory;	
            pDXGIAdapter->GetParent(__uuidof(), (void **)&pIDXGIFactory);	
            

See for a diagram of the relationship between DXGI objects.

bb174535 IDXGIFactory IDXGIFactory
Default Constructor for Factory Create an adapter interface that represents a software adapter. A software adapter is a DLL that implements the entirety of a device driver interface, plus emulation, if necessary, of kernel-mode graphics components for Windows. Details on implementing a software adapter can be found in the Windows Vista Driver Development Kit. This is a very complex development task, and is not recommended for general readers. Calling this method will increment the module's reference count by one. The reference count can be decremented by calling {{FreeLibrary}}. The typical calling scenario is to call {{LoadLibrary}}, pass the handle to CreateSoftwareAdapter, then immediately call {{FreeLibrary}} on the DLL and forget the DLL's {{HMODULE}}. Since the software adapter calls FreeLibrary when it is destroyed, the lifetime of the DLL will now be owned by the adapter, and the application is free of any further consideration of its lifetime. Handle to the software adapter's dll. A reference to an adapter (see ). HRESULT IDXGIFactory::CreateSoftwareAdapter([None] void* Module,[Out] IDXGIAdapter** ppAdapter) Gets both adapters (video cards) with or without outputs. The index of the adapter to enumerate. a reference to an interface at the position specified by the Adapter parameter When you create a factory, the factory enumerates the set of adapters that are available in the system. Therefore, if you change the adapters in a system, you must destroy and recreate the object. The number of adapters in a system changes when you add or remove a display card, or dock or undock a laptop.When the EnumAdapters method succeeds and fills the ppAdapter parameter with the address of the reference to the adapter interface, EnumAdapters increments the adapter interface's reference count. When you finish using the adapter interface, call the Release method to decrement the reference count before you destroy the reference.EnumAdapters first returns the local adapter with the output on which the desktop primary is displayed. This adapter corresponds with an index of zero. EnumAdapters then returns other adapters with outputs. HRESULT IDXGIFactory::EnumAdapters([In] unsigned int Adapter,[Out] IDXGIAdapter** ppAdapter) Return the number of available adapters from this factory. The number of adapters HRESULT IDXGIFactory::EnumAdapters([In] unsigned int Adapter,[Out] IDXGIAdapter** ppAdapter) Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Enumerates the adapters (video cards).

The index of the adapter to enumerate.

The address of a reference to an interface at the position specified by the Adapter parameter. This parameter must not be null.

Returns if successful; otherwise, returns if the index is greater than or equal to the number of adapters in the local system, or if ppAdapter parameter is null.

When you create a factory, the factory enumerates the set of adapters that are available in the system. Therefore, if you change the adapters in a system, you must destroy and recreate the object. The number of adapters in a system changes when you add or remove a display card, or dock or undock a laptop.

When the EnumAdapters method succeeds and fills the ppAdapter parameter with the address of the reference to the adapter interface, EnumAdapters increments the adapter interface's reference count. When you finish using the adapter interface, call the Release method to decrement the reference count before you destroy the reference.

EnumAdapters first returns the local adapter with the output on which the desktop primary is displayed. This adapter corresponds with an index of zero. EnumAdapters then returns other adapters with outputs.

bb174538 HRESULT IDXGIFactory::EnumAdapters([In] unsigned int Adapter,[Out] IDXGIAdapter** ppAdapter) IDXGIFactory::EnumAdapters

Allows DXGI to monitor an application's message queue for the alt-enter key sequence (which causes the application to switch from windowed to full screen or vice versa).

The handle of the window that is to be monitored. This parameter can be null; but only if the flags are also 0.

One or more of the following values:

  • - Prevent DXGI from monitoring an applications message queue; this makes DXGI unable to respond to mode changes.
  • - Prevent DXGI from responding to an alt-enter sequence.
  • - Prevent DXGI from responding to a print-screen key.

if WindowHandle is invalid, or E_OUTOFMEMORY.

The combination of WindowHandle and Flags informs DXGI to stop monitoring window messages for the previously-associated window.

If the application switches to full-screen mode, DXGI will choose a full-screen resolution to be the smallest supported resolution that is larger or the same size as the current back buffer size.

Applications can make some changes to make the transition from windowed to full screen more efficient. For example, on a WM_SIZE message, the application should release any outstanding swap-chain back buffers, call , then re-acquire the back buffers from the swap chain(s). This gives the swap chain(s) an opportunity to resize the back buffers, and/or recreate them to enable full-screen flipping operation. If the application does not perform this sequence, DXGI will still make the full-screen/windowed transition, but may be forced to use a stretch operation (since the back buffers may not be the correct size), which may be less efficient. Even if a stretch is not required, presentation may not be optimal because the back buffers might not be directly interchangeable with the front buffer. Thus, a call to ResizeBuffers on WM_SIZE is always recommended, since WM_SIZE is always sent during a fullscreen transition.

While windowed, the application can, if it chooses, restrict the size of its window's client area to sizes to which it is comfortable rendering. A fully flexible application would make no such restriction, but UI elements or other design considerations can, of course, make this flexibility untenable. If the application further chooses to restrict its window's client area to just those that match supported full-screen resolutions, the application can field WM_SIZING, then check against . If a matching mode is found, allow the resize. (The can be retrieved from . Absent subsequent changes to desktop topology, this will be the same output that will be chosen when alt-enter is fielded and fullscreen mode is begun for that swap chain.)

Applications that want to handle mode changes or Alt+Enter themselves should call MakeWindowAssociation with the flag after swap chain creation. The WindowHandle argument, if non-null, specifies that the application message queues will not be handled by the DXGI runtime for all swap chains of a particular target . Calling MakeWindowAssociation with the flag after swapchain creation ensures that DXGI will not interfere with application's handling of window mode changes or Alt+Enter.

Notes for Metro style apps

If a Metro style app calls MakeWindowAssociation, it fails with .

A Microsoft Win32 application can use MakeWindowAssociation to control full-screen transitions through the Alt+Enter key combination and print screen behavior for full screen. For Metro style apps, because DXGI cannot perform full-screen transitions, Metro style app have no way to control full-screen transitions.

bb174540 HRESULT IDXGIFactory::MakeWindowAssociation([In] HWND WindowHandle,[In] DXGI_MWA_FLAGS Flags) IDXGIFactory::MakeWindowAssociation

Get the window through which the user controls the transition to and from full screen.

A reference to a window handle.

Notes for Metro style apps

If a Metro style app calls GetWindowAssociation, it fails with .

Bb174539 HRESULT IDXGIFactory::GetWindowAssociation([Out] HWND* pWindowHandle) IDXGIFactory::GetWindowAssociation

[Starting with Direct3D 11.1, we recommend not to use CreateSwapChain anymore to create a swap chain. Instead, use CreateSwapChainForHwnd, CreateSwapChainForImmersiveWindow, or CreateSwapChainForCompositionSurface depending on how you want to create the swap chain.]

Creates a swap chain.

No documentation. No documentation. No documentation.

if pDesc or ppSwapChain is null, if you request full-screen mode and it is unavailable, or E_OUTOFMEMORY. Other error codes defined by the type of device passed in may also be returned.

If you attempt to create a swap chain in full-screen mode, and full-screen mode is unavailable, the swap chain will be created in windowed mode and will be returned.

If the buffer width or the buffer height is zero, the sizes will be inferred from the output window size in the swap-chain description.

Because the target output cannot be chosen explicitly when the swap-chain is created, you should not create a full-screen swap chain. This can reduce presentation performance if the swap chain size and the output window size do not match. Here are two ways to ensure that the sizes match:

  • Create a windowed swap chain and then set it full-screen using .
  • Save a reference to the swap chain immediately after creation, and use it to get the output window size during a WM_SIZE event. Then resize the swap chain buffers (with ) during the transition from windowed to full-screen.

If the swap chain is in full-screen mode, before you release it you must use SetFullscreenState to switch it to windowed mode. For more information about releasing a swap chain, see the "Destroying a Swap Chain" section of DXGI Overview.

You can specify and values in the swap-chain description that pDesc points to. These values allow you to use features like flip-model presentation and content protection by using pre-Windows Developer Preview APIs.

However, to use stereo presentation and to change resize behavior for the flip model, applications must use the IDXGIFactory2::CreateSwapChainForHwnd method. Otherwise, the back-buffer contents implicitly scale to fit the presentation target size; that is, you can't turn off scaling.

Notes for Metro style apps

If a Metro style app calls CreateSwapChain with full screen specified, CreateSwapChain fails.

Metro style apps call the IDXGIFactory2::CreateSwapChainForImmersiveWindow method to create a swap chain.

bb174537 HRESULT IDXGIFactory::CreateSwapChain([In] IUnknown* pDevice,[In] DXGI_SWAP_CHAIN_DESC* pDesc,[Out, Fast] IDXGISwapChain** ppSwapChain) IDXGIFactory::CreateSwapChain

Create an adapter interface that represents a software adapter.

Handle to the software adapter's dll. HMODULE can be obtained with GetModuleHandle or LoadLibrary.

Address of a reference to an adapter (see ).

A software adapter is a DLL that implements the entirety of a device driver interface, plus emulation, if necessary, of kernel-mode graphics components for Windows. Details on implementing a software adapter can be found in the Windows Vista Driver Development Kit. This is a very complex development task, and is not recommended for general readers.

Calling this method will increment the module's reference count by one. The reference count can be decremented by calling FreeLibrary.

The typical calling scenario is to call LoadLibrary, pass the handle to CreateSoftwareAdapter, then immediately call FreeLibrary on the DLL and forget the DLL's HMODULE. Since the software adapter calls FreeLibrary when it is destroyed, the lifetime of the DLL will now be owned by the adapter, and the application is free of any further consideration of its lifetime.

bb174536 HRESULT IDXGIFactory::CreateSoftwareAdapter([In] HINSTANCE Module,[Out] IDXGIAdapter** ppAdapter) IDXGIFactory::CreateSoftwareAdapter
Return an array of available from this factory. HRESULT IDXGIFactory::EnumAdapters([In] unsigned int Adapter,[Out] IDXGIAdapter** ppAdapter)

The interface implements methods for generating DXGI objects.

This interface is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

To create a factory, call the CreateDXGIFactory1 function.

ff471335 IDXGIFactory1 IDXGIFactory1
Default Constructor for Factory1. Gets both adapters (video cards) with or without outputs. The index of the adapter to enumerate. a reference to an interface at the position specified by the Adapter parameter This method is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).When you create a factory, the factory enumerates the set of adapters that are available in the system. Therefore, if you change the adapters in a system, you must destroy and recreate the object. The number of adapters in a system changes when you add or remove a display card, or dock or undock a laptop.When the EnumAdapters1 method succeeds and fills the ppAdapter parameter with the address of the reference to the adapter interface, EnumAdapters1 increments the adapter interface's reference count. When you finish using the adapter interface, call the Release method to decrement the reference count before you destroy the reference.EnumAdapters1 first returns the local adapter with the output on which the desktop primary is displayed. This adapter corresponds with an index of zero. EnumAdapters1 next returns other adapters with outputs. EnumAdapters1 finally returns adapters without outputs. HRESULT IDXGIFactory1::EnumAdapters1([In] unsigned int Adapter,[Out] IDXGIAdapter1** ppAdapter) Return the number of available adapters from this factory. The number of adapters HRESULT IDXGIFactory1::EnumAdapters1([In] unsigned int Adapter,[Out] IDXGIAdapter1** ppAdapter) Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Enumerates both adapters (video cards) with or without outputs.

The index of the adapter to enumerate.

The address of a reference to an interface at the position specified by the Adapter parameter. This parameter must not be null.

Returns if successful; otherwise, returns if the index is greater than or equal to the number of adapters in the local system, or if ppAdapter parameter is null.

This method is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

When you create a factory, the factory enumerates the set of adapters that are available in the system. Therefore, if you change the adapters in a system, you must destroy and recreate the object. The number of adapters in a system changes when you add or remove a display card, or dock or undock a laptop.

When the EnumAdapters1 method succeeds and fills the ppAdapter parameter with the address of the reference to the adapter interface, EnumAdapters1 increments the adapter interface's reference count. When you finish using the adapter interface, call the Release method to decrement the reference count before you destroy the reference.

EnumAdapters1 first returns the local adapter with the output on which the desktop primary is displayed. This adapter corresponds with an index of zero. EnumAdapters1 next returns other adapters with outputs. EnumAdapters1 finally returns adapters without outputs.

ff471336 HRESULT IDXGIFactory1::EnumAdapters1([In] unsigned int Adapter,[Out] IDXGIAdapter1** ppAdapter) IDXGIFactory1::EnumAdapters1

Informs an application of the possible need to re-enumerate adapters.

, if a new adapter is becoming available or the current adapter is going away. TRUE, no adapter changes.

IsCurrent returns to inform the calling application to re-enumerate adapters.

This method is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

ff471337 BOOL IDXGIFactory1::IsCurrent() IDXGIFactory1::IsCurrent
Return an array of available from this factory. HRESULT IDXGIFactory1::EnumAdapters1([In] unsigned int Adapter,[Out] IDXGIAdapter1** ppAdapter)

Informs an application of the possible need to re-enumerate adapters.

This method is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

ff471337 IsCurrent IsCurrent BOOL IDXGIFactory1::IsCurrent()
Helper to use with . Calculates the size of a in bytes. The dxgi format. size of in bytes Calculates the size of a in bits. The dxgi format. size of in bits Returns true if the is valid. A format to validate True if the is valid. Returns true if the is a compressed format. The format to check for compressed. True if the is a compressed format Determines whether the specified is packed. The DXGI Format. true if the specified is packed; otherwise, false. Determines whether the specified is video. The . true if the specified is video; otherwise, false. Determines whether the specified is a SRGB format. The . true if the specified is a SRGB format; otherwise, false. Determines whether the specified is typeless. The . true if the specified is typeless; otherwise, false. Computes the scanline count (number of scanlines). The . The height. The scanline count. Static initializer to speed up size calculation (not sure the JIT is enough "smart" for this kind of thing).

Identifies the type of DXGI adapter.

The enumerated type is used by the Flags member of the or DXGI_ADAPTER_DESC2 structure to identify the type of DXGI adapter.

ff471327 DXGI_ADAPTER_FLAG DXGI_ADAPTER_FLAG

Specifies no flags.

ff471327 DXGI_ADAPTER_FLAG_NONE DXGI_ADAPTER_FLAG_NONE

Value always set to 0. This flag is reserved.

ff471327 DXGI_ADAPTER_FLAG_REMOTE DXGI_ADAPTER_FLAG_REMOTE
No documentation. DXGI_ENUM_MODES_FLAGS DXGI_ENUM_MODES_FLAGS No documentation. DXGI_ENUM_MODES_INTERLACED DXGI_ENUM_MODES_INTERLACED No documentation. DXGI_ENUM_MODES_SCALING DXGI_ENUM_MODES_SCALING

Flags that indicate how the back buffers should be rotated to fit the physical rotation of a monitor.

bb173065 DXGI_MODE_ROTATION DXGI_MODE_ROTATION

Unspecified rotation.

bb173065 DXGI_MODE_ROTATION_UNSPECIFIED DXGI_MODE_ROTATION_UNSPECIFIED

Specifies no rotation.

bb173065 DXGI_MODE_ROTATION_IDENTITY DXGI_MODE_ROTATION_IDENTITY

Specifies 90 degrees of rotation.

bb173065 DXGI_MODE_ROTATION_ROTATE90 DXGI_MODE_ROTATION_ROTATE90

Specifies 180 degrees of rotation.

bb173065 DXGI_MODE_ROTATION_ROTATE180 DXGI_MODE_ROTATION_ROTATE180

Specifies 270 degrees of rotation.

bb173065 DXGI_MODE_ROTATION_ROTATE270 DXGI_MODE_ROTATION_ROTATE270

Flags indicating how an image is stretched to fit a given monitor's resolution.

bb173066 DXGI_MODE_SCALING DXGI_MODE_SCALING

Unspecified scaling.

bb173066 DXGI_MODE_SCALING_UNSPECIFIED DXGI_MODE_SCALING_UNSPECIFIED

Specifies no scaling. The image is centered on the display. This flag is typically used for a fixed-dot-pitch display (such as an LED display).

bb173066 DXGI_MODE_SCALING_CENTERED DXGI_MODE_SCALING_CENTERED

Specifies stretched scaling.

bb173066 DXGI_MODE_SCALING_STRETCHED DXGI_MODE_SCALING_STRETCHED

Flags indicating the method the raster uses to create an image on a surface.

bb173067 DXGI_MODE_SCANLINE_ORDER DXGI_MODE_SCANLINE_ORDER

Scanline order is unspecified.

bb173067 DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED

The image is created from the first scanline to the last without skipping any.

bb173067 DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE

The image is created beginning with the upper field.

bb173067 DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST

The image is created beginning with the lower field.

bb173067 DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST

Status codes that can be returned by DXGI functions.

cc308061 DXGI_STATUS DXGI_STATUS
No documentation. DXGI_STATUS_OCCLUDED DXGI_STATUS_OCCLUDED No documentation. DXGI_STATUS_CLIPPED DXGI_STATUS_CLIPPED No documentation. DXGI_STATUS_NO_REDIRECTION DXGI_STATUS_NO_REDIRECTION No documentation. DXGI_STATUS_NO_DESKTOP_ACCESS DXGI_STATUS_NO_DESKTOP_ACCESS No documentation. DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE No documentation. DXGI_STATUS_MODE_CHANGED DXGI_STATUS_MODE_CHANGED No documentation. DXGI_STATUS_MODE_CHANGE_IN_PROGRESS DXGI_STATUS_MODE_CHANGE_IN_PROGRESS

Resource data formats which includes fully-typed and typeless formats. There is a list of format modifiers at the bottom of the page, that more fully describes each format type.

A few formats have additional restrictions.

  1. A resource declared with the DXGI_FORMAT_R32G32B32 family of formats cannot be used simultaneously for vertex and texture data. That is, you may not create a buffer resource with the DXGI_FORMAT_R32G32B32 family of formats that uses any of the following bind flags: , , , or (see ).
  2. is designed specifically for text filtering, and must be used with a format-specific, configurable 8x8 filter mode. When calling an HLSL sampling function using this format, the address offset parameter must be set to (0,0).
  3. A resource using a sub-sampled format (such as DXGI_FORMAT_R8G8_B8G8) must have a size that is a multiple of 2 in the x dimension.
  4. Format is not available in Direct3D 10 and Direct3D 10.1

The following topics provide lists of the formats that particular hardware feature levels support:

  • Hardware Support for Direct3D 11.1 Formats
  • Hardware Support for Direct3D 11 Formats
  • Hardware Support for Direct3D 10.1 Formats
  • Hardware Support for Direct3D 10 Formats
  • Hardware Support for Direct3D 10Level9 Formats

For a list of the DirectXMath types that map to values, see DirectXMath Library Internals.

Format Modifiers

Each enumeration value contains a format modifier which describes the data type.

Format ModifiersDescription
_FLOATA floating-point value; 32-bit floating-point formats use IEEE 754 single-precision (s23e8 format): sign bit, 8-bit biased (127) exponent, and 23-bit mantissa. 16-bit floating-point formats use half-precision (s10e5 format): sign bit, 5-bit biased (15) exponent, and 10-bit mantissa.
_SINTTwo's complement signed integer. For example, a 3-bit SINT represents the values -4, -3, -2, -1, 0, 1, 2, 3.
_SNORMSigned normalized integer; which is interpreted in a resource as a signed integer, and is interpreted in a shader as a signed normalized floating-point value in the range [-1, 1]. For an 2's complement number, the maximum value is 1.0f (a 5-bit value 01111 maps to 1.0f), and the minimum value is -1.0f (a 5-bit value 10000 maps to -1.0f). In addition, the second-minimum number maps to -1.0f (a 5-bit value 10001 maps to -1.0f). The resulting integer representations are evenly spaced floating-point values in the range (-1.0f...0.0f), and also a complementary set of representations for numbers in the range (0.0f...1.0f).
_SRGBStandard RGB data, which roughly displays colors in a linear ramp of luminosity levels such that an average observer, under average viewing conditions, can view them on an average display.

All 0's maps to 0.0f, and all 1's maps to 1.0f. The sequence of unsigned integer encodings between all 0's and all 1's represent a nonlinear progression in the floating-point interpretation of the numbers between 0.0f to 1.0f. For more detail, see the SRGB color standard, IEC 61996-2-1, at IEC (International Electrotechnical Commission).

Conversion to or from sRGB space is automatically done by D3DX10 or D3DX9 texture-load functions. If the format has an alpha channel, the alpha data is also stored in sRGB color space.
_TYPELESSTypeless data, with a defined number of bits. Typeless formats are designed for creating typeless resources; that is, a resource whose size is known, but whose data type is not yet fully defined. When a typeless resource is bound to a shader, the application or shader must resolve the format type (which must match the number of bits per component in the typeless format).

A typeless format contains one or more subformats; each subformat resolves the data type. For example, in the R32G32B32 group, which defines types for three-component 96-bit data, there is one typeless format and three fully typed subformats.

 , , , ,	
            
_UINTUnsigned integer. For instance, a 3-bit UINT represents the values 0, 1, 2, 3, 4, 5, 6, 7.
_UNORMUnsigned normalized integer; which is interpreted in a resource as an unsigned integer, and is interpreted in a shader as an unsigned normalized floating-point value in the range [0, 1]. All 0's maps to 0.0f, and all 1's maps to 1.0f. A sequence of evenly spaced floating-point values from 0.0f to 1.0f are represented. For instance, a 2-bit UNORM represents 0.0f, 1/3, 2/3, and 1.0f.

?

New Resource Formats

Direct3D 10 offers new data compression formats for compressing high-dynamic range (HDR) lighting data, normal maps and heightfields to a fraction of their original size. These compression types include:

  • Shared-Exponent high-dynamic range (HDR) format (RGBE)
  • New Block-Compressed 1-2 channel UNORM/SNORM formats

The block compression formats can be used for any of the 2D or 3D texture types ( Texture2D, Texture2DArray, Texture3D, or TextureCube) including mipmap surfaces. The block compression techniques require texture dimensions to be a multiple of 4 (since the implementation compresses on blocks of 4x4 texels). In the texture sampler, compressed formats are always decompressed before texture filtering.

bb173059 DXGI_FORMAT DXGI_FORMAT

The format is not known.

bb173059 DXGI_FORMAT_UNKNOWN DXGI_FORMAT_UNKNOWN

A four-component, 128-bit typeless format that supports 32 bits per channel including alpha. 1

bb173059 DXGI_FORMAT_R32G32B32A32_TYPELESS DXGI_FORMAT_R32G32B32A32_TYPELESS

A four-component, 128-bit floating-point format that supports 32 bits per channel including alpha. 1

bb173059 DXGI_FORMAT_R32G32B32A32_FLOAT DXGI_FORMAT_R32G32B32A32_FLOAT

A four-component, 128-bit unsigned-integer format that supports 32 bits per channel including alpha. 1

bb173059 DXGI_FORMAT_R32G32B32A32_UINT DXGI_FORMAT_R32G32B32A32_UINT

A four-component, 128-bit signed-integer format that supports 32 bits per channel including alpha. 1

bb173059 DXGI_FORMAT_R32G32B32A32_SINT DXGI_FORMAT_R32G32B32A32_SINT

A three-component, 96-bit typeless format that supports 32 bits per color channel.

bb173059 DXGI_FORMAT_R32G32B32_TYPELESS DXGI_FORMAT_R32G32B32_TYPELESS

A three-component, 96-bit floating-point format that supports 32 bits per color channel.

bb173059 DXGI_FORMAT_R32G32B32_FLOAT DXGI_FORMAT_R32G32B32_FLOAT

A three-component, 96-bit unsigned-integer format that supports 32 bits per color channel.

bb173059 DXGI_FORMAT_R32G32B32_UINT DXGI_FORMAT_R32G32B32_UINT

A three-component, 96-bit signed-integer format that supports 32 bits per color channel.

bb173059 DXGI_FORMAT_R32G32B32_SINT DXGI_FORMAT_R32G32B32_SINT

A four-component, 64-bit typeless format that supports 16 bits per channel including alpha.

bb173059 DXGI_FORMAT_R16G16B16A16_TYPELESS DXGI_FORMAT_R16G16B16A16_TYPELESS

A four-component, 64-bit floating-point format that supports 16 bits per channel including alpha.

bb173059 DXGI_FORMAT_R16G16B16A16_FLOAT DXGI_FORMAT_R16G16B16A16_FLOAT

A four-component, 64-bit unsigned-normalized-integer format that supports 16 bits per channel including alpha.

bb173059 DXGI_FORMAT_R16G16B16A16_UNORM DXGI_FORMAT_R16G16B16A16_UNORM

A four-component, 64-bit unsigned-integer format that supports 16 bits per channel including alpha.

bb173059 DXGI_FORMAT_R16G16B16A16_UINT DXGI_FORMAT_R16G16B16A16_UINT

A four-component, 64-bit signed-normalized-integer format that supports 16 bits per channel including alpha.

bb173059 DXGI_FORMAT_R16G16B16A16_SNORM DXGI_FORMAT_R16G16B16A16_SNORM

A four-component, 64-bit signed-integer format that supports 16 bits per channel including alpha.

bb173059 DXGI_FORMAT_R16G16B16A16_SINT DXGI_FORMAT_R16G16B16A16_SINT

A two-component, 64-bit typeless format that supports 32 bits for the red channel and 32 bits for the green channel.

bb173059 DXGI_FORMAT_R32G32_TYPELESS DXGI_FORMAT_R32G32_TYPELESS

A two-component, 64-bit floating-point format that supports 32 bits for the red channel and 32 bits for the green channel.

bb173059 DXGI_FORMAT_R32G32_FLOAT DXGI_FORMAT_R32G32_FLOAT

A two-component, 64-bit unsigned-integer format that supports 32 bits for the red channel and 32 bits for the green channel.

bb173059 DXGI_FORMAT_R32G32_UINT DXGI_FORMAT_R32G32_UINT

A two-component, 64-bit signed-integer format that supports 32 bits for the red channel and 32 bits for the green channel.

bb173059 DXGI_FORMAT_R32G32_SINT DXGI_FORMAT_R32G32_SINT

A two-component, 64-bit typeless format that supports 32 bits for the red channel, 8 bits for the green channel, and 24 bits are unused.

bb173059 DXGI_FORMAT_R32G8X24_TYPELESS DXGI_FORMAT_R32G8X24_TYPELESS

A 32-bit floating-point component, and two unsigned-integer components (with an additional 32 bits). This format supports 32-bit depth, 8-bit stencil, and 24 bits are unused.

bb173059 DXGI_FORMAT_D32_FLOAT_S8X24_UINT DXGI_FORMAT_D32_FLOAT_S8X24_UINT

A 32-bit floating-point component, and two typeless components (with an additional 32 bits). This format supports 32-bit red channel, 8 bits are unused, and 24 bits are unused.

bb173059 DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS

A 32-bit typeless component, and two unsigned-integer components (with an additional 32 bits). This format has 32 bits unused, 8 bits for green channel, and 24 bits are unused.

bb173059 DXGI_FORMAT_X32_TYPELESS_G8X24_UINT DXGI_FORMAT_X32_TYPELESS_G8X24_UINT

A four-component, 32-bit typeless format that supports 10 bits for each color and 2 bits for alpha.

bb173059 DXGI_FORMAT_R10G10B10A2_TYPELESS DXGI_FORMAT_R10G10B10A2_TYPELESS

A four-component, 32-bit unsigned-normalized-integer format that supports 10 bits for each color and 2 bits for alpha.

bb173059 DXGI_FORMAT_R10G10B10A2_UNORM DXGI_FORMAT_R10G10B10A2_UNORM

A four-component, 32-bit unsigned-integer format that supports 10 bits for each color and 2 bits for alpha.

bb173059 DXGI_FORMAT_R10G10B10A2_UINT DXGI_FORMAT_R10G10B10A2_UINT

Three partial-precision floating-point numbers encoded into a single 32-bit value (a variant of s10e5, which is sign bit, 10-bit mantissa, and 5-bit biased (15) exponent). There are no sign bits, and there is a 5-bit biased (15) exponent for each channel, 6-bit mantissa for R and G, and a 5-bit mantissa for B, as shown in the following illustration.

bb173059 DXGI_FORMAT_R11G11B10_FLOAT DXGI_FORMAT_R11G11B10_FLOAT

A four-component, 32-bit typeless format that supports 8 bits per channel including alpha.

bb173059 DXGI_FORMAT_R8G8B8A8_TYPELESS DXGI_FORMAT_R8G8B8A8_TYPELESS

A four-component, 32-bit unsigned-normalized-integer format that supports 8 bits per channel including alpha.

bb173059 DXGI_FORMAT_R8G8B8A8_UNORM DXGI_FORMAT_R8G8B8A8_UNORM

A four-component, 32-bit unsigned-normalized integer sRGB format that supports 8 bits per channel including alpha.

bb173059 DXGI_FORMAT_R8G8B8A8_UNORM_SRGB DXGI_FORMAT_R8G8B8A8_UNORM_SRGB

A four-component, 32-bit unsigned-integer format that supports 8 bits per channel including alpha.

bb173059 DXGI_FORMAT_R8G8B8A8_UINT DXGI_FORMAT_R8G8B8A8_UINT

A four-component, 32-bit signed-normalized-integer format that supports 8 bits per channel including alpha.

bb173059 DXGI_FORMAT_R8G8B8A8_SNORM DXGI_FORMAT_R8G8B8A8_SNORM

A four-component, 32-bit signed-integer format that supports 8 bits per channel including alpha.

bb173059 DXGI_FORMAT_R8G8B8A8_SINT DXGI_FORMAT_R8G8B8A8_SINT

A two-component, 32-bit typeless format that supports 16 bits for the red channel and 16 bits for the green channel.

bb173059 DXGI_FORMAT_R16G16_TYPELESS DXGI_FORMAT_R16G16_TYPELESS

A two-component, 32-bit floating-point format that supports 16 bits for the red channel and 16 bits for the green channel.

bb173059 DXGI_FORMAT_R16G16_FLOAT DXGI_FORMAT_R16G16_FLOAT

A two-component, 32-bit unsigned-normalized-integer format that supports 16 bits each for the green and red channels.

bb173059 DXGI_FORMAT_R16G16_UNORM DXGI_FORMAT_R16G16_UNORM

A two-component, 32-bit unsigned-integer format that supports 16 bits for the red channel and 16 bits for the green channel.

bb173059 DXGI_FORMAT_R16G16_UINT DXGI_FORMAT_R16G16_UINT

A two-component, 32-bit signed-normalized-integer format that supports 16 bits for the red channel and 16 bits for the green channel.

bb173059 DXGI_FORMAT_R16G16_SNORM DXGI_FORMAT_R16G16_SNORM

A two-component, 32-bit signed-integer format that supports 16 bits for the red channel and 16 bits for the green channel.

bb173059 DXGI_FORMAT_R16G16_SINT DXGI_FORMAT_R16G16_SINT

A single-component, 32-bit typeless format that supports 32 bits for the red channel.

bb173059 DXGI_FORMAT_R32_TYPELESS DXGI_FORMAT_R32_TYPELESS

A single-component, 32-bit floating-point format that supports 32 bits for depth.

bb173059 DXGI_FORMAT_D32_FLOAT DXGI_FORMAT_D32_FLOAT

A single-component, 32-bit floating-point format that supports 32 bits for the red channel.

bb173059 DXGI_FORMAT_R32_FLOAT DXGI_FORMAT_R32_FLOAT

A single-component, 32-bit unsigned-integer format that supports 32 bits for the red channel.

bb173059 DXGI_FORMAT_R32_UINT DXGI_FORMAT_R32_UINT

A single-component, 32-bit signed-integer format that supports 32 bits for the red channel.

bb173059 DXGI_FORMAT_R32_SINT DXGI_FORMAT_R32_SINT

A two-component, 32-bit typeless format that supports 24 bits for the red channel and 8 bits for the green channel.

bb173059 DXGI_FORMAT_R24G8_TYPELESS DXGI_FORMAT_R24G8_TYPELESS

A 32-bit z-buffer format that supports 24 bits for depth and 8 bits for stencil.

bb173059 DXGI_FORMAT_D24_UNORM_S8_UINT DXGI_FORMAT_D24_UNORM_S8_UINT

A 32-bit format, that contains a 24 bit, single-component, unsigned-normalized integer, with an additional typeless 8 bits. This format has 24 bits red channel and 8 bits unused.

bb173059 DXGI_FORMAT_R24_UNORM_X8_TYPELESS DXGI_FORMAT_R24_UNORM_X8_TYPELESS

A 32-bit format, that contains a 24 bit, single-component, typeless format, with an additional 8 bit unsigned integer component. This format has 24 bits unused and 8 bits green channel.

bb173059 DXGI_FORMAT_X24_TYPELESS_G8_UINT DXGI_FORMAT_X24_TYPELESS_G8_UINT

A two-component, 16-bit typeless format that supports 8 bits for the red channel and 8 bits for the green channel.

bb173059 DXGI_FORMAT_R8G8_TYPELESS DXGI_FORMAT_R8G8_TYPELESS

A two-component, 16-bit unsigned-normalized-integer format that supports 8 bits for the red channel and 8 bits for the green channel.

bb173059 DXGI_FORMAT_R8G8_UNORM DXGI_FORMAT_R8G8_UNORM

A two-component, 16-bit unsigned-integer format that supports 8 bits for the red channel and 8 bits for the green channel.

bb173059 DXGI_FORMAT_R8G8_UINT DXGI_FORMAT_R8G8_UINT

A two-component, 16-bit signed-normalized-integer format that supports 8 bits for the red channel and 8 bits for the green channel.

bb173059 DXGI_FORMAT_R8G8_SNORM DXGI_FORMAT_R8G8_SNORM

A two-component, 16-bit signed-integer format that supports 8 bits for the red channel and 8 bits for the green channel.

bb173059 DXGI_FORMAT_R8G8_SINT DXGI_FORMAT_R8G8_SINT

A single-component, 16-bit typeless format that supports 16 bits for the red channel.

bb173059 DXGI_FORMAT_R16_TYPELESS DXGI_FORMAT_R16_TYPELESS

A single-component, 16-bit floating-point format that supports 16 bits for the red channel.

bb173059 DXGI_FORMAT_R16_FLOAT DXGI_FORMAT_R16_FLOAT

A single-component, 16-bit unsigned-normalized-integer format that supports 16 bits for depth.

bb173059 DXGI_FORMAT_D16_UNORM DXGI_FORMAT_D16_UNORM

A single-component, 16-bit unsigned-normalized-integer format that supports 16 bits for the red channel.

bb173059 DXGI_FORMAT_R16_UNORM DXGI_FORMAT_R16_UNORM

A single-component, 16-bit unsigned-integer format that supports 16 bits for the red channel.

bb173059 DXGI_FORMAT_R16_UINT DXGI_FORMAT_R16_UINT

A single-component, 16-bit signed-normalized-integer format that supports 16 bits for the red channel.

bb173059 DXGI_FORMAT_R16_SNORM DXGI_FORMAT_R16_SNORM

A single-component, 16-bit signed-integer format that supports 16 bits for the red channel.

bb173059 DXGI_FORMAT_R16_SINT DXGI_FORMAT_R16_SINT

A single-component, 8-bit typeless format that supports 8 bits for the red channel.

bb173059 DXGI_FORMAT_R8_TYPELESS DXGI_FORMAT_R8_TYPELESS

A single-component, 8-bit unsigned-normalized-integer format that supports 8 bits for the red channel.

bb173059 DXGI_FORMAT_R8_UNORM DXGI_FORMAT_R8_UNORM

A single-component, 8-bit unsigned-integer format that supports 8 bits for the red channel.

bb173059 DXGI_FORMAT_R8_UINT DXGI_FORMAT_R8_UINT

A single-component, 8-bit signed-normalized-integer format that supports 8 bits for the red channel.

bb173059 DXGI_FORMAT_R8_SNORM DXGI_FORMAT_R8_SNORM

A single-component, 8-bit signed-integer format that supports 8 bits for the red channel.

bb173059 DXGI_FORMAT_R8_SINT DXGI_FORMAT_R8_SINT

A single-component, 8-bit unsigned-normalized-integer format for alpha only.

bb173059 DXGI_FORMAT_A8_UNORM DXGI_FORMAT_A8_UNORM

A single-component, 1-bit unsigned-normalized integer format that supports 1 bit for the red channel. 2.

bb173059 DXGI_FORMAT_R1_UNORM DXGI_FORMAT_R1_UNORM

Three partial-precision floating-point numbers encoded into a single 32-bit value all sharing the same 5-bit exponent (variant of s10e5, which is sign bit, 10-bit mantissa, and 5-bit biased (15) exponent). There is no sign bit, and there is a shared 5-bit biased (15) exponent and a 9-bit mantissa for each channel, as shown in the following illustration. 2.

bb173059 DXGI_FORMAT_R9G9B9E5_SHAREDEXP DXGI_FORMAT_R9G9B9E5_SHAREDEXP

A four-component, 32-bit unsigned-normalized-integer format. This packed RGB format is analogous to the UYVY format. Each 32-bit block describes a pair of pixels: (R8, G8, B8) and (R8, G8, B8) where the R8/B8 values are repeated, and the G8 values are unique to each pixel. 3

bb173059 DXGI_FORMAT_R8G8_B8G8_UNORM DXGI_FORMAT_R8G8_B8G8_UNORM

A four-component, 32-bit unsigned-normalized-integer format. This packed RGB format is analogous to the YUY2 format. Each 32-bit block describes a pair of pixels: (R8, G8, B8) and (R8, G8, B8) where the R8/B8 values are repeated, and the G8 values are unique to each pixel. 3

bb173059 DXGI_FORMAT_G8R8_G8B8_UNORM DXGI_FORMAT_G8R8_G8B8_UNORM

Four-component typeless block-compression format. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

bb173059 DXGI_FORMAT_BC1_TYPELESS DXGI_FORMAT_BC1_TYPELESS

Four-component block-compression format. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

bb173059 DXGI_FORMAT_BC1_UNORM DXGI_FORMAT_BC1_UNORM

Four-component block-compression format for sRGB data. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

bb173059 DXGI_FORMAT_BC1_UNORM_SRGB DXGI_FORMAT_BC1_UNORM_SRGB

Four-component typeless block-compression format. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

bb173059 DXGI_FORMAT_BC2_TYPELESS DXGI_FORMAT_BC2_TYPELESS

Four-component block-compression format. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

bb173059 DXGI_FORMAT_BC2_UNORM DXGI_FORMAT_BC2_UNORM

Four-component block-compression format for sRGB data. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

bb173059 DXGI_FORMAT_BC2_UNORM_SRGB DXGI_FORMAT_BC2_UNORM_SRGB

Four-component typeless block-compression format. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

bb173059 DXGI_FORMAT_BC3_TYPELESS DXGI_FORMAT_BC3_TYPELESS

Four-component block-compression format. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

bb173059 DXGI_FORMAT_BC3_UNORM DXGI_FORMAT_BC3_UNORM

Four-component block-compression format for sRGB data. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

bb173059 DXGI_FORMAT_BC3_UNORM_SRGB DXGI_FORMAT_BC3_UNORM_SRGB

One-component typeless block-compression format. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

bb173059 DXGI_FORMAT_BC4_TYPELESS DXGI_FORMAT_BC4_TYPELESS

One-component block-compression format. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

bb173059 DXGI_FORMAT_BC4_UNORM DXGI_FORMAT_BC4_UNORM

One-component block-compression format. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

bb173059 DXGI_FORMAT_BC4_SNORM DXGI_FORMAT_BC4_SNORM

Two-component typeless block-compression format. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

bb173059 DXGI_FORMAT_BC5_TYPELESS DXGI_FORMAT_BC5_TYPELESS

Two-component block-compression format. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

bb173059 DXGI_FORMAT_BC5_UNORM DXGI_FORMAT_BC5_UNORM

Two-component block-compression format. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

bb173059 DXGI_FORMAT_BC5_SNORM DXGI_FORMAT_BC5_SNORM

A three-component, 16-bit unsigned-normalized-integer format that supports 5 bits for blue, 6 bits for green, and 5 bits for red.

bb173059 DXGI_FORMAT_B5G6R5_UNORM DXGI_FORMAT_B5G6R5_UNORM

A four-component, 16-bit unsigned-normalized-integer format that supports 5 bits for each color channel and 1-bit alpha.

bb173059 DXGI_FORMAT_B5G5R5A1_UNORM DXGI_FORMAT_B5G5R5A1_UNORM

A four-component, 32-bit unsigned-normalized-integer format that supports 8 bits for each color channel and 8-bit alpha.

bb173059 DXGI_FORMAT_B8G8R8A8_UNORM DXGI_FORMAT_B8G8R8A8_UNORM

A four-component, 32-bit unsigned-normalized-integer format that supports 8 bits for each color channel and 8 bits unused.

bb173059 DXGI_FORMAT_B8G8R8X8_UNORM DXGI_FORMAT_B8G8R8X8_UNORM

A four-component, 32-bit 2.8-biased fixed-point format that supports 10 bits for each color channel and 2-bit alpha.

bb173059 DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM

A four-component, 32-bit typeless format that supports 8 bits for each channel including alpha. 4

bb173059 DXGI_FORMAT_B8G8R8A8_TYPELESS DXGI_FORMAT_B8G8R8A8_TYPELESS

A four-component, 32-bit unsigned-normalized standard RGB format that supports 8 bits for each channel including alpha. 4

bb173059 DXGI_FORMAT_B8G8R8A8_UNORM_SRGB DXGI_FORMAT_B8G8R8A8_UNORM_SRGB

A four-component, 32-bit typeless format that supports 8 bits for each color channel, and 8 bits are unused. 4

bb173059 DXGI_FORMAT_B8G8R8X8_TYPELESS DXGI_FORMAT_B8G8R8X8_TYPELESS

A four-component, 32-bit unsigned-normalized standard RGB format that supports 8 bits for each color channel, and 8 bits are unused. 4

bb173059 DXGI_FORMAT_B8G8R8X8_UNORM_SRGB DXGI_FORMAT_B8G8R8X8_UNORM_SRGB

A typeless block-compression format. 4 For information about block-compression formats, see Texture Block Compression in Direct3D 11.

bb173059 DXGI_FORMAT_BC6H_TYPELESS DXGI_FORMAT_BC6H_TYPELESS

A block-compression format. 4 For information about block-compression formats, see Texture Block Compression in Direct3D 11.

bb173059 DXGI_FORMAT_BC6H_UF16 DXGI_FORMAT_BC6H_UF16

A block-compression format. 4 For information about block-compression formats, see Texture Block Compression in Direct3D 11.

bb173059 DXGI_FORMAT_BC6H_SF16 DXGI_FORMAT_BC6H_SF16

A typeless block-compression format. 4 For information about block-compression formats, see Texture Block Compression in Direct3D 11.

bb173059 DXGI_FORMAT_BC7_TYPELESS DXGI_FORMAT_BC7_TYPELESS

A block-compression format. 4 For information about block-compression formats, see Texture Block Compression in Direct3D 11.

bb173059 DXGI_FORMAT_BC7_UNORM DXGI_FORMAT_BC7_UNORM

A block-compression format. 4 For information about block-compression formats, see Texture Block Compression in Direct3D 11.

bb173059 DXGI_FORMAT_BC7_UNORM_SRGB DXGI_FORMAT_BC7_UNORM_SRGB
No documentation. DXGI_MAP_FLAGS DXGI_MAP_FLAGS No documentation. DXGI_MAP_READ DXGI_MAP_READ No documentation. DXGI_MAP_WRITE DXGI_MAP_WRITE No documentation. DXGI_MAP_DISCARD DXGI_MAP_DISCARD No documentation. DXGI_PRESENT_FLAGS DXGI_PRESENT_FLAGS No documentation. DXGI_PRESENT_TEST DXGI_PRESENT_TEST No documentation. DXGI_PRESENT_DO_NOT_SEQUENCE DXGI_PRESENT_DO_NOT_SEQUENCE No documentation. DXGI_PRESENT_RESTART DXGI_PRESENT_RESTART None. None None

Flags indicating the memory location of a resource.

bb173070 DXGI_RESIDENCY DXGI_RESIDENCY

The resource is located in video memory.

bb173070 DXGI_RESIDENCY_FULLY_RESIDENT DXGI_RESIDENCY_FULLY_RESIDENT

At least some of the resource is located in CPU memory.

bb173070 DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY

At least some of the resource has been paged out to the hard drive.

bb173070 DXGI_RESIDENCY_EVICTED_TO_DISK DXGI_RESIDENCY_EVICTED_TO_DISK
No documentation. DXGI_RESOURCE_PRIORITY DXGI_RESOURCE_PRIORITY No documentation. DXGI_RESOURCE_PRIORITY_MINIMUM DXGI_RESOURCE_PRIORITY_MINIMUM No documentation. DXGI_RESOURCE_PRIORITY_LOW DXGI_RESOURCE_PRIORITY_LOW No documentation. DXGI_RESOURCE_PRIORITY_NORMAL DXGI_RESOURCE_PRIORITY_NORMAL No documentation. DXGI_RESOURCE_PRIORITY_HIGH DXGI_RESOURCE_PRIORITY_HIGH No documentation. DXGI_RESOURCE_PRIORITY_MAXIMUM DXGI_RESOURCE_PRIORITY_MAXIMUM No documentation. DXGI_SHARED_RESOURCE_FLAGS DXGI_SHARED_RESOURCE_FLAGS None. None None

Options for swap-chain behavior.

This enumeration is used by the structure and the method.

This enumeration is also used by the DXGI_SWAP_CHAIN_DESC1 structure.

Swap chains that you create in full-screen mode with the method behave as if DXGI_SWAP_CHAIN_FLAG_DISPLAY_ONLY is set even though the flag is not set. That is, presented content is not accessible by remote access or through the desktop duplication APIs.

Swap chains that you create with the IDXGIFactory2::CreateSwapChainForHwnd, IDXGIFactory2::CreateSwapChainForImmersiveWindow, and IDXGIFactory2::CreateSwapChainForCompositionSurface methods are not protected if DXGI_SWAP_CHAIN_FLAG_DISPLAY_ONLY is not set and are protected if DXGI_SWAP_CHAIN_FLAG_DISPLAY_ONLY is set. When swap chains are protected, screen scraping is prevented and, in full-screen mode, presented content is not accessible through the desktop duplication APIs.

bb173076 DXGI_SWAP_CHAIN_FLAG DXGI_SWAP_CHAIN_FLAG

Set this flag to turn off automatic image rotation; that is, do not perform a rotation when transferring the contents of the front buffer to the monitor. Use this flag to avoid a bandwidth penalty when an application expects to handle rotation. This option is valid only during full-screen mode.

bb173076 DXGI_SWAP_CHAIN_FLAG_NONPREROTATED DXGI_SWAP_CHAIN_FLAG_NONPREROTATED

Set this flag to enable an application to switch modes by calling . When switching from windowed to full-screen mode, the display mode (or monitor resolution) will be changed to match the dimensions of the application window.

bb173076 DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH

Set this flag to enable an application to render using GDI on a swap chain or a surface. This will allow the application to call on the 0th back buffer or a surface.

bb173076 DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE
None. None None

Options for handling pixels in a display surface after calling .

This enumeration is used by the structure.

This enumeration is also used by the DXGI_SWAP_CHAIN_DESC1 structure.

The primary difference between presentation models is how back-buffer contents get to the Desktop Window Manager (DWM) for composition. In the bitblt model, which is used with the and values, contents of the back buffer get copied into the redirection surface on each call to . In the flip model, which is used with the DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL value, all back buffers are shared with the DWM. Therefore, the DWM can compose straight from those back buffers without any additional copy operations. In general, the flip model is the more efficient model. The flip model also provides more features, such as enhanced present statistics.

Regardless of whether the flip model is more efficient, an application still might choose the bitblt model for the following reasons:

  • The bitblt model is the only way to mix GDI and DirectX presentation.

    In the flip model, the application must create the swap chain with , and then must use GetDC on the back buffer explicitly. After the first successful call to on a flip-model swap chain, GDI no longer works with the that is associated with that swap chain, even after the destruction of the swap chain. This restriction even extends to methods like ScrollWindowEx.

  • The flip model requires at least three window-sized buffers if the application uses child windows. For the bitblt model, this minimum is two buffers.

bb173077 DXGI_SWAP_EFFECT DXGI_SWAP_EFFECT
No documentation. DXGI_SWAP_EFFECT_DISCARD DXGI_SWAP_EFFECT_DISCARD No documentation. DXGI_SWAP_EFFECT_SEQUENTIAL DXGI_SWAP_EFFECT_SEQUENTIAL No documentation. DXGI_USAGE_ENUM DXGI_USAGE_ENUM No documentation. DXGI_USAGE_SHADER_INPUT DXGI_USAGE_SHADER_INPUT No documentation. DXGI_USAGE_RENDER_TARGET_OUTPUT DXGI_USAGE_RENDER_TARGET_OUTPUT No documentation. DXGI_USAGE_BACK_BUFFER DXGI_USAGE_BACK_BUFFER No documentation. DXGI_USAGE_SHARED DXGI_USAGE_SHARED No documentation. DXGI_USAGE_READ_ONLY DXGI_USAGE_READ_ONLY No documentation. DXGI_USAGE_DISCARD_ON_PRESENT DXGI_USAGE_DISCARD_ON_PRESENT No documentation. DXGI_USAGE_UNORDERED_ACCESS DXGI_USAGE_UNORDERED_ACCESS No documentation. DXGI_MWA_FLAGS DXGI_MWA_FLAGS No documentation. DXGI_MWA_NO_WINDOW_CHANGES DXGI_MWA_NO_WINDOW_CHANGES No documentation. DXGI_MWA_NO_ALT_ENTER DXGI_MWA_NO_ALT_ENTER No documentation. DXGI_MWA_NO_PRINT_SCREEN DXGI_MWA_NO_PRINT_SCREEN No documentation. DXGI_MWA_VALID DXGI_MWA_VALID None. None None Functions

Creates a DXGI 1.1 factory that generates objects used to enumerate and specify video graphics settings.

The globally unique identifier () of the object referenced by the ppFactory parameter.

Address of a reference to an object.

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

Use a DXGI 1.1 factory to generate objects that enumerate adapters, create swap chains, and associate a window with the alt+enter key sequence for toggling to and from the full-screen display mode.

If the CreateDXGIFactory1 function succeeds, the reference count on the interface is incremented. To avoid a memory leak, when you finish using the interface, call the IDXGIFactory1::Release method to release the interface.

This entry point is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

Note??Do not mix the use of DXGI 1.0 () and DXGI 1.1 () in an application. Use or , but not both in an application.

ff471318 HRESULT CreateDXGIFactory1([In] const GUID& riid,[Out] void** ppFactory) CreateDXGIFactory1

Creates a DXGI 1.0 factory that generates objects used to enumerate and specify video graphics settings.

The globally unique identifier () of the object referenced by the ppFactory parameter.

Address of a reference to an object.

Returns if successful; otherwise, returns one of the following DXGI_ERROR.

Use a DXGI factory to generate objects that enumerate adapters, create swap chains, and associate a window with the alt+enter key sequence for toggling to and from the fullscreen display mode.

If the CreateDXGIFactory function succeeds, the reference count on the interface is incremented. To avoid a memory leak, when you finish using the interface, call the IDXGIFactory::Release method to release the interface.

Note??Do not mix the use of DXGI 1.0 () and DXGI 1.1 () in an application. Use or , but not both in an application.

The CreateDXGIFactory function does not exist for Metro style apps. Instead, Metro style apps use the CreateDXGIFactory1 function.

bb204862 HRESULT CreateDXGIFactory([In] const GUID& riid,[Out] void** ppFactory) CreateDXGIFactory
Functions Constant FrameStatisticsDisjoint. DXGI_ERROR_FRAME_STATISTICS_DISJOINT Constant DeviceReset. DXGI_ERROR_DEVICE_RESET Constant NotFound. DXGI_ERROR_NOT_FOUND Constant DriverInternalError. DXGI_ERROR_DRIVER_INTERNAL_ERROR Constant InvalidCall. DXGI_ERROR_INVALID_CALL Constant WasStillDrawing. DXGI_ERROR_WAS_STILL_DRAWING Constant Unsupported. DXGI_ERROR_UNSUPPORTED Constant RemoteClientDisconnected. DXGI_ERROR_REMOTE_CLIENT_DISCONNECTED Constant DeviceRemoved. DXGI_ERROR_DEVICE_REMOVED Constant DeviceHung. DXGI_ERROR_DEVICE_HUNG Constant RemoteOufOfMemory. DXGI_ERROR_REMOTE_OUTOFMEMORY Constant MoreData. DXGI_ERROR_MORE_DATA Constant Nonexclusive. DXGI_ERROR_NONEXCLUSIVE Constant GraphicsVidpnSourceInUse. DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE Constant NotCurrentlyAvailable. DXGI_ERROR_NOT_CURRENTLY_AVAILABLE

The interface represents a display sub-system (including one or more GPU's, DACs and video memory).

This interface is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

A display sub-system is often referred to as a video card, however, on some machines the display sub-system is part of the mother board.

To enumerate the display sub-systems, use . To get an interface to the adapter for a particular device, use . To create a software adapter, use .

ff471329 IDXGIAdapter1 IDXGIAdapter1
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets a DXGI 1.1 description of an adapter (or video card).

A reference to a structure that describes the adapter. This parameter must not be null.

Returns if successful; otherwise, returns E_INVALIDARG if the pDesc parameter is null.

This method is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

Use the GetDesc1 method to get a DXGI 1.1 description of an adapter. To get a DXGI 1.0 description, use the method.

ff471330 HRESULT IDXGIAdapter1::GetDesc1([Out] DXGI_ADAPTER_DESC1* pDesc) IDXGIAdapter1::GetDesc1

Gets a DXGI 1.1 description of an adapter (or video card).

This method is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

Use the GetDesc1 method to get a DXGI 1.1 description of an adapter. To get a DXGI 1.0 description, use the method.

ff471330 GetDesc1 GetDesc1 HRESULT IDXGIAdapter1::GetDesc1([Out] DXGI_ADAPTER_DESC1* pDesc)

An interface implements a derived class for DXGI objects that produce image data.

This interface is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

The interface is designed for use by DXGI objects that need access to other DXGI objects. This interface is useful to applications that do not use Direct3D to communicate with DXGI.

ff471331 IDXGIDevice1 IDXGIDevice1
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets the number of frames that the system is allowed to queue for rendering.

The maximum number of back buffer frames that a driver can queue. The value defaults to 3, but can range from 1 to 16. A value of 0 will reset latency to the default. For multi-head devices, this value is specified per-head.

Returns if successful; otherwise, if the device was removed.

This method is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

Frame latency is the number of frames that are allowed to be stored in a queue before submission for rendering. Latency is often used to control how the CPU chooses between responding to user input and frames that are in the render queue. It is often beneficial for applications that have no user input (for example, video playback) to queue more than 3 frames of data.

ff471334 HRESULT IDXGIDevice1::SetMaximumFrameLatency([In] unsigned int MaxLatency) IDXGIDevice1::SetMaximumFrameLatency

Gets the number of frames that the system is allowed to queue for rendering.

This value is set to the number of frames that can be queued for render. This value defaults to 3, but can range from 1 to 16.

Returns if successful; otherwise, returns one of the following members of the D3DERR enumerated type:

This method is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

Frame latency is the number of frames that are allowed to be stored in a queue before submission for rendering. Latency is often used to control how the CPU chooses between responding to user input and frames that are in the render queue. It is often beneficial for applications that have no user input (for example, video playback) to queue more than 3 frames of data.

ff471332 HRESULT IDXGIDevice1::GetMaximumFrameLatency([Out] unsigned int* pMaxLatency) IDXGIDevice1::GetMaximumFrameLatency

Gets or sets the number of frames that the system is allowed to queue for rendering.

This method is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

Frame latency is the number of frames that are allowed to be stored in a queue before submission for rendering. Latency is often used to control how the CPU chooses between responding to user input and frames that are in the render queue. It is often beneficial for applications that have no user input (for example, video playback) to queue more than 3 frames of data.

ff471332 GetMaximumFrameLatency / SetMaximumFrameLatency GetMaximumFrameLatency HRESULT IDXGIDevice1::GetMaximumFrameLatency([Out] unsigned int* pMaxLatency)

Using a key, acquires exclusive rendering access to a shared resource.

The AcquireSync method creates a lock to a surface that is shared between multiple devices, allowing only one device to render to a surface at a time. This method uses a key to determine which device currently has exclusive access to the surface.

When a surface is created using the value of the enumeration, you must call the AcquireSync method before rendering to the surface. You must call the ReleaseSync method when you are done rendering to a surface.

To acquire a reference to the keyed mutex object of a shared resource, call the QueryInterface method of the resource and pass in the UUID of the interface. For more information about acquiring this reference, see the following code example.

The AcquireSync method uses the key as follows, depending on the state of the surface:

  • On initial creation, the surface is unowned and any device can call the AcquireSync method to gain access. For an unowned device, only a key of 0 will succeed. Calling the AcquireSync method for any other key will stall the calling CPU thread.
  • If the surface is owned by a device when you call the AcquireSync method, the CPU thread that called the AcquireSync method will stall until the owning device calls the ReleaseSync method using the same Key.
  • If the surface is unowned when you call the AcquireSync method (for example, the last owning device has already called the ReleaseSync method), the AcquireSync method will succeed if you specify the same key that was specified when the ReleaseSync method was last called. Calling the AcquireSync method using any other key will cause a stall.
  • When the owning device calls the ReleaseSync method with a particular key, and more than one device is waiting after calling the AcquireSync method using the same key, any one of the waiting devices could be woken up first. The order in which devices are woken up is undefined.
  • A keyed mutex does not support recursive calls to the AcquireSync method.
ff471339 IDXGIKeyedMutex IDXGIKeyedMutex
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Using a key, acquires exclusive rendering access to a shared resource.

A value that indicates which device to give access to. This method will succeed when the device that currently owns the surface calls the method using the same value. This value can be any UINT64 value.

The time-out interval, in milliseconds. This method will return if the interval elapses, and the keyed mutex has not been released using the specified Key. If this value is set to zero, the AcquireSync method will test to see if the keyed mutex has been released and returns immediately. If this value is set to INFINITE, the time-out interval will never elapse.

Return if successful.

If the owning device attempted to create another keyed mutex on the same shared resource, AcquireSync returns E_FAIL.

AcquireSync can also return the following DWORD constants. Therefore, you should explicitly check for these constants. If you only use the SUCCEEDED macro on the return value to determine if AcquireSync succeeded, you will not catch these constants.

  • WAIT_ABANDONED - The shared surface and keyed mutex are no longer in a consistent state. If AcquireSync returns this value, you should release and recreate both the keyed mutex and the shared surface.
  • WAIT_TIMEOUT - The time-out interval elapsed before the specified key was released.

The AcquireSync method creates a lock to a surface that is shared between multiple devices, allowing only one device to render to a surface at a time. This method uses a key to determine which device currently has exclusive access to the surface.

When a surface is created using the value of the enumeration, you must call the AcquireSync method before rendering to the surface. You must call the ReleaseSync method when you are done rendering to a surface.

To acquire a reference to the keyed mutex object of a shared resource, call the QueryInterface method of the resource and pass in the UUID of the interface. For more information about acquiring this reference, see the following code example.

The AcquireSync method uses the key as follows, depending on the state of the surface:

  • On initial creation, the surface is unowned and any device can call the AcquireSync method to gain access. For an unowned device, only a key of 0 will succeed. Calling the AcquireSync method for any other key will stall the calling CPU thread.
  • If the surface is owned by a device when you call the AcquireSync method, the CPU thread that called the AcquireSync method will stall until the owning device calls the ReleaseSync method using the same Key.
  • If the surface is unowned when you call the AcquireSync method (for example, the last owning device has already called the ReleaseSync method), the AcquireSync method will succeed if you specify the same key that was specified when the ReleaseSync method was last called. Calling the AcquireSync method using any other key will cause a stall.
  • When the owning device calls the ReleaseSync method with a particular key, and more than one device is waiting after calling the AcquireSync method using the same key, any one of the waiting devices could be woken up first. The order in which devices are woken up is undefined.
  • A keyed mutex does not support recursive calls to the AcquireSync method.
ff471339 HRESULT IDXGIKeyedMutex::AcquireSync([In] unsigned longlong Key,[In] unsigned int dwMilliseconds) IDXGIKeyedMutex::AcquireSync

Using a key, releases exclusive rendering access to a shared resource.

A value that indicates which device to give access to. This method succeeds when the device that currently owns the surface calls the ReleaseSync method using the same value. This value can be any UINT64 value.

Returns if successful.

If the device attempted to release a keyed mutex that is not valid or owned by the device, ReleaseSync returns E_FAIL.

The ReleaseSync method releases a lock to a surface that is shared between multiple devices. This method uses a key to determine which device currently has exclusive access to the surface.

When a surface is created using the value of the enumeration, you must call the method before rendering to the surface. You must call the ReleaseSync method when you are done rendering to a surface.

After you call the ReleaseSync method, the shared resource is unset from the rendering pipeline.

To acquire a reference to the keyed mutex object of a shared resource, call the QueryInterface method of the resource and pass in the UUID of the interface. For more information about acquiring this reference, see the following code example.

ff471340 HRESULT IDXGIKeyedMutex::ReleaseSync([In] unsigned longlong Key) IDXGIKeyedMutex::ReleaseSync

An interface represents an adapter output (such as a monitor).

To see the outputs available, use . To see the specific output that the swap chain will update, use .

bb174546 IDXGIOutput IDXGIOutput
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Get a description of the output.

A reference to the output description (see ).

Returns a code that indicates success or failure. if successful, if pDesc is passed in as null.

bb174548 HRESULT IDXGIOutput::GetDesc([Out] DXGI_OUTPUT_DESC* pDesc) IDXGIOutput::GetDesc

[Starting with Direct3D 11.1, we recommend not to use GetDisplayModeList anymore to retrieve the matching display mode. Instead, use IDXGIOutput1::GetDisplayModeList1, which supports stereo display mode.]

Gets the display modes that match the requested format and other input options.

No documentation. No documentation. No documentation. No documentation.

Returns one of the following DXGI_ERROR. It is rare, but possible, that the display modes available can change immediately after calling this method, in which case is returned (if there is not enough room for all the display modes). If GetDisplayModeList is called from a Remote Desktop Services session (formerly Terminal Services session), is returned.

In general, when switching from windowed to full-screen mode, a swap chain automatically chooses a display mode that meets (or exceeds) the resolution, color depth and refresh rate of the swap chain. To exercise more control over the display mode, use this API to poll the set of display modes that are validated against monitor capabilities, or all modes that match the desktop (if the desktop settings are not validated against the monitor).

As shown, this API is designed to be called twice. First to get the number of modes available, and second to return a description of the modes.

 UINT num = 0;	
             format = ;	
            UINT flags         = ; pOutput->GetDisplayModeList( format, flags, &num, 0); ...  * pDescs = new [num];	
            pOutput->GetDisplayModeList( format, flags, &num, pDescs); 
bb174549 HRESULT IDXGIOutput::GetDisplayModeList([In] DXGI_FORMAT EnumFormat,[In] unsigned int Flags,[InOut] unsigned int* pNumModes,[Out, Buffer, Optional] DXGI_MODE_DESC* pDesc) IDXGIOutput::GetDisplayModeList

[Starting with Direct3D 11.1, we recommend not to use FindClosestMatchingMode anymore to find the display mode that most closely matches the requested display mode. Instead, use IDXGIOutput1::FindClosestMatchingMode1, which supports stereo display mode.]

Finds the display mode that most closely matches the requested display mode.

No documentation. No documentation. No documentation.

Returns one of the following DXGI_ERROR.

FindClosestMatchingMode behaves similarly to the IDXGIOutput1::FindClosestMatchingMode1 except FindClosestMatchingMode considers only the mono display modes. IDXGIOutput1::FindClosestMatchingMode1 considers only stereo modes if you set the Stereo member in the DXGI_MODE_DESC1 structure that pModeToMatch points to, and considers only mono modes if Stereo is not set.

IDXGIOutput1::FindClosestMatchingMode1 returns a matched display-mode set with only stereo modes or only mono modes. FindClosestMatchingMode behaves as though you specified the input mode as mono.

bb174547 HRESULT IDXGIOutput::FindClosestMatchingMode([In] const DXGI_MODE_DESC* pModeToMatch,[Out] DXGI_MODE_DESC* pClosestMatch,[In, Optional] IUnknown* pConcernedDevice) IDXGIOutput::FindClosestMatchingMode

Halt a thread until the next vertical blank occurs.

Returns one of the following DXGI_ERROR.

A vertical blank occurs when the raster moves from the lower right corner to the upper left corner to begin drawing the next frame.

bb174559 HRESULT IDXGIOutput::WaitForVBlank() IDXGIOutput::WaitForVBlank

Takes ownership of an output.

A reference to the interface of a device (such as an ).

Set to TRUE to enable other threads or applications to take ownership of the device; otherwise, set to .

Returns one of the DXGI_ERROR values.

When you are finished with the output, call .

TakeOwnership should not be called directly by applications, since results will be unpredictable. It is called implicitly by the DXGI swap chain object during full-screen transitions, and should not be used as a substitute for swap-chain methods.

Notes for Metro style apps

If a Metro style app uses TakeOwnership, it fails with .

Bb174558 HRESULT IDXGIOutput::TakeOwnership([In] IUnknown* pDevice,[In] BOOL Exclusive) IDXGIOutput::TakeOwnership

Releases ownership of the output.

If you are not using a swap chain, get access to an output by calling and release it when you are finished by calling . An application that uses a swap chain will typically not call either of these methods.

Bb174554 void IDXGIOutput::ReleaseOwnership() IDXGIOutput::ReleaseOwnership

Gets a description of the gamma-control capabilities.

A reference to a description of the gamma-control capabilities (see ).

Returns one of the DXGI_ERROR values.

Note??Calling this method is only supported while in full-screen mode.

bb174553 HRESULT IDXGIOutput::GetGammaControlCapabilities([Out] DXGI_GAMMA_CONTROL_CAPABILITIES* pGammaCaps) IDXGIOutput::GetGammaControlCapabilities

Sets the gamma controls.

A reference to an array of gamma controls (see ).

Returns one of the DXGI_ERROR values.

Note??Calling this method is only supported while in full-screen mode.

Bb174557 HRESULT IDXGIOutput::SetGammaControl([In] const DXGI_GAMMA_CONTROL* pArray) IDXGIOutput::SetGammaControl

Gets the gamma control settings.

An array of gamma control settings (see ).

Returns one of the DXGI_ERROR values.

Note??Calling this method is only supported while in full-screen mode.

bb174552 HRESULT IDXGIOutput::GetGammaControl([Out] DXGI_GAMMA_CONTROL* pArray) IDXGIOutput::GetGammaControl

Changes the display mode.

A reference to a surface (see ) used for rendering an image to the screen. The surface must have been created as a back buffer (DXGI_USAGE_BACKBUFFER).

Returns one of the DXGI_ERROR values.

should not be called directly by applications, since results will be unpredictable. It is called implicitly by the DXGI swap chain object during full-screen transitions, and should not be used as a substitute for swap-chain methods.

This method should only be called between and calls.

Notes for Metro style apps

If a Metro style app uses SetDisplaySurface, it fails with .

bb174556 HRESULT IDXGIOutput::SetDisplaySurface([In] IDXGISurface* pScanoutSurface) IDXGIOutput::SetDisplaySurface

[Starting with Direct3D 11.1, we recommend not to use GetDisplaySurfaceData anymore to retrieve the current display surface. Instead, use IDXGIOutput1::GetDisplaySurfaceData1, which supports stereo display mode.]

Gets a copy of the current display surface.

No documentation.

Returns one of the DXGI_ERROR values.

can only be called when an output is in full-screen mode. If the method succeeds, DXGI fills the destination surface.

Use to determine the size (width and height) of the output when you want to allocate space for the destination surface. This is true regardless of target monitor rotation. A destination surface created by a graphics component (such as Direct3D 10) must be created with CPU-write permission (see ). Other surfaces should be created with CPU read-write permission (see D3D10_CPU_ACCESS_READ_WRITE). This method will modify the surface data to fit the destination surface (stretch, shrink, convert format, rotate). The stretch and shrink is performed with point-sampling.

bb174550 HRESULT IDXGIOutput::GetDisplaySurfaceData([In] IDXGISurface* pDestination) IDXGIOutput::GetDisplaySurfaceData

Gets statistics about recently rendered frames.

A reference to frame statistics (see ).

If this function succeeds, it returns . Otherwise, it might return .

This API is similar to .

Note??Calling this method is only supported while in full-screen mode.

bb174551 HRESULT IDXGIOutput::GetFrameStatistics([Out] DXGI_FRAME_STATISTICS* pStats) IDXGIOutput::GetFrameStatistics
Find the display mode that most closely matches the requested display mode. Direct3D devices require UNORM formats. This method finds the closest matching available display mode to the mode specified in pModeToMatch. Similarly ranked fields (ie. all specified, or all unspecified, etc) are resolved in the following order. ScanlineOrdering Scaling Format Resolution RefreshRate When determining the closest value for a particular field, previously matched fields are used to filter the display mode list choices, and other fields are ignored. For example, when matching Resolution, the display mode list will have already been filtered by a certain ScanlineOrdering, Scaling, and Format, while RefreshRate is ignored. This ordering doesn't define the absolute ordering for every usage scenario of FindClosestMatchingMode, because the application can choose some values initially, effectively changing the order that fields are chosen. Fields of the display mode are matched one at a time, generally in a specified order. If a field is unspecified, FindClosestMatchingMode gravitates toward the values for the desktop related to this output. If this output is not part of the desktop, then the default desktop output is used to find values. If an application uses a fully unspecified display mode, FindClosestMatchingMode will typically return a display mode that matches the desktop settings for this output. Unspecified fields are lower priority than specified fields and will be resolved later than specified fields. A reference to the Direct3D device interface. If this parameter is NULL, only modes whose format matches that of pModeToMatch will be returned; otherwise, only those formats that are supported for scan-out by the device are returned. The desired display mode (see ). Members of DXGI_MODE_DESC can be unspecified indicating no preference for that member. A value of 0 for Width or Height indicates the value is unspecified. If either Width or Height are 0 both must be 0. A numerator and denominator of 0 in RefreshRate indicate it is unspecified. Other members of DXGI_MODE_DESC have enumeration values indicating the member is unspecified. If pConnectedDevice is NULL Format cannot be DXGI_FORMAT_UNKNOWN. The mode that most closely matches pModeToMatch. Returns one of the following . HRESULT IDXGIOutput::FindClosestMatchingMode([In] const DXGI_MODE_DESC* pModeToMatch,[Out] DXGI_MODE_DESC* pClosestMatch,[In, Optional] IUnknown* pConcernedDevice) Gets the display modes that match the requested format and other input options. In general, when switching from windowed to full-screen mode, a swap chain automatically chooses a display mode that meets (or exceeds) the resolution, color depth and refresh rate of the swap chain. To exercise more control over the display mode, use this API to poll the set of display modes that are validated against monitor capabilities, or all modes that match the desktop (if the desktop settings are not validated against the monitor). As shown, this API is designed to be called twice. First to get the number of modes available, and second to return a description of the modes. UINT num = 0; DXGI_FORMAT format = DXGI_FORMAT_R32G32B32A32_FLOAT; UINT flags = DXGI_ENUM_MODES_INTERLACED; pOutput->GetDisplayModeList( format, flags, &num, 0); ... DXGI_MODE_DESC * pDescs = new DXGI_MODE_DESC[num]; pOutput->GetDisplayModeList( format, flags, &num, pDescs); The color format (see ). format for modes to include (see {{DXGI_ENUM_MODES}}). DXGI_ENUM_MODES_SCALING needs to be specified to expose the display modes that require scaling. Centered modes, requiring no scaling and corresponding directly to the display output, are enumerated by default. Returns a list of display modes (see ); HRESULT IDXGIOutput::GetDisplayModeList([None] DXGI_FORMAT EnumFormat,[None] int Flags,[InOut] int* pNumModes,[Out, Buffer, Optional] DXGI_MODE_DESC* pDesc)

Get a description of the output.

bb174548 GetDesc GetDesc HRESULT IDXGIOutput::GetDesc([Out] DXGI_OUTPUT_DESC* pDesc)

Gets a description of the gamma-control capabilities.

Note??Calling this method is only supported while in full-screen mode.

bb174553 GetGammaControlCapabilities GetGammaControlCapabilities HRESULT IDXGIOutput::GetGammaControlCapabilities([Out] DXGI_GAMMA_CONTROL_CAPABILITIES* pGammaCaps)

Gets or sets the gamma control settings.

Note??Calling this method is only supported while in full-screen mode.

bb174552 GetGammaControl / SetGammaControl GetGammaControl HRESULT IDXGIOutput::GetGammaControl([Out] DXGI_GAMMA_CONTROL* pArray)

Gets statistics about recently rendered frames.

This API is similar to .

Note??Calling this method is only supported while in full-screen mode.

bb174551 GetFrameStatistics GetFrameStatistics HRESULT IDXGIOutput::GetFrameStatistics([Out] DXGI_FRAME_STATISTICS* pStats)

An interface allows resource sharing and identifies the memory that a resource resides in.

To find out what type of memory a resource is currently located in, use . To share resources between processes, use . For information about how to share resources between multiple Windows graphics APIs, including Direct3D 11, Direct2D, Direct3D 10, and Direct3D 9Ex, see Surface Sharing Between Windows Graphics APIs.

You can retrieve the interface from any video memory resource that you create from a Direct3D 10 and later function. Any Direct3D object that supports or also supports . For example, the Direct3D 2D texture object that you create from supports . You can call QueryInterface on the 2D texture object () to retrieve the interface. For example, to retrieve the interface from the 2D texture object, use the following code.

 * pDXGIResource;	
            hr = g_pd3dTexture2D->QueryInterface(__uuidof(), (void **)&pDXGIResource);	
            
bb174560 IDXGIResource IDXGIResource
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

[Starting with Direct3D 11.1, we recommend not to use GetSharedHandle anymore to retrieve the handle to a shared resource. Instead, use IDXGIResource1::CreateSharedHandle to get a handle for sharing. To use IDXGIResource1::CreateSharedHandle, you must create the resource as shared and specify that it uses NT handles (that is, you set the D3D11_RESOURCE_MISC_SHARED_NTHANDLE flag). We also recommend that you create shared resources that use NT handles so you can use CloseHandle, DuplicateHandle, and so on on those shared resources.]

Gets the handle to a shared resource.

No documentation.

Returns one of the DXGI_ERROR values.

You can pass the handle that GetSharedHandle returns in a call to the method to give a device access to a shared resource that you created on a different device.

GetSharedHandle doesn't always return a handle. GetSharedHandle only returns the handle when you created the resource as shared (that is, you set the or flag).

The handle that GetSharedHandle returns is not an NT handle. Therefore, don't use the handle with CloseHandle, DuplicateHandle, and so on. The creator of a shared resource must not destroy the resource until all entities that opened the resource have destroyed the resource. The validity of the handle is tied to the lifetime of the underlying video memory. If no resource objects exist on any devices that refer to this resource, the handle is no longer valid. To extend the lifetime of the handle and video memory, you must open the shared resource on a device.

bb174562 HRESULT IDXGIResource::GetSharedHandle([Out] void** pSharedHandle) IDXGIResource::GetSharedHandle

Get the expected resource usage.

A reference to a usage flag (see DXGI_USAGE). For Direct3D 10, a surface can be used as a shader input or a render-target output.

Returns one of the following DXGI_ERROR.

bb174563 HRESULT IDXGIResource::GetUsage([Out] unsigned int* pUsage) IDXGIResource::GetUsage

Set the priority for evicting the resource from memory.

The priority is one of the following values:

ValueMeaning
(0x28000000)

The resource is unused and can be evicted as soon as another resource requires the memory that the resource occupies.

(0x50000000)

The eviction priority of the resource is low. The placement of the resource is not critical, and minimal work is performed to find a location for the resource. For example, if a GPU can render with a vertex buffer from either local or non-local memory with little difference in performance, that vertex buffer is low priority. Other more critical resources (for example, a render target or texture) can then occupy the faster memory.

(0x78000000)

The eviction priority of the resource is normal. The placement of the resource is important, but not critical, for performance. The resource is placed in its preferred location instead of a low-priority resource.

(0xa0000000)

The eviction priority of the resource is high. The resource is placed in its preferred location instead of a low-priority or normal-priority resource.

(0xc8000000)

The resource is evicted from memory only if there is no other way of resolving the memory requirement.

?

Returns one of the following DXGI_ERROR.

The eviction priority is a memory-management variable that is used by DXGI for determining how to populate overcommitted memory.

You can set priority levels other than the defined values when appropriate. For example, you can set a resource with a priority level of 0x78000001 to indicate that the resource is slightly above normal.

Bb174564 HRESULT IDXGIResource::SetEvictionPriority([In] unsigned int EvictionPriority) IDXGIResource::SetEvictionPriority

Get the eviction priority.

A reference to the eviction priority, which determines when a resource can be evicted from memory.

The following defined values are possible.

ValueMeaning
(0x28000000)

The resource is unused and can be evicted as soon as another resource requires the memory that the resource occupies.

(0x50000000)

The eviction priority of the resource is low. The placement of the resource is not critical, and minimal work is performed to find a location for the resource. For example, if a GPU can render with a vertex buffer from either local or non-local memory with little difference in performance, that vertex buffer is low priority. Other more critical resources (for example, a render target or texture) can then occupy the faster memory.

(0x78000000)

The eviction priority of the resource is normal. The placement of the resource is important, but not critical, for performance. The resource is placed in its preferred location instead of a low-priority resource.

(0xa0000000)

The eviction priority of the resource is high. The resource is placed in its preferred location instead of a low-priority or normal-priority resource.

(0xc8000000)

The resource is evicted from memory only if there is no other way of resolving the memory requirement.

?

Returns one of the following DXGI_ERROR.

The eviction priority is a memory-management variable that is used by DXGI to determine how to manage overcommitted memory.

Priority levels other than the defined values are used when appropriate. For example, a resource with a priority level of 0x78000001 indicates that the resource is slightly above normal.

bb174561 HRESULT IDXGIResource::GetEvictionPriority([Out] unsigned int* pEvictionPriority) IDXGIResource::GetEvictionPriority

[Starting with Direct3D 11.1, we recommend not to use GetSharedHandle anymore to retrieve the handle to a shared resource. Instead, use IDXGIResource1::CreateSharedHandle to get a handle for sharing. To use IDXGIResource1::CreateSharedHandle, you must create the resource as shared and specify that it uses NT handles (that is, you set the D3D11_RESOURCE_MISC_SHARED_NTHANDLE flag). We also recommend that you create shared resources that use NT handles so you can use CloseHandle, DuplicateHandle, and so on on those shared resources.]

Gets the handle to a shared resource.

You can pass the handle that GetSharedHandle returns in a call to the method to give a device access to a shared resource that you created on a different device.

GetSharedHandle doesn't always return a handle. GetSharedHandle only returns the handle when you created the resource as shared (that is, you set the or flag).

The handle that GetSharedHandle returns is not an NT handle. Therefore, don't use the handle with CloseHandle, DuplicateHandle, and so on. The creator of a shared resource must not destroy the resource until all entities that opened the resource have destroyed the resource. The validity of the handle is tied to the lifetime of the underlying video memory. If no resource objects exist on any devices that refer to this resource, the handle is no longer valid. To extend the lifetime of the handle and video memory, you must open the shared resource on a device.

bb174562 GetSharedHandle GetSharedHandle HRESULT IDXGIResource::GetSharedHandle([Out] void** pSharedHandle)

Get the expected resource usage.

bb174563 GetUsage GetUsage HRESULT IDXGIResource::GetUsage([Out] unsigned int* pUsage)

Get or sets the eviction priority.

The eviction priority is a memory-management variable that is used by DXGI to determine how to manage overcommitted memory.

Priority levels other than the defined values are used when appropriate. For example, a resource with a priority level of 0x78000001 indicates that the resource is slightly above normal.

bb174561 GetEvictionPriority / SetEvictionPriority GetEvictionPriority HRESULT IDXGIResource::GetEvictionPriority([Out] unsigned int* pEvictionPriority)

The interface implements methods for image-data objects.

An image-data object is a 2D section of memory, commonly called a surface. To get the surface from an output, call .

The runtime automatically creates an interface when it creates a Direct3D resource object that represents a surface. For example, the runtime creates an interface when you call or to create a 2D texture. To retrieve the interface that represents the 2D texture surface, call ID3D11Texture2D::QueryInterface or ID3D10Texture2D::QueryInterface. In this call, you must pass the identifier of . If the 2D texture has only a single MIP-map level and does not consist of an array of textures, QueryInterface succeeds and returns a reference to the interface reference. Otherwise, QueryInterface fails and does not return the reference to .

bb174565 IDXGISurface IDXGISurface
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Get a description of the surface.

A reference to the surface description (see ).

Returns if successful; otherwise, returns one of the error codes that are described in the DXGI_ERROR topic.

bb174566 HRESULT IDXGISurface::GetDesc([Out] DXGI_SURFACE_DESC* pDesc) IDXGISurface::GetDesc

Get a reference to the data contained in the surface, and deny GPU access to the surface.

A reference to the surface data (see ).

CPU read-write flags. These flags can be combined with a logical OR.

  • - Allow CPU read access.
  • - Allow CPU write access.
  • - Discard the previous contents of a resource when it is mapped.

Returns if successful; otherwise, returns one of the error codes that are described in the DXGI_ERROR topic.

Use to access a surface from the CPU. To release a mapped surface (and allow GPU access) call .

bb174567 HRESULT IDXGISurface::Map([Out] DXGI_MAPPED_RECT* pLockedRect,[In] unsigned int MapFlags) IDXGISurface::Map

Invalidate the reference to the surface retrieved by and re-enable GPU access to the resource.

Returns if successful; otherwise, returns one of the error codes that are described in the DXGI_ERROR topic.

bb174568 HRESULT IDXGISurface::Unmap() IDXGISurface::Unmap
Acquires access to the surface data. Flags specifying CPU access permissions. A for accessing the mapped data, or null on failure.. Acquires access to the surface data. Flags specifying CPU access permissions. A for accessing the mapped data, or null on failure.. Gets a swap chain back buffer. The swap chain to get the buffer from. The index of the desired buffer. The buffer interface, or null on failure.

Get a description of the surface.

bb174566 GetDesc GetDesc HRESULT IDXGISurface::GetDesc([Out] DXGI_SURFACE_DESC* pDesc)

The interface extends the by adding support for using Windows Graphics Device Interface (GDI) to render to a Microsoft DirectX Graphics Infrastructure (DXGI) surface.

This interface is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

An image-data object is a 2D section of memory, commonly called a surface. To get the surface from an output, call . Then, call QueryInterface on the object that returns to retrieve the interface.

Any object that supports also supports .

The runtime automatically creates an interface when it creates a Direct3D resource object that represents a surface. For example, the runtime creates an interface when you call or to create a 2D texture. To retrieve the interface that represents the 2D texture surface, call ID3D11Texture2D::QueryInterface or ID3D10Texture2D::QueryInterface. In this call, you must pass the identifier of . If the 2D texture has only a single MIP-map level and does not consist of an array of textures, QueryInterface succeeds and returns a reference to the interface reference. Otherwise, QueryInterface fails and does not return the reference to .

ff471343 IDXGISurface1 IDXGISurface1
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Returns a device context (DC) that allows you to render to a Microsoft DirectX Graphics Infrastructure (DXGI) surface using Windows Graphics Device Interface (GDI).

A Boolean value that specifies whether to preserve Direct3D contents in the GDI DC. TRUE directs the runtime not to preserve Direct3D contents in the GDI DC; that is, the runtime discards the Direct3D contents. guarantees that Direct3D contents are available in the GDI DC.

A reference to an handle that represents the current device context for GDI rendering.

This method is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

After you use the GetDC method to retrieve a DC, you can render to the DXGI surface by using GDI. The GetDC method readies the surface for GDI rendering and allows inter-operation between DXGI and GDI technologies.

Keep the following in mind when using this method:

  • You must create the surface by using the flag for a surface or by using the flag for swap chains, otherwise this method fails.
  • You must release the device and call the method before you issue any new Direct3D commands.
  • This method fails if an outstanding DC has already been created by this method.
  • The format for the surface or swap chain must be or .
  • On GetDC, the render target in the output merger of the Direct3D pipeline is unbound from the surface. You must call the method on the device prior to Direct3D rendering after GDI rendering.
  • Prior to resizing buffers you must release all outstanding DCs.

You can also call GetDC on the back buffer at index 0 of a swap chain by obtaining an from the swap chain. The following code illustrates the process.

 * g_pSwapChain = null;	
            * g_pSurface1 = null;	
            ...	
            //Setup the device and and swapchain	
            g_pSwapChain->GetBuffer(0, __uuidof(), (void**) &g_pSurface1);	
            g_pSurface1->GetDC( , &g_hDC );	
            ...      	
            //Draw on the DC using GDI	
            ...	
            //When finish drawing release the DC	
            g_pSurface1->ReleaseDC( null ); 
ff471345 HRESULT IDXGISurface1::GetDC([In] BOOL Discard,[Out] HDC* phdc) IDXGISurface1::GetDC

Releases the GDI device context (DC) that is associated with the current surface and allows you to use Direct3D to render.

A reference to a structure that identifies the dirty region of the surface. A dirty region is any part of the surface that you used for GDI rendering and that you want to preserve. This area is used as a performance hint to graphics subsystem in certain scenarios. Do not use this parameter to restrict rendering to the specified rectangular region. If you pass in null, ReleaseDC considers the whole surface as dirty. Otherwise, ReleaseDC uses the area specified by the as a performance hint to indicate what areas have been manipulated by GDI rendering.

You can pass a reference to an empty structure (a rectangle with no position or area) if you didn't change any content.

If this method succeeds, it returns . Otherwise, it returns an error code.

This method is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

Use the ReleaseDC method to release the DC and indicate that your application finished all GDI rendering to this surface. You must call the ReleaseDC method before you can use Direct3D to perform additional rendering.

Prior to resizing buffers you must release all outstanding DCs.

ff471346 HRESULT IDXGISurface1::ReleaseDC([In, Optional] RECT* pDirtyRect) IDXGISurface1::ReleaseDC
Releases the GDI device context (DC) associated with the current surface and allows rendering using Direct3D. The whole surface to be considered dirty. Use the ReleaseDC method to release the DC and indicate that your application has finished all GDI rendering to this surface. You must call the ReleaseDC method before you perform addition rendering using Direct3D. Prior to resizing buffers all outstanding DCs must be released. If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. HRESULT IDXGISurface1::ReleaseDC([In, Optional] RECT* pDirtyRect) Releases the GDI device context (DC) associated with the current surface and allows rendering using Direct3D. Use the ReleaseDC method to release the DC and indicate that your application has finished all GDI rendering to this surface. You must call the ReleaseDC method before you perform addition rendering using Direct3D. Prior to resizing buffers all outstanding DCs must be released. A reference to a structure that identifies the dirty region of the surface. A dirty region is any part of the surface that you have used for GDI rendering and that you want to preserve. This is used as a performance hint to graphics subsystem in certain scenarios. Do not use this parameter to restrict rendering to the specified rectangular region. The area specified by the will be used as a performance hint to indicate what areas have been manipulated by GDI rendering. If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. HRESULT IDXGISurface1::ReleaseDC([In, Optional] RECT* pDirtyRect)

An interface implements one or more surfaces for storing rendered data before presenting it to an output.

You can create a swap chain in several ways. If your application uses Direct3D, create a swap chain when you create a device by calling or . If your application does not need Direct3D, create a swap chain for use directly with DXGI by calling , IDXGIFactory2::CreateSwapChainForHwnd, IDXGIFactory2::CreateSwapChainForImmersiveWindow, or IDXGIFactory2::CreateSwapChainForCompositionSurface.

bb174569 IDXGISwapChain IDXGISwapChain
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

[Starting with Direct3D 11.1, we recommend not to use Present anymore to present a rendered image. Instead, use IDXGISwapChain1::Present1.]

Presents a rendered image to the user.

No documentation. No documentation.

Possible return values include: , or (see DXGI_ERROR), (see ), or D3DDDIERR_DEVICEREMOVED.

Note??The Present method can return either or D3DDDIERR_DEVICEREMOVED if a video card has been physically removed from the computer, or a driver upgrade for the video card has occurred.

For the best performance when flipping swap-chain buffers in a full-screen application, see Full-Screen Application Performance Hints.

Because calling Present might cause the render thread to wait on the message-pump thread, be careful when calling this method in an application that uses multiple threads. For more details, see Multithreading Considerations.

Differences between Direct3D 9 and Direct3D 10:

Specifying in the Flags parameter is analogous to in Direct3D 9.

?

For flip presentation model swap chains that you create with the DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL value set, a successful presentation unbinds back buffer 0 from the graphics pipeline, except for when you pass the flag in the Flags parameter.

Flip presentation model queue

Suppose the following frames with sync-interval values are queued from oldest (A) to newest (E) before you call Present.

A: 3, B: 0, C: 0, D: 1, E: 0

When you call Present, the runtime shows frame A for 3 vertical blank intervals, then frame D for 1 vertical blank interval, and then frame E until you submit a new presentation. The runtime discards frames C and D.

bb174576 HRESULT IDXGISwapChain::Present([In] unsigned int SyncInterval,[In] DXGI_PRESENT_FLAGS Flags) IDXGISwapChain::Present

Accesses one of the swap-chain's back buffers.

A zero-based buffer index.

If the swap chain's swap effect is , this method can only access the first buffer; for this situation, set the index to zero.

If the swap chain's swap effect is either or DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL, this method can only access read-only buffers with indexes greater than zero. Read-only back buffers have the BufferUsage member of the or DXGI_SWAP_CHAIN_DESC1 structure set to .

The type of interface used to manipulate the buffer. See remarks.

A reference to a back-buffer interface.

Returns one of the following DXGI_ERROR.

bb174570 HRESULT IDXGISwapChain::GetBuffer([In] unsigned int Buffer,[In] const GUID& riid,[Out] void** ppSurface) IDXGISwapChain::GetBuffer

Sets the display state to windowed or full screen.

A Boolean value that specifies whether to set the display state to windowed or full screen. TRUE for full screen, and for windowed.

If you pass TRUE to the Fullscreen parameter to set the display state to full screen, you can optionally set this parameter to a reference to an interface for the output target that contains the swap chain. If you set this parameter to null, DXGI will choose the output based on the swap-chain's device and the output window's placement. If you pass to Fullscreen, you must set this parameter to null.

This methods returns:

  • if the action succeeded and the swap chain was placed in the requested state.
  • if the action failed. There are many reasons why a windowed-mode swap chain cannot switch to full-screen mode. For instance:
    • The application is running over Terminal Server.
    • The output window is occluded.
    • The output window does not have keyboard focus.
    • Another application is already in full-screen mode.

    When this error is returned, an application can continue to run in windowed mode and try to switch to full-screen mode later.

  • is returned if a fullscreen/windowed mode transition is occurring when this API is called.
  • Other error codes if you run out of memory or encounter another unexpected fault; these codes may be treated as hard, non-continuable errors.

DXGI may change the display state of a swap chain in response to end user or system requests.

We recommend that you create a windowed swap chain and allow the end user to change the swap chain to full screen through SetFullscreenState; that is, do not set the Windowed member of to to force the swap chain to be full screen. However, if you create the swap chain as full screen, also provide the end user with a list of supported display modes because a swap chain that is created with an unsupported display mode might cause the display to go black and prevent the end user from seeing anything. Also, we recommend that you have a time-out confirmation screen or other fallback mechanism when you allow the end user to change display modes.

Notes for Metro style apps

If a Metro style app calls SetFullscreenState to set the display state to full screen, SetFullscreenState fails with .

You cannot call SetFullscreenState on a windowless swap chain that you created with IDXGIFactory2::CreateSwapChainForCompositionSurface.

For the flip presentation model, after you transition the display state to full screen, you must call ResizeBuffers to ensure that your call to IDXGISwapChain1::Present1 succeeds.

bb174579 HRESULT IDXGISwapChain::SetFullscreenState([In] BOOL Fullscreen,[In, Optional] IDXGIOutput* pTarget) IDXGISwapChain::SetFullscreenState

Get the state associated with full-screen mode.

A reference to a boolean whose value is either:

  • TRUE if the swap chain is in full-screen mode
  • if the swap chain is in windowed mode

A reference to the output target (see ) when the mode is full screen; otherwise null.

Returns one of the following DXGI_ERROR.

When the swap chain is in full-screen mode, a reference to the target output will be returned and its reference count will be incremented.

bb174574 HRESULT IDXGISwapChain::GetFullscreenState([Out] BOOL* pFullscreen,[Out] IDXGIOutput** ppTarget) IDXGISwapChain::GetFullscreenState

[Starting with Direct3D 11.1, we recommend not to use GetDesc anymore to get a description of the swap chain. Instead, use IDXGISwapChain1::GetDesc1.]

Get a description of the swap chain.

No documentation.

Returns one of the following DXGI_ERROR.

bb174572 HRESULT IDXGISwapChain::GetDesc([Out] DXGI_SWAP_CHAIN_DESC* pDesc) IDXGISwapChain::GetDesc

Changes the swap chain's back buffer size, format, and number of buffers. This should be called when the application window is resized.

The number of buffers in the swap chain (including all back and front buffers). This number can be different from the number of buffers with which you created the swap chain. This number can't be greater than DXGI_MAX_SWAP_CHAIN_BUFFERS. Set this number to zero to preserve the existing number of buffers in the swap chain. You can't specify greater than two buffers for the flip presentation model.

New width of the back buffer. If you specify zero, DXGI will use the width of the client area of the target window. You can't specify the width as zero if you called the IDXGIFactory2::CreateSwapChainForCompositionSurface method to create the swap chain for a composition surface.

New height of the back buffer. If you specify zero, DXGI will use the height of the client area of the target window. You can't specify the height as zero if you called the IDXGIFactory2::CreateSwapChainForCompositionSurface method to create the swap chain for a composition surface.

A -typed value for the new format of the back buffer. Set this value to to preserve the existing format of the back buffer. The flip presentation model supports a more restricted set of formats than the bit-block transfer (bitblt) model.

A combination of -typed values that are combined by using a bitwise OR operation. The resulting value specifies options for swap-chain behavior.

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

You can't resize a swap chain unless you release all outstanding references to its back buffers. You must release all of its direct and indirect references on the back buffers in order for ResizeBuffers to succeed.

Direct references are held by the application after it calls AddRef on a resource.

Indirect references are held by views to a resource, binding a view of the resource to a device context, a command list that used the resource, a command list that used a view to that resource, a command list that executed another command list that used the resource, and so on.

Before you call ResizeBuffers, ensure that the application releases all references (by calling the appropriate number of Release invocations) on the resources, any views to the resource, and any command lists that use either the resources or views, and ensure that neither the resource nor a view is still bound to a device context. You can use to ensure that all references are released. If a view is bound to a deferred context, you must discard the partially built command list as well (by calling ClearState, , then Release on the command list). After you call ResizeBuffers, you can re-query interfaces via .

For swap chains that you created with , before you call ResizeBuffers, also call on the swap chain's back-buffer surface to ensure that you have no outstanding GDI device contexts (DCs) open.

We recommend that you call ResizeBuffers when a client window is resized (that is, when an application receives a WM_SIZE message).

The only difference between ResizeBuffers in Windows Developer Preview and ResizeBuffers in Windows?7 is with flip presentation model swap chains that you create with the DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL value set. In Windows Developer Preview, you must call ResizeBuffers to realize a transition between full-screen mode and windowed mode; otherwise, your next call to the Present method fails.

bb174577 HRESULT IDXGISwapChain::ResizeBuffers([In] unsigned int BufferCount,[In] unsigned int Width,[In] unsigned int Height,[In] DXGI_FORMAT NewFormat,[In] DXGI_SWAP_CHAIN_FLAG SwapChainFlags) IDXGISwapChain::ResizeBuffers

Resizes the output target.

A reference to a structure that describes the mode, which specifies the new width, height, format, and refresh rate of the target. If the format is , ResizeTarget uses the existing format. We only recommend that you use when the swap chain is in full-screen mode as this method is not thread safe.

Returns a code that indicates success or failure. is returned if a fullscreen/windowed mode transition is occurring when this API is called. See DXGI_ERROR for additional DXGI error codes.

ResizeTarget resizes the target window when the swap chain is in windowed mode, and changes the display mode on the target output when the swap chain is in full-screen mode. Therefore, applications can call ResizeTarget to resize the target window (rather than a Microsoft Win32API such as SetWindowPos) without knowledge of the swap chain display mode.

If a Metro style app calls ResizeTarget, it fails with .

You cannot call ResizeTarget on a windowless swap chain that you created with IDXGIFactory2::CreateSwapChainForCompositionSurface.

bb174578 HRESULT IDXGISwapChain::ResizeTarget([In] const DXGI_MODE_DESC* pNewTargetParameters) IDXGISwapChain::ResizeTarget

Get the output (the display monitor) that contains the majority of the client area of the target window.

A reference to the output interface (see ).

Returns one of the following DXGI_ERROR.

If the method succeeds, the output interface will be filled and its reference count incremented. When you are finished with it, be sure to release the interface to avoid a memory leak.

The output is also owned by the adapter on which the swap chain's device was created.

You cannot call GetContainingOutput on a windowless swap chain that you created with IDXGIFactory2::CreateSwapChainForCompositionSurface.

bb174571 HRESULT IDXGISwapChain::GetContainingOutput([Out] IDXGIOutput** ppOutput) IDXGISwapChain::GetContainingOutput

Gets performance statistics about the last render frame.

A reference to a structure for the frame statistics.

Returns one of the DXGI_ERROR values.

You cannot use GetFrameStatistics for swap chains that both use the bit-block transfer (bitblt) presentation model and draw in windowed mode.

You can only use GetFrameStatistics for swap chains that either use the flip presentation model or draw in full-screen mode. You set the DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL value in the SwapEffect member of the DXGI_SWAP_CHAIN_DESC1 structure to specify that the swap chain uses the flip presentation model.

bb174573 HRESULT IDXGISwapChain::GetFrameStatistics([Out] DXGI_FRAME_STATISTICS* pStats) IDXGISwapChain::GetFrameStatistics

Gets the number of times that or IDXGISwapChain1::Present1 has been called.

No documentation.

Returns one of the DXGI_ERROR values.

For info about presentation statistics for a frame, see .

bb174575 HRESULT IDXGISwapChain::GetLastPresentCount([Out] unsigned int* pLastPresentCount) IDXGISwapChain::GetLastPresentCount
Creates a swap chain. If you attempt to create a swap chain in full-screen mode, and full-screen mode is unavailable, the swap chain will be created in windowed mode and DXGI_STATUS_OCCLUDED will be returned. If the buffer width or the buffer height are zero, the sizes will be inferred from the output window size in the swap-chain description. Since the target output cannot be chosen explicitly when the swap-chain is created, you should not create a full-screen swap chain. This can reduce presentation performance if the swap chain size and the output window size do not match. Here are two ways to ensure the sizes match: Create a windowed swap chain and then set it full-screen using . Save a reference to the swap-chain immediately after creation, and use it to get the output window size during a WM_SIZE event. Then resize the swap chain buffers (with ) during the transition from windowed to full-screen. If the swap chain is in full-screen mode, before you release it, you must use {{SetFullscreenState}} to switch it to windowed mode. For more information about releasing a swap chain, see the Destroying a Swap Chain section of {{DXGI Overview}}. a reference to a . A reference to the device that will write 2D images to the swap chain. A reference to the swap-chain description (see ). HRESULT IDXGIFactory::CreateSwapChain([In] IUnknown* pDevice,[In] DXGI_SWAP_CHAIN_DESC* pDesc,[Out] IDXGISwapChain** ppSwapChain) bb174537 HRESULT IDXGIFactory::CreateSwapChain([In] IUnknown* pDevice,[In] DXGI_SWAP_CHAIN_DESC* pDesc,[Out, Fast] IDXGISwapChain** ppSwapChain) IDXGIFactory::CreateSwapChain Access one of the swap-chain back buffers. The interface of the surface to resolve from the back buffer A zero-based buffer index. If the swap effect is not DXGI_SWAP_EFFECT_SEQUENTIAL, this method only has access to the first buffer; for this case, set the index to zero. Returns a reference to a back-buffer interface. bb174570 HRESULT IDXGISwapChain::GetBuffer([In] unsigned int Buffer,[In] const GUID& riid,[Out] void** ppSurface) IDXGISwapChain::GetBuffer

[Starting with Direct3D 11.1, we recommend not to use GetDesc anymore to get a description of the swap chain. Instead, use IDXGISwapChain1::GetDesc1.]

Get a description of the swap chain.

bb174572 GetDesc GetDesc HRESULT IDXGISwapChain::GetDesc([Out] DXGI_SWAP_CHAIN_DESC* pDesc)

Get the output (the display monitor) that contains the majority of the client area of the target window.

If the method succeeds, the output interface will be filled and its reference count incremented. When you are finished with it, be sure to release the interface to avoid a memory leak.

The output is also owned by the adapter on which the swap chain's device was created.

You cannot call GetContainingOutput on a windowless swap chain that you created with IDXGIFactory2::CreateSwapChainForCompositionSurface.

bb174571 GetContainingOutput GetContainingOutput HRESULT IDXGISwapChain::GetContainingOutput([Out] IDXGIOutput** ppOutput)

Gets performance statistics about the last render frame.

You cannot use GetFrameStatistics for swap chains that both use the bit-block transfer (bitblt) presentation model and draw in windowed mode.

You can only use GetFrameStatistics for swap chains that either use the flip presentation model or draw in full-screen mode. You set the DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL value in the SwapEffect member of the DXGI_SWAP_CHAIN_DESC1 structure to specify that the swap chain uses the flip presentation model.

bb174573 GetFrameStatistics GetFrameStatistics HRESULT IDXGISwapChain::GetFrameStatistics([Out] DXGI_FRAME_STATISTICS* pStats)

Gets the number of times that or IDXGISwapChain1::Present1 has been called.

For info about presentation statistics for a frame, see .

bb174575 GetLastPresentCount GetLastPresentCount HRESULT IDXGISwapChain::GetLastPresentCount([Out] unsigned int* pLastPresentCount)
Gets or sets a value indicating whether the swapchain is in fullscreen. true if this swapchain is in fullscreen; otherwise, false. bb174574 HRESULT IDXGISwapChain::GetFullscreenState([Out] BOOL* pFullscreen,[Out] IDXGIOutput** ppTarget) IDXGISwapChain::GetFullscreenState

Describes an adapter (or video card) by using DXGI 1.0.

The structure provides a description of an adapter. This structure is initialized by using the method.

bb173058 DXGI_ADAPTER_DESC DXGI_ADAPTER_DESC

A string that contains the adapter description.

bb173058 wchar_t Description[128] wchar_t Description

The PCI ID of the hardware vendor.

bb173058 unsigned int VendorId unsigned int VendorId

The PCI ID of the hardware device.

bb173058 unsigned int DeviceId unsigned int DeviceId

The PCI ID of the sub system.

bb173058 unsigned int SubSysId unsigned int SubSysId

The PCI ID of the revision number of the adapter.

bb173058 unsigned int Revision unsigned int Revision

The number of bytes of dedicated video memory that are not shared with the CPU.

bb173058 SIZE_T DedicatedVideoMemory SIZE_T DedicatedVideoMemory

The number of bytes of dedicated system memory that are not shared with the CPU. This memory is allocated from available system memory at boot time.

bb173058 SIZE_T DedicatedSystemMemory SIZE_T DedicatedSystemMemory

The number of bytes of shared system memory. This is the maximum value of system memory that may be consumed by the adapter during operation. Any incidental memory consumed by the driver as it manages and uses video memory is additional.

bb173058 SIZE_T SharedSystemMemory SIZE_T SharedSystemMemory

A unique value that identifies the adapter. See for a definition of the structure. is defined in dxgi.h.

bb173058 LUID AdapterLuid LUID AdapterLuid

Describes an adapter (or video card) using DXGI 1.1.

The structure provides a DXGI 1.1 description of an adapter. This structure is initialized by using the method.

ff471326 DXGI_ADAPTER_DESC1 DXGI_ADAPTER_DESC1

A string that contains the adapter description.

ff471326 wchar_t Description[128] wchar_t Description

The PCI ID of the hardware vendor.

ff471326 unsigned int VendorId unsigned int VendorId

The PCI ID of the hardware device.

ff471326 unsigned int DeviceId unsigned int DeviceId

The PCI ID of the sub system.

ff471326 unsigned int SubSysId unsigned int SubSysId

The PCI ID of the revision number of the adapter.

ff471326 unsigned int Revision unsigned int Revision

The number of bytes of dedicated video memory that are not shared with the CPU.

ff471326 SIZE_T DedicatedVideoMemory SIZE_T DedicatedVideoMemory

The number of bytes of dedicated system memory that are not shared with the CPU. This memory is allocated from available system memory at boot time.

ff471326 SIZE_T DedicatedSystemMemory SIZE_T DedicatedSystemMemory

The number of bytes of shared system memory. This is the maximum value of system memory that may be consumed by the adapter during operation. Any incidental memory consumed by the driver as it manages and uses video memory is additional.

ff471326 SIZE_T SharedSystemMemory SIZE_T SharedSystemMemory

A unique value that identifies the adapter. See for a definition of the structure. is defined in dxgi.h.

ff471326 LUID AdapterLuid LUID AdapterLuid

A value of the enumerated type that describes the adapter type. The flag is reserved.

ff471326 DXGI_ADAPTER_FLAG Flags DXGI_ADAPTER_FLAG Flags

Describes timing and presentation statistics for a frame.

You initialize the structure with the or method.

You can only use for swap chains that either use the flip presentation model or draw in full-screen mode. You set the DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL value in the SwapEffect member of the DXGI_SWAP_CHAIN_DESC1 structure to specify that the swap chain uses the flip presentation model.

The values in the PresentCount and PresentRefreshCount members indicate information about when a frame was presented on the display screen. You can use these values to determine whether a glitch occurred. The values in the SyncRefreshCount and SyncQPCTime members indicate timing information that you can use for audio and video synchronization or very precise animation. If the swap chain draws in full-screen mode, these values are based on when the computer booted. If the swap chain draws in windowed mode, these values are based on when the swap chain is created.

bb173060 DXGI_FRAME_STATISTICS DXGI_FRAME_STATISTICS

A value that represents the running total count of times that an image was presented to the monitor since the computer booted.

Note??The number of times that an image was presented to the monitor is not necessarily the same as the number of times that you called or IDXGISwapChain1::Present1.

bb173060 unsigned int PresentCount unsigned int PresentCount

A value that represents the running total count of v-blanks at which the last image was presented to the monitor and that have happened since the computer booted (for windowed mode, since the swap chain was created).

bb173060 unsigned int PresentRefreshCount unsigned int PresentRefreshCount

A value that represents the running total count of v-blanks when the scheduler last sampled the machine time by calling QueryPerformanceCounter and that have happened since the computer booted (for windowed mode, since the swap chain was created).

bb173060 unsigned int SyncRefreshCount unsigned int SyncRefreshCount

A value that represents the high-resolution performance counter timer. This value is the same as the value returned by the QueryPerformanceCounter function.

bb173060 LARGE_INTEGER SyncQPCTime LARGE_INTEGER SyncQPCTime

Reserved. Always returns 0.

bb173060 LARGE_INTEGER SyncGPUTime LARGE_INTEGER SyncGPUTime

Controls the settings of a gamma curve.

The structure is used by the method.

bb173061 DXGI_GAMMA_CONTROL DXGI_GAMMA_CONTROL

A structure with scalar values that are applied to rgb values before being sent to the gamma look up table.

bb173061 DXGI_RGB Scale DXGI_RGB Scale

A structure with offset values that are applied to the rgb values before being sent to the gamma look up table.

bb173061 DXGI_RGB Offset DXGI_RGB Offset

An array of structures that control the points of a gamma curve.

bb173061 DXGI_RGB GammaCurve[1025] DXGI_RGB GammaCurve

Controls the gamma capabilities of an adapter.

To get a list of the capabilities for controlling gamma correction, call .

bb173062 DXGI_GAMMA_CONTROL_CAPABILITIES DXGI_GAMMA_CONTROL_CAPABILITIES

True if scaling and offset operations are supported during gamma correction; otherwise, false.

bb173062 BOOL ScaleAndOffsetSupported BOOL ScaleAndOffsetSupported

A value describing the maximum range of the control-point positions.

bb173062 float MaxConvertedValue float MaxConvertedValue

A value describing the minimum range of the control-point positions.

bb173062 float MinConvertedValue float MinConvertedValue

A value describing the number of control points in the array.

bb173062 unsigned int NumGammaControlPoints unsigned int NumGammaControlPoints

An array of values describing control points; the maximum length of control points is 1025.

bb173062 float ControlPointPositions[1025] float ControlPointPositions

Describes a mapped rectangle that is used to access a surface.

The structure is initialized by the method.

bb173063 DXGI_MAPPED_RECT DXGI_MAPPED_RECT

A value that describes the width, in bytes, of the surface.

bb173063 int Pitch int Pitch

A reference to the image buffer of the surface.

bb173063 unsigned char* pBits unsigned char pBits

Describes a display mode.

The following format values are valid for display modes and when you create a bit-block transfer (bitblt) model swap chain. The valid values depend on the feature level that you are working with.

  • Feature level >= 9.1

    • (except 10.x on Windows?Vista)
    • (except 10.x on Windows?Vista)
  • Feature level >= 10.0

  • Feature level >= 11.0

You can pass one of these format values to to determine if it is a valid format for displaying on screen. If returns in the bit field to which the pFormatSupport parameter points, the format is valid for displaying on screen.

Starting with Windows Developer Preview for a flip model swap chain (that is, a swap chain that has the DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL value set in the SwapEffect member of ), you must set the Format member of to , , or .

Because of the relaxed render target creation rules that Direct3D 11 has for back buffers, applications can create a render target view from a swap chain so they can use automatic color space conversion when they render the swap chain.

bb173064 DXGI_MODE_DESC DXGI_MODE_DESC

A value that describes the resolution width. If you specify the width as zero when you call the method to create a swap chain, the runtime obtains the width from the output window and assigns this width value to the swap-chain description. You can subsequently call the method to retrieve the assigned width value.

bb173064 unsigned int Width unsigned int Width

A value describing the resolution height. If you specify the height as zero when you call the method to create a swap chain, the runtime obtains the height from the output window and assigns this height value to the swap-chain description. You can subsequently call the method to retrieve the assigned height value.

bb173064 unsigned int Height unsigned int Height

A structure describing the refresh rate in hertz

bb173064 DXGI_RATIONAL RefreshRate DXGI_RATIONAL RefreshRate

A structure describing the display format.

bb173064 DXGI_FORMAT Format DXGI_FORMAT Format

A member of the enumerated type describing the scanline drawing mode.

bb173064 DXGI_MODE_SCANLINE_ORDER ScanlineOrdering DXGI_MODE_SCANLINE_ORDER ScanlineOrdering

A member of the enumerated type describing the scaling mode.

bb173064 DXGI_MODE_SCALING Scaling DXGI_MODE_SCALING Scaling
Initializes a new instance of the structure. The width. The height. The refresh rate. The format.

Describes an output or physical connection between the adapter (video card) and a device.

The structure is initialized by the method.

bb173068 DXGI_OUTPUT_DESC DXGI_OUTPUT_DESC

A string that contains the name of the output device.

bb173068 wchar_t DeviceName[32] wchar_t DeviceName

A structure containing the bounds of the output in desktop coordinates.

bb173068 RECT DesktopCoordinates RECT DesktopCoordinates

True if the output is attached to the desktop; otherwise, false.

bb173068 BOOL AttachedToDesktop BOOL AttachedToDesktop

A member of the enumerated type describing on how an image is rotated by the output.

bb173068 DXGI_MODE_ROTATION Rotation DXGI_MODE_ROTATION Rotation

An handle that represents the display monitor. For more information, see and the Device Context.

bb173068 HMONITOR Monitor HMONITOR Monitor

Represents a rational number.

The structure operates under the following rules:

  • 0/0 is legal and will be interpreted as 0/1.
  • 0/anything is interpreted as zero.
  • If you are representing a whole number, the denominator should be 1.
bb173069 DXGI_RATIONAL DXGI_RATIONAL

An unsigned integer value representing the top of the rational number.

bb173069 unsigned int Numerator unsigned int Numerator

An unsigned integer value representing the bottom of the rational number.

bb173069 unsigned int Denominator unsigned int Denominator
An empty rational that can be used for comparisons. Initializes a new instance of the structure. The numerator of the rational pair. The denominator of the rational pair.

Describes multi-sampling parameters for a resource.

The default sampler mode, with no anti-aliasing, has a count of 1 and a quality level of 0.

If multi-sample antialiasing is being used, all bound render targets and depth buffers must have the same sample counts and quality levels.

Differences between Direct3D 10.0 and Direct3D 10.1 and between Direct3D 10.0 and Direct3D 11:

Direct3D 10.1 has defined two standard quality levels: and in the enumeration in D3D10_1.h.

Direct3D 11 has defined two standard quality levels: and in the enumeration in D3D11.h.

?

bb173072 DXGI_SAMPLE_DESC DXGI_SAMPLE_DESC

The number of multisamples per pixel.

bb173072 unsigned int Count unsigned int Count

The image quality level. The higher the quality, the lower the performance. The valid range is between zero and one less than the level returned by for Direct3D 10 or for Direct3D 11.

For Direct3D 10.1 and Direct3D 11, you can use two special quality level values. For more information about these quality level values, see Remarks.

bb173072 unsigned int Quality unsigned int Quality
Initializes a new instance of the structure. The sample count. The sample quality.

Represents a handle to a shared resource.

To create a shared surface, pass a shared-resource handle into the method.

bb173073 DXGI_SHARED_RESOURCE DXGI_SHARED_RESOURCE

A handle to a shared resource.

bb173073 void* Handle void Handle

Describes a surface.

bb173074 DXGI_SURFACE_DESC DXGI_SURFACE_DESC

A value describing the surface width.

bb173074 unsigned int Width unsigned int Width

A value describing the surface height.

bb173074 unsigned int Height unsigned int Height

A member of the enumerated type that describes the surface format.

bb173074 DXGI_FORMAT Format DXGI_FORMAT Format

A member of the structure that describes multi-sampling parameters for the surface.

bb173074 DXGI_SAMPLE_DESC SampleDesc DXGI_SAMPLE_DESC SampleDesc

Describes a swap chain.

In full-screen mode, there is a dedicated front buffer; in windowed mode, the desktop is the front buffer.

If you create a swap chain with one buffer, specifying does not cause the contents of the single buffer to be swapped with the front buffer.

For performance information about flipping swap-chain buffers in full-screen application, see Full-Screen Application Performance Hints.

bb173075 DXGI_SWAP_CHAIN_DESC DXGI_SWAP_CHAIN_DESC

A structure that describes the backbuffer display mode.

bb173075 DXGI_MODE_DESC BufferDesc DXGI_MODE_DESC BufferDesc

A structure that describes multi-sampling parameters.

bb173075 DXGI_SAMPLE_DESC SampleDesc DXGI_SAMPLE_DESC SampleDesc

A member of the DXGI_USAGE enumerated type that describes the surface usage and CPU access options for the back buffer. The back buffer can be used for shader input or render-target output.

bb173075 DXGI_USAGE_ENUM BufferUsage DXGI_USAGE_ENUM BufferUsage

A value that describes the number of buffers in the swap chain. When you call to create a full-screen swap chain, you typically include the front buffer in this value. For more information about swap-chain buffers, see Remarks.

bb173075 unsigned int BufferCount unsigned int BufferCount

An handle to the output window. This member must not be null.

bb173075 HWND OutputWindow HWND OutputWindow

A Boolean value that specifies whether the output is in windowed mode. TRUE if the output is in windowed mode; otherwise, .

We recommend that you create a windowed swap chain and allow the end user to change the swap chain to full screen through ; that is, do not set this member to to force the swap chain to be full screen. However, if you create the swap chain as full screen, also provide the end user with a list of supported display modes through the BufferDesc member because a swap chain that is created with an unsupported display mode might cause the display to go black and prevent the end user from seeing anything.

For more information about choosing windowed verses full screen, see .

bb173075 BOOL Windowed BOOL Windowed

A member of the enumerated type that describes options for handling the contents of the presentation buffer after presenting a surface.

bb173075 DXGI_SWAP_EFFECT SwapEffect DXGI_SWAP_EFFECT SwapEffect

A member of the enumerated type that describes options for swap-chain behavior.

bb173075 DXGI_SWAP_CHAIN_FLAG Flags DXGI_SWAP_CHAIN_FLAG Flags
Internal class used to initialize this assembly. Initializes this assembly. This method is called when the assembly is loaded.