----------------------------------------
-- File : D3DX10core.ads --
-- Translator:Dongfeng.Gu,2018/10/25 --
-- Mail: [email protected] --
-- Progress:100% --
----------------------------------------
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 DXGI; use DXGI;
with d3d10; use d3d10;
with D3D10_1; use D3D10_1;
with d3d10misc; use d3d10misc;
with Ada.Characters.Handling; use Ada.Characters.Handling;
package D3DX10core is
D3DX10_DLL_W : constant Wide_String:= To_Wide_String("d3dx10_42.dll"&Character'First);
D3DX10_DLL_A : constant String:= "d3dx10_42.dll"&Character'First;
D3DX10_DLL : constant String:= D3DX10_DLL_A;
D3DX10_SDK_VERSION : constant := 42;
function D3DX10CreateDevice(pAdapter:LPIDXGIAdapter;DriverType:D3D10_DRIVER_TYPE;Software:HMODULE;Flags:UINT;ppDevice:LPLPID3D10Device) return HRESULT with Import,Convention=>stdcall,external_name=>"D3DX10CreateDevice";
function D3DX10CreateDeviceAndSwapChain(pAdapter:LPIDXGIAdapter;DriverType:D3D10_DRIVER_TYPE;Software:HMODULE;Flags:UINT;pSwapChainDesc:LPDXGI_SWAP_CHAIN_DESC;ppSwapChain:LPLPIDXGISwapChain;ppDevice:LPLPID3D10Device) return HRESULT with Import,Convention=>stdcall,external_name=>"D3DX10CreateDeviceAndSwapChain";
function D3DX10GetFeatureLevel1(pDevice:LPID3D10Device;ppDevice1:LPLPID3D10Device1) return HRESULT with Import,Convention=>stdcall,external_name=>"D3DX10GetFeatureLevel1";
function D3DX10DebugMute(Mute:BOOL) return BOOL with Import,Convention=>stdcall,external_name=>"D3DX10DebugMute";
function D3DX10CheckVersion(D3DSdkVersion:UINT;D3DX10SdkVersion:UINT) return HRESULT with Import,Convention=>stdcall,external_name=>"D3DX10CheckVersion";
type tagD3DX10_SPRITE_FLAG is (D3DX10_SPRITE_SORT_TEXTURE,
D3DX10_SPRITE_SORT_DEPTH_BACK_TO_FRONT,
D3DX10_SPRITE_SORT_DEPTH_FRONT_TO_BACK,
D3DX10_SPRITE_SAVE_STATE,
D3DX10_SPRITE_ADDREF_TEXTURES);
for tagD3DX10_SPRITE_FLAG use (D3DX10_SPRITE_SORT_TEXTURE=>16#01#,
D3DX10_SPRITE_SORT_DEPTH_BACK_TO_FRONT=>16#02#,
D3DX10_SPRITE_SORT_DEPTH_FRONT_TO_BACK=>16#04#,
D3DX10_SPRITE_SAVE_STATE=>16#08#,
D3DX10_SPRITE_ADDREF_TEXTURES=>16#10#);
subtype D3DX10_SPRITE_FLAG is tagD3DX10_SPRITE_FLAG;
type LPD3DX10_SPRITE_FLAG is access tagD3DX10_SPRITE_FLAG;
type FLOAT_ARRAY_DIMENSION2 is array (Natural range<>,Natural range<>) of float;
-- defined in d3dx10math.h
type D3DXMATRIX(b:Boolean:=True) is record
case b is
when True=>
m11,m12,m13,m14:float;
m21,m22,m23,m24:float;
m31,m32,m33,m34:float;
m41,m42,m43,m44:float;
when False=>
m:FLOAT_ARRAY_DIMENSION2(0..3,0..3);
end case;
end record with Unchecked_Union;
type LPD3DXMATRIX is access all D3DXMATRIX;
-- defined in d3dx10math.h
type D3DXVECTOR2 is record
x,y:float;
end record;
-- defined in d3dx10math.h
type D3DXVECTOR3 is record
x,y,z:float;
end record;
type LPD3DXVECTOR3 is access all D3DXVECTOR3;
type D3DXVECTOR4 is record
x,y,z,w:float;
end record;
type LPD3DXVECTOR4 is access all D3DXVECTOR4;
-- defined in d3dx10math.h
type D3DXCOLOR is record
r,g,b,a:float;
end record;
type tagD3DX10_SPRITE is record
matWorld: D3DXMATRIX;
TexCoord: D3DXVECTOR2;
TexSize: D3DXVECTOR2;
ColorModulate: D3DXCOLOR;
pTexture:LPID3D10ShaderResourceView;
TextureIndex: UINT;
end record;
subtype D3DX10_SPRITE is tagD3DX10_SPRITE;
type LPD3DX10_SPRITE is access all tagD3DX10_SPRITE;
type ID3DX10Sprite;
type LPID3DX10Sprite is access all ID3DX10Sprite;
type LPLPID3DX10Sprite is access all LPID3DX10Sprite;
subtype LPD3DX10Sprite is LPID3DX10Sprite;
subtype LPLPD3DX10Sprite is LPLPID3DX10Sprite;
IID_ID3DX10Sprite:constant win32.rpcdce.GUID:=(16#ba0b762d#,16#8d28#,16#43ec#,(16#b9#,16#dc#,16#2f#,16#84#,16#44#,16#3b#,16#6#,16#14#));
type ID3DX10Sprite is record
QueryInterface:access procedure(THIS:LPID3DX10Sprite;iid:REFIID;ppv:LPLPVOID) with Convention=>Stdcall;
AddRef:access function(THIS:LPID3DX10Sprite) return ULONG with Convention=>Stdcall;
Release:access function(THIS:LPID3DX10Sprite) return ULONG with Convention=>Stdcall;
Beginn:access procedure(THIS:LPID3DX10Sprite;flags:UINT) with Convention=>Stdcall;
DrawSpritesBuffered:access procedure(THIS:LPID3DX10Sprite;pSprites:LPD3DX10_SPRITE;cSprites:UINT) with Convention=>Stdcall;
Flush:access procedure(THIS:LPID3DX10Sprite) with Convention=>Stdcall;
DrawSpritesImmediate:access procedure(THIS:LPID3DX10Sprite;pSprites:LPD3DX10_SPRITE;cSprites:UINT;cbSprite:UINT;flags:UINT) with Convention=>Stdcall;
Endd:access procedure(THIS:LPID3DX10Sprite) with Convention=>Stdcall;
GetViewTransform:access procedure(THIS:LPID3DX10Sprite;pViewTransform:LPD3DXMATRIX) with Convention=>Stdcall;
SetViewTransform:access procedure(THIS:LPID3DX10Sprite;pViewTransform:LPD3DXMATRIX) with Convention=>Stdcall;
GetProjectionTransform:access procedure(THIS:LPID3DX10Sprite;pProjectionTransform:LPD3DXMATRIX) with Convention=>Stdcall;
SetProjectionTransform:access procedure(THIS:LPID3DX10Sprite;pProjectionTransform:LPD3DXMATRIX) with Convention=>Stdcall;
GetDevice:access procedure(THIS:LPID3DX10Sprite;ppDevice:LPLPID3D10Device) with Convention=>Stdcall;
end record;
function D3DX10CreateSprite(pDevice:LPID3D10Device;cDeviceBufferSize:UINT;ppSprite:LPLPD3DX10SPRITE) return HRESULT with Import,Convention=>stdcall,external_name=>"D3DX10CreateSprite";
type ID3DX10DataLoader;
type LPID3DX10DataLoader is access all ID3DX10DataLoader;
type LPLPID3DX10DataLoader is access all LPID3DX10DataLoader;
subtype LPD3DX10DataLoader is LPID3DX10DataLoader;
subtype LPLPD3DX10DataLoader is LPLPID3DX10DataLoader;
type ID3DX10DataLoader is record
Load:access procedure(THIS:LPID3DX10DataLoader) with Convention=>Stdcall;
Decompress:access procedure(THIS:LPID3DX10DataLoader;ppData:LPLPvoid;pcBytes:LPSIZE_T) with Convention=>Stdcall;
Destroy:access procedure(THIS:LPID3DX10DataLoader) with Convention=>Stdcall;
end record;
type ID3DX10DataProcessor;
type LPID3DX10DataProcessor is access all ID3DX10DataProcessor;
type LPLPID3DX10DataProcessor is access all LPID3DX10DataProcessor;
subtype LPD3DX10DataProcessor is LPID3DX10DataProcessor;
subtype LPLPD3DX10DataProcessor is LPLPID3DX10DataProcessor;
type ID3DX10DataProcessor is record
Process:access procedure(THIS:LPID3DX10DataProcessor;pData:LPvoid;cBytes:SIZE_T) with Convention=>Stdcall;
CreateDeviceObject:access procedure(THIS:LPID3DX10DataProcessor;ppDataObject:LPLPvoid) with Convention=>Stdcall;
Destroy:access procedure(THIS:LPID3DX10DataProcessor) with Convention=>Stdcall;
end record;
type ID3DX10ThreadPump;
type LPID3DX10ThreadPump is access all ID3DX10ThreadPump;
type LPLPID3DX10ThreadPump is access all LPID3DX10ThreadPump;
subtype LPD3DX10ThreadPump is LPID3DX10ThreadPump;
subtype LPLPD3DX10ThreadPump is LPLPID3DX10ThreadPump;
IID_ID3DX10ThreadPump: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 ID3DX10ThreadPump is record
QueryInterface:access procedure(THIS:LPID3DX10ThreadPump;iid:REFIID;ppv:LPLPVOID) with Convention=>Stdcall;
AddRef:access function(THIS:LPID3DX10ThreadPump) return ULONG with Convention=>Stdcall;
Release:access function(THIS:LPID3DX10ThreadPump) return ULONG with Convention=>Stdcall;
AddWorkItem:access procedure(THIS:LPID3DX10ThreadPump;pDataLoader:LPID3DX10DataLoader;pDataProcessor:LPID3DX10DataProcessor;pHResult:ACCESS HRESULT;ppDeviceObject:LPLPvoid) with Convention=>Stdcall;
GetWorkItemCount:access function(THIS:LPID3DX10ThreadPump) return UINT with Convention=>Stdcall;
WaitForAllItems:access procedure(THIS:LPID3DX10ThreadPump) with Convention=>Stdcall;
ProcessDeviceWorkItems:access procedure(THIS:LPID3DX10ThreadPump;iWorkItemCount:UINT) with Convention=>Stdcall;
PurgeAllItems:access procedure(THIS:LPID3DX10ThreadPump) with Convention=>Stdcall;
GetQueueStatus:access procedure(THIS:LPID3DX10ThreadPump;pIoQueue:LPUINT;pProcessQueue:LPUINT;pDeviceQueue:LPUINT) with Convention=>Stdcall;
end record;
function D3DX10CreateThreadPump(cIoThreads:UINT;cProcThreads:UINT;ppThreadPump:LPLPID3DX10ThreadPump) return HRESULT with Import,Convention=>stdcall,external_name=>"D3DX10CreateThreadPump";
type tagD3DX10_FONT_DESCA is record
Height: INT;
Width: UINT;
Weight: UINT;
MipLevels: UINT;
Italic: BOOL;
CharSet: BYTE;
OutputPrecision: BYTE;
Quality: BYTE;
PitchAndFamily: BYTE;
FaceName: CHAR_Array(0..Wingdi.LF_FACESIZE-1);
end record;
subtype D3DX10_FONT_DESCA is tagD3DX10_FONT_DESCA;
type LPD3DX10_FONT_DESCA is access all tagD3DX10_FONT_DESCA;
type tagD3DX10_FONT_DESCW is record
Height: INT;
Width: UINT;
Weight: UINT;
MipLevels: UINT;
Italic: BOOL;
CharSet: BYTE;
OutputPrecision: BYTE;
Quality: BYTE;
PitchAndFamily: BYTE;
FaceName: WCHAR_Array(0..Wingdi.LF_FACESIZE-1);
end record;
subtype D3DX10_FONT_DESCW is tagD3DX10_FONT_DESCW;
type LPD3DX10_FONT_DESCW is access all tagD3DX10_FONT_DESCW;
IID_ID3DX10Font:constant win32.rpcdce.GUID:=(16#d79dbb70#,16#5f21#,16#4d36#,(16#bb#,16#c2#,16#ff#,16#52#,16#5c#,16#21#,16#3c#,16#dc#));
end D3DX10core;