Class DxgiSurface3
The IDXGISurface2 interface extends the IDXGISurface1 interface by adding support for sub-resource surfaces and getting a handle to a shared resource.
Implements
Inherited Members
Namespace: JeremyAnsel.DirectX.Dxgi
Assembly: JeremyAnsel.DirectX.Dxgi.dll
Syntax
[SecurityCritical]
public class DxgiSurface3 : DxgiDeviceSubObject, IDisposable
Constructors
| Edit this page View SourceDxgiSurface3(nint)
Initializes a new instance of the DxgiSurface3 class.
Declaration
public DxgiSurface3(nint comPtr)
Parameters
| Type | Name | Description |
|---|---|---|
| nint | comPtr |
Fields
| Edit this page View SourceDxgiSurface3Guid
The interface GUID.
Declaration
public static readonly Guid DxgiSurface3Guid
Field Value
| Type | Description |
|---|---|
| Guid |
Properties
| Edit this page View SourceDescription
Gets a description of the surface.
Declaration
public DxgiSurfaceDesc Description { get; }
Property Value
| Type | Description |
|---|---|
| DxgiSurfaceDesc |
Methods
| Edit this page View SourceCreateSurfaceFromResource(DXComObject)
Initializes a new instance of the DxgiSurface3 class.
Declaration
public static DxgiSurface3 CreateSurfaceFromResource(DXComObject resource)
Parameters
| Type | Name | Description |
|---|---|---|
| DXComObject | resource | A resource interface which implements the |
Returns
| Type | Description |
|---|---|
| DxgiSurface3 |
CreateSurfaceFromResource(nint)
Initializes a new instance of the DxgiSurface3 class.
Declaration
public static DxgiSurface3 CreateSurfaceFromResource(nint resource)
Parameters
| Type | Name | Description |
|---|---|---|
| nint | resource | A resource interface which implements the |
Returns
| Type | Description |
|---|---|
| DxgiSurface3 |
GetDC(bool)
Returns a device context (DC) that allows you to render to a Microsoft DirectX Graphics Infrastructure (DXGI) surface using Windows Graphics Device Interface (GDI).
Declaration
public nint GetDC(bool discard)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | discard | A value indicating whether to preserve Direct3D contents in the GDI DC. |
Returns
| Type | Description |
|---|---|
| nint | An HDC handle that represents the current device context for GDI rendering. |
GetResource(in Guid)
Gets the parent resource and subresource index that support a subresource surface.
Declaration
public nint GetResource(in Guid iid)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | iid | The globally unique identifier (GUID) of the requested interface type. |
Returns
| Type | Description |
|---|---|
| nint | A pointer to the parent resource object for the subresource surface. |
GetResource(in Guid, out uint)
Gets the parent resource and subresource index that support a subresource surface.
Declaration
public nint GetResource(in Guid iid, out uint subressourceIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | iid | The globally unique identifier (GUID) of the requested interface type. |
| uint | subressourceIndex | A pointer to a variable that receives the index of the subresource surface. |
Returns
| Type | Description |
|---|---|
| nint | A pointer to the parent resource object for the subresource surface. |
Map(DxgiMapOptions)
Get a pointer to the data contained in the surface, and deny GPU access to the surface.
Declaration
public DxgiMappedRect Map(DxgiMapOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| DxgiMapOptions | options | CPU read-write flags. These flags can be combined with a logical OR. |
Returns
| Type | Description |
|---|---|
| DxgiMappedRect | The surface data. |
ReleaseDC(in DxgiRect?)
Releases the GDI device context (DC) that is associated with the current surface and allows you to use Direct3D to render.
Declaration
public void ReleaseDC(in DxgiRect? dirtyRect)
Parameters
| Type | Name | Description |
|---|---|---|
| DxgiRect? | dirtyRect | A RECT 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. |
Unmap()
Invalidate the pointer to the surface retrieved by IDXGISurface::Map and re-enable GPU access to the resource.
Declaration
public void Unmap()