d3d

package
v0.0.0-...-47b0c5d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	D3D11_USAGE_DEFAULT = 0
	D3D11_USAGE_STAGING = 3

	D3D11_CPU_ACCESS_READ = 0x20000

	D3D11_RLDO_SUMMARY         = 0x1
	D3D11_RLDO_DETAIL          = 0x2
	D3D11_RLDO_IGNORE_INTERNAL = 0x4

	D3D11_CREATE_DEVICE_DEBUG        = 0x2
	D3D11_CREATE_DEVICE_BGRA_SUPPORT = 0x20

	D3D11_SDK_VERSION = 7
)
View Source
const (
	DXGI_MAP_READ    = 1 << 0
	DXGI_MAP_WRITE   = 1 << 1
	DXGI_MAP_DISCARD = 1 << 2
)
View Source
const (
	DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MONOCHROME   DXGI_OUTDUPL_POINTER_SHAPE_TYPE = 1
	DXGI_OUTDUPL_POINTER_SHAPE_TYPE_COLOR        DXGI_OUTDUPL_POINTER_SHAPE_TYPE = 2
	DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MASKED_COLOR DXGI_OUTDUPL_POINTER_SHAPE_TYPE = 4
	DXGI_FORMAT_R8G8B8A8_UNORM                   DXGI_FORMAT                     = 28
	DXGI_FORMAT_B8G8R8A8_UNORM                   DXGI_FORMAT                     = 87
)

Variables

View Source
var ErrNoImageYet = errors.New("no image yet")

Functions

func NewD3D11Device

func NewD3D11Device() (*ID3D11Device, *ID3D11DeviceContext, error)

Types

type D3D11_BOX

type D3D11_BOX struct {
	Left, Top, Front, Right, Bottom, Back uint32
}

type D3D11_TEXTURE2D_DESC

type D3D11_TEXTURE2D_DESC struct {
	Width          uint32
	Height         uint32
	MipLevels      uint32
	ArraySize      uint32
	Format         uint32
	SampleDesc     DXGI_SAMPLE_DESC
	Usage          uint32
	BindFlags      uint32
	CPUAccessFlags uint32
	MiscFlags      uint32
}

type DXGI_FORMAT

type DXGI_FORMAT uint32

type DXGI_MAPPED_RECT

type DXGI_MAPPED_RECT struct {
	Pitch int32
	PBits uintptr
}
type DXGI_OUTDUPL_POINTER_POSITION struct {
	Position POINT
	Visible  uint32
}
type DXGI_OUTDUPL_FRAME_INFO struct {
	LastPresentTime           int64
	LastMouseUpdateTime       int64
	AccumulatedFrames         uint32
	RectsCoalesced            uint32
	ProtectedContentMaskedOut uint32
	PointerPosition           DXGI_OUTDUPL_POINTER_POSITION
	TotalMetadataBufferSize   uint32
	PointerShapeBufferSize    uint32
}

type DXGI_MODE_DESC

type DXGI_MODE_DESC struct {
	Width            uint32
	Height           uint32
	Rational         DXGI_RATIONAL
	Format           uint32 // DXGI_FORMAT
	ScanlineOrdering uint32 // DXGI_MODE_SCANLINE_ORDER
	Scaling          uint32 // DXGI_MODE_SCALING
}

type DXGI_OUTDUPL_DESC

type DXGI_OUTDUPL_DESC struct {
	ModeDesc                   DXGI_MODE_DESC
	Rotation                   uint32 // DXGI_MODE_ROTATION
	DesktopImageInSystemMemory uint32 // BOOL
}

type DXGI_OUTDUPL_FRAME_INFO

type DXGI_OUTDUPL_FRAME_INFO struct {
	LastPresentTime           int64
	LastMouseUpdateTime       int64
	AccumulatedFrames         uint32
	RectsCoalesced            uint32
	ProtectedContentMaskedOut uint32
	PointerPosition           DXGI_OUTDUPL_POINTER_POSITION
	TotalMetadataBufferSize   uint32
	PointerShapeBufferSize    uint32
}

type DXGI_OUTDUPL_MOVE_RECT

type DXGI_OUTDUPL_MOVE_RECT struct {
	Src  POINT
	Dest RECT
}

type DXGI_OUTDUPL_POINTER_POSITION

type DXGI_OUTDUPL_POINTER_POSITION struct {
	Position POINT
	Visible  uint32
}

type DXGI_OUTDUPL_POINTER_SHAPE_INFO

