Documentation
¶
Overview ¶
Package dxgi provides low-level DXGI (DirectX Graphics Infrastructure) COM bindings for Windows.
DXGI provides functionality for enumerating graphics adapters, creating swap chains, and managing display output. This package uses syscall to directly call DXGI COM vtable methods, providing a zero-CGO approach to graphics programming on Windows.
Architecture ¶
DXGI uses COM (Component Object Model) interfaces. Each interface is represented as a Go struct containing a pointer to a vtable. The vtable contains function pointers for all methods.
type IDXGIFactory6 struct {
vtbl *idxgiFactory6Vtbl
}
Usage ¶
lib, err := dxgi.LoadDXGI()
if err != nil {
log.Fatal(err)
}
factory, err := lib.CreateFactory2(dxgi.DXGI_CREATE_FACTORY_DEBUG)
if err != nil {
log.Fatal(err)
}
defer factory.Release()
adapter, err := factory.EnumAdapterByGpuPreference(0, dxgi.DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE)
if err != nil {
log.Fatal(err)
}
defer adapter.Release()
desc, err := adapter.GetDesc1()
if err != nil {
log.Fatal(err)
}
fmt.Printf("Adapter: %s\n", desc.Description())
Error Handling ¶
All COM methods that return HRESULT are wrapped to return Go errors. This package reuses d3d12.HRESULTError for consistency.
Memory Management ¶
COM objects use reference counting. Call Release() when done:
factory, _ := lib.CreateFactory2(0) defer factory.Release()
References ¶
Index ¶
- Constants
- Variables
- func IsDeviceRemovedError(err error) bool
- func IsModeChanged(err error) bool
- func IsOccluded(err error) bool
- type DXGILib
- type DXGI_ADAPTER_DESC1
- type DXGI_ADAPTER_DESC3
- type DXGI_ADAPTER_FLAG
- type DXGI_ALPHA_MODE
- type DXGI_FEATURE
- type DXGI_FORMAT
- type DXGI_FRAME_STATISTICS
- type DXGI_GPU_PREFERENCE
- type DXGI_MODE_DESC
- type DXGI_MODE_DESC1
- type DXGI_MODE_ROTATION
- type DXGI_MODE_SCALING
- type DXGI_MODE_SCANLINE_ORDER
- type DXGI_MWA
- type DXGI_OUTPUT_DESC
- type DXGI_PRESENT
- type DXGI_PRESENT_PARAMETERS
- type DXGI_RATIONAL
- type DXGI_SAMPLE_DESC
- type DXGI_SCALING
- type DXGI_SWAP_CHAIN_DESC
- type DXGI_SWAP_CHAIN_DESC1
- type DXGI_SWAP_CHAIN_FLAG
- type DXGI_SWAP_CHAIN_FULLSCREEN_DESC
- type DXGI_SWAP_EFFECT
- type DXGI_USAGE
- type GUID
- type IDXGIAdapter
- type IDXGIAdapter1
- type IDXGIAdapter4
- func (a *IDXGIAdapter4) CheckInterfaceSupport(interfaceName *GUID) (int64, error)
- func (a *IDXGIAdapter4) EnumOutputs(index uint32) (*IDXGIOutput, error)
- func (a *IDXGIAdapter4) GetDesc1() (DXGI_ADAPTER_DESC1, error)
- func (a *IDXGIAdapter4) GetDesc3() (DXGI_ADAPTER_DESC3, error)
- func (a *IDXGIAdapter4) Release() uint32
- type IDXGIFactory
- type IDXGIFactory1
- type IDXGIFactory2
- type IDXGIFactory4
- func (f *IDXGIFactory4) CreateSwapChainForHwnd(device unsafe.Pointer, hwnd uintptr, desc *DXGI_SWAP_CHAIN_DESC1, ...) (*IDXGISwapChain1, error)
- func (f *IDXGIFactory4) EnumAdapterByLuid(luid LUID) (*IDXGIAdapter1, error)
- func (f *IDXGIFactory4) EnumAdapters1(index uint32) (*IDXGIAdapter1, error)
- func (f *IDXGIFactory4) EnumWarpAdapter() (*IDXGIAdapter1, error)
- func (f *IDXGIFactory4) MakeWindowAssociation(hwnd uintptr, flags DXGI_MWA) error
- func (f *IDXGIFactory4) Release() uint32
- type IDXGIFactory5
- type IDXGIFactory6
- func (f *IDXGIFactory6) CheckFeatureSupport(feature DXGI_FEATURE, featureData unsafe.Pointer, featureDataSize uint32) error
- func (f *IDXGIFactory6) CreateSwapChainForHwnd(device unsafe.Pointer, hwnd uintptr, desc *DXGI_SWAP_CHAIN_DESC1, ...) (*IDXGISwapChain1, error)
- func (f *IDXGIFactory6) EnumAdapterByGpuPreference(index uint32, preference DXGI_GPU_PREFERENCE) (*IDXGIAdapter4, error)
- func (f *IDXGIFactory6) EnumAdapterByLuid(luid LUID) (*IDXGIAdapter4, error)
- func (f *IDXGIFactory6) EnumAdapters1(index uint32) (*IDXGIAdapter1, error)
- func (f *IDXGIFactory6) EnumWarpAdapter() (*IDXGIAdapter4, error)
- func (f *IDXGIFactory6) MakeWindowAssociation(hwnd uintptr, flags DXGI_MWA) error
- func (f *IDXGIFactory6) Release() uint32
- type IDXGIObject
- type IDXGIOutput
- type IDXGISwapChain
- type IDXGISwapChain1
- func (s *IDXGISwapChain1) GetBuffer(index uint32, riid *GUID) (unsafe.Pointer, error)
- func (s *IDXGISwapChain1) GetDesc1() (DXGI_SWAP_CHAIN_DESC1, error)
- func (s *IDXGISwapChain1) GetFullscreenState() (bool, *IDXGIOutput, error)
- func (s *IDXGISwapChain1) Present(syncInterval, flags uint32) error
- func (s *IDXGISwapChain1) QueryInterface() (*IDXGISwapChain4, error)
- func (s *IDXGISwapChain1) Release() uint32
- func (s *IDXGISwapChain1) ResizeBuffers(bufferCount, width, height uint32, format DXGI_FORMAT, flags uint32) error
- func (s *IDXGISwapChain1) SetFullscreenState(fullscreen int32, target *IDXGIOutput) error
- type IDXGISwapChain3
- func (s *IDXGISwapChain3) GetBuffer(index uint32, riid *GUID) (unsafe.Pointer, error)
- func (s *IDXGISwapChain3) GetCurrentBackBufferIndex() uint32
- func (s *IDXGISwapChain3) GetDesc1() (DXGI_SWAP_CHAIN_DESC1, error)
- func (s *IDXGISwapChain3) GetFrameLatencyWaitableObject() uintptr
- func (s *IDXGISwapChain3) Present(syncInterval, flags uint32) error
- func (s *IDXGISwapChain3) Release() uint32
- func (s *IDXGISwapChain3) ResizeBuffers(bufferCount, width, height uint32, format DXGI_FORMAT, flags uint32) error
- func (s *IDXGISwapChain3) SetMaximumFrameLatency(maxLatency uint32) error
- type IDXGISwapChain4
- func (s *IDXGISwapChain4) GetBuffer(index uint32, riid *GUID) (unsafe.Pointer, error)
- func (s *IDXGISwapChain4) GetCurrentBackBufferIndex() uint32
- func (s *IDXGISwapChain4) GetDesc1() (DXGI_SWAP_CHAIN_DESC1, error)
- func (s *IDXGISwapChain4) GetFrameLatencyWaitableObject() uintptr
- func (s *IDXGISwapChain4) GetFullscreenState() (bool, *IDXGIOutput, error)
- func (s *IDXGISwapChain4) Present(syncInterval, flags uint32) error
- func (s *IDXGISwapChain4) Present1(syncInterval, flags uint32, params *DXGI_PRESENT_PARAMETERS) error
- func (s *IDXGISwapChain4) Release() uint32
- func (s *IDXGISwapChain4) ResizeBuffers(bufferCount, width, height uint32, format DXGI_FORMAT, flags uint32) error
- func (s *IDXGISwapChain4) SetFullscreenState(fullscreen int32, target *IDXGIOutput) error
- func (s *IDXGISwapChain4) SetMaximumFrameLatency(maxLatency uint32) error
- type LUID
- type POINT
- type RECT
Constants ¶
const ( // DXGI success codes DXGI_STATUS_OCCLUDED = d3d12.HRESULTError(0x087A0001) DXGI_STATUS_CLIPPED = d3d12.HRESULTError(0x087A0002) DXGI_STATUS_NO_REDIRECTION = d3d12.HRESULTError(0x087A0004) DXGI_STATUS_NO_DESKTOP_ACCESS = d3d12.HRESULTError(0x087A0005) DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE = d3d12.HRESULTError(0x087A0006) DXGI_STATUS_MODE_CHANGED = d3d12.HRESULTError(0x087A0007) DXGI_STATUS_MODE_CHANGE_IN_PROGRESS = d3d12.HRESULTError(0x087A0008) DXGI_STATUS_UNOCCLUDED = d3d12.HRESULTError(0x087A0009) DXGI_STATUS_DDA_WAS_STILL_DRAWING = d3d12.HRESULTError(0x087A000A) DXGI_STATUS_PRESENT_REQUIRED = d3d12.HRESULTError(0x087A002F) // DXGI error codes (re-exported from d3d12 for convenience) DXGI_ERROR_INVALID_CALL = d3d12.DXGI_ERROR_INVALID_CALL DXGI_ERROR_NOT_FOUND = d3d12.DXGI_ERROR_NOT_FOUND DXGI_ERROR_MORE_DATA = d3d12.DXGI_ERROR_MORE_DATA DXGI_ERROR_UNSUPPORTED = d3d12.DXGI_ERROR_UNSUPPORTED DXGI_ERROR_DEVICE_REMOVED = d3d12.DXGI_ERROR_DEVICE_REMOVED DXGI_ERROR_DEVICE_HUNG = d3d12.DXGI_ERROR_DEVICE_HUNG DXGI_ERROR_DEVICE_RESET = d3d12.DXGI_ERROR_DEVICE_RESET DXGI_ERROR_WAS_STILL_DRAWING = d3d12.DXGI_ERROR_WAS_STILL_DRAWING DXGI_ERROR_FRAME_STATISTICS_DISJOINT = d3d12.DXGI_ERROR_FRAME_STATISTICS_DISJOINT DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE = d3d12.DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE DXGI_ERROR_DRIVER_INTERNAL_ERROR = d3d12.DXGI_ERROR_DRIVER_INTERNAL_ERROR DXGI_ERROR_NONEXCLUSIVE = d3d12.DXGI_ERROR_NONEXCLUSIVE DXGI_ERROR_NOT_CURRENTLY_AVAILABLE = d3d12.DXGI_ERROR_NOT_CURRENTLY_AVAILABLE DXGI_ERROR_REMOTE_CLIENT_DISCONNECTED = d3d12.DXGI_ERROR_REMOTE_CLIENT_DISCONNECTED DXGI_ERROR_REMOTE_OUTOFMEMORY = d3d12.DXGI_ERROR_REMOTE_OUTOFMEMORY DXGI_ERROR_ACCESS_LOST = d3d12.DXGI_ERROR_ACCESS_LOST DXGI_ERROR_WAIT_TIMEOUT = d3d12.DXGI_ERROR_WAIT_TIMEOUT DXGI_ERROR_SESSION_DISCONNECTED = d3d12.DXGI_ERROR_SESSION_DISCONNECTED DXGI_ERROR_RESTRICT_TO_OUTPUT_STALE = d3d12.DXGI_ERROR_RESTRICT_TO_OUTPUT_STALE DXGI_ERROR_CANNOT_PROTECT_CONTENT = d3d12.DXGI_ERROR_CANNOT_PROTECT_CONTENT DXGI_ERROR_ACCESS_DENIED = d3d12.DXGI_ERROR_ACCESS_DENIED DXGI_ERROR_NAME_ALREADY_EXISTS = d3d12.DXGI_ERROR_NAME_ALREADY_EXISTS DXGI_ERROR_SDK_COMPONENT_MISSING = d3d12.DXGI_ERROR_SDK_COMPONENT_MISSING DXGI_ERROR_NOT_CURRENT = d3d12.DXGI_ERROR_NOT_CURRENT DXGI_ERROR_HW_PROTECTION_OUTOFMEMORY = d3d12.DXGI_ERROR_HW_PROTECTION_OUTOFMEMORY DXGI_ERROR_DYNAMIC_CODE_POLICY_VIOLATION = d3d12.DXGI_ERROR_DYNAMIC_CODE_POLICY_VIOLATION DXGI_ERROR_NON_COMPOSITED_UI = d3d12.DXGI_ERROR_NON_COMPOSITED_UI )
DXGI-specific HRESULT error codes. These are re-exported from d3d12 package for convenience.
const (
DXGI_CREATE_FACTORY_DEBUG uint32 = 0x01
)
Factory creation flags for CreateDXGIFactory2.
Variables ¶
var IID_ID3D12Resource = GUID{ Data1: 0x696442BE, Data2: 0xA72E, Data3: 0x4059, Data4: [8]byte{0xBC, 0x79, 0x5B, 0x5C, 0x98, 0x04, 0x0F, 0xAD}, }
IID_ID3D12Resource is the interface ID for ID3D12Resource. This is a D3D12 GUID duplicated here for convenience when calling DXGI functions. {696442BE-A72E-4059-BC79-5B5C98040FAD}
var IID_IDXGIAdapter = GUID{ Data1: 0x2411E7E1, Data2: 0x12AC, Data3: 0x4CCF, Data4: [8]byte{0xBD, 0x14, 0x97, 0x98, 0xE8, 0x53, 0x4D, 0xC0}, }
IID_IDXGIAdapter is the interface ID for IDXGIAdapter. {2411E7E1-12AC-4CCF-BD14-9798E8534DC0}
var IID_IDXGIAdapter1 = GUID{ Data1: 0x29038F61, Data2: 0x3839, Data3: 0x4626, Data4: [8]byte{0x91, 0xFD, 0x08, 0x68, 0x79, 0x01, 0x1A, 0x05}, }
IID_IDXGIAdapter1 is the interface ID for IDXGIAdapter1. {29038F61-3839-4626-91FD-086879011A05}
var IID_IDXGIAdapter2 = GUID{ Data1: 0x0AA1AE0A, Data2: 0xFA0E, Data3: 0x4B84, Data4: [8]byte{0x86, 0x44, 0xE0, 0x5F, 0xF8, 0xE5, 0xAC, 0xB5}, }
IID_IDXGIAdapter2 is the interface ID for IDXGIAdapter2. {0AA1AE0A-FA0E-4B84-8644-E05FF8E5ACB5}
var IID_IDXGIAdapter3 = GUID{ Data1: 0x645967A4, Data2: 0x1392, Data3: 0x4310, Data4: [8]byte{0xA7, 0x98, 0x80, 0x53, 0xCE, 0x3E, 0x93, 0xFD}, }
IID_IDXGIAdapter3 is the interface ID for IDXGIAdapter3. {645967A4-1392-4310-A798-8053CE3E93FD}
var IID_IDXGIAdapter4 = GUID{ Data1: 0x3C8D99D1, Data2: 0x4FBF, Data3: 0x4181, Data4: [8]byte{0xA8, 0x2C, 0xAF, 0x66, 0xBF, 0x7B, 0xD2, 0x4E}, }
IID_IDXGIAdapter4 is the interface ID for IDXGIAdapter4. {3C8D99D1-4FBF-4181-A82C-AF66BF7BD24E}
var IID_IDXGIDevice = GUID{ Data1: 0x54EC77FA, Data2: 0x1377, Data3: 0x44E6, Data4: [8]byte{0x8C, 0x32, 0x88, 0xFD, 0x5F, 0x44, 0xC8, 0x4C}, }
IID_IDXGIDevice is the interface ID for IDXGIDevice. {54EC77FA-1377-44E6-8C32-88FD5F44C84C}
var IID_IDXGIDeviceSubObject = GUID{ Data1: 0x3D3E0379, Data2: 0xF9DE, Data3: 0x4D58, Data4: [8]byte{0xBB, 0x6C, 0x18, 0xD6, 0x29, 0x92, 0xF1, 0xA6}, }
IID_IDXGIDeviceSubObject is the interface ID for IDXGIDeviceSubObject. {3D3E0379-F9DE-4D58-BB6C-18D62992F1A6}
var IID_IDXGIFactory = GUID{ Data1: 0x7B7166EC, Data2: 0x21C7, Data3: 0x44AE, Data4: [8]byte{0xB2, 0x1A, 0xC9, 0xAE, 0x32, 0x1A, 0xE3, 0x69}, }
IID_IDXGIFactory is the interface ID for IDXGIFactory. {7B7166EC-21C7-44AE-B21A-C9AE321AE369}
var IID_IDXGIFactory1 = GUID{ Data1: 0x770AAE78, Data2: 0xF26F, Data3: 0x4DBA, Data4: [8]byte{0xA8, 0x29, 0x25, 0x3C, 0x83, 0xD1, 0xB3, 0x87}, }
IID_IDXGIFactory1 is the interface ID for IDXGIFactory1. {770AAE78-F26F-4DBA-A829-253C83D1B387}
var IID_IDXGIFactory2 = GUID{ Data1: 0x50C83A1C, Data2: 0xE072, Data3: 0x4C48, Data4: [8]byte{0x87, 0xB0, 0x36, 0x30, 0xFA, 0x36, 0xA6, 0xD0}, }
IID_IDXGIFactory2 is the interface ID for IDXGIFactory2. {50C83A1C-E072-4C48-87B0-3630FA36A6D0}
var IID_IDXGIFactory3 = GUID{ Data1: 0x25483823, Data2: 0xCD46, Data3: 0x4C7D, Data4: [8]byte{0x86, 0xCA, 0x47, 0xAA, 0x95, 0xB8, 0x37, 0xBD}, }
IID_IDXGIFactory3 is the interface ID for IDXGIFactory3. {25483823-CD46-4C7D-86CA-47AA95B837BD}
var IID_IDXGIFactory4 = GUID{ Data1: 0x1BC6EA02, Data2: 0xEF36, Data3: 0x464F, Data4: [8]byte{0xBF, 0x0C, 0x21, 0xCA, 0x39, 0xE5, 0x16, 0x8A}, }
IID_IDXGIFactory4 is the interface ID for IDXGIFactory4. {1BC6EA02-EF36-464F-BF0C-21CA39E5168A}
var IID_IDXGIFactory5 = GUID{ Data1: 0x7632E1F5, Data2: 0xEE65, Data3: 0x4DCA, Data4: [8]byte{0x87, 0xFD, 0x84, 0xCD, 0x75, 0xF8, 0x83, 0x8D}, }
IID_IDXGIFactory5 is the interface ID for IDXGIFactory5. {7632E1F5-EE65-4DCA-87FD-84CD75F8838D}
var IID_IDXGIFactory6 = GUID{ Data1: 0xC1B6694F, Data2: 0xFF09, Data3: 0x44A9, Data4: [8]byte{0xB0, 0x3C, 0x77, 0x90, 0x0A, 0x0A, 0x1D, 0x17}, }
IID_IDXGIFactory6 is the interface ID for IDXGIFactory6. {C1B6694F-FF09-44A9-B03C-77900A0A1D17}
var IID_IDXGIFactory7 = GUID{ Data1: 0xA4966EED, Data2: 0x76DB, Data3: 0x44DA, Data4: [8]byte{0x84, 0xC1, 0xEE, 0x9A, 0x7A, 0xFB, 0x20, 0xA8}, }
IID_IDXGIFactory7 is the interface ID for IDXGIFactory7. {A4966EED-76DB-44DA-84C1-EE9A7AFB20A8}
var IID_IDXGIObject = GUID{ Data1: 0xAEC22FB8, Data2: 0x76F3, Data3: 0x4639, Data4: [8]byte{0x9B, 0xE0, 0x28, 0xEB, 0x43, 0xA6, 0x7A, 0x2E}, }
IID_IDXGIObject is the interface ID for IDXGIObject. {AEC22FB8-76F3-4639-9BE0-28EB43A67A2E}
var IID_IDXGIOutput = GUID{ Data1: 0xAE02EEDB, Data2: 0xC735, Data3: 0x4690, Data4: [8]byte{0x8D, 0x52, 0x5A, 0x8D, 0xC2, 0x02, 0x13, 0xAA}, }
IID_IDXGIOutput is the interface ID for IDXGIOutput. {AE02EEDB-C735-4690-8D52-5A8DC20213AA}
var IID_IDXGIOutput1 = GUID{ Data1: 0x00CDDEA8, Data2: 0x939B, Data3: 0x4B83, Data4: [8]byte{0xA3, 0x40, 0xA6, 0x85, 0x22, 0x66, 0x66, 0xCC}, }
IID_IDXGIOutput1 is the interface ID for IDXGIOutput1. {00CDDEA8-939B-4B83-A340-A685226666CC}
var IID_IDXGIOutput2 = GUID{ Data1: 0x595E39D1, Data2: 0x2724, Data3: 0x4663, Data4: [8]byte{0x99, 0xB1, 0xDA, 0x96, 0x9D, 0xE2, 0x83, 0x64}, }
IID_IDXGIOutput2 is the interface ID for IDXGIOutput2. {595E39D1-2724-4663-99B1-DA969DE28364}
var IID_IDXGIOutput3 = GUID{ Data1: 0x8A6BB301, Data2: 0x7E7E, Data3: 0x41F4, Data4: [8]byte{0xA8, 0xE0, 0x5B, 0x32, 0xF7, 0xF9, 0x9B, 0x18}, }
IID_IDXGIOutput3 is the interface ID for IDXGIOutput3. {8A6BB301-7E7E-41F4-A8E0-5B32F7F99B18}
var IID_IDXGIOutput4 = GUID{ Data1: 0xDC7DCA35, Data2: 0x2196, Data3: 0x414D, Data4: [8]byte{0x9F, 0x53, 0x61, 0x78, 0x84, 0x03, 0x2A, 0x60}, }
IID_IDXGIOutput4 is the interface ID for IDXGIOutput4. {DC7DCA35-2196-414D-9F53-617884032A60}
var IID_IDXGIResource = GUID{ Data1: 0x035F3AB4, Data2: 0x482E, Data3: 0x4E50, Data4: [8]byte{0xB4, 0x1F, 0x8A, 0x7F, 0x8B, 0xD8, 0x96, 0x0B}, }
IID_IDXGIResource is the interface ID for IDXGIResource. {035F3AB4-482E-4E50-B41F-8A7F8BD8960B}
var IID_IDXGISurface = GUID{ Data1: 0xCAFCB56C, Data2: 0x6AC3, Data3: 0x4889, Data4: [8]byte{0xBF, 0x47, 0x9E, 0x23, 0xBB, 0xD2, 0x60, 0xEC}, }
IID_IDXGISurface is the interface ID for IDXGISurface. {CAFCB56C-6AC3-4889-BF47-9E23BBD260EC}
var IID_IDXGISwapChain = GUID{ Data1: 0x310D36A0, Data2: 0xD2E7, Data3: 0x4C0A, Data4: [8]byte{0xAA, 0x04, 0x6A, 0x9D, 0x23, 0xB8, 0x88, 0x6A}, }
IID_IDXGISwapChain is the interface ID for IDXGISwapChain. {310D36A0-D2E7-4C0A-AA04-6A9D23B8886A}
var IID_IDXGISwapChain1 = GUID{ Data1: 0x790A45F7, Data2: 0x0D42, Data3: 0x4876, Data4: [8]byte{0x98, 0x3A, 0x0A, 0x55, 0xCF, 0xE6, 0xF4, 0xAA}, }
IID_IDXGISwapChain1 is the interface ID for IDXGISwapChain1. {790A45F7-0D42-4876-983A-0A55CFE6F4AA}
var IID_IDXGISwapChain2 = GUID{ Data1: 0xA8BE2AC4, Data2: 0x199F, Data3: 0x4946, Data4: [8]byte{0xB3, 0x31, 0x79, 0x59, 0x9F, 0xB9, 0x8D, 0xE7}, }
IID_IDXGISwapChain2 is the interface ID for IDXGISwapChain2. {A8BE2AC4-199F-4946-B331-79599FB98DE7}
var IID_IDXGISwapChain3 = GUID{ Data1: 0x94D99BDB, Data2: 0xF1F8, Data3: 0x4AB0, Data4: [8]byte{0xB2, 0x36, 0x7D, 0xA0, 0x17, 0x0E, 0xDA, 0xB1}, }
IID_IDXGISwapChain3 is the interface ID for IDXGISwapChain3. {94D99BDB-F1F8-4AB0-B236-7DA0170EDAB1}
var IID_IDXGISwapChain4 = GUID{ Data1: 0x3D585D5A, Data2: 0xBD4A, Data3: 0x489E, Data4: [8]byte{0xB1, 0xF4, 0x3D, 0xBC, 0xB6, 0x45, 0x2F, 0xFB}, }
IID_IDXGISwapChain4 is the interface ID for IDXGISwapChain4. {3D585D5A-BD4A-489E-B1F4-3DBCB6452FFB}
Functions ¶
func IsDeviceRemovedError ¶
IsDeviceRemovedError returns true if the error indicates the device was removed.
func IsModeChanged ¶
IsModeChanged returns true if the display mode changed.
func IsOccluded ¶
IsOccluded returns true if the HRESULT indicates the window is occluded.
Types ¶
type DXGILib ¶
type DXGILib struct {
// contains filtered or unexported fields
}
DXGILib provides access to DXGI functions.
func (*DXGILib) CreateFactory1 ¶
func (lib *DXGILib) CreateFactory1() (*IDXGIFactory1, error)
CreateFactory1 creates a DXGI factory (IDXGIFactory1).
func (*DXGILib) CreateFactory2 ¶
func (lib *DXGILib) CreateFactory2(flags uint32) (*IDXGIFactory6, error)
CreateFactory2 creates a DXGI factory with debug flags (IDXGIFactory6). Use DXGI_CREATE_FACTORY_DEBUG for debug mode.
func (*DXGILib) CreateFactory4 ¶
func (lib *DXGILib) CreateFactory4(flags uint32) (*IDXGIFactory4, error)
CreateFactory4 creates a DXGI factory (IDXGIFactory4).
type DXGI_ADAPTER_DESC1 ¶
type DXGI_ADAPTER_DESC1 struct {
Description [128]uint16
VendorID uint32
DeviceID uint32
SubSysID uint32
Revision uint32
DedicatedVideoMemory uint64
DedicatedSystemMemory uint64
AdapterLuid LUID
Flags DXGI_ADAPTER_FLAG
}
DXGI_ADAPTER_DESC1 describes an adapter (graphics card).
func (*DXGI_ADAPTER_DESC1) DescriptionString ¶
func (d *DXGI_ADAPTER_DESC1) DescriptionString() string
DescriptionString returns the adapter description as a Go string.
type DXGI_ADAPTER_DESC3 ¶
type DXGI_ADAPTER_DESC3 struct {
Description [128]uint16
VendorID uint32
DeviceID uint32
SubSysID uint32
Revision uint32
DedicatedVideoMemory uint64
DedicatedSystemMemory uint64
AdapterLuid LUID
Flags DXGI_ADAPTER_FLAG
GraphicsPreemptionGranularity uint32
ComputePreemptionGranularity uint32
}
DXGI_ADAPTER_DESC3 describes an adapter with extended information.
func (*DXGI_ADAPTER_DESC3) DescriptionString ¶
func (d *DXGI_ADAPTER_DESC3) DescriptionString() string
DescriptionString returns the adapter description as a Go string.
type DXGI_ADAPTER_FLAG ¶
type DXGI_ADAPTER_FLAG uint32
DXGI_ADAPTER_FLAG specifies adapter flags.
const ( DXGI_ADAPTER_FLAG_NONE DXGI_ADAPTER_FLAG = 0 DXGI_ADAPTER_FLAG_REMOTE DXGI_ADAPTER_FLAG = 1 DXGI_ADAPTER_FLAG_SOFTWARE DXGI_ADAPTER_FLAG = 2 )
Adapter flag constants.
type DXGI_ALPHA_MODE ¶
type DXGI_ALPHA_MODE uint32
DXGI_ALPHA_MODE specifies alpha blending behavior.
const ( DXGI_ALPHA_MODE_UNSPECIFIED DXGI_ALPHA_MODE = 0 DXGI_ALPHA_MODE_PREMULTIPLIED DXGI_ALPHA_MODE = 1 DXGI_ALPHA_MODE_STRAIGHT DXGI_ALPHA_MODE = 2 DXGI_ALPHA_MODE_IGNORE DXGI_ALPHA_MODE = 3 )
Alpha mode constants.
type DXGI_FEATURE ¶
type DXGI_FEATURE uint32
DXGI_FEATURE specifies DXGI features.
const (
DXGI_FEATURE_PRESENT_ALLOW_TEARING DXGI_FEATURE = 0
)
Feature constants.
type DXGI_FORMAT ¶
type DXGI_FORMAT uint32
DXGI_FORMAT specifies the data format for resources. Note: This is also defined in d3d12 package. We define it here for DXGI-specific contexts where importing d3d12 is not desirable.
const ( DXGI_FORMAT_UNKNOWN DXGI_FORMAT = 0 DXGI_FORMAT_R32G32B32A32_TYPELESS DXGI_FORMAT = 1 DXGI_FORMAT_R32G32B32A32_FLOAT DXGI_FORMAT = 2 DXGI_FORMAT_R32G32B32A32_UINT DXGI_FORMAT = 3 DXGI_FORMAT_R32G32B32A32_SINT DXGI_FORMAT = 4 DXGI_FORMAT_R32G32B32_TYPELESS DXGI_FORMAT = 5 DXGI_FORMAT_R32G32B32_FLOAT DXGI_FORMAT = 6 DXGI_FORMAT_R32G32B32_UINT DXGI_FORMAT = 7 DXGI_FORMAT_R32G32B32_SINT DXGI_FORMAT = 8 DXGI_FORMAT_R16G16B16A16_TYPELESS DXGI_FORMAT = 9 DXGI_FORMAT_R16G16B16A16_FLOAT DXGI_FORMAT = 10 DXGI_FORMAT_R16G16B16A16_UNORM DXGI_FORMAT = 11 DXGI_FORMAT_R16G16B16A16_UINT DXGI_FORMAT = 12 DXGI_FORMAT_R16G16B16A16_SNORM DXGI_FORMAT = 13 DXGI_FORMAT_R16G16B16A16_SINT DXGI_FORMAT = 14 DXGI_FORMAT_R32G32_TYPELESS DXGI_FORMAT = 15 DXGI_FORMAT_R32G32_FLOAT DXGI_FORMAT = 16 DXGI_FORMAT_R32G32_UINT DXGI_FORMAT = 17 DXGI_FORMAT_R32G32_SINT DXGI_FORMAT = 18 DXGI_FORMAT_R32G8X24_TYPELESS DXGI_FORMAT = 19 DXGI_FORMAT_D32_FLOAT_S8X24_UINT DXGI_FORMAT = 20 DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS DXGI_FORMAT = 21 DXGI_FORMAT_X32_TYPELESS_G8X24_UINT DXGI_FORMAT = 22 DXGI_FORMAT_R10G10B10A2_TYPELESS DXGI_FORMAT = 23 DXGI_FORMAT_R10G10B10A2_UNORM DXGI_FORMAT = 24 DXGI_FORMAT_R10G10B10A2_UINT DXGI_FORMAT = 25 DXGI_FORMAT_R11G11B10_FLOAT DXGI_FORMAT = 26 DXGI_FORMAT_R8G8B8A8_TYPELESS DXGI_FORMAT = 27 DXGI_FORMAT_R8G8B8A8_UNORM DXGI_FORMAT = 28 DXGI_FORMAT_R8G8B8A8_UNORM_SRGB DXGI_FORMAT = 29 DXGI_FORMAT_R8G8B8A8_UINT DXGI_FORMAT = 30 DXGI_FORMAT_R8G8B8A8_SNORM DXGI_FORMAT = 31 DXGI_FORMAT_R8G8B8A8_SINT DXGI_FORMAT = 32 DXGI_FORMAT_R16G16_TYPELESS DXGI_FORMAT = 33 DXGI_FORMAT_R16G16_FLOAT DXGI_FORMAT = 34 DXGI_FORMAT_R16G16_UNORM DXGI_FORMAT = 35 DXGI_FORMAT_R16G16_UINT DXGI_FORMAT = 36 DXGI_FORMAT_R16G16_SNORM DXGI_FORMAT = 37 DXGI_FORMAT_R16G16_SINT DXGI_FORMAT = 38 DXGI_FORMAT_R32_TYPELESS DXGI_FORMAT = 39 DXGI_FORMAT_D32_FLOAT DXGI_FORMAT = 40 DXGI_FORMAT_R32_FLOAT DXGI_FORMAT = 41 DXGI_FORMAT_R32_UINT DXGI_FORMAT = 42 DXGI_FORMAT_R32_SINT DXGI_FORMAT = 43 DXGI_FORMAT_R24G8_TYPELESS DXGI_FORMAT = 44 DXGI_FORMAT_D24_UNORM_S8_UINT DXGI_FORMAT = 45 DXGI_FORMAT_R24_UNORM_X8_TYPELESS DXGI_FORMAT = 46 DXGI_FORMAT_X24_TYPELESS_G8_UINT DXGI_FORMAT = 47 DXGI_FORMAT_R8G8_TYPELESS DXGI_FORMAT = 48 DXGI_FORMAT_R8G8_UNORM DXGI_FORMAT = 49 DXGI_FORMAT_R8G8_UINT DXGI_FORMAT = 50 DXGI_FORMAT_R8G8_SNORM DXGI_FORMAT = 51 DXGI_FORMAT_R8G8_SINT DXGI_FORMAT = 52 DXGI_FORMAT_R16_TYPELESS DXGI_FORMAT = 53 DXGI_FORMAT_R16_FLOAT DXGI_FORMAT = 54 DXGI_FORMAT_D16_UNORM DXGI_FORMAT = 55 DXGI_FORMAT_R16_UNORM DXGI_FORMAT = 56 DXGI_FORMAT_R16_UINT DXGI_FORMAT = 57 DXGI_FORMAT_R16_SNORM DXGI_FORMAT = 58 DXGI_FORMAT_R16_SINT DXGI_FORMAT = 59 DXGI_FORMAT_R8_TYPELESS DXGI_FORMAT = 60 DXGI_FORMAT_R8_UNORM DXGI_FORMAT = 61 DXGI_FORMAT_R8_UINT DXGI_FORMAT = 62 DXGI_FORMAT_R8_SNORM DXGI_FORMAT = 63 DXGI_FORMAT_R8_SINT DXGI_FORMAT = 64 DXGI_FORMAT_A8_UNORM DXGI_FORMAT = 65 DXGI_FORMAT_R1_UNORM DXGI_FORMAT = 66 DXGI_FORMAT_R9G9B9E5_SHAREDEXP DXGI_FORMAT = 67 DXGI_FORMAT_R8G8_B8G8_UNORM DXGI_FORMAT = 68 DXGI_FORMAT_G8R8_G8B8_UNORM DXGI_FORMAT = 69 DXGI_FORMAT_BC1_TYPELESS DXGI_FORMAT = 70 DXGI_FORMAT_BC1_UNORM DXGI_FORMAT = 71 DXGI_FORMAT_BC1_UNORM_SRGB DXGI_FORMAT = 72 DXGI_FORMAT_BC2_TYPELESS DXGI_FORMAT = 73 DXGI_FORMAT_BC2_UNORM DXGI_FORMAT = 74 DXGI_FORMAT_BC2_UNORM_SRGB DXGI_FORMAT = 75 DXGI_FORMAT_BC3_TYPELESS DXGI_FORMAT = 76 DXGI_FORMAT_BC3_UNORM DXGI_FORMAT = 77 DXGI_FORMAT_BC3_UNORM_SRGB DXGI_FORMAT = 78 DXGI_FORMAT_BC4_TYPELESS DXGI_FORMAT = 79 DXGI_FORMAT_BC4_UNORM DXGI_FORMAT = 80 DXGI_FORMAT_BC4_SNORM DXGI_FORMAT = 81 DXGI_FORMAT_BC5_TYPELESS DXGI_FORMAT = 82 DXGI_FORMAT_BC5_UNORM DXGI_FORMAT = 83 DXGI_FORMAT_BC5_SNORM DXGI_FORMAT = 84 DXGI_FORMAT_B5G6R5_UNORM DXGI_FORMAT = 85 DXGI_FORMAT_B5G5R5A1_UNORM DXGI_FORMAT = 86 DXGI_FORMAT_B8G8R8A8_UNORM DXGI_FORMAT = 87 DXGI_FORMAT_B8G8R8X8_UNORM DXGI_FORMAT = 88 DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM DXGI_FORMAT = 89 DXGI_FORMAT_B8G8R8A8_TYPELESS DXGI_FORMAT = 90 DXGI_FORMAT_B8G8R8A8_UNORM_SRGB DXGI_FORMAT = 91 DXGI_FORMAT_B8G8R8X8_TYPELESS DXGI_FORMAT = 92 DXGI_FORMAT_B8G8R8X8_UNORM_SRGB DXGI_FORMAT = 93 DXGI_FORMAT_BC6H_TYPELESS DXGI_FORMAT = 94 DXGI_FORMAT_BC6H_UF16 DXGI_FORMAT = 95 DXGI_FORMAT_BC6H_SF16 DXGI_FORMAT = 96 DXGI_FORMAT_BC7_TYPELESS DXGI_FORMAT = 97 DXGI_FORMAT_BC7_UNORM DXGI_FORMAT = 98 DXGI_FORMAT_BC7_UNORM_SRGB DXGI_FORMAT = 99 DXGI_FORMAT_AYUV DXGI_FORMAT = 100 DXGI_FORMAT_Y410 DXGI_FORMAT = 101 DXGI_FORMAT_Y416 DXGI_FORMAT = 102 DXGI_FORMAT_NV12 DXGI_FORMAT = 103 DXGI_FORMAT_P010 DXGI_FORMAT = 104 DXGI_FORMAT_P016 DXGI_FORMAT = 105 DXGI_FORMAT_420_OPAQUE DXGI_FORMAT = 106 DXGI_FORMAT_YUY2 DXGI_FORMAT = 107 DXGI_FORMAT_Y210 DXGI_FORMAT = 108 DXGI_FORMAT_Y216 DXGI_FORMAT = 109 DXGI_FORMAT_NV11 DXGI_FORMAT = 110 DXGI_FORMAT_AI44 DXGI_FORMAT = 111 DXGI_FORMAT_IA44 DXGI_FORMAT = 112 DXGI_FORMAT_P8 DXGI_FORMAT = 113 DXGI_FORMAT_A8P8 DXGI_FORMAT = 114 DXGI_FORMAT_B4G4R4A4_UNORM DXGI_FORMAT = 115 DXGI_FORMAT_P208 DXGI_FORMAT = 130 DXGI_FORMAT_V208 DXGI_FORMAT = 131 DXGI_FORMAT_V408 DXGI_FORMAT = 132 DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE DXGI_FORMAT = 189 DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE DXGI_FORMAT = 190 )
DXGI format constants.
type DXGI_FRAME_STATISTICS ¶
type DXGI_FRAME_STATISTICS struct {
PresentCount uint32
PresentRefreshCount uint32
SyncRefreshCount uint32
SyncQPCTime int64 // LARGE_INTEGER
SyncGPUTime int64 // LARGE_INTEGER
}
DXGI_FRAME_STATISTICS describes frame statistics.
type DXGI_GPU_PREFERENCE ¶
type DXGI_GPU_PREFERENCE uint32
DXGI_GPU_PREFERENCE specifies which GPU to prefer.
const ( DXGI_GPU_PREFERENCE_UNSPECIFIED DXGI_GPU_PREFERENCE = 0 DXGI_GPU_PREFERENCE_MINIMUM_POWER DXGI_GPU_PREFERENCE = 1 DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE DXGI_GPU_PREFERENCE = 2 )
GPU preference constants.
type DXGI_MODE_DESC ¶
type DXGI_MODE_DESC struct {
Width uint32
Height uint32
RefreshRate DXGI_RATIONAL
Format DXGI_FORMAT
ScanlineOrdering DXGI_MODE_SCANLINE_ORDER
Scaling DXGI_MODE_SCALING
}
DXGI_MODE_DESC describes a display mode.
type DXGI_MODE_DESC1 ¶
type DXGI_MODE_DESC1 struct {
Width uint32
Height uint32
RefreshRate DXGI_RATIONAL
Format DXGI_FORMAT
ScanlineOrdering DXGI_MODE_SCANLINE_ORDER
Scaling DXGI_MODE_SCALING
Stereo int32 // BOOL
}
DXGI_MODE_DESC1 describes a display mode with stereo support.
type DXGI_MODE_ROTATION ¶
type DXGI_MODE_ROTATION uint32
DXGI_MODE_ROTATION specifies display rotation.
const ( DXGI_MODE_ROTATION_UNSPECIFIED DXGI_MODE_ROTATION = 0 DXGI_MODE_ROTATION_IDENTITY DXGI_MODE_ROTATION = 1 DXGI_MODE_ROTATION_ROTATE90 DXGI_MODE_ROTATION = 2 DXGI_MODE_ROTATION_ROTATE180 DXGI_MODE_ROTATION = 3 DXGI_MODE_ROTATION_ROTATE270 DXGI_MODE_ROTATION = 4 )
Mode rotation constants.
type DXGI_MODE_SCALING ¶
type DXGI_MODE_SCALING uint32
DXGI_MODE_SCALING specifies how images are stretched.
const ( DXGI_MODE_SCALING_UNSPECIFIED DXGI_MODE_SCALING = 0 DXGI_MODE_SCALING_CENTERED DXGI_MODE_SCALING = 1 DXGI_MODE_SCALING_STRETCHED DXGI_MODE_SCALING = 2 )
Mode scaling constants.
type DXGI_MODE_SCANLINE_ORDER ¶
type DXGI_MODE_SCANLINE_ORDER uint32
DXGI_MODE_SCANLINE_ORDER specifies the order of scanlines.
const ( DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED DXGI_MODE_SCANLINE_ORDER = 0 DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE DXGI_MODE_SCANLINE_ORDER = 1 DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST DXGI_MODE_SCANLINE_ORDER = 2 DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST DXGI_MODE_SCANLINE_ORDER = 3 )
Scanline order constants.
type DXGI_OUTPUT_DESC ¶
type DXGI_OUTPUT_DESC struct {
DeviceName [32]uint16
DesktopCoordinates RECT
AttachedToDesktop int32 // BOOL
Rotation DXGI_MODE_ROTATION
Monitor uintptr // HMONITOR
}
DXGI_OUTPUT_DESC describes an adapter output (display).
func (*DXGI_OUTPUT_DESC) DeviceNameString ¶
func (d *DXGI_OUTPUT_DESC) DeviceNameString() string
DeviceNameString returns the device name as a Go string.
type DXGI_PRESENT ¶
type DXGI_PRESENT uint32
DXGI_PRESENT specifies present options.
const ( DXGI_PRESENT_TEST DXGI_PRESENT = 0x00000001 DXGI_PRESENT_DO_NOT_SEQUENCE DXGI_PRESENT = 0x00000002 DXGI_PRESENT_RESTART DXGI_PRESENT = 0x00000004 DXGI_PRESENT_DO_NOT_WAIT DXGI_PRESENT = 0x00000008 DXGI_PRESENT_STEREO_PREFER_RIGHT DXGI_PRESENT = 0x00000010 DXGI_PRESENT_STEREO_TEMPORARY_MONO DXGI_PRESENT = 0x00000020 DXGI_PRESENT_RESTRICT_TO_OUTPUT DXGI_PRESENT = 0x00000040 DXGI_PRESENT_USE_DURATION DXGI_PRESENT = 0x00000100 DXGI_PRESENT_ALLOW_TEARING DXGI_PRESENT = 0x00000200 )
Present flag constants.
type DXGI_PRESENT_PARAMETERS ¶
type DXGI_PRESENT_PARAMETERS struct {
DirtyRectsCount uint32
DirtyRects *RECT
ScrollRect *RECT
ScrollOffset *POINT
}
DXGI_PRESENT_PARAMETERS describes present parameters.
type DXGI_RATIONAL ¶
DXGI_RATIONAL represents a rational number (numerator/denominator).
type DXGI_SAMPLE_DESC ¶
DXGI_SAMPLE_DESC describes multi-sampling parameters.
type DXGI_SCALING ¶
type DXGI_SCALING uint32
DXGI_SCALING specifies scaling behavior when the back buffer is presented.
const ( DXGI_SCALING_STRETCH DXGI_SCALING = 0 DXGI_SCALING_NONE DXGI_SCALING = 1 DXGI_SCALING_ASPECT_RATIO_STRETCH DXGI_SCALING = 2 )
Scaling constants.
type DXGI_SWAP_CHAIN_DESC ¶
type DXGI_SWAP_CHAIN_DESC struct {
BufferDesc DXGI_MODE_DESC
SampleDesc DXGI_SAMPLE_DESC
BufferUsage DXGI_USAGE
BufferCount uint32
OutputWindow uintptr // HWND
Windowed int32 // BOOL
SwapEffect DXGI_SWAP_EFFECT
Flags uint32
}
DXGI_SWAP_CHAIN_DESC describes a swap chain.
type DXGI_SWAP_CHAIN_DESC1 ¶
type DXGI_SWAP_CHAIN_DESC1 struct {
Width uint32
Height uint32
Format DXGI_FORMAT
Stereo int32 // BOOL
SampleDesc DXGI_SAMPLE_DESC
BufferUsage DXGI_USAGE
BufferCount uint32
Scaling DXGI_SCALING
SwapEffect DXGI_SWAP_EFFECT
AlphaMode DXGI_ALPHA_MODE
Flags uint32
}
DXGI_SWAP_CHAIN_DESC1 describes a swap chain (extended).
type DXGI_SWAP_CHAIN_FLAG ¶
type DXGI_SWAP_CHAIN_FLAG uint32
DXGI_SWAP_CHAIN_FLAG specifies swap chain options.
const ( DXGI_SWAP_CHAIN_FLAG_NONPREROTATED DXGI_SWAP_CHAIN_FLAG = 1 DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH DXGI_SWAP_CHAIN_FLAG = 2 DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE DXGI_SWAP_CHAIN_FLAG = 4 DXGI_SWAP_CHAIN_FLAG_RESTRICTED_CONTENT DXGI_SWAP_CHAIN_FLAG = 8 DXGI_SWAP_CHAIN_FLAG_RESTRICT_SHARED_RESOURCE_DRIVER DXGI_SWAP_CHAIN_FLAG = 16 DXGI_SWAP_CHAIN_FLAG_DISPLAY_ONLY DXGI_SWAP_CHAIN_FLAG = 32 DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT DXGI_SWAP_CHAIN_FLAG = 64 DXGI_SWAP_CHAIN_FLAG_FOREGROUND_LAYER DXGI_SWAP_CHAIN_FLAG = 128 DXGI_SWAP_CHAIN_FLAG_FULLSCREEN_VIDEO DXGI_SWAP_CHAIN_FLAG = 256 DXGI_SWAP_CHAIN_FLAG_YUV_VIDEO DXGI_SWAP_CHAIN_FLAG = 512 DXGI_SWAP_CHAIN_FLAG_HW_PROTECTED DXGI_SWAP_CHAIN_FLAG = 1024 DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING DXGI_SWAP_CHAIN_FLAG = 2048 DXGI_SWAP_CHAIN_FLAG_RESTRICTED_TO_ALL_HOLOGRAPHIC_DISPLAYS DXGI_SWAP_CHAIN_FLAG = 4096 )
Swap chain flag constants.
type DXGI_SWAP_CHAIN_FULLSCREEN_DESC ¶
type DXGI_SWAP_CHAIN_FULLSCREEN_DESC struct {
RefreshRate DXGI_RATIONAL
ScanlineOrdering DXGI_MODE_SCANLINE_ORDER
Scaling DXGI_MODE_SCALING
Windowed int32 // BOOL
}
DXGI_SWAP_CHAIN_FULLSCREEN_DESC describes fullscreen swap chain settings.
type DXGI_SWAP_EFFECT ¶
type DXGI_SWAP_EFFECT uint32
DXGI_SWAP_EFFECT specifies options for swap chain presentation behavior.
const ( DXGI_SWAP_EFFECT_DISCARD DXGI_SWAP_EFFECT = 0 DXGI_SWAP_EFFECT_SEQUENTIAL DXGI_SWAP_EFFECT = 1 DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL DXGI_SWAP_EFFECT = 3 DXGI_SWAP_EFFECT_FLIP_DISCARD DXGI_SWAP_EFFECT = 4 )
Swap effect constants.
type DXGI_USAGE ¶
type DXGI_USAGE uint32
DXGI_USAGE specifies how a surface or resource is intended to be used.
const ( DXGI_USAGE_SHADER_INPUT DXGI_USAGE = 0x00000010 DXGI_USAGE_RENDER_TARGET_OUTPUT DXGI_USAGE = 0x00000020 DXGI_USAGE_BACK_BUFFER DXGI_USAGE = 0x00000040 DXGI_USAGE_SHARED DXGI_USAGE = 0x00000080 DXGI_USAGE_READ_ONLY DXGI_USAGE = 0x00000100 DXGI_USAGE_DISCARD_ON_PRESENT DXGI_USAGE = 0x00000200 DXGI_USAGE_UNORDERED_ACCESS DXGI_USAGE = 0x00000400 )
Usage constants.
type GUID ¶
GUID represents a Windows GUID (Globally Unique Identifier). Layout must match Windows GUID structure exactly.
type IDXGIAdapter ¶
type IDXGIAdapter struct {
// contains filtered or unexported fields
}
IDXGIAdapter represents a display adapter.
type IDXGIAdapter1 ¶
type IDXGIAdapter1 struct {
// contains filtered or unexported fields
}
IDXGIAdapter1 extends IDXGIAdapter with GetDesc1.
func (*IDXGIAdapter1) CheckInterfaceSupport ¶
func (a *IDXGIAdapter1) CheckInterfaceSupport(interfaceName *GUID) (int64, error)
CheckInterfaceSupport checks if the adapter supports a specific interface. Returns the driver version if supported.
func (*IDXGIAdapter1) EnumOutputs ¶
func (a *IDXGIAdapter1) EnumOutputs(index uint32) (*IDXGIOutput, error)
EnumOutputs enumerates the adapter outputs.
func (*IDXGIAdapter1) GetDesc1 ¶
func (a *IDXGIAdapter1) GetDesc1() (DXGI_ADAPTER_DESC1, error)
GetDesc1 returns the adapter description.
func (*IDXGIAdapter1) Release ¶
func (a *IDXGIAdapter1) Release() uint32
Release decrements the reference count.
type IDXGIAdapter4 ¶
type IDXGIAdapter4 struct {
// contains filtered or unexported fields
}
IDXGIAdapter4 extends IDXGIAdapter3 with GetDesc3.
func (*IDXGIAdapter4) CheckInterfaceSupport ¶
func (a *IDXGIAdapter4) CheckInterfaceSupport(interfaceName *GUID) (int64, error)
CheckInterfaceSupport checks if the adapter supports a specific interface.
func (*IDXGIAdapter4) EnumOutputs ¶
func (a *IDXGIAdapter4) EnumOutputs(index uint32) (*IDXGIOutput, error)
EnumOutputs enumerates the adapter outputs.
func (*IDXGIAdapter4) GetDesc1 ¶
func (a *IDXGIAdapter4) GetDesc1() (DXGI_ADAPTER_DESC1, error)
GetDesc1 returns the adapter description.
func (*IDXGIAdapter4) GetDesc3 ¶
func (a *IDXGIAdapter4) GetDesc3() (DXGI_ADAPTER_DESC3, error)
GetDesc3 returns the extended adapter description.
func (*IDXGIAdapter4) Release ¶
func (a *IDXGIAdapter4) Release() uint32
Release decrements the reference count.
type IDXGIFactory ¶
type IDXGIFactory struct {
// contains filtered or unexported fields
}
IDXGIFactory represents a factory for creating DXGI objects.
type IDXGIFactory1 ¶
type IDXGIFactory1 struct {
// contains filtered or unexported fields
}
IDXGIFactory1 extends IDXGIFactory with adapter enumeration.
func (*IDXGIFactory1) EnumAdapters1 ¶
func (f *IDXGIFactory1) EnumAdapters1(index uint32) (*IDXGIAdapter1, error)
EnumAdapters1 enumerates local adapters.
func (*IDXGIFactory1) Release ¶
func (f *IDXGIFactory1) Release() uint32
Release decrements the reference count.
type IDXGIFactory2 ¶
type IDXGIFactory2 struct {
// contains filtered or unexported fields
}
IDXGIFactory2 extends IDXGIFactory1 with swap chain creation for HWND.
type IDXGIFactory4 ¶
type IDXGIFactory4 struct {
// contains filtered or unexported fields
}
IDXGIFactory4 extends IDXGIFactory3 with adapter enumeration by LUID.
func (*IDXGIFactory4) CreateSwapChainForHwnd ¶
func (f *IDXGIFactory4) CreateSwapChainForHwnd( device unsafe.Pointer, hwnd uintptr, desc *DXGI_SWAP_CHAIN_DESC1, fullscreenDesc *DXGI_SWAP_CHAIN_FULLSCREEN_DESC, restrictToOutput *IDXGIOutput, ) (*IDXGISwapChain1, error)
CreateSwapChainForHwnd creates a swap chain for an HWND.
func (*IDXGIFactory4) EnumAdapterByLuid ¶
func (f *IDXGIFactory4) EnumAdapterByLuid(luid LUID) (*IDXGIAdapter1, error)
EnumAdapterByLuid enumerates a specific adapter by LUID.
func (*IDXGIFactory4) EnumAdapters1 ¶
func (f *IDXGIFactory4) EnumAdapters1(index uint32) (*IDXGIAdapter1, error)
EnumAdapters1 enumerates local adapters.
func (*IDXGIFactory4) EnumWarpAdapter ¶
func (f *IDXGIFactory4) EnumWarpAdapter() (*IDXGIAdapter1, error)
EnumWarpAdapter enumerates the WARP (software) adapter.
func (*IDXGIFactory4) MakeWindowAssociation ¶
func (f *IDXGIFactory4) MakeWindowAssociation(hwnd uintptr, flags DXGI_MWA) error
MakeWindowAssociation associates a window with the factory.
func (*IDXGIFactory4) Release ¶
func (f *IDXGIFactory4) Release() uint32
Release decrements the reference count.
type IDXGIFactory5 ¶
type IDXGIFactory5 struct {
// contains filtered or unexported fields
}
IDXGIFactory5 extends IDXGIFactory4 with feature support check.
type IDXGIFactory6 ¶
type IDXGIFactory6 struct {
// contains filtered or unexported fields
}
IDXGIFactory6 extends IDXGIFactory5 with GPU preference enumeration.
func (*IDXGIFactory6) CheckFeatureSupport ¶
func (f *IDXGIFactory6) CheckFeatureSupport(feature DXGI_FEATURE, featureData unsafe.Pointer, featureDataSize uint32) error
CheckFeatureSupport checks for DXGI feature support.
func (*IDXGIFactory6) CreateSwapChainForHwnd ¶
func (f *IDXGIFactory6) CreateSwapChainForHwnd( device unsafe.Pointer, hwnd uintptr, desc *DXGI_SWAP_CHAIN_DESC1, fullscreenDesc *DXGI_SWAP_CHAIN_FULLSCREEN_DESC, restrictToOutput *IDXGIOutput, ) (*IDXGISwapChain1, error)
CreateSwapChainForHwnd creates a swap chain for an HWND.
func (*IDXGIFactory6) EnumAdapterByGpuPreference ¶
func (f *IDXGIFactory6) EnumAdapterByGpuPreference( index uint32, preference DXGI_GPU_PREFERENCE, ) (*IDXGIAdapter4, error)
EnumAdapterByGpuPreference enumerates adapters by GPU preference.
func (*IDXGIFactory6) EnumAdapterByLuid ¶
func (f *IDXGIFactory6) EnumAdapterByLuid(luid LUID) (*IDXGIAdapter4, error)
EnumAdapterByLuid enumerates a specific adapter by LUID.
func (*IDXGIFactory6) EnumAdapters1 ¶
func (f *IDXGIFactory6) EnumAdapters1(index uint32) (*IDXGIAdapter1, error)
EnumAdapters1 enumerates local adapters.
func (*IDXGIFactory6) EnumWarpAdapter ¶
func (f *IDXGIFactory6) EnumWarpAdapter() (*IDXGIAdapter4, error)
EnumWarpAdapter enumerates the WARP (software) adapter.
func (*IDXGIFactory6) MakeWindowAssociation ¶
func (f *IDXGIFactory6) MakeWindowAssociation(hwnd uintptr, flags DXGI_MWA) error
MakeWindowAssociation associates a window with the factory.
func (*IDXGIFactory6) Release ¶
func (f *IDXGIFactory6) Release() uint32
Release decrements the reference count.
type IDXGIObject ¶
type IDXGIObject struct {
// contains filtered or unexported fields
}
IDXGIObject is the base interface for DXGI objects.
type IDXGIOutput ¶
type IDXGIOutput struct {
// contains filtered or unexported fields
}
IDXGIOutput represents an adapter output (display).
func (*IDXGIOutput) GetDesc ¶
func (o *IDXGIOutput) GetDesc() (DXGI_OUTPUT_DESC, error)
GetDesc returns the output description.
func (*IDXGIOutput) Release ¶
func (o *IDXGIOutput) Release() uint32
Release decrements the reference count.
func (*IDXGIOutput) WaitForVBlank ¶
func (o *IDXGIOutput) WaitForVBlank() error
WaitForVBlank waits for the next vertical blank period.
type IDXGISwapChain ¶
type IDXGISwapChain struct {
// contains filtered or unexported fields
}
IDXGISwapChain represents a swap chain.
type IDXGISwapChain1 ¶
type IDXGISwapChain1 struct {
// contains filtered or unexported fields
}
IDXGISwapChain1 extends IDXGISwapChain with extended presentation.
func (*IDXGISwapChain1) GetDesc1 ¶
func (s *IDXGISwapChain1) GetDesc1() (DXGI_SWAP_CHAIN_DESC1, error)
GetDesc1 returns the swap chain description.
func (*IDXGISwapChain1) GetFullscreenState ¶
func (s *IDXGISwapChain1) GetFullscreenState() (bool, *IDXGIOutput, error)
GetFullscreenState returns the fullscreen state.
func (*IDXGISwapChain1) Present ¶
func (s *IDXGISwapChain1) Present(syncInterval, flags uint32) error
Present presents a rendered frame.
func (*IDXGISwapChain1) QueryInterface ¶
func (s *IDXGISwapChain1) QueryInterface() (*IDXGISwapChain4, error)
QueryInterface queries for IDXGISwapChain4 interface.
func (*IDXGISwapChain1) Release ¶
func (s *IDXGISwapChain1) Release() uint32
Release decrements the reference count.
func (*IDXGISwapChain1) ResizeBuffers ¶
func (s *IDXGISwapChain1) ResizeBuffers(bufferCount, width, height uint32, format DXGI_FORMAT, flags uint32) error
ResizeBuffers resizes the swap chain buffers.
func (*IDXGISwapChain1) SetFullscreenState ¶
func (s *IDXGISwapChain1) SetFullscreenState(fullscreen int32, target *IDXGIOutput) error
SetFullscreenState sets the swap chain fullscreen state.
type IDXGISwapChain3 ¶
type IDXGISwapChain3 struct {
// contains filtered or unexported fields
}
IDXGISwapChain3 extends IDXGISwapChain2 with color space and HDR support.
func (*IDXGISwapChain3) GetCurrentBackBufferIndex ¶
func (s *IDXGISwapChain3) GetCurrentBackBufferIndex() uint32
GetCurrentBackBufferIndex returns the index of the current back buffer.
func (*IDXGISwapChain3) GetDesc1 ¶
func (s *IDXGISwapChain3) GetDesc1() (DXGI_SWAP_CHAIN_DESC1, error)
GetDesc1 returns the swap chain description.
func (*IDXGISwapChain3) GetFrameLatencyWaitableObject ¶
func (s *IDXGISwapChain3) GetFrameLatencyWaitableObject() uintptr
GetFrameLatencyWaitableObject returns a waitable object for frame latency.
func (*IDXGISwapChain3) Present ¶
func (s *IDXGISwapChain3) Present(syncInterval, flags uint32) error
Present presents a rendered frame.
func (*IDXGISwapChain3) Release ¶
func (s *IDXGISwapChain3) Release() uint32
Release decrements the reference count.
func (*IDXGISwapChain3) ResizeBuffers ¶
func (s *IDXGISwapChain3) ResizeBuffers(bufferCount, width, height uint32, format DXGI_FORMAT, flags uint32) error
ResizeBuffers resizes the swap chain buffers.
func (*IDXGISwapChain3) SetMaximumFrameLatency ¶
func (s *IDXGISwapChain3) SetMaximumFrameLatency(maxLatency uint32) error
SetMaximumFrameLatency sets the maximum frame latency.
type IDXGISwapChain4 ¶
type IDXGISwapChain4 struct {
// contains filtered or unexported fields
}
IDXGISwapChain4 extends IDXGISwapChain3 with HDR metadata.
func (*IDXGISwapChain4) GetCurrentBackBufferIndex ¶
func (s *IDXGISwapChain4) GetCurrentBackBufferIndex() uint32
GetCurrentBackBufferIndex returns the index of the current back buffer.
func (*IDXGISwapChain4) GetDesc1 ¶
func (s *IDXGISwapChain4) GetDesc1() (DXGI_SWAP_CHAIN_DESC1, error)
GetDesc1 returns the swap chain description.
func (*IDXGISwapChain4) GetFrameLatencyWaitableObject ¶
func (s *IDXGISwapChain4) GetFrameLatencyWaitableObject() uintptr
GetFrameLatencyWaitableObject returns a waitable object for frame latency.
func (*IDXGISwapChain4) GetFullscreenState ¶
func (s *IDXGISwapChain4) GetFullscreenState() (bool, *IDXGIOutput, error)
GetFullscreenState returns the fullscreen state.
func (*IDXGISwapChain4) Present ¶
func (s *IDXGISwapChain4) Present(syncInterval, flags uint32) error
Present presents a rendered frame.
func (*IDXGISwapChain4) Present1 ¶ added in v0.26.1
func (s *IDXGISwapChain4) Present1(syncInterval, flags uint32, params *DXGI_PRESENT_PARAMETERS) error
Present1 presents a rendered frame with dirty rectangle information. This is IDXGISwapChain1::Present1 — requires FLIP_SEQUENTIAL swap effect for the dirty rects to be meaningful. With FLIP_DISCARD or when params is nil, this behaves identically to Present().
params.DirtyRectsCount=0 with nil DirtyRects signals full-surface update.
func (*IDXGISwapChain4) Release ¶
func (s *IDXGISwapChain4) Release() uint32
Release decrements the reference count.
func (*IDXGISwapChain4) ResizeBuffers ¶
func (s *IDXGISwapChain4) ResizeBuffers(bufferCount, width, height uint32, format DXGI_FORMAT, flags uint32) error
ResizeBuffers resizes the swap chain buffers.
func (*IDXGISwapChain4) SetFullscreenState ¶
func (s *IDXGISwapChain4) SetFullscreenState(fullscreen int32, target *IDXGIOutput) error
SetFullscreenState sets the swap chain fullscreen state.
func (*IDXGISwapChain4) SetMaximumFrameLatency ¶
func (s *IDXGISwapChain4) SetMaximumFrameLatency(maxLatency uint32) error
SetMaximumFrameLatency sets the maximum frame latency.