// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0 > or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT >, at your option.
// All files in the project carrying such notice may not be copied, modified, or distributed
// except according to those terms.
//! Mappings for the contents of dxgi1_2.h
use ctypes::c_void;
use shared::basetsd::SIZE_T;
use shared::dxgi::{
DXGI_MAPPED_RECT, DXGI_SWAP_EFFECT, IDXGIAdapter1, IDXGIAdapter1Vtbl, IDXGIDevice1,
IDXGIDevice1Vtbl, IDXGIFactory1, IDXGIFactory1Vtbl, IDXGIObject, IDXGIObjectVtbl, IDX
GIOutput,
IDXGIOutputVtbl, IDXGIResource, IDXGIResourceVtbl, IDXGISurface1, IDXGISurface1Vtbl,
IDXGISwapChain, IDXGISwapChainVtbl,
};
use shared::dxgiformat::DXGI_FORMAT;
use shared::dxgitype::{
DXGI_MODE_DESC, DXGI_MODE_ROTATION, DXGI_MODE_SCALING, DXGI_MODE_SCANLINE_ORDER, DXGI_RATIONAL,
DXGI_RGBA, DXGI_SAMPLE_DESC, DXGI_USAGE,
};
use shared::guiddef::REFGUID;
use shared::minwindef::{BOOL, DWORD, UINT};
use shared::windef::{HWND, POINT, RECT};
use um::minwinbase::SECURITY_ATTRIBUTES;
use um::unknwnbase::{IUnknown, IUnknownVtbl};
use um::winnt::{HANDLE, HRESULT, LARGE_INTEGER, LPCWSTR, LUID, WCHAR};
ENUM !{enum DXGI_ALPHA_MODE {
DXGI_ALPHA_MODE_UNSPECIFIED = 0 ,
DXGI_ALPHA_MODE_PREMULTIPLIED = 1 ,
DXGI_ALPHA_MODE_STRAIGHT = 2 ,
DXGI_ALPHA_MODE_IGNORE = 3 ,
DXGI_ALPHA_MODE_FORCE_DWORD = 0 xFFFFFFFF,
}}
ENUM !{enum DXGI_COMPUTE_PREEMPTION_GRANULARITY {
DXGI_COMPUTE_PREEMPTION_DMA_BUFFER_BOUNDARY = 0 ,
DXGI_COMPUTE_PREEMPTION_DISPATCH_BOUNDARY = 1 ,
DXGI_COMPUTE_PREEMPTION_THREAD_GROUP_BOUNDARY = 2 ,
DXGI_COMPUTE_PREEMPTION_THREAD_BOUNDARY = 3 ,
DXGI_COMPUTE_PREEMPTION_INSTRUCTION_BOUNDARY = 4 ,
}}
ENUM !{enum DXGI_GRAPHICS_PREEMPTION_GRANULARITY {
DXGI_GRAPHICS_PREEMPTION_DMA_BUFFER_BOUNDARY = 0 ,
DXGI_GRAPHICS_PREEMPTION_PRIMITIVE_BOUNDARY = 1 ,
DXGI_GRAPHICS_PREEMPTION_TRIANGLE_BOUNDARY = 2 ,
DXGI_GRAPHICS_PREEMPTION_PIXEL_BOUNDARY = 3 ,
DXGI_GRAPHICS_PREEMPTION_INSTRUCTION_BOUNDARY = 4 ,
}}
ENUM !{enum DXGI_OUTDUPL_POINTER_SHAPE_TYPE {
DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MONOCHROME = 1 ,
DXGI_OUTDUPL_POINTER_SHAPE_TYPE_COLOR = 2 ,
DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MASKED_COLOR = 4 ,
}}
ENUM !{enum DXGI_SCALING {
DXGI_SCALING_STRETCH = 0 ,
DXGI_SCALING_NONE = 1 ,
DXGI_SCALING_ASPECT_RATIO_STRETCH = 2 ,
}}
ENUM !{enum _DXGI_OFFER_RESOURCE_PRIORITY {
DXGI_OFFER_RESOURCE_PRIORITY_LOW = 1 ,
DXGI_OFFER_RESOURCE_PRIORITY_NORMAL = 2 ,
DXGI_OFFER_RESOURCE_PRIORITY_HIGH = 3 ,
}}
STRUCT !{struct DXGI_ADAPTER_DESC2 {
Description: [WCHAR; 128 ],
VendorId: UINT,
DeviceId: UINT,
SubSysId: UINT,
Revision: UINT,
DedicatedVideoMemory: SIZE_T,
DedicatedSystemMemory: SIZE_T,
SharedSystemMemory: SIZE_T,
AdapterLuid: LUID,
Flags: UINT,
GraphicsPreemptionGranularity: DXGI_GRAPHICS_PREEMPTION_GRANULARITY,
ComputePreemptionGranularity: DXGI_COMPUTE_PREEMPTION_GRANULARITY,
}}
STRUCT !{struct DXGI_MODE_DESC1 {
Width: UINT,
Height: UINT,
RefreshRate: DXGI_RATIONAL,
Format: DXGI_FORMAT,
ScanlineOrdering: DXGI_MODE_SCANLINE_ORDER,
Scaling: DXGI_MODE_SCALING,
Stereo: BOOL,
}}
STRUCT !{struct DXGI_OUTDUPL_DESC {
ModeDesc: DXGI_MODE_DESC,
Rotation: DXGI_MODE_ROTATION,
DesktopImageInSystemMemory: BOOL,
}}
STRUCT !{struct DXGI_OUTDUPL_FRAME_INFO {
LastPresentTime: LARGE_INTEGER,
LastMouseUpdateTime: LARGE_INTEGER,
AccumulatedFrames: UINT,
RectsCoalesced: BOOL,
ProtectedContentMaskedOut: BOOL,
PointerPosition: DXGI_OUTDUPL_POINTER_POSITION,
TotalMetadataBufferSize: UINT,
PointerShapeBufferSize: UINT,
}}
STRUCT !{struct DXGI_OUTDUPL_MOVE_RECT {
SourcePoint: POINT,
DestinationRect: RECT,
}}
STRUCT !{struct DXGI_OUTDUPL_POINTER_POSITION {
Position: POINT,
Visible: BOOL,
}}
STRUCT !{struct DXGI_OUTDUPL_POINTER_SHAPE_INFO {
Type : UINT,
Width: UINT,
Height: UINT,
Pitch: UINT,
HotSpot: POINT,
}}
STRUCT !{struct DXGI_PRESENT_PARAMETERS {
DirtyRectsCount: UINT,
pDirtyRects: *mut RECT,
pScrollRect: *mut RECT,
pScrollOffset: *mut POINT,
}}
STRUCT !{struct DXGI_SWAP_CHAIN_DESC1 {
Width: UINT,
Height: UINT,
Format: DXGI_FORMAT,
Stereo: BOOL,
SampleDesc: DXGI_SAMPLE_DESC,
BufferUsage: DXGI_USAGE,
BufferCount: UINT,
Scaling: DXGI_SCALING,
SwapEffect: DXGI_SWAP_EFFECT,
AlphaMode: DXGI_ALPHA_MODE,
Flags: UINT,
}}
STRUCT !{struct DXGI_SWAP_CHAIN_FULLSCREEN_DESC {
RefreshRate: DXGI_RATIONAL,
ScanlineOrdering: DXGI_MODE_SCANLINE_ORDER,
Scaling: DXGI_MODE_SCALING,
Windowed: BOOL,
}}
RIDL!{#[ uuid(0 x0aa1ae0a, 0 xfa0e, 0 x4b84, 0 x86, 0 x44, 0 xe0, 0 x5f, 0 xf8, 0 xe5, 0 xac, 0 xb5)]
interface IDXGIAdapter2(IDXGIAdapter2Vtbl): IDXGIAdapter1(IDXGIAdapter1Vtbl) {
fn GetDesc2(
pDesc: *mut DXGI_ADAPTER_DESC2,
) -> HRESULT,
}}
RIDL!{#[ uuid(0 x05008617, 0 xfbfd, 0 x4051, 0 xa7, 0 x90, 0 x14, 0 x48, 0 x84, 0 xb4, 0 xf6, 0 xa9)]
interface IDXGIDevice2(IDXGIDevice2Vtbl): IDXGIDevice1(IDXGIDevice1Vtbl) {
fn OfferResources(
NumResources: UINT,
ppResources: *mut *mut IDXGIResource,
Priority: DXGI_OFFER_RESOURCE_PRIORITY,
) -> HRESULT,
fn ReclaimResources(
NumResources: UINT,
ppResources: *mut *mut IDXGIResource,
pDiscarded: *mut BOOL,
) -> HRESULT,
fn EnqueueSetEvent(
hEvent: HANDLE,
) -> HRESULT,
}}
RIDL!{#[ uuid(0 xea9dbf1a, 0 xc88e, 0 x4486, 0 x85, 0 x4a, 0 x98, 0 xaa, 0 x01, 0 x38, 0 xf3, 0 x0c)]
interface IDXGIDisplayControl(IDXGIDisplayControlVtbl): IUnknown(IUnknownVtbl) {
fn IsStereoEnabled() -> BOOL,
fn SetStereoEnabled(
enabled: BOOL,
) -> (),
}}
RIDL!{#[ uuid(0 x50c83a1c, 0 xe072, 0 x4c48, 0 x87, 0 xb0, 0 x36, 0 x30, 0 xfa, 0 x36, 0 xa6, 0 xd0)]
interface IDXGIFactory2(IDXGIFactory2Vtbl): IDXGIFactory1(IDXGIFactory1Vtbl) {
fn IsWindowedStereoEnabled() -> BOOL,
fn CreateSwapChainForHwnd(
pDevice: *mut IUnknown,
hWnd: HWND,
pDesc: *const DXGI_SWAP_CHAIN_DESC1,
pFullscreenDesc: *const DXGI_SWAP_CHAIN_FULLSCREEN_DESC,
pRestrictToOutput: *mut IDXGIOutput,
ppSwapChain: *mut *mut IDXGISwapChain1,
) -> HRESULT,
fn CreateSwapChainForCoreWindow(
pDevice: *mut IUnknown,
pWindow: *mut IUnknown,
pDesc: *const DXGI_SWAP_CHAIN_DESC1,
pRestrictToOutput: *mut IDXGIOutput,
ppSwapChain: *mut *mut IDXGISwapChain1,
) -> HRESULT,
fn GetSharedResourceAdapterLuid(
hResource: HANDLE,
pLuid: *mut LUID,
) -> HRESULT,
fn RegisterStereoStatusWindow(
WindowHandle: HWND,
wMsg: UINT,
pdwCookie: *mut DWORD,
) -> HRESULT,
fn RegisterStereoStatusEvent(
hEvent: HANDLE,
pdwCookie: *mut DWORD,
) -> HRESULT,
fn UnregisterStereoStatus(
dwCookie: DWORD,
) -> (),
fn RegisterOcclusionStatusWindow(
WindowHandle: HWND,
wMsg: UINT,
pdwCookie: *mut DWORD,
) -> HRESULT,
fn RegisterOcclusionStatusEvent(
hEvent: HANDLE,
pdwCookie: *mut DWORD,
) -> HRESULT,
fn UnregisterOcclusionStatus(
dwCookie: DWORD,
) -> (),
fn CreateSwapChainForComposition(
pDevice: *mut IUnknown,
pDesc: *const DXGI_SWAP_CHAIN_DESC1,
pRestrictToOutput: *mut IDXGIOutput,
ppSwapChain: *mut *mut IDXGISwapChain1,
) -> HRESULT,
}}
RIDL!{#[ uuid(0 x00cddea8, 0 x939b, 0 x4b83, 0 xa3, 0 x40, 0 xa6, 0 x85, 0 x22, 0 x66, 0 x66, 0 xcc)]
interface IDXGIOutput1(IDXGIOutput1Vtbl): IDXGIOutput(IDXGIOutputVtbl) {
fn GetDisplayModeList1(
EnumFormat: DXGI_FORMAT,
Flags: UINT,
pNumModes: *mut UINT,
pDesc: *mut DXGI_MODE_DESC1,
) -> HRESULT,
fn FindClosestMatchingMode1(
pModeToMatch: *const DXGI_MODE_DESC1,
pClosestMatch: *mut DXGI_MODE_DESC1,
pConcernedDevice: *mut IUnknown,
) -> HRESULT,
fn GetDisplaySurfaceData1(
pDestination: *mut IDXGIResource,
) -> HRESULT,
fn DuplicateOutput(
pDevice: *mut IUnknown,
ppOutputDuplication: *mut *mut IDXGIOutputDuplication,
) -> HRESULT,
}}
RIDL!{#[ uuid(0 x191cfac3, 0 xa341, 0 x470d, 0 xb2, 0 x6e, 0 xa8, 0 x64, 0 xf4, 0 x28, 0 x31, 0 x9c)]
interface IDXGIOutputDuplication(IDXGIOutputDuplicationVtbl): IDXGIObject(IDXGIObjectVtbl) {
fn GetDesc(
pDesc: *mut DXGI_OUTDUPL_DESC,
) -> (),
fn AcquireNextFrame(
TimeoutInMilliseconds: UINT,
pFrameInfo: *mut DXGI_OUTDUPL_FRAME_INFO,
ppDesktopResource: *mut *mut IDXGIResource,
) -> HRESULT,
fn GetFrameDirtyRects(
DirtyRectsBufferSize: UINT,
pDirtyRectsBuffer: *mut RECT,
pDirtyRectsBufferSizeRequired: *mut UINT,
) -> HRESULT,
fn GetFrameMoveRects(
MoveRectsBufferSize: UINT,
pMoveRectBuffer: *mut DXGI_OUTDUPL_MOVE_RECT,
pMoveRectsBufferSizeRequired: *mut UINT,
) -> HRESULT,
fn GetFramePointerShape(
PointerShapeBufferSize: UINT,
pPointerShapeBuffer: *mut c_void,
pPointerShapeBufferSizeRequired: *mut UINT,
pPointerShapeInfo: *mut DXGI_OUTDUPL_POINTER_SHAPE_INFO,
) -> HRESULT,
fn MapDesktopSurface(
pLockedRect: *mut DXGI_MAPPED_RECT,
) -> HRESULT,
fn UnMapDesktopSurface() -> HRESULT,
fn ReleaseFrame() -> HRESULT,
}}
RIDL!{#[ uuid(0 x30961379, 0 x4609, 0 x4a41, 0 x99, 0 x8e, 0 x54, 0 xfe, 0 x56, 0 x7e, 0 xe0, 0 xc1)]
interface IDXGIResource1(IDXGIResource1Vtbl): IDXGIResource(IDXGIResourceVtbl) {
fn CreateSubresourceSurface(
index: UINT,
ppSurface: *mut *mut IDXGISurface2,
) -> HRESULT,
fn CreateSharedHandle(
pAttributes: *const SECURITY_ATTRIBUTES,
dwAccess: DWORD,
lpName: LPCWSTR,
pHandle: *mut HANDLE,
) -> HRESULT,
}}
RIDL!{#[ uuid(0 xaba496dd, 0 xb617, 0 x4cb8, 0 xa8, 0 x66, 0 xbc, 0 x44, 0 xd7, 0 xeb, 0 x1f, 0 xa2)]
interface IDXGISurface2(IDXGISurface2Vtbl): IDXGISurface1(IDXGISurface1Vtbl) {
fn GetResource(
riid: REFGUID,
ppParentResource: *mut *mut c_void,
pSubresourceIndex: *mut UINT,
) -> HRESULT,
}}
RIDL!{#[ uuid(0 x790a45f7, 0 x0d42, 0 x4876, 0 x98, 0 x3a, 0 x0a, 0 x55, 0 xcf, 0 xe6, 0 xf4, 0 xaa)]
interface IDXGISwapChain1(IDXGISwapChain1Vtbl): IDXGISwapChain(IDXGISwapChainVtbl) {
fn GetDesc1(
pDesc: *mut DXGI_SWAP_CHAIN_DESC1,
) -> HRESULT,
fn GetFullscreenDesc(
pDesc: *mut DXGI_SWAP_CHAIN_FULLSCREEN_DESC,
) -> HRESULT,
fn GetHwnd(
pHwnd: *mut HWND,
) -> HRESULT,
fn GetCoreWindow(
refiid: REFGUID,
ppUnk: *mut *mut c_void,
) -> HRESULT,
fn Present1(
SyncInterval: UINT,
PresentFlags: UINT,
pPresentParameters: *const DXGI_PRESENT_PARAMETERS,
) -> HRESULT,
fn IsTemporaryMonoSupported() -> BOOL,
fn GetRestrictToOutput(
ppRestrictToOutput: *mut *mut IDXGIOutput,
) -> HRESULT,
fn SetBackgroundColor(
pColor: *const DXGI_RGBA,
) -> HRESULT,
fn GetBackgroundColor(
pColor: *mut DXGI_RGBA,
) -> HRESULT,
fn SetRotation(
Rotation: DXGI_MODE_ROTATION,
) -> HRESULT,
fn GetRotation(
pRotation: *mut DXGI_MODE_ROTATION,
) -> HRESULT,
}}
pub type DXGI_OFFER_RESOURCE_PRIORITY = _DXGI_OFFER_RESOURCE_PRIORITY;
pub const DXGI_ENUM_MODES_DISABLED_STEREO: UINT = 8 ;
pub const DXGI_ENUM_MODES_STEREO: UINT = 4 ;
pub const DXGI_SHARED_RESOURCE_READ: UINT = 0 x80000000;
pub const DXGI_SHARED_RESOURCE_WRITE: UINT = 1 ;
DEFINE_GUID!{IID_IDXGIDisplayControl,
0 xea9dbf1a, 0 xc88e, 0 x4486, 0 x85, 0 x4a, 0 x98, 0 xaa, 0 x01, 0 x38, 0 xf3, 0 x0c}
DEFINE_GUID!{IID_IDXGIOutputDuplication,
0 x191cfac3, 0 xa341, 0 x470d, 0 xb2, 0 x6e, 0 xa8, 0 x64, 0 xf4, 0 x28, 0 x31, 0 x9c}
DEFINE_GUID!{IID_IDXGISurface2,
0 xaba496dd, 0 xb617, 0 x4cb8, 0 xa8, 0 x66, 0 xbc, 0 x44, 0 xd7, 0 xeb, 0 x1f, 0 xa2}
DEFINE_GUID!{IID_IDXGIResource1,
0 x30961379, 0 x4609, 0 x4a41, 0 x99, 0 x8e, 0 x54, 0 xfe, 0 x56, 0 x7e, 0 xe0, 0 xc1}
DEFINE_GUID!{IID_IDXGIDevice2,
0 x05008617, 0 xfbfd, 0 x4051, 0 xa7, 0 x90, 0 x14, 0 x48, 0 x84, 0 xb4, 0 xf6, 0 xa9}
DEFINE_GUID!{IID_IDXGISwapChain1,
0 x790a45f7, 0 x0d42, 0 x4876, 0 x98, 0 x3a, 0 x0a, 0 x55, 0 xcf, 0 xe6, 0 xf4, 0 xaa}
DEFINE_GUID!{IID_IDXGIFactory2,
0 x50c83a1c, 0 xe072, 0 x4c48, 0 x87, 0 xb0, 0 x36, 0 x30, 0 xfa, 0 x36, 0 xa6, 0 xd0}
DEFINE_GUID!{IID_IDXGIAdapter2,
0 x0aa1ae0a, 0 xfa0e, 0 x4b84, 0 x86, 0 x44, 0 xe0, 0 x5f, 0 xf8, 0 xe5, 0 xac, 0 xb5}
DEFINE_GUID!{IID_IDXGIOutput1,
0 x00cddea8, 0 x939b, 0 x4b83, 0 xa3, 0 x40, 0 xa6, 0 x85, 0 x22, 0 x66, 0 x66, 0 xcc}
Messung V0.5 in Prozent C=99 H=100 G=99
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-06-21)
¤
*© Formatika GbR, Deutschland