type DXGI_OUTDUPL_POINTER_SHAPE_INFO struct {
	Type    DXGI_OUTDUPL_POINTER_SHAPE_TYPE
	Width   uint32
	Height  uint32
	Pitch   uint32
	HotSpot POINT
}

type DXGI_OUTDUPL_POINTER_SHAPE_TYPE

type DXGI_OUTDUPL_POINTER_SHAPE_TYPE uint32

type DXGI_RATIONAL

type DXGI_RATIONAL struct {
	Numerator   uint32
	Denominator uint32
}

type DXGI_SAMPLE_DESC

type DXGI_SAMPLE_DESC struct {
	Count   uint32
	Quality uint32
}

type HRESULT

type HRESULT uint32
const (
	S_OK                                     HRESULT = 0x0
	E_INVALIDARG                             HRESULT = 0x80070057
	DXGI_STATUS_OCCLUDED                     HRESULT = 0x087A0001
	DXGI_STATUS_CLIPPED                      HRESULT = 0x087A0002
	DXGI_STATUS_NO_REDIRECTION               HRESULT = 0x087A0004
	DXGI_STATUS_NO_DESKTOP_ACCESS            HRESULT = 0x087A0005
	DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE HRESULT = 0x087A0006
	DXGI_STATUS_MODE_CHANGED                 HRESULT = 0x087A0007
	DXGI_STATUS_MODE_CHANGE_IN_PROGRESS      HRESULT = 0x087A0008
	DXGI_ERROR_INVALID_CALL                  HRESULT = 0x887A0001
	DXGI_ERROR_NOT_FOUND                     HRESULT = 0x887A0002
	DXGI_ERROR_MORE_DATA                     HRESULT = 0x887A0003
	DXGI_ERROR_UNSUPPORTED                   HRESULT = 0x887A0004
	DXGI_ERROR_DEVICE_REMOVED                HRESULT = 0x887A0005
	DXGI_ERROR_DEVICE_HUNG                   HRESULT = 0x887A0006
	DXGI_ERROR_DEVICE_RESET                  HRESULT = 0x887A0007
	DXGI_ERROR_WAS_STILL_DRAWING             HRESULT = 0x887A000A
	DXGI_ERROR_FRAME_STATISTICS_DISJOINT     HRESULT = 0x887A000B
	DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE  HRESULT = 0x887A000C
	DXGI_ERROR_DRIVER_INTERNAL_ERROR         HRESULT = 0x887A0020
	DXGI_ERROR_NONEXCLUSIVE                  HRESULT = 0x887A0021
	DXGI_ERROR_NOT_CURRENTLY_AVAILABLE       HRESULT = 0x887A0022
	DXGI_ERROR_REMOTE_CLIENT_DISCONNECTED    HRESULT = 0x887A0023
	DXGI_ERROR_REMOTE_OUTOFMEMORY            HRESULT = 0x887A0024
	DXGI_ERROR_ACCESS_LOST                   HRESULT = 0x887A0026
	DXGI_ERROR_WAIT_TIMEOUT                  HRESULT = 0x887A0027
	DXGI_ERROR_SESSION_DISCONNECTED          HRESULT = 0x887A0028
	DXGI_ERROR_RESTRICT_TO_OUTPUT_STALE      HRESULT = 0x887A0029
	DXGI_ERROR_CANNOT_PROTECT_CONTENT        HRESULT = 0x887A002A
	DXGI_ERROR_ACCESS_DENIED                 HRESULT = 0x887A002B
	DXGI_ERROR_NAME_ALREADY_EXISTS           HRESULT = 0x887A002C
	DXGI_ERROR_SDK_COMPONENT_MISSING         HRESULT = 0x887A002D
	DXGI_ERROR_NOT_CURRENT                   HRESULT = 0x887A002E
	DXGI_ERROR_HW_PROTECTION_OUTOFMEMORY     HRESULT = 0x887A0030
	DXGI_ERROR_DYNAMIC_CODE_POLICY_VIOLATION HRESULT = 0x887A0031
	DXGI_ERROR_NON_COMPOSITED_UI             HRESULT = 0x887A0032
	DXGI_STATUS_UNOCCLUDED                   HRESULT = 0x087A0009
	DXGI_STATUS_DDA_WAS_STILL_DRAWING        HRESULT = 0x087A000A
	DXGI_ERROR_MODE_CHANGE_IN_PROGRESS       HRESULT = 0x887A0025
	DXGI_STATUS_PRESENT_REQUIRED             HRESULT = 0x087A002F
	DXGI_ERROR_CACHE_CORRUPT                 HRESULT = 0x887A0033
	DXGI_ERROR_CACHE_FULL                    HRESULT = 0x887A0034
	DXGI_ERROR_CACHE_HASH_COLLISION          HRESULT = 0x887A0035
	DXGI_ERROR_ALREADY_EXISTS                HRESULT = 0x887A0036
	DXGI_DDI_ERR_WASSTILLDRAWING             HRESULT = 0x887B0001
	DXGI_DDI_ERR_UNSUPPORTED                 HRESULT = 0x887B0002
	DXGI_DDI_ERR_NONEXCLUSIVE                HRESULT = 0x887B0003
)

