1 module directx.dxgi1_2; 2 3 public import directx.dxgi; 4 5 mixin( uuid!(IDXGIDisplayControl, "ea9dbf1a-c88e-4486-854a-98aa0138f30c") ); 6 extern (C++) interface IDXGIDisplayControl : IUnknown 7 { 8 BOOL IsStereoEnabled(); 9 10 void SetStereoEnabled( 11 BOOL enabled); 12 } 13 14 struct DXGI_OUTDUPL_MOVE_RECT 15 { 16 POINT SourcePoint; 17 RECT DestinationRect; 18 } 19 20 struct DXGI_OUTDUPL_DESC 21 { 22 DXGI_MODE_DESC ModeDesc; 23 DXGI_MODE_ROTATION Rotation; 24 BOOL DesktopImageInSystemMemory; 25 } 26 27 struct DXGI_OUTDUPL_POINTER_POSITION 28 { 29 POINT Position; 30 BOOL Visible; 31 } 32 33 alias DXGI_OUTDUPL_POINTER_SHAPE_TYPE = int; 34 enum : DXGI_OUTDUPL_POINTER_SHAPE_TYPE 35 { 36 DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MONOCHROME = 0x1, 37 DXGI_OUTDUPL_POINTER_SHAPE_TYPE_COLOR = 0x2, 38 DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MASKED_COLOR = 0x4 39 } 40 41 struct DXGI_OUTDUPL_POINTER_SHAPE_INFO 42 { 43 UINT Type; 44 UINT Width; 45 UINT Height; 46 UINT Pitch; 47 POINT HotSpot; 48 } 49 50 struct DXGI_OUTDUPL_FRAME_INFO 51 { 52 LARGE_INTEGER LastPresentTime; 53 LARGE_INTEGER LastMouseUpdateTime; 54 UINT AccumulatedFrames; 55 BOOL RectsCoalesced; 56 BOOL ProtectedContentMaskedOut; 57 DXGI_OUTDUPL_POINTER_POSITION PointerPosition; 58 UINT TotalMetadataBufferSize; 59 UINT PointerShapeBufferSize; 60 } 61 62 mixin( uuid!(IDXGIOutputDuplication, "191cfac3-a341-470d-b26e-a864f428319c") ); 63 extern (C++) interface IDXGIOutputDuplication : IDXGIObject 64 { 65 void GetDesc( 66 /*out*/ DXGI_OUTDUPL_DESC* pDesc); 67 68 HRESULT AcquireNextFrame( 69 UINT TimeoutInMilliseconds, 70 /*out*/ DXGI_OUTDUPL_FRAME_INFO* pFrameInfo, 71 /*out*/IDXGIResource* ppDesktopResource); 72 73 HRESULT GetFrameDirtyRects( 74 UINT DirtyRectsBufferSize, 75 /*out*/ RECT* pDirtyRectsBuffer, 76 /*out*/ UINT* pDirtyRectsBufferSizeRequired); 77 78 HRESULT GetFrameMoveRects( 79 UINT MoveRectsBufferSize, 80 /*out*/ DXGI_OUTDUPL_MOVE_RECT* pMoveRectBuffer, 81 /*out*/ UINT* pMoveRectsBufferSizeRequired); 82 83 HRESULT GetFramePointerShape( 84 UINT PointerShapeBufferSize, 85 /*out*/ void* pPointerShapeBuffer, 86 /*out*/ UINT* pPointerShapeBufferSizeRequired, 87 /*out*/ DXGI_OUTDUPL_POINTER_SHAPE_INFO* pPointerShapeInfo); 88 89 HRESULT MapDesktopSurface( 90 /*out*/ DXGI_MAPPED_RECT* pLockedRect); 91 92 HRESULT UnMapDesktopSurface(); 93 94 HRESULT ReleaseFrame(); 95 } 96 97 alias DXGI_ALPHA_MODE = int; 98 enum : DXGI_ALPHA_MODE 99 { 100 DXGI_ALPHA_MODE_UNSPECIFIED = 0, 101 DXGI_ALPHA_MODE_PREMULTIPLIED = 1, 102 DXGI_ALPHA_MODE_STRAIGHT = 2, 103 DXGI_ALPHA_MODE_IGNORE = 3, 104 DXGI_ALPHA_MODE_FORCE_DWORD = 0xffffffff 105 } 106 107 mixin( uuid!(IDXGISurface2, "aba496dd-b617-4cb8-a866-bc44d7eb1fa2") ); 108 extern (C++) interface IDXGISurface2 : IDXGISurface1 109 { 110 HRESULT GetResource( 111 REFIID riid, 112 /*out*/ void** ppParentResource, 113 /*out*/ UINT* pSubresourceIndex); 114 } 115 116 mixin( uuid!(IDXGIResource1, "30961379-4609-4a41-998e-54fe567ee0c1") ); 117 extern (C++) interface IDXGIResource1 : IDXGIResource 118 { 119 HRESULT CreateSubresourceSurface( 120 UINT index, 121 /*out*/ IDXGISurface2* ppSurface); 122 123 HRESULT CreateSharedHandle( 124 const(SECURITY_ATTRIBUTES)* pAttributes, 125 DWORD dwAccess, 126 LPCWSTR lpName, 127 /*out*/ HANDLE* pHandle); 128 } 129 130 alias DXGI_OFFER_RESOURCE_PRIORITY = int; 131 enum : DXGI_OFFER_RESOURCE_PRIORITY 132 { 133 DXGI_OFFER_RESOURCE_PRIORITY_LOW = 1, 134 DXGI_OFFER_RESOURCE_PRIORITY_NORMAL = ( DXGI_OFFER_RESOURCE_PRIORITY_LOW + 1 ) , 135 DXGI_OFFER_RESOURCE_PRIORITY_HIGH = ( DXGI_OFFER_RESOURCE_PRIORITY_NORMAL + 1 ) 136 } 137 138 mixin( uuid!(IDXGIDevice2, "05008617-fbfd-4051-a790-144884b4f6a9") ); 139 extern (C++) interface IDXGIDevice2 : IDXGIDevice1 140 { 141 HRESULT OfferResources( 142 UINT NumResources, 143 const(IDXGIResource)* ppResources, 144 DXGI_OFFER_RESOURCE_PRIORITY Priority); 145 146 HRESULT ReclaimResources( 147 UINT NumResources, 148 const(IDXGIResource)* ppResources, 149 /*out*/ BOOL* pDiscarded); 150 151 HRESULT EnqueueSetEvent( 152 HANDLE hEvent); 153 } 154 155 enum DXGI_ENUM_MODES_STEREO = ( 4UL ); 156 enum DXGI_ENUM_MODES_DISABLED_STEREO = ( 8UL ); 157 enum DXGI_SHARED_RESOURCE_READ = ( 0x80000000L ); 158 enum DXGI_SHARED_RESOURCE_WRITE = ( 1 ); 159 160 struct DXGI_MODE_DESC1 161 { 162 UINT Width; 163 UINT Height; 164 DXGI_RATIONAL RefreshRate; 165 DXGI_FORMAT Format; 166 DXGI_MODE_SCANLINE_ORDER ScanlineOrdering; 167 DXGI_MODE_SCALING Scaling; 168 BOOL Stereo; 169 } 170 171 alias DXGI_SCALING = int; 172 enum : DXGI_SCALING 173 { 174 DXGI_SCALING_STRETCH = 0, 175 DXGI_SCALING_NONE = 1, 176 DXGI_SCALING_ASPECT_RATIO_STRETCH = 2 177 } 178 179 struct DXGI_SWAP_CHAIN_DESC1 180 { 181 UINT Width; 182 UINT Height; 183 DXGI_FORMAT Format; 184 BOOL Stereo; 185 DXGI_SAMPLE_DESC SampleDesc; 186 DXGI_USAGE BufferUsage; 187 UINT BufferCount; 188 DXGI_SCALING Scaling; 189 DXGI_SWAP_EFFECT SwapEffect; 190 DXGI_ALPHA_MODE AlphaMode; 191 UINT Flags; 192 } 193 194 struct DXGI_SWAP_CHAIN_FULLSCREEN_DESC 195 { 196 DXGI_RATIONAL RefreshRate; 197 DXGI_MODE_SCANLINE_ORDER ScanlineOrdering; 198 DXGI_MODE_SCALING Scaling; 199 BOOL Windowed; 200 } 201 202 struct DXGI_PRESENT_PARAMETERS 203 { 204 UINT DirtyRectsCount; 205 RECT *pDirtyRects; 206 RECT *pScrollRect; 207 POINT *pScrollOffset; 208 } 209 210 mixin( uuid!(IDXGISwapChain1, "790a45f7-0d42-4876-983a-0a55cfe6f4aa") ); 211 extern (C++) interface IDXGISwapChain1 : IDXGISwapChain 212 { 213 HRESULT GetDesc1( 214 /*out*/ DXGI_SWAP_CHAIN_DESC1* pDesc); 215 216 HRESULT GetFullscreenDesc( 217 /*out*/ DXGI_SWAP_CHAIN_FULLSCREEN_DESC* pDesc); 218 219 HRESULT GetHwnd( 220 /*out*/ HWND* pHwnd); 221 222 HRESULT GetCoreWindow( 223 REFIID refiid, 224 /*out*/ void** ppUnk); 225 226 HRESULT Present1( 227 UINT SyncInterval, 228 UINT PresentFlags, 229 const(DXGI_PRESENT_PARAMETERS)* pPresentParameters); 230 231 BOOL IsTemporaryMonoSupported(); 232 233 HRESULT GetRestrictToOutput( 234 /*out*/ IDXGIOutput* ppRestrictToOutput); 235 236 HRESULT SetBackgroundColor( 237 const(DXGI_RGBA)* pColor); 238 239 HRESULT GetBackgroundColor( 240 /*out*/ DXGI_RGBA* pColor); 241 242 HRESULT SetRotation( 243 DXGI_MODE_ROTATION Rotation); 244 245 HRESULT GetRotation( 246 /*out*/ DXGI_MODE_ROTATION* pRotation); 247 } 248 249 mixin( uuid!(IDXGIFactory2, "50c83a1c-e072-4c48-87b0-3630fa36a6d0") ); 250 extern (C++) interface IDXGIFactory2 : IDXGIFactory1 251 { 252 BOOL IsWindowedStereoEnabled(); 253 254 HRESULT CreateSwapChainForHwnd( 255 IUnknown pDevice, 256 HWND hWnd, 257 const(DXGI_SWAP_CHAIN_DESC1)* pDesc, 258 const(DXGI_SWAP_CHAIN_FULLSCREEN_DESC)* pFullscreenDesc, 259 IDXGIOutput pRestrictToOutput, 260 /*out*/ IDXGISwapChain1* ppSwapChain); 261 262 HRESULT CreateSwapChainForCoreWindow( 263 IUnknown pDevice, 264 IUnknown pWindow, 265 const(DXGI_SWAP_CHAIN_DESC1)* pDesc, 266 IDXGIOutput pRestrictToOutput, 267 /*out*/ IDXGISwapChain1* ppSwapChain); 268 269 HRESULT GetSharedResourceAdapterLuid( 270 HANDLE hResource, 271 /*out*/ LUID* pLuid); 272 273 HRESULT RegisterStereoStatusWindow( 274 HWND WindowHandle, 275 UINT wMsg, 276 /*out*/ DWORD* pdwCookie); 277 278 HRESULT RegisterStereoStatusEvent( 279 HANDLE hEvent, 280 /*out*/ DWORD* pdwCookie); 281 282 void UnregisterStereoStatus( 283 DWORD dwCookie); 284 285 HRESULT RegisterOcclusionStatusWindow( 286 HWND WindowHandle, 287 UINT wMsg, 288 DWORD* pdwCookie); 289 290 HRESULT RegisterOcclusionStatusEvent( 291 HANDLE hEvent, 292 /*out*/ DWORD* pdwCookie); 293 294 void UnregisterOcclusionStatus( 295 DWORD dwCookie); 296 297 HRESULT CreateSwapChainForComposition( 298 IUnknown pDevice, 299 const(DXGI_SWAP_CHAIN_DESC1)* pDesc, 300 IDXGIOutput pRestrictToOutput, 301 /*out*/ IDXGISwapChain1* ppSwapChain); 302 } 303 304 alias DXGI_GRAPHICS_PREEMPTION_GRANULARITY = int; 305 enum : DXGI_GRAPHICS_PREEMPTION_GRANULARITY 306 { 307 DXGI_GRAPHICS_PREEMPTION_DMA_BUFFER_BOUNDARY = 0, 308 DXGI_GRAPHICS_PREEMPTION_PRIMITIVE_BOUNDARY = 1, 309 DXGI_GRAPHICS_PREEMPTION_TRIANGLE_BOUNDARY = 2, 310 DXGI_GRAPHICS_PREEMPTION_PIXEL_BOUNDARY = 3, 311 DXGI_GRAPHICS_PREEMPTION_INSTRUCTION_BOUNDARY = 4 312 } 313 314 alias DXGI_COMPUTE_PREEMPTION_GRANULARITY = int; 315 enum : DXGI_COMPUTE_PREEMPTION_GRANULARITY 316 { 317 DXGI_COMPUTE_PREEMPTION_DMA_BUFFER_BOUNDARY = 0, 318 DXGI_COMPUTE_PREEMPTION_DISPATCH_BOUNDARY = 1, 319 DXGI_COMPUTE_PREEMPTION_THREAD_GROUP_BOUNDARY = 2, 320 DXGI_COMPUTE_PREEMPTION_THREAD_BOUNDARY = 3, 321 DXGI_COMPUTE_PREEMPTION_INSTRUCTION_BOUNDARY = 4 322 } 323 324 struct DXGI_ADAPTER_DESC2 325 { 326 WCHAR[128] Description; 327 UINT VendorId; 328 UINT DeviceId; 329 UINT SubSysId; 330 UINT Revision; 331 SIZE_T DedicatedVideoMemory; 332 SIZE_T DedicatedSystemMemory; 333 SIZE_T SharedSystemMemory; 334 LUID AdapterLuid; 335 UINT Flags; 336 DXGI_GRAPHICS_PREEMPTION_GRANULARITY GraphicsPreemptionGranularity; 337 DXGI_COMPUTE_PREEMPTION_GRANULARITY ComputePreemptionGranularity; 338 } 339 340 mixin( uuid!(IDXGIAdapter2, "0AA1AE0A-FA0E-4B84-8644-E05FF8E5ACB5") ); 341 extern (C++) interface IDXGIAdapter2 : IDXGIAdapter1 342 { 343 HRESULT GetDesc2( 344 /*out*/ DXGI_ADAPTER_DESC2* pDesc); 345 } 346 347 mixin( uuid!(IDXGIOutput1, "00cddea8-939b-4b83-a340-a685226666cc") ); 348 extern (C++) interface IDXGIOutput1 : IDXGIOutput 349 { 350 HRESULT GetDisplayModeList1( 351 DXGI_FORMAT EnumFormat, 352 UINT Flags, 353 /*inout*/ UINT* pNumModes, 354 /*out*/ DXGI_MODE_DESC1* pDesc); 355 356 HRESULT FindClosestMatchingMode1( 357 const(DXGI_MODE_DESC1)* pModeToMatch, 358 /*out*/ DXGI_MODE_DESC1* pClosestMatch, 359 IUnknown pConcernedDevice); 360 361 HRESULT GetDisplaySurfaceData1( 362 IDXGIResource pDestination); 363 364 HRESULT DuplicateOutput( 365 IUnknown pDevice, 366 /*out*/ IDXGIOutputDuplication* ppOutputDuplication); 367 }