Ada计算机图形DirectX之DXGI

----------------------------------------
-- File : DXGI.ads                    --
-- Translator:Dongfeng.Gu,2018/10/22  --
-- Mail: 515639@qq.com                --
-- Progress:100%                      --
----------------------------------------


with win32;                 use win32;
with win32.winnt;           use win32.winnt;
with win32.windef;          use win32.windef;
with win32.objbase;         use win32.objbase;
with win32.rpcdce;          use win32.rpcdce;

with DXGIFormat;            use DXGIFormat;
with DXGIType;              use DXGIType;


package DXGI is

   function Shift_Left(A:dword;B:Natural) return dword with import,convention=>Intrinsic;
   function Lsh(A:dword;B:Natural) return dword is (Shift_Left(A,B));

   function Shift_Right(A:dword;B:Natural) return dword with import,convention=>Intrinsic;
   function Rsh(A:dword;B:Natural) return dword is (Shift_Right(A,B));

   type LPIUNKNOWN is access all IUnknown;
   type LPCIUNKNOWN is access constant IUnknown;
   subtype UINT64 is win32.ULONGLONG;
   type LPHDC is access all HDC;
   type LPLARGE_INTEGER is access all LARGE_INTEGER;
   type LPHWND is access all windef.HWND;

   type IDXGIObject;
   type LPIDXGIObject is access all IDXGIObject;
   type LPLPIDXGIObject is access all LPIDXGIObject;
   subtype LPDXGIObject is LPIDXGIObject;
   subtype LPLPDXGIObject is LPLPIDXGIObject;

   type IDXGIDeviceSubObject;
   type LPIDXGIDeviceSubObject is access all IDXGIDeviceSubObject;
   type LPLPIDXGIDeviceSubObject is access all LPIDXGIDeviceSubObject;
   subtype LPDXGIDeviceSubObject is LPIDXGIDeviceSubObject;
   subtype LPLPDXGIDeviceSubObject is LPLPIDXGIDeviceSubObject;

   type IDXGIResource;
   type LPIDXGIResource is access all IDXGIResource;
   type LPLPIDXGIResource is access all LPIDXGIResource;
   subtype LPDXGIResource is LPIDXGIResource;
   subtype LPLPDXGIResource is LPLPIDXGIResource;

   type IDXGIKeyedMutex;
   type LPIDXGIKeyedMutex is access all IDXGIKeyedMutex;
   type LPLPIDXGIKeyedMutex is access all LPIDXGIKeyedMutex;
   subtype LPDXGIKeyedMutex is LPIDXGIKeyedMutex;
   subtype LPLPDXGIKeyedMutex is LPLPIDXGIKeyedMutex;

   type IDXGISurface;
   type LPIDXGISurface is access all IDXGISurface;
   type LPLPIDXGISurface is access all LPIDXGISurface;
   subtype LPDXGISurface is LPIDXGISurface;
   subtype LPLPDXGISurface is LPLPIDXGISurface;

   type IDXGISurface1;
   type LPIDXGISurface1 is access all IDXGISurface1;
   type LPLPIDXGISurface1 is access all LPIDXGISurface1;
   subtype LPDXGISurface1 is LPIDXGISurface1;
   subtype LPLPDXGISurface1 is LPLPIDXGISurface1;

   type IDXGIAdapter;
   type LPIDXGIAdapter is access all IDXGIAdapter;
   type LPLPIDXGIAdapter is access all LPIDXGIAdapter;
   subtype LPDXGIAdapter is LPIDXGIAdapter;
   subtype LPLPDXGIAdapter is LPLPIDXGIAdapter;

   type IDXGIOutput;
   type LPIDXGIOutput is access all IDXGIOutput;
   type LPLPIDXGIOutput is access all LPIDXGIOutput;
   subtype LPDXGIOutput is LPIDXGIOutput;
   subtype LPLPDXGIOutput is LPLPIDXGIOutput;

   type IDXGISwapChain;
   type LPIDXGISwapChain is access all IDXGISwapChain;
   type LPLPIDXGISwapChain is access all LPIDXGISwapChain;
   subtype LPDXGISwapChain is LPIDXGISwapChain;
   subtype LPLPDXGISwapChain is LPLPIDXGISwapChain;

   type IDXGIFactory;
   type LPIDXGIFactory is access all IDXGIFactory;
   type LPLPIDXGIFactory is access all LPIDXGIFactory;
   subtype LPDXGIFactory is LPIDXGIFactory;
   subtype LPLPDXGIFactory is LPLPIDXGIFactory;

   type IDXGIDevice;
   type LPIDXGIDevice is access all IDXGIDevice;
   type LPLPIDXGIDevice is access all LPIDXGIDevice;
   subtype LPDXGIDevice is LPIDXGIDevice;
   subtype LPLPDXGIDevice is LPLPIDXGIDevice;

   type IDXGIFactory1;
   type LPIDXGIFactory1 is access all IDXGIFactory1;
   type LPLPIDXGIFactory1 is access all LPIDXGIFactory1;
   subtype LPDXGIFactory1 is LPIDXGIFactory1;
   subtype LPLPDXGIFactory1 is LPLPIDXGIFactory1;

   type IDXGIAdapter1;
   type LPIDXGIAdapter1 is access all IDXGIAdapter1;
   type LPLPIDXGIAdapter1 is access all LPIDXGIAdapter1;
   subtype LPDXGIAdapter1 is LPIDXGIAdapter1;
   subtype LPLPDXGIAdapter1 is LPLPIDXGIAdapter1;

   type IDXGIDevice1;
   type LPIDXGIDevice1 is access all IDXGIDevice1;
   type LPLPIDXGIDevice1 is access all LPIDXGIDevice1;
   subtype LPDXGIDevice1 is LPIDXGIDevice1;
   subtype LPLPDXGIDevice1 is LPLPIDXGIDevice1;



   REQUIRED_RPCNDR_H_VERSION : constant := 475;

   REQUIRED_RPCSAL_H_VERSION : constant := 100;

   DXGI_CPU_ACCESS_NONE : constant := ( 0 );

   DXGI_CPU_ACCESS_DYNAMIC : constant := ( 1 );

   DXGI_CPU_ACCESS_READ_WRITE : constant := ( 2 );

   DXGI_CPU_ACCESS_SCRATCH : constant := ( 3 );

   DXGI_CPU_ACCESS_FIELD : constant := 15;

   DXGI_USAGE_SHADER_INPUT : constant dword:= Lsh(1, (0 + 4) );

   DXGI_USAGE_RENDER_TARGET_OUTPUT : constant dword:= Lsh(1, (1 + 4) );

   DXGI_USAGE_BACK_BUFFER : constant dword:= Lsh(1, (2 + 4) );

   DXGI_USAGE_SHARED : constant dword:= Lsh(1, (3 + 4) );

   DXGI_USAGE_READ_ONLY : constant dword:= Lsh(1, (4 + 4) );

   DXGI_USAGE_DISCARD_ON_PRESENT : constant dword:= Lsh(1, (5 + 4) );

   DXGI_USAGE_UNORDERED_ACCESS : constant dword:= Lsh(1, (6 + 4) );

   subtype DXGI_USAGE is UINT;
   type LPDXGI_USAGE is access all DXGI_USAGE;

   type DXGI_FRAME_STATISTICS is record
      PresentCount:UINT;
      PresentRefreshCount:UINT;
      SyncRefreshCount:UINT;
      SyncQPCTime:LARGE_INTEGER;
      SyncGPUTime:LARGE_INTEGER;
   end record;

   type LPDXGI_FRAME_STATISTICS is access all DXGI_FRAME_STATISTICS;

   type DXGI_MAPPED_RECT is record
      Pitch:INT;
      pBits:LPBYTE;
   end record;

   type LPDXGI_MAPPED_RECT is access all DXGI_MAPPED_RECT;

   type tagLUID is record
      LowPart:DWORD;
      HighPart:LONG;
   end record;

   subtype LUID is tagLUID;

   type LPLUID is access all tagLUID;
   type PLUID is access all tagLUID;

   type DXGI_ADAPTER_DESC is record
      Description:WCHAR_Array(0..127);
      VendorId:UINT;
      DeviceId:UINT;
      SubSysId:UINT;
      Revision:UINT;
      DedicatedVideoMemory:SIZE_T;
      DedicatedSystemMemory:SIZE_T;
      SharedSystemMemory:SIZE_T;
      AdapterLuid:LUID;
   end record;

   type LPDXGI_ADAPTER_DESC is access all DXGI_ADAPTER_DESC;

   subtype HMONITOR is HANDLE;

   type DXGI_OUTPUT_DESC is record
      DeviceName:WCHAR_Array(0..31);
      DesktopCoordinates:RECT;
      AttachedToDesktop:BOOL;
      Rotation:DXGI_MODE_ROTATION;
      Monitor:HMONITOR;
   end record;

   type LPDXGI_OUTPUT_DESC is access all DXGI_OUTPUT_DESC;

   type DXGI_SHARED_RESOURCE is record
      Handle:win32.winnt.HANDLE;
   end record;

   type LPDXGI_SHARED_RESOURCE is access all DXGI_SHARED_RESOURCE;
   type LPCDXGI_SHARED_RESOURCE is access constant DXGI_SHARED_RESOURCE;


   DXGI_RESOURCE_PRIORITY_MINIMUM : constant := ( 16#28000000# );

   DXGI_RESOURCE_PRIORITY_LOW : constant := ( 16#50000000# );

   DXGI_RESOURCE_PRIORITY_NORMAL : constant := ( 16#78000000# );

   DXGI_RESOURCE_PRIORITY_HIGH : constant := ( 16#a0000000# );

   DXGI_RESOURCE_PRIORITY_MAXIMUM : constant := ( 16#c8000000# );

   type DXGI_RESIDENCY is (DXGI_RESIDENCY_FULLY_RESIDENT,
                           DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY,
                           DXGI_RESIDENCY_EVICTED_TO_DISK);
   for DXGI_RESIDENCY use (DXGI_RESIDENCY_FULLY_RESIDENT=>1,
                           DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY=>2,
                           DXGI_RESIDENCY_EVICTED_TO_DISK=>3);

   type LPDXGI_RESIDENCY is access DXGI_RESIDENCY;

   type DXGI_SURFACE_DESC is record
      Width:UINT;
      Height:UINT;
      Format:DXGI_FORMAT;
      SampleDesc:DXGI_SAMPLE_DESC;
   end record;

   type LPDXGI_SURFACE_DESC is access all DXGI_SURFACE_DESC;
   type LPCDXGI_SURFACE_DESC is access constant  DXGI_SURFACE_DESC;

   type DXGI_SWAP_EFFECT is (DXGI_SWAP_EFFECT_DISCARD,
                             DXGI_SWAP_EFFECT_SEQUENTIAL);
   for DXGI_SWAP_EFFECT use (DXGI_SWAP_EFFECT_DISCARD=>0,
                             DXGI_SWAP_EFFECT_SEQUENTIAL=>1);

   type LPDXGI_SWAP_EFFECT is access DXGI_SWAP_EFFECT;

   type DXGI_SWAP_CHAIN_FLAG is (DXGI_SWAP_CHAIN_FLAG_NONPREROTATED,
                                 DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH,
                                 DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE);
   for DXGI_SWAP_CHAIN_FLAG use (DXGI_SWAP_CHAIN_FLAG_NONPREROTATED=>1,
                                 DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH=>2,
                                 DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE=>4);

   type LPDXGI_SWAP_CHAIN_FLAG is access DXGI_SWAP_CHAIN_FLAG;

   type DXGI_SWAP_CHAIN_DESC is record
      BufferDesc:DXGI_MODE_DESC;
      SampleDesc:DXGI_SAMPLE_DESC;
      BufferUsage:DXGI_USAGE;
      BufferCount:UINT;
      OutputWindow:HWND;
      Windowed:BOOL;
      SwapEffect:DXGI_SWAP_EFFECT;
      Flags:UINT;
   end record;

   type LPDXGI_SWAP_CHAIN_DESC is access all DXGI_SWAP_CHAIN_DESC;

   type IDXGIObject is record
      QueryInterface:access function(This:LPIDXGIObject;riid:REFIID;ppvObject:LPLPvoid) return HRESULT with Convention=>Stdcall;
      AddRef:access function(This:LPIDXGIObject) return ULONG with Convention=>Stdcall;
      Release:access function(This:LPIDXGIObject) return ULONG with Convention=>Stdcall;
      SetPrivateData:access function(This:LPIDXGIObject;Name:REFGUID;DataSize:UINT;pData:LPCvoid) return HRESULT with Convention=>Stdcall;
      SetPrivateDataInterface:access function(This:LPIDXGIObject;Name:REFGUID;pUnknown:access constant IUnknown) return HRESULT with Convention=>Stdcall;
      GetPrivateData:access function(This:LPIDXGIObject;Name:REFGUID;pDataSize:LPUINT;pData:LPvoid) return HRESULT with Convention=>Stdcall;
      GetParent:access function(This:LPIDXGIObject;riid:REFIID;ppParent:LPLPvoid) return HRESULT with Convention=>Stdcall;
   end record;

   type IDXGIDeviceSubObject is record
      QueryInterface:access function(This:LPIDXGIDeviceSubObject;riid:REFIID;ppvObject:LPLPvoid) return HRESULT with Convention=>Stdcall;
      AddRef:access function(This:LPIDXGIDeviceSubObject) return ULONG with Convention=>Stdcall;
      Release:access function(This:LPIDXGIDeviceSubObject) return ULONG with Convention=>Stdcall;
      SetPrivateData:access function(This:LPIDXGIDeviceSubObject;Name:REFGUID;DataSize:UINT;pData:LPCvoid) return HRESULT with Convention=>Stdcall;
      SetPrivateDataInterface:access function(This:LPIDXGIDeviceSubObject;Name:REFGUID;pUnknown:LPCIUnknown) return HRESULT with Convention=>Stdcall;
      GetPrivateData:access function(This:LPIDXGIDeviceSubObject;Name:REFGUID;pDataSize:LPUINT;pData:LPvoid) return HRESULT with Convention=>Stdcall;
      GetParent:access function(This:LPIDXGIDeviceSubObject;riid:REFIID;ppParent:LPLPvoid) return HRESULT with Convention=>Stdcall;
      GetDevice:access function(This:LPIDXGIDeviceSubObject;riid:REFIID;ppDevice:LPLPvoid) return HRESULT with Convention=>Stdcall;
   end record;

   type IDXGIResource is record
      QueryInterface:access function(This:LPIDXGIResource;riid:REFIID;ppvObject:LPLPvoid) return HRESULT with Convention=>Stdcall;
      AddRef:access function(This:LPIDXGIResource) return ULONG with Convention=>Stdcall;
      Release:access function(This:LPIDXGIResource) return ULONG with Convention=>Stdcall;
      SetPrivateData:access function(This:LPIDXGIResource;Name:REFGUID;DataSize:UINT;pData:LPCvoid) return HRESULT with Convention=>Stdcall;
      SetPrivateDataInterface:access function(This:LPIDXGIResource;Name:REFGUID;pUnknown:LPCIUnknown) return HRESULT with Convention=>Stdcall;
      GetPrivateData:access function(This:LPIDXGIResource;Name:REFGUID;pDataSize:LPUINT;pData:LPvoid) return HRESULT with Convention=>Stdcall;
      GetParent:access function(This:LPIDXGIResource;riid:REFIID;ppParent:LPLPvoid) return HRESULT with Convention=>Stdcall;
      GetDevice:access function(This:LPIDXGIResource;riid:REFIID;ppDevice:LPLPvoid) return HRESULT with Convention=>Stdcall;
      GetSharedHandle:access function(This:LPIDXGIResource;pSharedHandle:LPHANDLE) return HRESULT with Convention=>Stdcall;
      GetUsage:access function(This:LPIDXGIResource;pUsage:LPDXGI_USAGE) return HRESULT with Convention=>Stdcall;
      SetEvictionPriority:access function(This:LPIDXGIResource;EvictionPriority:UINT) return HRESULT with Convention=>Stdcall;
      GetEvictionPriority:access function(This:LPIDXGIResource;pEvictionPriority:LPUINT) return HRESULT with Convention=>Stdcall;
   end record;

   type IDXGIKeyedMutex is record
      QueryInterface:access function(This:LPIDXGIKeyedMutex;riid:REFIID;ppvObject:LPLPvoid) return HRESULT with Convention=>Stdcall;
      AddRef:access function(This:LPIDXGIKeyedMutex) return ULONG with Convention=>Stdcall;
      Release:access function(This:LPIDXGIKeyedMutex) return ULONG with Convention=>Stdcall;
      SetPrivateData:access function(This:LPIDXGIKeyedMutex;Name:REFGUID;DataSize:UINT;pData:LPCvoid) return HRESULT with Convention=>Stdcall;
      SetPrivateDataInterface:access function(This:LPIDXGIKeyedMutex;Name:REFGUID;pUnknown:LPCIUnknown) return HRESULT with Convention=>Stdcall;
      GetPrivateData:access function(This:LPIDXGIKeyedMutex;Name:REFGUID;pDataSize:LPUINT;pData:LPvoid) return HRESULT with Convention=>Stdcall;
      GetParent:access function(This:LPIDXGIKeyedMutex;riid:REFIID;ppParent:LPLPvoid) return HRESULT with Convention=>Stdcall;
      GetDevice:access function(This:LPIDXGIKeyedMutex;riid:REFIID;ppDevice:LPLPvoid) return HRESULT with Convention=>Stdcall;
      AcquireSync:access function(This:LPIDXGIKeyedMutex;Key:UINT64;dwMilliseconds:DWORD) return HRESULT with Convention=>Stdcall;
      ReleaseSync:access function(This:LPIDXGIKeyedMutex;Key:UINT64) return HRESULT with Convention=>Stdcall;
   end record;

   DXGI_MAP_READ : constant := ( 1 );

   DXGI_MAP_WRITE : constant := ( 2 );

   DXGI_MAP_DISCARD : constant := ( 4 );

   type IDXGISurface is record
      QueryInterface:access function(This:LPIDXGISurface;riid:REFIID;ppvObject:LPLPvoid) return HRESULT with Convention=>Stdcall;
      AddRef:access function(This:LPIDXGISurface) return ULONG with Convention=>Stdcall;
      Release:access function(This:LPIDXGISurface) return ULONG with Convention=>Stdcall;
      SetPrivateData:access function(This:LPIDXGISurface;Name:REFGUID;DataSize:UINT;pData:LPCvoid) return HRESULT with Convention=>Stdcall;
      SetPrivateDataInterface:access function(This:LPIDXGISurface;Name:REFGUID;pUnknown:LPCIUnknown) return HRESULT with Convention=>Stdcall;
      GetPrivateData:access function(This:LPIDXGISurface;Name:REFGUID;pDataSize:LPUINT;pData:LPvoid) return HRESULT with Convention=>Stdcall;
      GetParent:access function(This:LPIDXGISurface;riid:REFIID;ppParent:LPLPvoid) return HRESULT with Convention=>Stdcall;
      GetDevice:access function(This:LPIDXGISurface;riid:REFIID;ppDevice:LPLPvoid) return HRESULT with Convention=>Stdcall;
      GetDesc:access function(This:LPIDXGISurface;pDesc:LPDXGI_SURFACE_DESC) return HRESULT with Convention=>Stdcall;
      Map:access function(This:LPIDXGISurface;pLockedRect:LPDXGI_MAPPED_RECT;MapFlags:UINT) return HRESULT with Convention=>Stdcall;
      Unmap:access function(This:LPIDXGISurface) return HRESULT with Convention=>Stdcall;
   end record;

   type IDXGISurface1 is record
      QueryInterface:access function(This:LPIDXGISurface1;riid:REFIID;ppvObject:LPLPvoid) return HRESULT with Convention=>Stdcall;
      AddRef:access function(This:LPIDXGISurface1) return ULONG with Convention=>Stdcall;
      Release:access function(This:LPIDXGISurface1) return ULONG with Convention=>Stdcall;
      SetPrivateData:access function(This:LPIDXGISurface1;Name:REFGUID;DataSize:UINT;pData:LPCvoid) return HRESULT with Convention=>Stdcall;
      SetPrivateDataInterface:access function(This:LPIDXGISurface1;Name:REFGUID;pUnknown:LPCIUnknown) return HRESULT with Convention=>Stdcall;
      GetPrivateData:access function(This:LPIDXGISurface1;Name:REFGUID;pDataSize:LPUINT;pData:LPvoid) return HRESULT with Convention=>Stdcall;
      GetParent:access function(This:LPIDXGISurface1;riid:REFIID;ppParent:LPLPvoid) return HRESULT with Convention=>Stdcall;
      GetDevice:access function(This:LPIDXGISurface1;riid:REFIID;ppDevice:LPLPvoid) return HRESULT with Convention=>Stdcall;
      GetDesc:access function(This:LPIDXGISurface1;pDesc:LPDXGI_SURFACE_DESC) return HRESULT with Convention=>Stdcall;
      Map:access function(This:LPIDXGISurface1;pLockedRect:LPDXGI_MAPPED_RECT;MapFlags:UINT) return HRESULT with Convention=>Stdcall;
      Unmap:access function(This:LPIDXGISurface1) return HRESULT with Convention=>Stdcall;
      GetDC:access function(This:LPIDXGISurface1;Discard:BOOL;phdc:LPHDC) return HRESULT with Convention=>Stdcall;
      ReleaseDC:access function(This:LPIDXGISurface1;pDirtyRect:LPRECT) return HRESULT with Convention=>Stdcall;
   end record;

   type IDXGIAdapter is record
      QueryInterface:access function(This:LPIDXGIAdapter;riid:REFIID;ppvObject:LPLPvoid) return HRESULT with Convention=>Stdcall;
      AddRef:access function(This:LPIDXGIAdapter) return ULONG with Convention=>Stdcall;
      Release:access function(This:LPIDXGIAdapter) return ULONG with Convention=>Stdcall;
      SetPrivateData:access function(This:LPIDXGIAdapter;Name:REFGUID;DataSize:UINT;pData:LPCvoid) return HRESULT with Convention=>Stdcall;
      SetPrivateDataInterface:access function(This:LPIDXGIAdapter;Name:REFGUID;pUnknown:LPCIUnknown) return HRESULT with Convention=>Stdcall;
      GetPrivateData:access function(This:LPIDXGIAdapter;Name:REFGUID;pDataSize:LPUINT;pData:LPvoid) return HRESULT with Convention=>Stdcall;
      GetParent:access function(This:LPIDXGIAdapter;riid:REFIID;ppParent:LPLPvoid) return HRESULT with Convention=>Stdcall;
      EnumOutputs:access function(This:LPIDXGIAdapter;Output:UINT;ppOutput:LPLPIDXGIOutput) return HRESULT with Convention=>Stdcall;
      GetDesc:access function(This:LPIDXGIAdapter;pDesc:LPDXGI_ADAPTER_DESC) return HRESULT with Convention=>Stdcall;
      CheckInterfaceSupport:access function(This:LPIDXGIAdapter;InterfaceName:REFGUID;pUMDVersion:LPLARGE_INTEGER) return HRESULT with Convention=>Stdcall;
   end record;

   DXGI_ENUM_MODES_INTERLACED : constant := ( 1 );

   DXGI_ENUM_MODES_SCALING : constant := ( 2 );

   type IDXGIOutput is record
      QueryInterface:access function(This:LPIDXGIOutput;riid:REFIID;ppvObject:LPLPvoid) return HRESULT with Convention=>Stdcall;
      AddRef:access function(This:LPIDXGIOutput) return ULONG with Convention=>Stdcall;
      Release:access function(This:LPIDXGIOutput) return ULONG with Convention=>Stdcall;
      SetPrivateData:access function(This:LPIDXGIOutput;Name:REFGUID;DataSize:UINT;pData:LPCvoid) return HRESULT with Convention=>Stdcall;
      SetPrivateDataInterface:access function(This:LPIDXGIOutput;Name:REFGUID;pUnknown:LPCIUnknown) return HRESULT with Convention=>Stdcall;
      GetPrivateData:access function(This:LPIDXGIOutput;Name:REFGUID;pDataSize:LPUINT;pData:LPvoid) return HRESULT with Convention=>Stdcall;
      GetParent:access function(This:LPIDXGIOutput;riid:REFIID;ppParent:LPLPvoid) return HRESULT with Convention=>Stdcall;
      GetDesc:access function(This:LPIDXGIOutput;pDesc:LPDXGI_OUTPUT_DESC) return HRESULT with Convention=>Stdcall;
      GetDisplayModeList:access function(This:LPIDXGIOutput;EnumFormat:DXGI_FORMAT;Flags:UINT;pNumModes:LPUINT;pDesc:LPDXGI_MODE_DESC) return HRESULT with Convention=>Stdcall;
      FindClosestMatchingMode:access function(This:LPIDXGIOutput;pModeToMatch:LPCDXGI_MODE_DESC;pClosestMatch:LPDXGI_MODE_DESC;pConcernedDevice:LPIUnknown) return HRESULT with Convention=>Stdcall;
      WaitForVBlank:access function(This:LPIDXGIOutput) return HRESULT with Convention=>Stdcall;
      TakeOwnership:access function(This:LPIDXGIOutput;pDevice:LPIUnknown;Exclusive:BOOL) return HRESULT with Convention=>Stdcall;
      ReleaseOwnership:access function(This:LPIDXGIOutput) return void with Convention=>Stdcall;
      GetGammaControlCapabilities:access function(This:LPIDXGIOutput;pGammaCaps:LPDXGI_GAMMA_CONTROL_CAPABILITIES) return HRESULT with Convention=>Stdcall;
      SetGammaControl:access function(This:LPIDXGIOutput;pArray:LPCDXGI_GAMMA_CONTROL) return HRESULT with Convention=>Stdcall;
      GetGammaControl:access function(This:LPIDXGIOutput;pArray:LPDXGI_GAMMA_CONTROL) return HRESULT with Convention=>Stdcall;
      SetDisplaySurface:access function(This:LPIDXGIOutput;pScanoutSurface:LPIDXGISurface) return HRESULT with Convention=>Stdcall;
      GetDisplaySurfaceData:access function(This:LPIDXGIOutput;pDestination:LPIDXGISurface) return HRESULT with Convention=>Stdcall;
      GetFrameStatistics:access function(This:LPIDXGIOutput;pStats:LPDXGI_FRAME_STATISTICS) return HRESULT with Convention=>Stdcall;
   end record;

   DXGI_MAX_SWAP_CHAIN_BUFFERS : constant := ( 16 );

   DXGI_PRESENT_TEST : constant := 16#00000001#;

   DXGI_PRESENT_DO_NOT_SEQUENCE : constant := 16#00000002#;

   DXGI_PRESENT_RESTART : constant := 16#00000004#;

   type IDXGISwapChain is record
      QueryInterface:access function(This:LPIDXGISwapChain;riid:REFIID;ppvObject:LPLPvoid) return HRESULT with Convention=>Stdcall;
      AddRef:access function(This:LPIDXGISwapChain) return ULONG with Convention=>Stdcall;
      Release:access function(This:LPIDXGISwapChain) return ULONG with Convention=>Stdcall;
      SetPrivateData:access function(This:LPIDXGISwapChain;Name:REFGUID;DataSize:UINT;pData:LPCvoid) return HRESULT with Convention=>Stdcall;
      SetPrivateDataInterface:access function(This:LPIDXGISwapChain;Name:REFGUID;pUnknown:LPCIUnknown) return HRESULT with Convention=>Stdcall;
      GetPrivateData:access function(This:LPIDXGISwapChain;Name:REFGUID;pDataSize:LPUINT;pData:LPvoid) return HRESULT with Convention=>Stdcall;
      GetParent:access function(This:LPIDXGISwapChain;riid:REFIID;ppParent:LPLPvoid) return HRESULT with Convention=>Stdcall;
      GetDevice:access function(This:LPIDXGISwapChain;riid:REFIID;ppDevice:LPLPvoid) return HRESULT with Convention=>Stdcall;
      Present:access function(This:LPIDXGISwapChain;SyncInterval:UINT;Flags:UINT) return HRESULT with Convention=>Stdcall;
      GetBuffer:access function(This:LPIDXGISwapChain;Buffer:UINT;riid:REFIID;ppSurface:LPLPvoid) return HRESULT with Convention=>Stdcall;
      SetFullscreenState:access function(This:LPIDXGISwapChain;Fullscreen:BOOL;pTarget:LPIDXGIOutput) return HRESULT with Convention=>Stdcall;
      GetFullscreenState:access function(This:LPIDXGISwapChain;pFullscreen:LPBOOL;ppTarget:LPLPIDXGIOutput) return HRESULT with Convention=>Stdcall;
      GetDesc:access function(This:LPIDXGISwapChain;pDesc:LPDXGI_SWAP_CHAIN_DESC) return HRESULT with Convention=>Stdcall;
      ResizeBuffers:access function(This:LPIDXGISwapChain;BufferCount:UINT;Width:UINT;Height:UINT;NewFormat:DXGI_FORMAT;SwapChainFlags:UINT) return HRESULT with Convention=>Stdcall;
      ResizeTarget:access function(This:LPIDXGISwapChain;pNewTargetParameters:LPCDXGI_MODE_DESC) return HRESULT with Convention=>Stdcall;
      GetContainingOutput:access function(This:LPIDXGISwapChain;ppOutput:LPLPIDXGIOutput) return HRESULT with Convention=>Stdcall;
      GetFrameStatistics:access function(This:LPIDXGISwapChain;pStats:LPDXGI_FRAME_STATISTICS) return HRESULT with Convention=>Stdcall;
      GetLastPresentCount:access function(This:LPIDXGISwapChain;pLastPresentCount:LPUINT) return HRESULT with Convention=>Stdcall;
   end record;

   DXGI_MWA_NO_WINDOW_CHANGES : constant dword:= Lsh(1,0);

   DXGI_MWA_NO_ALT_ENTER : constant dword:= Lsh(1,1);

   DXGI_MWA_NO_PRINT_SCREEN : constant dword:= Lsh(1,2);

   DXGI_MWA_VALID : constant := ( 16#7# );

   type IDXGIFactory is record
      QueryInterface:access function(This:LPIDXGIFactory;riid:REFIID;ppvObject:LPLPvoid) return HRESULT with Convention=>Stdcall;
      AddRef:access function(This:LPIDXGIFactory) return ULONG with Convention=>Stdcall;
      Release:access function(This:LPIDXGIFactory) return ULONG with Convention=>Stdcall;
      SetPrivateData:access function(This:LPIDXGIFactory;Name:REFGUID;DataSize:UINT;pData:LPCvoid) return HRESULT with Convention=>Stdcall;
      SetPrivateDataInterface:access function(This:LPIDXGIFactory;Name:REFGUID;pUnknown:LPCIUnknown) return HRESULT with Convention=>Stdcall;
      GetPrivateData:access function(This:LPIDXGIFactory;Name:REFGUID;pDataSize:LPUINT;pData:LPvoid) return HRESULT with Convention=>Stdcall;
      GetParent:access function(This:LPIDXGIFactory;riid:REFIID;ppParent:LPLPvoid) return HRESULT with Convention=>Stdcall;
      EnumAdapters:access function(This:LPIDXGIFactory;Adapter:UINT;ppAdapter:LPLPIDXGIAdapter) return HRESULT with Convention=>Stdcall;
      MakeWindowAssociation:access function(This:LPIDXGIFactory;WindowHandle:HWND;Flags:UINT) return HRESULT with Convention=>Stdcall;
      GetWindowAssociation:access function(This:LPIDXGIFactory;pWindowHandle:LPHWND) return HRESULT with Convention=>Stdcall;
      CreateSwapChain:access function(This:LPIDXGIFactory;pDevice:LPIUnknown;pDesc:LPDXGI_SWAP_CHAIN_DESC;ppSwapChain:LPLPIDXGISwapChain) return HRESULT with Convention=>Stdcall;
      CreateSoftwareAdapter:access function(This:LPIDXGIFactory;Module:HMODULE;ppAdapter:LPLPIDXGIAdapter) return HRESULT with Convention=>Stdcall;
   end record;

   function CreateDXGIFactory(riid:REFIID;ppFactory:LPLPvoid) return HRESULT with Import,Convention=>stdcall,external_name=>"CreateDXGIFactory";

   function CreateDXGIFactory1(riid:REFIID;ppFactory:LPLPvoid) return HRESULT with Import,Convention=>stdcall,external_name=>"CreateDXGIFactory1";

   type IDXGIDevice is record
      QueryInterface:access function(This:LPIDXGIDevice;riid:REFIID;ppvObject:LPLPvoid) return HRESULT with Convention=>Stdcall;
      AddRef:access function(This:LPIDXGIDevice) return ULONG with Convention=>Stdcall;
      Release:access function(This:LPIDXGIDevice) return ULONG with Convention=>Stdcall;
      SetPrivateData:access function(This:LPIDXGIDevice;Name:REFGUID;DataSize:UINT;pData:LPCvoid) return HRESULT with Convention=>Stdcall;
      SetPrivateDataInterface:access function(This:LPIDXGIDevice;Name:REFGUID;pUnknown:LPCIUnknown) return HRESULT with Convention=>Stdcall;
      GetPrivateData:access function(This:LPIDXGIDevice;Name:REFGUID;pDataSize:LPUINT;pData:LPvoid) return HRESULT with Convention=>Stdcall;
      GetParent:access function(This:LPIDXGIDevice;riid:REFIID;ppParent:LPLPvoid) return HRESULT with Convention=>Stdcall;
      GetAdapter:access function(This:LPIDXGIDevice;pAdapter:LPLPIDXGIAdapter) return HRESULT with Convention=>Stdcall;
      CreateSurface:access function(This:LPIDXGIDevice;pDesc:LPCDXGI_SURFACE_DESC;NumSurfaces:UINT;Usage:DXGI_USAGE;pSharedResource:LPCDXGI_SHARED_RESOURCE;ppSurface:LPLPIDXGISurface) return HRESULT with Convention=>Stdcall;
      QueryResourceResidency:access function(This:LPIDXGIDevice;ppResources:access LPIUNKNOWN;pResidencyStatus:LPDXGI_RESIDENCY;NumResources:UINT) return HRESULT with Convention=>Stdcall;
      SetGPUThreadPriority:access function(This:LPIDXGIDevice;Priority:INT) return HRESULT with Convention=>Stdcall;
      GetGPUThreadPriority:access function(This:LPIDXGIDevice;pPriority:LPINT) return HRESULT with Convention=>Stdcall;
   end record;

   type DXGI_ADAPTER_FLAG is (DXGI_ADAPTER_FLAG_NONE,
                              DXGI_ADAPTER_FLAG_REMOTE,
                              DXGI_ADAPTER_FLAG_FORCE_DWORD);
   for DXGI_ADAPTER_FLAG use (DXGI_ADAPTER_FLAG_NONE=>0,
                              DXGI_ADAPTER_FLAG_REMOTE=>1,
                              DXGI_ADAPTER_FLAG_FORCE_DWORD=>16#ffffffff#);

   type LPDXGI_ADAPTER_FLAG is access DXGI_ADAPTER_FLAG;

   type DXGI_ADAPTER_DESC1 is record
      Description:WCHAR_Array(0..127);
      VendorId:UINT;
      DeviceId:UINT;
      SubSysId:UINT;
      Revision:UINT;
      DedicatedVideoMemory:SIZE_T;
      DedicatedSystemMemory:SIZE_T;
      SharedSystemMemory:SIZE_T;
      AdapterLuid:LUID;
      Flags:UINT;
   end record;

   type LPDXGI_ADAPTER_DESC1 is access all DXGI_ADAPTER_DESC1;

   type FLOAT_ARRAY_DEMENSION2 is array(Natural range<>,Natural range<>) of float;

   type DXGI_DISPLAY_COLOR_SPACE is record
      PrimaryCoordinates:FLOAT_ARRAY_DEMENSION2(0..7,0..1);
      WhitePoints:FLOAT_ARRAY_DEMENSION2(0..15,0..1);
   end record;

   type LPDXGI_DISPLAY_COLOR_SPACE is access all DXGI_DISPLAY_COLOR_SPACE;

   type IDXGIFactory1 is record
      QueryInterface:access function(This:LPIDXGIFactory1;riid:REFIID;ppvObject:LPLPvoid) return HRESULT with Convention=>Stdcall;
      AddRef:access function(This:LPIDXGIFactory1) return ULONG with Convention=>Stdcall;
      Release:access function(This:LPIDXGIFactory1) return ULONG with Convention=>Stdcall;
      SetPrivateData:access function(This:LPIDXGIFactory1;Name:REFGUID;DataSize:UINT;pData:LPCvoid) return HRESULT with Convention=>Stdcall;
      SetPrivateDataInterface:access function(This:LPIDXGIFactory1;Name:REFGUID;pUnknown:LPCIUnknown) return HRESULT with Convention=>Stdcall;
      GetPrivateData:access function(This:LPIDXGIFactory1;Name:REFGUID;pDataSize:LPUINT;pData:LPvoid) return HRESULT with Convention=>Stdcall;
      GetParent:access function(This:LPIDXGIFactory1;riid:REFIID;ppParent:LPLPvoid) return HRESULT with Convention=>Stdcall;
      EnumAdapters:access function(This:LPIDXGIFactory1;Adapter:UINT;ppAdapter:LPLPIDXGIAdapter) return HRESULT with Convention=>Stdcall;
      MakeWindowAssociation:access function(This:LPIDXGIFactory1;WindowHandle:HWND;Flags:UINT) return HRESULT with Convention=>Stdcall;
      GetWindowAssociation:access function(This:LPIDXGIFactory1;pWindowHandle:LPHWND) return HRESULT with Convention=>Stdcall;
      CreateSwapChain:access function(This:LPIDXGIFactory1;pDevice:LPIUnknown;pDesc:LPDXGI_SWAP_CHAIN_DESC;ppSwapChain:LPLPIDXGISwapChain) return HRESULT with Convention=>Stdcall;
      CreateSoftwareAdapter:access function(This:LPIDXGIFactory1;Module:HMODULE;ppAdapter:LPLPIDXGIAdapter) return HRESULT with Convention=>Stdcall;
      EnumAdapters1:access function(This:LPIDXGIFactory1;Adapter:UINT;ppAdapter:LPLPIDXGIAdapter1) return HRESULT with Convention=>Stdcall;
      IsCurrent:access function(This:LPIDXGIFactory1) return BOOL with Convention=>Stdcall;
   end record;

   type IDXGIAdapter1 is record
      QueryInterface:access function(This:LPIDXGIAdapter1;riid:REFIID;ppvObject:LPLPvoid) return HRESULT with Convention=>Stdcall;
      AddRef:access function(This:LPIDXGIAdapter1) return ULONG with Convention=>Stdcall;
      Release:access function(This:LPIDXGIAdapter1) return ULONG with Convention=>Stdcall;
      SetPrivateData:access function(This:LPIDXGIAdapter1;Name:REFGUID;DataSize:UINT;pData:LPCvoid) return HRESULT with Convention=>Stdcall;
      SetPrivateDataInterface:access function(This:LPIDXGIAdapter1;Name:REFGUID;pUnknown:LPCIUnknown) return HRESULT with Convention=>Stdcall;
      GetPrivateData:access function(This:LPIDXGIAdapter1;Name:REFGUID;pDataSize:LPUINT;pData:LPvoid) return HRESULT with Convention=>Stdcall;
      GetParent:access function(This:LPIDXGIAdapter1;riid:REFIID;ppParent:LPLPvoid) return HRESULT with Convention=>Stdcall;
      EnumOutputs:access function(This:LPIDXGIAdapter1;Output:UINT;ppOutput:LPLPIDXGIOutput) return HRESULT with Convention=>Stdcall;
      GetDesc:access function(This:LPIDXGIAdapter1;pDesc:LPDXGI_ADAPTER_DESC) return HRESULT with Convention=>Stdcall;
      CheckInterfaceSupport:access function(This:LPIDXGIAdapter1;InterfaceName:REFGUID;pUMDVersion:LPLARGE_INTEGER) return HRESULT with Convention=>Stdcall;
      GetDesc1:access function(This:LPIDXGIAdapter1;pDesc:LPDXGI_ADAPTER_DESC1) return HRESULT with Convention=>Stdcall;
   end record;

   type IDXGIDevice1 is record
      QueryInterface:access function(This:LPIDXGIDevice1;riid:REFIID;ppvObject:LPLPvoid) return HRESULT with Convention=>Stdcall;
      AddRef:access function(This:LPIDXGIDevice1) return ULONG with Convention=>Stdcall;
      Release:access function(This:LPIDXGIDevice1) return ULONG with Convention=>Stdcall;
      SetPrivateData:access function(This:LPIDXGIDevice1;Name:REFGUID;DataSize:UINT;pData:LPCvoid) return HRESULT with Convention=>Stdcall;
      SetPrivateDataInterface:access function(This:LPIDXGIDevice1;Name:REFGUID;pUnknown:LPCIUnknown) return HRESULT with Convention=>Stdcall;
      GetPrivateData:access function(This:LPIDXGIDevice1;Name:REFGUID;pDataSize:LPUINT;pData:LPvoid) return HRESULT with Convention=>Stdcall;
      GetParent:access function(This:LPIDXGIDevice1;riid:REFIID;ppParent:LPLPvoid) return HRESULT with Convention=>Stdcall;
      GetAdapter:access function(This:LPIDXGIDevice1;pAdapter:LPLPIDXGIAdapter) return HRESULT with Convention=>Stdcall;
      CreateSurface:access function(This:LPIDXGIDevice1;pDesc:LPCDXGI_SURFACE_DESC;NumSurfaces:UINT;Usage:DXGI_USAGE;pSharedResource:LPCDXGI_SHARED_RESOURCE;ppSurface:LPLPIDXGISurface) return HRESULT with Convention=>Stdcall;
      QueryResourceResidency:access function(This:LPIDXGIDevice1;ppResources:access LPIUNKNOWN;pResidencyStatus:LPDXGI_RESIDENCY;NumResources:UINT) return HRESULT with Convention=>Stdcall;
      SetGPUThreadPriority:access function(This:LPIDXGIDevice1;Priority:INT) return HRESULT with Convention=>Stdcall;
      GetGPUThreadPriority:access function(This:LPIDXGIDevice1;pPriority:LPINT) return HRESULT with Convention=>Stdcall;
      SetMaximumFrameLatency:access function(This:LPIDXGIDevice1;MaxLatency:UINT) return HRESULT with Convention=>Stdcall;
      GetMaximumFrameLatency:access function(This:LPIDXGIDevice1;pMaxLatency:LPUINT) return HRESULT with Convention=>Stdcall;
   end record;

   IID_IDXGIObject:constant win32.rpcdce.GUID:=(16#aec22fb8#,16#76f3#,16#4639#,(16#9b#,16#e0#,16#28#,16#eb#,16#43#,16#a6#,16#7a#,16#2e#));
   IID_IDXGIDeviceSubObject:constant win32.rpcdce.GUID:=(16#3d3e0379#,16#f9de#,16#4d58#,(16#bb#,16#6c#,16#18#,16#d6#,16#29#,16#92#,16#f1#,16#a6#));
   IID_IDXGIResource:constant win32.rpcdce.GUID:=(16#035f3ab4#,16#482e#,16#4e50#,(16#b4#,16#1f#,16#8a#,16#7f#,16#8b#,16#d8#,16#96#,16#0b#));
   IID_IDXGIKeyedMutex:constant win32.rpcdce.GUID:=(16#9d8e1289#,16#d7b3#,16#465f#,(16#81#,16#26#,16#25#,16#0e#,16#34#,16#9a#,16#f8#,16#5d#));
   IID_IDXGISurface:constant win32.rpcdce.GUID:=(16#cafcb56c#,16#6ac3#,16#4889#,(16#bf#,16#47#,16#9e#,16#23#,16#bb#,16#d2#,16#60#,16#ec#));
   IID_IDXGISurface1:constant win32.rpcdce.GUID:=(16#4AE63092#,16#6327#,16#4c1b#,(16#80#,16#AE#,16#BF#,16#E1#,16#2E#,16#A3#,16#2B#,16#86#));
   IID_IDXGIAdapter:constant win32.rpcdce.GUID:=(16#2411e7e1#,16#12ac#,16#4ccf#,(16#bd#,16#14#,16#97#,16#98#,16#e8#,16#53#,16#4d#,16#c0#));
   IID_IDXGIOutput:constant win32.rpcdce.GUID:=(16#ae02eedb#,16#c735#,16#4690#,(16#8d#,16#52#,16#5a#,16#8d#,16#c2#,16#02#,16#13#,16#aa#));
   IID_IDXGISwapChain:constant win32.rpcdce.GUID:=(16#310d36a0#,16#d2e7#,16#4c0a#,(16#aa#,16#04#,16#6a#,16#9d#,16#23#,16#b8#,16#88#,16#6a#));
   IID_IDXGIFactory:constant win32.rpcdce.GUID:=(16#7b7166ec#,16#21c7#,16#44ae#,(16#b2#,16#1a#,16#c9#,16#ae#,16#32#,16#1a#,16#e3#,16#69#));
   IID_IDXGIDevice:constant win32.rpcdce.GUID:=(16#54ec77fa#,16#1377#,16#44e6#,(16#8c#,16#32#,16#88#,16#fd#,16#5f#,16#44#,16#c8#,16#4c#));
   IID_IDXGIFactory1:constant win32.rpcdce.GUID:=(16#770aae78#,16#f26f#,16#4dba#,(16#a8#,16#29#,16#25#,16#3c#,16#83#,16#d1#,16#b3#,16#87#));
   IID_IDXGIAdapter1:constant win32.rpcdce.GUID:=(16#29038f61#,16#3839#,16#4626#,(16#91#,16#fd#,16#08#,16#68#,16#79#,16#01#,16#1a#,16#05#));
   IID_IDXGIDevice1:constant win32.rpcdce.GUID:=(16#77db970f#,16#6276#,16#48ba#,(16#ba#,16#28#,16#07#,16#01#,16#43#,16#b4#,16#39#,16#2c#));


   --
   -- THE END.
   --

end DXGI;




















 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值