func (HRESULT) Error

func (e HRESULT) Error() string

func (HRESULT) String

func (i HRESULT) String() string

type ID3D11Debug

type ID3D11Debug struct {
	// contains filtered or unexported fields
}

func (*ID3D11Debug) QueryInterface

func (obj *ID3D11Debug) QueryInterface(iid windows.GUID, pp interface{}) int32

func (*ID3D11Debug) Release

func (obj *ID3D11Debug) Release() int32

func (*ID3D11Debug) ReportLiveDeviceObjects

func (obj *ID3D11Debug) ReportLiveDeviceObjects(flags uint32) int32

type ID3D11Device

type ID3D11Device struct {
	// contains filtered or unexported fields
}

func (*ID3D11Device) CreateTexture2D

func (obj *ID3D11Device) CreateTexture2D(desc *D3D11_TEXTURE2D_DESC, ppTexture2D **ID3D11Texture2D) int32

func (*ID3D11Device) QueryInterface

func (obj *ID3D11Device) QueryInterface(iid windows.GUID, pp interface{}) int32

func (*ID3D11Device) Release

func (obj *ID3D11Device) Release() int32

type ID3D11Device1

type ID3D11Device1 struct {
	// contains filtered or unexported fields
}

func (*ID3D11Device1) CreateTexture2D

func (obj *ID3D11Device1) CreateTexture2D(desc *D3D11_TEXTURE2D_DESC, ppTexture2D **ID3D11Texture2D) int32

func (*ID3D11Device1) Release

func (obj *ID3D11Device1) Release() int32

type ID3D11DeviceContext

type ID3D11DeviceContext struct {
	// contains filtered or unexported fields
}

func (*ID3D11DeviceContext) CopyResource2D

func (obj *ID3D11DeviceContext) CopyResource2D(dst, src *ID3D11Texture2D) int32

func (*ID3D11DeviceContext) CopyResourceDXGI

func (obj *ID3D11DeviceContext) CopyResourceDXGI(dst, src *IDXGIResource) int32

func (*ID3D11DeviceContext) CopySubresourceRegion

func (obj *ID3D11DeviceContext) CopySubresourceRegion(dst *ID3D11Resource, dstSubResource, dstX, dstY, dstZ uint32, src *ID3D11Resource, srcSubResource uint32, pSrcBox *D3D11_BOX) int32

func (*ID3D11DeviceContext) CopySubresourceRegion2D

func (obj *ID3D11DeviceContext) CopySubresourceRegion2D(dst *ID3D11Texture2D, dstSubResource, dstX, dstY, dstZ uint32, src *ID3D11Texture2D, srcSubResource uint32, pSrcBox *D3D11_BOX) int32

func (*ID3D11DeviceContext) Release

func (obj *ID3D11DeviceContext) Release() int32

type ID3D11InfoQueue

type ID3D11InfoQueue struct {
	// contains filtered or unexported fields
}

func (*ID3D11InfoQueue) Release

func (obj *ID3D11InfoQueue) Release() int32

type ID3D11Resource

type ID3D11Resource struct {
	// contains filtered or unexported fields
}

func (*ID3D11Resource) Release

func (obj *ID3D11Resource) Release() int32

type ID3D11Texture2D

type ID3D11Texture2D struct {
	// contains filtered or unexported fields
}

func (*ID3D11Texture2D) GetDesc

func (obj *ID3D11Texture2D) GetDesc(desc *D3D11_TEXTURE2D_DESC) int32

func (*ID3D11Texture2D) QueryInterface

func (obj *ID3D11Texture2D) QueryInterface(iid windows.GUID, pp interface{}) int32

func (*ID3D11Texture2D) Release

func (obj *ID3D11Texture2D) Release() int32

type IDXGIAdapter

type IDXGIAdapter struct {
	// contains filtered or unexported fields
}

func (*IDXGIAdapter) EnumOutputs

