Ada计算机图形DirectX之D3DX11core

----------------------------------------
-- File : D3DX11core.ads              --
-- Translator:Dongfeng.Gu,2018/10/26  --
-- Mail: [email protected]                --
-- Progress:100%                      --
----------------------------------------

with Ada.Characters.Handling;



with win32;                                use win32;
with win32.windef;                         use win32.windef;
with win32.rpcdce;                         use win32.rpcdce;
with win32.objbase;                        use win32.Objbase;
with win32.Wingdi;
with win32.Winerror;

with d3d11;                                use d3d11;


package D3DX11core is

   D3DX11_DLL_W : constant Wide_String:= Ada.Characters.Handling.To_Wide_String("d3dx11_42.dll");

   D3DX11_DLL_A : constant String:= "d3dx11_42.dll";

   D3DX11_DLL : constant String:= D3DX11_DLL_A;

   D3DX11_SDK_VERSION : constant := 42;

   function D3DX11DebugMute(Mute:BOOL) return BOOL with Import,Convention=>stdcall,external_name=>"D3DX11DebugMute";

   function D3DX11CheckVersion(D3DSdkVersion:UINT;D3DX11SdkVersion:UINT) return HRESULT with Import,Convention=>stdcall,external_name=>"D3DX11CheckVersion";


   type ID3DX11DataLoader;
   type LPID3DX11DataLoader is access all ID3DX11DataLoader;
   type LPLPID3DX11DataLoader is access all LPID3DX11DataLoader;
   subtype LPD3DX11DataLoader is LPID3DX11DataLoader;
   subtype LPLPD3DX11DataLoader is LPLPID3DX11DataLoader;

   type ID3DX11DataProcessor;
   type LPID3DX11DataProcessor is access all ID3DX11DataProcessor;
   type LPLPID3DX11DataProcessor is access all LPID3DX11DataProcessor;
   subtype LPD3DX11DataProcessor is LPID3DX11DataProcessor;
   subtype LPLPD3DX11DataProcessor is LPLPID3DX11DataProcessor;

   type ID3DX11ThreadPump;
   type LPID3DX11ThreadPump is access all ID3DX11ThreadPump;
   type LPLPID3DX11ThreadPump is access all LPID3DX11ThreadPump;
   subtype LPD3DX11ThreadPump is LPID3DX11ThreadPump;
   subtype LPLPD3DX11ThreadPump is LPLPID3DX11ThreadPump;

   type ID3DX11DataLoader is record
      Load:access procedure(THIS:LPID3DX11DataLoader) with Convention=>Stdcall;
      Decompress:access procedure(THIS:LPID3DX11DataLoader;ppData:LPLPvoid;pcBytes:LPSIZE_T) with Convention=>Stdcall;
      Destroy:access procedure(THIS:LPID3DX11DataLoader) with Convention=>Stdcall;
   end record;

   type ID3DX11DataProcessor is record
      Process:access procedure(THIS:LPID3DX11DataProcessor;pData:LPvoid;cBytes:SIZE_T) with Convention=>Stdcall;
      CreateDeviceObject:access procedure(THIS:LPID3DX11DataProcessor;ppDataObject:LPLPvoid) with Convention=>Stdcall;
      Destroy:access procedure(THIS:LPID3DX11DataProcessor) with Convention=>Stdcall;
   end record;

   IID_ID3DX11ThreadPump:constant win32.rpcdce.GUID:=(16#c93fecfa#,16#6967#,16#478a#,(16#ab#,16#bc#,16#40#,16#2d#,16#90#,16#62#,16#1f#,16#cb#));
   type ID3DX11ThreadPump is record
      QueryInterface:access procedure(THIS:LPID3DX11ThreadPump;iid:REFIID;ppv:LPLPVOID) with Convention=>Stdcall;
      AddRef:access function(THIS:LPID3DX11ThreadPump) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPID3DX11ThreadPump) return ULONG with Convention=>Stdcall;
      AddWorkItem:access procedure(THIS:LPID3DX11ThreadPump;pDataLoader:LPID3DX11DataLoader;pDataProcessor:LPID3DX11DataProcessor;pHResult:access HRESULT;ppDeviceObject:LPLPvoid) with Convention=>Stdcall;
      GetWorkItemCount:access function(THIS:LPID3DX11ThreadPump) return UINT with Convention=>Stdcall;
      WaitForAllItems:access procedure(THIS:LPID3DX11ThreadPump) with Convention=>Stdcall;
      ProcessDeviceWorkItems:access procedure(THIS:LPID3DX11ThreadPump;iWorkItemCount:UINT) with Convention=>Stdcall;
      PurgeAllItems:access procedure(THIS:LPID3DX11ThreadPump) with Convention=>Stdcall;
      GetQueueStatus:access procedure(THIS:LPID3DX11ThreadPump;pIoQueue:LPUINT;pProcessQueue:LPUINT;pDeviceQueue:LPUINT) with Convention=>Stdcall;
   end record;

   function D3DX11CreateThreadPump(cIoThreads:UINT;cProcThreads:UINT;ppThreadPump:LPLPID3DX11ThreadPump) return HRESULT with Import,Convention=>stdcall,external_name=>"D3DX11CreateThreadPump";

   function D3DX11UnsetAllDeviceObjects(pContext:LPID3D11DeviceContext) return HRESULT with Import,Convention=>stdcall,external_name=>"D3DX11UnsetAllDeviceObjects";

   FACD3D : constant := 16#876#;


   function MAKE_D3DHRESULT(code:WORD) return HRESULT is (win32.Winerror.MAKE_HRESULT( 1, FACD3D, code ));
   function MAKE_D3DSTATUS(code:WORD ) return HRESULT is (win32.Winerror.MAKE_HRESULT( 0, FACD3D, code ));


   D3DERR_INVALIDCALL : constant HRESULT:= MAKE_D3DHRESULT(2156);

   D3DERR_WASSTILLDRAWING : constant HRESULT:= MAKE_D3DHRESULT(540);




end D3DX11core;

猜你喜欢

转载自blog.csdn.net/adacore/article/details/83411173