Class DxgiSurface1
The IDXGISurface1 interface extends the IDXGISurface by adding support for using Windows Graphics Device Interface (GDI) to render to a Microsoft DirectX Graphics Infrastructure (DXGI) surface.
Implements
Inherited Members
Namespace: JeremyAnsel.DirectX.Dxgi
Assembly: JeremyAnsel.DirectX.Dxgi.dll
Syntax
[SecurityCritical]
public class DxgiSurface1 : DxgiDeviceSubObject, IDisposable
Constructors
| Edit this page View SourceDxgiSurface1(nint)
Initializes a new instance of the DxgiSurface1 class.
Declaration
public DxgiSurface1(nint comPtr)
Parameters
| Type | Name | Description |
|---|---|---|
| nint | comPtr |
Fields
| Edit this page View SourceDxgiSurface1Guid
The interface GUID.
Declaration
public static readonly Guid DxgiSurface1Guid
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 DxgiSurface1 class.
Declaration
public static DxgiSurface1 CreateSurfaceFromResource(DXComObject resource)
Parameters
| Type | Name | Description |
|---|---|---|
| DXComObject | resource | A resource interface which implements the |
Returns
| Type | Description |
|---|---|
| DxgiSurface1 |
CreateSurfaceFromResource(nint)
Initializes a new instance of the DxgiSurface1 class.
Declaration
public static DxgiSurface1 CreateSurfaceFromResource(nint resource)
Parameters
| Type | Name | Description |
|---|---|---|
| nint | resource | A resource interface which implements the |
Returns
| Type | Description |
|---|---|
| DxgiSurface1 |
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. |
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()