func (obj *IDXGIAdapter) EnumOutputs(output uint, pp **IDXGIOutput) uint32

func (*IDXGIAdapter) Release

func (obj *IDXGIAdapter) Release() int32

type IDXGIAdapter1

type IDXGIAdapter1 struct {
	// contains filtered or unexported fields
}

func (*IDXGIAdapter1) EnumOutputs

func (obj *IDXGIAdapter1) EnumOutputs(output uint, pp **IDXGIOutput) uint32

func (*IDXGIAdapter1) Release

func (obj *IDXGIAdapter1) Release() int32

type IDXGIAdapter1Vtbl

type IDXGIAdapter1Vtbl struct {
	IDXGIAdapterVtbl

	GetDesc1 uintptr
}

type IDXGIAdapterVtbl

type IDXGIAdapterVtbl struct {
	EnumOutputs           uintptr
	GetDesc               uintptr
	CheckInterfaceSupport uintptr
	// contains filtered or unexported fields
}

type IDXGIDevice

type IDXGIDevice struct {
	// contains filtered or unexported fields
}

func (*IDXGIDevice) GetAdapter

func (obj *IDXGIDevice) GetAdapter(pAdapter **IDXGIAdapter) int32

func (*IDXGIDevice) GetGPUThreadPriority

func (obj *IDXGIDevice) GetGPUThreadPriority(priority *int) int32

func (*IDXGIDevice) GetParent

func (obj *IDXGIDevice) GetParent(iid windows.GUID, pp *unsafe.Pointer) int32

func (*IDXGIDevice) QueryInterface

func (obj *IDXGIDevice) QueryInterface(iid windows.GUID, pp interface{}) int32

func (*IDXGIDevice) Release

func (obj *IDXGIDevice) Release() int32

type IDXGIDevice1

type IDXGIDevice1 struct {
	// contains filtered or unexported fields
}

func (*IDXGIDevice1) GetAdapter

func (obj *IDXGIDevice1) GetAdapter(pAdapter *IDXGIAdapter) int32

func (*IDXGIDevice1) GetParent

func (obj *IDXGIDevice1) GetParent(iid windows.GUID, pp *unsafe.Pointer) int32

func (*IDXGIDevice1) QueryInterface

func (obj *IDXGIDevice1) QueryInterface(iid windows.GUID, pp interface{}) int32

func (*IDXGIDevice1) Release

func (obj *IDXGIDevice1) Release() int32

type IDXGIFactory1

type IDXGIFactory1 struct {
	// contains filtered or unexported fields
}

func (*IDXGIFactory1) EnumAdapters1

func (obj *IDXGIFactory1) EnumAdapters1(adapter uint, pp **IDXGIAdapter1) int32

func (*IDXGIFactory1) Release

func (obj *IDXGIFactory1) Release() int32

type IDXGIOutput

type IDXGIOutput struct {
	// contains filtered or unexported fields
}

func (*IDXGIOutput) GetParent

func (obj *IDXGIOutput) GetParent(iid windows.GUID, pp *unsafe.Pointer) int32

func (*IDXGIOutput) QueryInterface

func (obj *IDXGIOutput) QueryInterface(iid windows.GUID, pp interface{}) int32

func (*IDXGIOutput) Release

func (obj *IDXGIOutput) Release() int32

type IDXGIOutput1

type IDXGIOutput1 struct {
	// contains filtered or unexported fields
}

func (*IDXGIOutput1) DuplicateOutput

func (obj *IDXGIOutput1) DuplicateOutput(device1 *IDXGIDevice1, ppOutputDuplication **IDXGIOutputDuplication) int32

func (*IDXGIOutput1) GetParent

func (obj *IDXGIOutput1) GetParent(iid windows.GUID, pp *unsafe.Pointer) int32

func (*IDXGIOutput1) Release

func (obj *IDXGIOutput1) Release() int32

type IDXGIOutput5

type IDXGIOutput5 struct {
	// contains filtered or unexported fields
}

func (*IDXGIOutput5) DuplicateOutput1

func (obj *IDXGIOutput5) DuplicateOutput1(device1 *IDXGIDevice1, flags uint, pSupportedFormats []DXGI_FORMAT, ppOutputDuplication **IDXGIOutputDuplication) int32

func (*IDXGIOutput5) GetParent

func (obj *IDXGIOutput5) GetParent(iid windows.GUID, pp *unsafe.Pointer) int32

func (*IDXGIOutput5) Release

func (obj *IDXGIOutput5) Release() int32

type IDXGIOutputDuplication

type IDXGIOutputDuplication struct {
	// contains filtered or unexported fields
}

func (*IDXGIOutputDuplication) AcquireNextFrame

func (obj *IDXGIOutputDuplication) AcquireNextFrame(timeoutMs uint, pFrameInfo *DXGI_OUTDUPL_FRAME_INFO, ppDesktopResource **IDXGIResource) uint32

func (*IDXGIOutputDuplication) AddRef

func (obj *IDXGIOutputDuplication) AddRef() uint32

func (*IDXGIOutputDuplication) GetDesc

func (obj *IDXGIOutputDuplication) GetDesc(desc *DXGI_OUTDUPL_DESC) int32

func (*IDXGIOutputDuplication) GetFrameDirtyRects

func (obj *IDXGIOutputDuplication) GetFrameDirtyRects(buffer []RECT, rectsRequired *uint32) int32

func (*IDXGIOutputDuplication) GetFrameMoveRects

func (obj *IDXGIOutputDuplication) GetFrameMoveRects(buffer []DXGI_OUTDUPL_MOVE_RECT, rectsRequired *uint32) int32

func (*IDXGIOutputDuplication) GetFramePointerShape

func (obj *IDXGIOutputDuplication) GetFramePointerShape(pointerShapeBufferSize uint32,
	pPointerShapeBuffer []byte,
	pPointerShapeBufferSizeRequired *uint32,
	pPointerShapeInfo *DXGI_OUTDUPL_POINTER_SHAPE_INFO) int32

func (*IDXGIOutputDuplication) MapDesktopSurface

func (obj *IDXGIOutputDuplication) MapDesktopSurface(pLockedRect *DXGI_MAPPED_RECT) int32

func (*IDXGIOutputDuplication) Release

func (obj *IDXGIOutputDuplication) Release() uint32

func (*IDXGIOutputDuplication) ReleaseFrame

func (obj *IDXGIOutputDuplication) ReleaseFrame()

func (*IDXGIOutputDuplication) UnMapDesktopSurface

func (obj *IDXGIOutputDuplication) UnMapDesktopSurface() int32

type IDXGIResource

type IDXGIResource struct {
	// contains filtered or unexported fields
}

func (*IDXGIResource) QueryInterface

func (obj *IDXGIResource) QueryInterface(iid windows.GUID, pp interface{}) int32

func (*IDXGIResource) Release

func (obj *IDXGIResource) Release() int32

type IDXGISurface

type IDXGISurface struct {
	// contains filtered or unexported fields
}

func (*IDXGISurface) Map

func (obj *IDXGISurface) Map(pLockedRect *DXGI_MAPPED_RECT, mapFlags uint32) int32

func (*IDXGISurface) QueryInterface

func (obj *IDXGISurface) QueryInterface(iid windows.GUID, pp interface{}) int32

func (*IDXGISurface) Release

func (obj *IDXGISurface) Release() int32

func (*IDXGISurface) Unmap

func (obj *IDXGISurface) Unmap() int32

type OutputDuplicator

type OutputDuplicator struct {
	DrawPointer bool
	// contains filtered or unexported fields
}

func NewIDXGIOutputDuplication

func NewIDXGIOutputDuplication(device *ID3D11Device, deviceCtx *ID3D11DeviceContext, output uint) (*OutputDuplicator, error)

NewXASession casts your ppv from above to a *XASession

func (*OutputDuplicator) GetImage

func (dup *OutputDuplicator) GetImage(img *image.RGBA, timeoutMs uint, cursor bool) error

func (*OutputDuplicator) Release

func (dup *OutputDuplicator) Release()

func (*OutputDuplicator) ReleaseFrame

func (dup *OutputDuplicator) ReleaseFrame()

func (*OutputDuplicator) Snapshot

func (dup *OutputDuplicator) Snapshot(timeoutMs uint) (unmapFn, *DXGI_MAPPED_RECT, *POINT, error)

returns DXGI_FORMAT_B8G8R8A8_UNORM data

func (*OutputDuplicator) Snapshot2

func (dup *OutputDuplicator) Snapshot2(timeoutMs uint) (unmapFn, *DXGI_MAPPED_RECT, *POINT, error)

returns DXGI_FORMAT_B8G8R8A8_UNORM data

type POINT

type POINT struct {
	X int32
	Y int32
}

type PointerInfo

type PointerInfo struct {
	// contains filtered or unexported fields
}

type RECT

type RECT struct {
	Left, Top, Right, Bottom int32
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL