d3d9.bmx 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743
  1. Strict
  2. Import brl.standardio
  3. Import Pub.Win32
  4. Import "d3d.bmx"
  5. Import "include/*.h"
  6. Import "d3d9.cpp"
  7. Const DIRECT3D_VERSION9=$900
  8. 'what's up with this...?
  9. Type D3DDEVTYPE
  10. Const D3DDEVTYPE_HAL = 1
  11. Const D3DDEVTYPE_REF = 2
  12. Const D3DDEVTYPE_SW = 3
  13. Const D3DDEVTYPE_NULLREF = 4
  14. Const D3DDEVTYPE_FORCE_DWORD = $7fffffff
  15. End Type
  16. Global nullBaseTexture9:IDirect3DBaseTexture9' = New IDirect3DBaseTexture9
  17. Extern
  18. Function bmx_directx_d3d9_D3DCAPS9_new:Byte Ptr()
  19. Function bmx_directx_d3d9_D3DCAPS9_free(handle:Byte Ptr)
  20. End Extern
  21. Struct D3DVSHADERCAPS2_0
  22. Field Caps
  23. Field DynamicFlowControlDepth
  24. Field NumTemps
  25. Field StaticFlowControlDepth
  26. End Struct
  27. Struct D3DPSHADERCAPS2_0
  28. Field Caps
  29. Field DynamicFlowControlDepth
  30. Field NumTemps
  31. Field StaticFlowControlDepth
  32. Field NumInstructionSlots
  33. End Struct
  34. Struct D3DCAPS9
  35. Field DeviceType 'D3DDEVTYPE
  36. Field AdapterOrdinal;
  37. Field Caps;
  38. Field Caps2;
  39. Field Caps3;
  40. Field PresentationIntervals;
  41. Field CursorCaps;
  42. Field DevCaps;
  43. Field PrimitiveMiscCaps;
  44. Field RasterCaps;
  45. Field ZCmpCaps;
  46. Field SrcBlendCaps;
  47. Field DestBlendCaps;
  48. Field AlphaCmpCaps;
  49. Field ShadeCaps;
  50. Field TextureCaps;
  51. Field TextureFilterCaps;
  52. Field CubeTextureFilterCaps;
  53. Field VolumeTextureFilterCaps;
  54. Field TextureAddressCaps;
  55. Field VolumeTextureAddressCaps;
  56. Field LineCaps;
  57. Field MaxTextureWidth;
  58. Field MaxTextureHeight;
  59. Field MaxVolumeExtent;
  60. Field MaxTextureRepeat;
  61. Field MaxTextureAspectRatio;
  62. Field MaxAnisotropy;
  63. Field MaxVertexW#;
  64. Field GuardBandLeft#;
  65. Field GuardBandTop#;
  66. Field GuardBandRight#;
  67. Field GuardBandBottom#;
  68. Field ExtentsAdjust#;
  69. Field StencilCaps;
  70. Field FVFCaps;
  71. Field TextureOpCaps;
  72. Field MaxTextureBlendStages;
  73. Field MaxSimultaneousTextures;
  74. Field VertexProcessingCaps;
  75. Field MaxActiveLights;
  76. Field MaxUserClipPlanes;
  77. Field MaxVertexBlendMatrices;
  78. Field MaxVertexBlendMatrixIndex;
  79. Field MaxPointSize#;
  80. Field MaxPrimitiveCount;
  81. Field MaxVertexIndex;
  82. Field MaxStreams;
  83. Field MaxStreamStride;
  84. Field VertexShaderVersion;
  85. Field MaxVertexShaderConst;
  86. Field PixelShaderVersion;
  87. Field PixelShader1xMaxValue#;
  88. Field DevCaps2;
  89. Field MaxNpatchTessellationLevel#;
  90. Field Reserved5;
  91. Field MasterAdapterOrdinal;
  92. Field AdapterOrdinalInGroup;
  93. Field NumberOfAdaptersInGroup;
  94. Field DeclTypes;
  95. Field NumSimultaneousRTs;
  96. Field StretchRectFilterCaps;
  97. Field VS20Caps:D3DVSHADERCAPS2_0
  98. Field PS20Caps:D3DPSHADERCAPS2_0
  99. Field VertexTextureFilterCaps;
  100. Field MaxVShaderInstructionsExecuted;
  101. Field MaxPShaderInstructionsExecuted;
  102. Field MaxVertexShader30InstructionSlots;
  103. Field MaxPixelShader30InstructionSlots;
  104. End Struct
  105. Type D3DCLIPSTATUS9
  106. Field ClipUnion
  107. Field ClipIntersection
  108. End Type
  109. Struct D3DVIEWPORT9
  110. Field X
  111. Field Y
  112. Field Width
  113. Field Height
  114. Field MinZ:Float
  115. Field MaxZ:Float
  116. End Struct
  117. Type D3DMATERIAL9
  118. Field Diffuse_r#,Diffuse_g#,Diffuse_b#,Diffuse_a#
  119. Field Ambient_r#,Ambient_g#,Ambient_b#,Ambient_a#
  120. Field Specular_r#,Specular_g#,Specular_b#,Specular_a#
  121. Field Emissive_r#,Emissive_g#,Emissive_b#,Emissive_a#
  122. Field Power#
  123. End Type
  124. Type D3DLIGHT9
  125. Field Type_
  126. Field Diffuse_r#,Diffuse_g#,Diffuse_b#,Diffuse_a#
  127. Field Specular_r#,Specular_g#,Specular_b#,Specular_a#
  128. Field Ambient_r#,Ambient_g#,Ambient_b#,Ambient_a#
  129. Field Position_x#,Position_y#,Position_z#
  130. Field Direction_x#,Direction_y#,Direction_z#
  131. Field Range#
  132. Field Falloff#
  133. Field Attenuation0#
  134. Field Attenuation1#
  135. Field Attenuation2#
  136. Field Theta#
  137. Field Phi#
  138. End Type
  139. Type D3DVERTEXELEMENT9
  140. Field Stream:Short
  141. Field Offset:Short
  142. Field Type_:Byte
  143. Field Method_:Byte
  144. Field Usage:Byte
  145. Field UsageIndex:Byte
  146. End Type
  147. Type D3DADAPTER_IDENTIFIER9
  148. Field Driver0, Driver1, Driver2, Driver3, Driver4, Driver5, Driver6, Driver7, Driver8, Driver9
  149. Field Driver10, Driver11, Driver12, Driver13, Driver14, Driver15, Driver16, Driver17, Driver18, Driver19
  150. Field Driver20, Driver21, Driver22, Driver23, Driver24, Driver25, Driver26, Driver27, Driver28, Driver29
  151. Field Driver30, Driver31, Driver32, Driver33, Driver34, Driver35, Driver36, Driver37, Driver38, Driver39
  152. Field Driver40, Driver41, Driver42, Driver43, Driver44, Driver45, Driver46, Driver47, Driver48, Driver49
  153. Field Driver50, Driver51, Driver52, Driver53, Driver54, Driver55, Driver56, Driver57, Driver58, Driver59
  154. Field Driver60, Driver61, Driver62, Driver63, Driver64, Driver65, Driver66, Driver67, Driver68, Driver69
  155. Field Driver70, Driver71, Driver72, Driver73, Driver74, Driver75, Driver76, Driver77, Driver78, Driver79
  156. Field Driver80, Driver81, Driver82, Driver83, Driver84, Driver85, Driver86, Driver87, Driver88, Driver89
  157. Field Driver90, Driver91, Driver92, Driver93, Driver94, Driver95, Driver96, Driver97, Driver98, Driver99
  158. Field Driver100, Driver101, Driver102, Driver103, Driver104, Driver105, Driver106, Driver107, Driver108, Driver109
  159. Field Driver110, Driver111, Driver112, Driver113, Driver114, Driver115, Driver116, Driver117, Driver118, Driver119
  160. Field Driver120, Driver121, Driver122, Driver123, Driver124, Driver125, Driver126, Driver127
  161. Field Description0, Description1, Description2, Description3, Description4, Description5, Description6, Description7, Description8, Description9
  162. Field Description10, Description11, Description12, Description13, Description14, Description15, Description16, Description17, Description18, Description19
  163. Field Description20, Description21, Description22, Description23, Description24, Description25, Description26, Description27, Description28, Description29
  164. Field Description30, Description31, Description32, Description33, Description34, Description35, Description36, Description37, Description38, Description39
  165. Field Description40, Description41, Description42, Description43, Description44, Description45, Description46, Description47, Description48, Description49
  166. Field Description50, Description51, Description52, Description53, Description54, Description55, Description56, Description57, Description58, Description59
  167. Field Description60, Description61, Description62, Description63, Description64, Description65, Description66, Description67, Description68, Description69
  168. Field Description70, Description71, Description72, Description73, Description74, Description75, Description76, Description77, Description78, Description79
  169. Field Description80, Description81, Description82, Description83, Description84, Description85, Description86, Description87, Description88, Description89
  170. Field Description90, Description91, Description92, Description93, Description94, Description95, Description96, Description97, Description98, Description99
  171. Field Description100, Description101, Description102, Description103, Description104, Description105, Description106, Description107, Description108, Description109
  172. Field Description110, Description111, Description112, Description113, Description114, Description115, Description116, Description117, Description118, Description119
  173. Field Description120, Description121, Description122, Description123, Description124, Description125, Description126, Description127
  174. Field DeviceName0, DeviceName1, DeviceName2, DeviceName3, DeviceName4, DeviceName5, DeviceName6, DeviceName7
  175. Field DriverVersionLowPart
  176. Field DriverVersionHighPart
  177. Field VendorId
  178. Field DeviceId
  179. Field SubSysId
  180. Field Revision
  181. Field DeviceIdentifier0
  182. Field DeviceIdentifier1
  183. Field DeviceIdentifier2
  184. Field DeviceIdentifier3
  185. Field WHQLLevel
  186. Method Driver$()
  187. Return String.fromCString(Varptr Driver0)
  188. End Method
  189. Method Description$()
  190. Return String.fromCString(Varptr Description0)
  191. End Method
  192. Method DeviceName$()
  193. Return String.fromCString(Varptr DeviceName0)
  194. End Method
  195. End Type
  196. Extern "win32"
  197. Interface IDirect3DQuery9 Extends IUnknown_
  198. Method GetDevice( ppDevice:IDirect3DDevice9 Var )
  199. Method GetType()
  200. Method GetDataSize()
  201. Method Issue( dwIssueFlags:Int )
  202. Method GetData( pData:Byte Ptr,dwSize,dwGetDataFlags )
  203. Rem
  204. STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE;
  205. STDMETHOD_(D3DQUERYTYPE, GetType)(THIS) PURE;
  206. STDMETHOD_(DWORD, GetDataSize)(THIS) PURE;
  207. STDMETHOD(Issue)(THIS_ DWORD dwIssueFlags) PURE;
  208. STDMETHOD(GetData)(THIS_ void* pData,DWORD dwSize,DWORD dwGetDataFlags) PURE;
  209. End Rem
  210. End Interface
  211. Interface IDirect3DStateBlock9 Extends IUnknown_
  212. Method GetDevice(ppDevice:IDirect3DDevice9 Var)
  213. Method Capture()
  214. Method Apply()
  215. Rem
  216. STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE;
  217. STDMETHOD(Capture)(THIS) PURE;
  218. STDMETHOD(Apply)(THIS) PURE;
  219. End Rem
  220. End Interface
  221. Interface IDirect3DPixelShader9 Extends IUnknown_
  222. Rem
  223. STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE;
  224. STDMETHOD(GetFunction)(THIS_ void*,UINT* pSizeOfData) PURE;
  225. End Rem
  226. End Interface
  227. Interface IDirect3DVertexShader9 Extends IUnknown_
  228. Rem
  229. STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE;
  230. STDMETHOD(GetFunction)(THIS_ void*,UINT* pSizeOfData) PURE;
  231. End Rem
  232. End Interface
  233. Interface IDirect3DVertexDeclaration9 Extends IUnknown_
  234. Rem
  235. STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE;
  236. STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9*,UINT* pNumElements) PURE;
  237. End Rem
  238. End Interface
  239. End Extern
  240. Extern "win32"
  241. Interface IDirect3D9 Extends IUnknown_
  242. Method RegisterSoftwareDevice( pInitializeFunction() )
  243. Method GetAdapterCount()
  244. Method GetAdapterIdentifier( Adapter,Flags,pIdentifier:Byte Ptr )
  245. Method GetAdapterModeCount( Adapter,Format )
  246. Method EnumAdapterModes( Adapter,Format,Mode,pMode:D3DDISPLAYMODE Var)
  247. Method GetAdapterDisplayMode( Adapter,pMode:D3DDISPLAYMODE Var)
  248. Method CheckDeviceType( iAdapter,DevType,DisplayFormat,BackBufferFormat,bWindowed )
  249. Method CheckDeviceFormat( Adapter,DeviceType,AdapterFormat,Usage,RType,CheckFormat )
  250. Method CheckDeviceMultiSampleType( Adapter,DeviceType,SurfaceFormat,Windowed,MultiSampleType,pQualityLevels:Int Ptr )
  251. Method CheckDepthStencilMatch( Adapter,DeviceType,AdapterFormat,RenderTargetFormat,DepthStencilFormat )
  252. Method CheckDeviceFormatConversion( Adapter,DeviceType,SourceFormat,TargetFormat )
  253. Method GetDeviceCaps( Adapter,DeviceType,pCaps:D3DCAPS9 Var)
  254. Method GetAdapterMonitor( Adapter )
  255. Method CreateDevice( Adapter:Int,DeviceType:Int,hFocusWindow:Byte Ptr,BehaviorFlags:Int, pPresentationParameters:D3DPRESENT_PARAMETERS Var,ppReturnedDeviceInterface:IDirect3DDevice9 Var)
  256. Rem
  257. STDMETHOD(RegisterSoftwareDevice)(THIS_ void* pInitializeFunction) PURE;
  258. STDMETHOD_(UINT, GetAdapterCount)(THIS) PURE;
  259. STDMETHOD(GetAdapterIdentifier)(THIS_ UINT Adapter,DWORD Flags,D3DADAPTER_IDENTIFIER9* pIdentifier) PURE;
  260. STDMETHOD_(UINT, GetAdapterModeCount)(THIS_ UINT Adapter,D3DFORMAT Format) PURE;
  261. STDMETHOD(EnumAdapterModes)(THIS_ UINT Adapter,D3DFORMAT Format,UINT Mode,D3DDISPLAYMODE* pMode) PURE;
  262. STDMETHOD(GetAdapterDisplayMode)(THIS_ UINT Adapter,D3DDISPLAYMODE* pMode) PURE;
  263. STDMETHOD(CheckDeviceType)(THIS_ UINT iAdapter,D3DDEVTYPE DevType,D3DFORMAT DisplayFormat,D3DFORMAT BackBufferFormat,BOOL bWindowed) PURE;
  264. STDMETHOD(CheckDeviceFormat)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,DWORD Usage,D3DRESOURCETYPE RType,D3DFORMAT CheckFormat) PURE;
  265. STDMETHOD(CheckDeviceMultiSampleType)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SurfaceFormat,BOOL Windowed,D3DMULTISAMPLE_TYPE MultiSampleType,DWORD* pQualityLevels) PURE;
  266. STDMETHOD(CheckDepthStencilMatch)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,D3DFORMAT RenderTargetFormat,D3DFORMAT DepthStencilFormat) PURE;
  267. STDMETHOD(CheckDeviceFormatConversion)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SourceFormat,D3DFORMAT TargetFormat) PURE;
  268. STDMETHOD(GetDeviceCaps)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DCAPS9* pCaps) PURE;
  269. STDMETHOD_(HMONITOR, GetAdapterMonitor)(THIS_ UINT Adapter) PURE;
  270. STDMETHOD(CreateDevice)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DDevice9** ppReturnedDeviceInterface) PURE;
  271. End Rem
  272. End Interface
  273. End Extern
  274. Extern "win32"
  275. Interface IDirect3DDevice9 Extends IUnknown_
  276. Method TestCooperativeLevel()
  277. Method GetAvailableTextureMem()
  278. Method EvictManagedResources()
  279. Method GetDirect3D( ppD3D9:IDirect3D9 Var )
  280. Method GetDeviceCaps( caps:Byte Ptr )
  281. Method GetDisplayMode( iSwapChain,pMode:Byte Ptr )
  282. Method GetCreationParameters( pParameters:Byte Ptr )
  283. Method SetCursorProperties( XHotSpot,YHotSpot,pCursorBitmap:IDirect3DSurface9 )
  284. Method SetCursorPosition( X,Y,Flags )
  285. Method ShowCursor( bShow )
  286. Method CreateAdditionalSwapChain( pPresentationParameters:D3DPRESENT_PARAMETERS Var,pSwapChain:IDirect3DSwapChain9 Var )
  287. Method GetSwapChain( iSwapChain,pSwapChain:IDirect3DSwapChain9 Var )
  288. Method GetNumberOfSwapChains()
  289. Method Reset( pPresentationParameters:D3DPRESENT_PARAMETERS Var)
  290. Method Present( pSourceRect:Byte Ptr,pDestRect:Byte Ptr,hDestWindowOverride:Byte Ptr,pDirtyRegion:Byte Ptr )
  291. Method GetBackBuffer( iSwapChain,iBackBuffer,bType,ppBackBuffer:IDirect3DSurface9 Var )
  292. Method GetRasterStatus( iSwapChain,pRasterStatus:Byte Ptr )
  293. Method SetDialogBoxMode( bEnableDialogs )
  294. Method SetGammaRamp( iSwapChain,Flags,pRamp:Short Ptr )
  295. Method GetGammaRamp( iSwapChain,pRamp:Short Ptr )
  296. Method CreateTexture( Width,Height,Levels,Usage,Format,Pool,ppTexture:IDirect3DTexture9 Var,pSharedHandle:Byte Ptr )
  297. Method CreateVolumeTexture( Width,Height,Depth,Levels,Usage,Format,Pool,ppVolumeTexture:IDirect3DVolumeTexture9 Var,pSharedHandle:Byte Ptr )
  298. Method CreateCubeTexture( EdgeLength,Levels,Usage,Format,Pool,ppTexture:IDirect3DCubeTexture9 Var,pSharedHandle:Byte Ptr )
  299. Method CreateVertexBuffer( Length,Usage,FVF,Pool,ppVertexBuffer:IDirect3DVertexBuffer9 Var,pSharedHandle:Byte Ptr )
  300. Method CreateIndexBuffer( Length,Usage,Format,Pool,ppIndexBuffer:IDirect3DIndexBuffer9 Var,pSharedHandle:Byte Ptr )
  301. Method CreateRenderTarget( Width,Height,Format,MultiSample,MultisampleQuality,Lockable,ppSurface:IDirect3DSurface9 Var,pSharedHandle:Byte Ptr )
  302. Method CreateDepthStencilSurface( Width,Height,Format,MultiSample,MultisampleQuality,Discard,ppSurface:IDirect3DSurface9 Var,pSharedHandle:Byte Ptr )
  303. Method UpdateSurface( pSourceSurface:IDirect3DSurface9,pSourceRect:Byte Ptr,pDestinationSurface:IDirect3DSurface9,pDestPoint:Byte Ptr )
  304. Method UpdateTexture( pSourceTexture:IDirect3DBaseTexture9,pDestinationTexture:IDirect3DBaseTexture9 )
  305. Method GetRenderTargetData( pRenderTarget:IDirect3DSurface9,pDestSurface:IDirect3DSurface9 )
  306. Method GetFrontBufferData( iSwapChain,pDestSurface:IDirect3DSurface9 )
  307. Method StretchRect( pSourceSurface:IDirect3DSurface9,pSourceRect:Byte Ptr,pDestSurface:IDirect3DSurface9,pDestRect:Byte Ptr,Filter )
  308. Method ColorFill( pSurface:IDirect3DSurface9,pRect:Byte Ptr,color )
  309. Method CreateOffscreenPlainSurface( Width,Height,Format,Pool,ppSurface:IDirect3DSurface9 Var,pSharedHandle:Byte Ptr )
  310. Method SetRenderTarget( RenderTargetIndex,pRenderTarget:IDirect3DSurface9 )
  311. Method GetRenderTarget( RenderTargetIndex,pRenderTarget:IDirect3DSurface9)
  312. Method SetDepthStencilSurface( pNewZStencil:IDirect3DSurface9 )
  313. Method GetDepthStencilSurface( ppZStencilSurface:IDirect3DSurface9 Var )
  314. Method BeginScene()
  315. Method EndScene()
  316. Method Clear( Count,pRects:Byte Ptr,Flags,Color,Z#,Stencil )
  317. Method SetTransform( State,pMatrix:Float Ptr )
  318. Method GetTransform( State,pMatrix:Float Ptr )
  319. Method MultiplyTransform( State,pMatrix:Float Ptr )
  320. Method SetViewport( pViewport:D3DVIEWPORT9 Var )
  321. Method GetViewport( pViewport:Byte Ptr )
  322. Method SetMaterial( pMaterial:Byte Ptr )
  323. Method GetMaterial( pMaterial:Byte Ptr )
  324. Method SetLight( Index,pLight:Byte Ptr )
  325. Method GetLight( Index,pLight:Byte Ptr )
  326. Method LightEnable( Index,Enable )
  327. Method GetLightEnable( Index,Enable:Int Ptr )
  328. Method SetClipPlane( Index,pPlane:Float Ptr )
  329. Method GetClipPlane( Index,pPlane:Float Ptr )
  330. Method SetRenderState( State,Value )
  331. Method GetRenderState( State,Value Var )
  332. Method CreateStateBlock( Type_,ppSB:IDirect3DStateBlock9 Var )
  333. Method BeginStateBlock()
  334. Method EndStateBlock( ppSB:IDirect3DStateBlock9 Var )
  335. Method SetClipStatus( pClipStatus:Byte Ptr )
  336. Method GetClipStatus( pClipStatus:Byte Ptr )
  337. Method GetTexture( Stage,ppTexture:IDirect3DBaseTexture9 Var )
  338. Method SetTexture( Stage,pTexture:IDirect3DBaseTexture9 )
  339. Method GetTextureStageState( Stage,Type_,pValue Var )
  340. Method SetTextureStageState( Stage,Type_,Value )
  341. Method GetSamplerState( Sampler,Type_,pValue Var )
  342. Method SetSamplerState( Sampler,Type_,Value )
  343. Method ValidateDevice( pNumPasses:Int Ptr )
  344. Method SetPaletteEntries( PaletteNumber,pEntries:Byte Ptr )
  345. Method GetPaletteEntries( PaletteNumber,pEntries:Byte Ptr )
  346. Method SetCurrentTexturePalette( PaletteNumber )
  347. Method GetCurrentTexturePalette( PaletteNumber Var )
  348. Method SetScissorRect( pRect:Byte Ptr )
  349. Method GetScissorRect( pRect:Byte Ptr )
  350. Method SetSoftwareVertexProcessing( bSoftware )
  351. Method GetSoftwareVertexProcessing()
  352. Method SetNPatchMode( nSegments# )
  353. Method GetNPatchMode#()
  354. Method DrawPrimitive( PrimitiveType,StartVertex,PrimitiveCount )
  355. Method DrawIndexedPrimitive( PrimitiveType,BaseVertexIndex,MinVertexIndex,NumVertices,startIndex,primCount )
  356. Method DrawPrimitiveUP( PrimitiveType,PrimitiveCount,pVertexStreamZeroData:Byte Ptr,VertexStreamZeroStride )
  357. Method DrawIndexedPrimitiveUP( PrimitiveType,MinVertexIndex,NumVertices,PrimitiveCount,pIndexData:Byte Ptr,IndexDataFormat,pVertexStreamZeroData:Byte Ptr,VertexStreamZeroStride )
  358. Method ProcessVertices( SrcStartIndex,DestIndex,VertexCount,pDestBuffer:IDirect3DVertexBuffer9,pVertexDecl:IDirect3DVertexDeclaration9,Flags )
  359. Method CreateVertexDeclaration( pVertexElements:Byte Ptr,ppDecl:IDirect3DVertexDeclaration9 Var )
  360. Method SetVertexDeclaration( pDecl:IDirect3DVertexDeclaration9 )
  361. Method GetVertexDeclaration( ppDecl:IDirect3DVertexDeclaration9 Var )
  362. Method SetFVF( FVF )
  363. Method GetFVF( FVF Var )
  364. Method CreateVertexShader( pFunction:Byte Ptr,ppShader:IDirect3DVertexShader9 Var )
  365. Method SetVertexShader( pShader:IDirect3DVertexShader9 )
  366. Method GetVertexShader( ppShader:IDirect3DVertexShader9 Var )
  367. Method SetVertexShaderConstantF( StartRegister,pConstantData:Float Ptr,Vector4fCount )
  368. Method GetVertexShaderConstantF( StartRegister,pConstantData:Float Ptr,Vector4fCount )
  369. Method SetVertexShaderConstantI( StartRegister,pConstantData:Int Ptr,Vector4iCount )
  370. Method GetVertexShaderConstantI( StartRegister,pConstantData:Int Ptr,Vector4iCount )
  371. Method SetVertexShaderConstantB( StartRegister,pConstantData:Byte Ptr,BoolCount )
  372. Method GetVertexShaderConstantB( StartRegister,pConstantData:Byte Ptr,BoolCount )
  373. Method SetStreamSource( StreamNumber,pStreamData:IDirect3DVertexBuffer9,OffsetInBytes,Stride )
  374. Method GetStreamSource( StreamNumber,ppStreamData:IDirect3DVertexBuffer9 Var,OffsetInBytes Var,Stride Var )
  375. Method SetStreamSourceFreq( StreamNumber,Divider )
  376. Method GetStreamSourceFreq( StreamNumber,Divider Var )
  377. Method SetIndices( pIndexData:IDirect3DIndexBuffer9 )
  378. Method GetIndices( ppIndexData:IDirect3DIndexBuffer9 Var )
  379. Method CreatePixelShader( pFunction:Byte Ptr,ppShader:IDirect3DPixelShader9 Var )
  380. Method SetPixelShader( pShader:IDirect3DPixelShader9 )
  381. Method GetPixelShader( ppShader:IDirect3DPixelShader9 Var )
  382. Method SetPixelShaderConstantF( StartRegister,pConstantData:Float Ptr,Vector4fCount )
  383. Method GetPixelShaderConstantF( StartRegister,pConstantData:Float Ptr,Vector4fCount )
  384. Method SetPixelShaderConstantI( StartRegister,pConstantData:Int Ptr,Vector4iCount )
  385. Method GetPixelShaderConstantI( StartRegister,pConstantData:Int Ptr,Vector4iCount )
  386. Method SetPixelShaderConstantB( StartRegister,pConstantData:Byte Ptr,BoolCount )
  387. Method GetPixelShaderConstantB( StartRegister,pConstantData:Byte Ptr,BoolCount )
  388. Method DrawRectPatch( Handle,pNumSegs:Float Ptr,pRectPathInfo:Byte Ptr )
  389. Method DrawTriPatch( Handle,pNumSegs:Float Ptr,pTriPatchInfo:Byte Ptr )
  390. Method DeletePatch( Handle )
  391. Method CreateQuery(Type_:Int, ppQuery:IDirect3DQuery9 Var)
  392. Rem
  393. STDMETHOD(TestCooperativeLevel)(THIS) PURE;
  394. STDMETHOD_(UINT, GetAvailableTextureMem)(THIS) PURE;
  395. STDMETHOD(EvictManagedResources)(THIS) PURE;
  396. STDMETHOD(GetDirect3D)(THIS_ IDirect3D9** ppD3D9) PURE;
  397. STDMETHOD(GetDeviceCaps)(THIS_ D3DCAPS9* pCaps) PURE;
  398. STDMETHOD(GetDisplayMode)(THIS_ UINT iSwapChain,D3DDISPLAYMODE* pMode) PURE;
  399. STDMETHOD(GetCreationParameters)(THIS_ D3DDEVICE_CREATION_PARAMETERS *pParameters) PURE;
  400. STDMETHOD(SetCursorProperties)(THIS_ UINT XHotSpot,UINT YHotSpot,IDirect3DSurface9* pCursorBitmap) PURE;
  401. STDMETHOD_(void, SetCursorPosition)(THIS_ Int X,Int Y,DWORD Flags) PURE;
  402. STDMETHOD_(BOOL, ShowCursor)(THIS_ BOOL bShow) PURE;
  403. STDMETHOD(CreateAdditionalSwapChain)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DSwapChain9** pSwapChain) PURE;
  404. STDMETHOD(GetSwapChain)(THIS_ UINT iSwapChain,IDirect3DSwapChain9** pSwapChain) PURE;
  405. STDMETHOD_(UINT, GetNumberOfSwapChains)(THIS) PURE;
  406. STDMETHOD(Reset)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE;
  407. STDMETHOD(Present)(THIS_ Const RECT* pSourceRect,Const RECT* pDestRect,HWND hDestWindowOverride,Const RGNDATA* pDirtyRegion) PURE;
  408. STDMETHOD(GetBackBuffer)(THIS_ UINT iSwapChain,UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer) PURE;
  409. STDMETHOD(GetRasterStatus)(THIS_ UINT iSwapChain,D3DRASTER_STATUS* pRasterStatus) PURE;
  410. STDMETHOD(SetDialogBoxMode)(THIS_ BOOL bEnableDialogs) PURE;
  411. STDMETHOD_(void, SetGammaRamp)(THIS_ UINT iSwapChain,DWORD Flags,Const D3DGAMMARAMP* pRamp) PURE;
  412. STDMETHOD_(void, GetGammaRamp)(THIS_ UINT iSwapChain,D3DGAMMARAMP* pRamp) PURE;
  413. STDMETHOD(CreateTexture)(THIS_ UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture9** ppTexture,HANDLE* pSharedHandle) PURE;
  414. STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture9** ppVolumeTexture,HANDLE* pSharedHandle) PURE;
  415. STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture9** ppCubeTexture,HANDLE* pSharedHandle) PURE;
  416. STDMETHOD(CreateVertexBuffer)(THIS_ UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer9** ppVertexBuffer,HANDLE* pSharedHandle) PURE;
  417. STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer9** ppIndexBuffer,HANDLE* pSharedHandle) PURE;
  418. STDMETHOD(CreateRenderTarget)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE;
  419. STDMETHOD(CreateDepthStencilSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE;
  420. STDMETHOD(UpdateSurface)(THIS_ IDirect3DSurface9* pSourceSurface,Const RECT* pSourceRect,IDirect3DSurface9* pDestinationSurface,Const POINT* pDestPoint) PURE;
  421. STDMETHOD(UpdateTexture)(THIS_ IDirect3DBaseTexture9* pSourceTexture,IDirect3DBaseTexture9* pDestinationTexture) PURE;
  422. STDMETHOD(GetRenderTargetData)(THIS_ IDirect3DSurface9* pRenderTarget,IDirect3DSurface9* pDestSurface) PURE;
  423. STDMETHOD(GetFrontBufferData)(THIS_ UINT iSwapChain,IDirect3DSurface9* pDestSurface) PURE;
  424. STDMETHOD(StretchRect)(THIS_ IDirect3DSurface9* pSourceSurface,Const RECT* pSourceRect,IDirect3DSurface9* pDestSurface,Const RECT* pDestRect,D3DTEXTUREFILTERTYPE Filter) PURE;
  425. STDMETHOD(ColorFill)(THIS_ IDirect3DSurface9* pSurface,Const RECT* pRect,D3DCOLOR color) PURE;
  426. STDMETHOD(CreateOffscreenPlainSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE;
  427. STDMETHOD(SetRenderTarget)(THIS_ DWORD RenderTargetIndex,IDirect3DSurface9* pRenderTarget) PURE;
  428. STDMETHOD(GetRenderTarget)(THIS_ DWORD RenderTargetIndex,IDirect3DSurface9** ppRenderTarget) PURE;
  429. STDMETHOD(SetDepthStencilSurface)(THIS_ IDirect3DSurface9* pNewZStencil) PURE;
  430. STDMETHOD(GetDepthStencilSurface)(THIS_ IDirect3DSurface9** ppZStencilSurface) PURE;
  431. STDMETHOD(BeginScene)(THIS) PURE;
  432. STDMETHOD(EndScene)(THIS) PURE;
  433. STDMETHOD(Clear)(THIS_ DWORD Count,Const D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,Float Z,DWORD Stencil) PURE;
  434. STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,Const D3DMATRIX* pMatrix) PURE;
  435. STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,D3DMATRIX* pMatrix) PURE;
  436. STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,Const D3DMATRIX*) PURE;
  437. STDMETHOD(SetViewport)(THIS_ Const D3DVIEWPORT9* pViewport) PURE;
  438. STDMETHOD(GetViewport)(THIS_ D3DVIEWPORT9* pViewport) PURE;
  439. STDMETHOD(SetMaterial)(THIS_ Const D3DMATERIAL9* pMaterial) PURE;
  440. STDMETHOD(GetMaterial)(THIS_ D3DMATERIAL9* pMaterial) PURE;
  441. STDMETHOD(SetLight)(THIS_ DWORD Index,Const D3DLIGHT9*) PURE;
  442. STDMETHOD(GetLight)(THIS_ DWORD Index,D3DLIGHT9*) PURE;
  443. STDMETHOD(LightEnable)(THIS_ DWORD Index,BOOL Enable) PURE;
  444. STDMETHOD(GetLightEnable)(THIS_ DWORD Index,BOOL* pEnable) PURE;
  445. STDMETHOD(SetClipPlane)(THIS_ DWORD Index,Const Float* pPlane) PURE;
  446. STDMETHOD(GetClipPlane)(THIS_ DWORD Index,Float* pPlane) PURE;
  447. STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD Value) PURE;
  448. STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD* pValue) PURE;
  449. STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE Type,IDirect3DStateBlock9** ppSB) PURE;
  450. STDMETHOD(BeginStateBlock)(THIS) PURE;
  451. STDMETHOD(EndStateBlock)(THIS_ IDirect3DStateBlock9** ppSB) PURE;
  452. STDMETHOD(SetClipStatus)(THIS_ Const D3DCLIPSTATUS9* pClipStatus) PURE;
  453. STDMETHOD(GetClipStatus)(THIS_ D3DCLIPSTATUS9* pClipStatus) PURE;
  454. STDMETHOD(GetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture9** ppTexture) PURE;
  455. STDMETHOD(SetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture9* pTexture) PURE;
  456. STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue) PURE;
  457. STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value) PURE;
  458. STDMETHOD(GetSamplerState)(THIS_ DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD* pValue) PURE;
  459. STDMETHOD(SetSamplerState)(THIS_ DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD Value) PURE;
  460. STDMETHOD(ValidateDevice)(THIS_ DWORD* pNumPasses) PURE;
  461. STDMETHOD(SetPaletteEntries)(THIS_ UINT PaletteNumber,Const PALETTEENTRY* pEntries) PURE;
  462. STDMETHOD(GetPaletteEntries)(THIS_ UINT PaletteNumber,PALETTEENTRY* pEntries) PURE;
  463. STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT PaletteNumber) PURE;
  464. STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT *PaletteNumber) PURE;
  465. STDMETHOD(SetScissorRect)(THIS_ Const RECT* pRect) PURE;
  466. STDMETHOD(GetScissorRect)(THIS_ RECT* pRect) PURE;
  467. STDMETHOD(SetSoftwareVertexProcessing)(THIS_ BOOL bSoftware) PURE;
  468. STDMETHOD_(BOOL, GetSoftwareVertexProcessing)(THIS) PURE;
  469. STDMETHOD(SetNPatchMode)(THIS_ Float nSegments) PURE;
  470. STDMETHOD_(Float, GetNPatchMode)(THIS) PURE;
  471. STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount) PURE;
  472. STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,Int BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount) PURE;
  473. STDMETHOD(DrawPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,Const void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE;
  474. STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertices,UINT PrimitiveCount,Const void* pIndexData,D3DFORMAT IndexDataFormat,Const void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE;
  475. STDMETHOD(ProcessVertices)(THIS_ UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer9* pDestBuffer,IDirect3DVertexDeclaration9* pVertexDecl,DWORD Flags) PURE;
  476. STDMETHOD(CreateVertexDeclaration)(THIS_ Const D3DVERTEXELEMENT9* pVertexElements,IDirect3DVertexDeclaration9** ppDecl) PURE;
  477. STDMETHOD(SetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9* pDecl) PURE;
  478. STDMETHOD(GetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9** ppDecl) PURE;
  479. STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE;
  480. STDMETHOD(GetFVF)(THIS_ DWORD* pFVF) PURE;
  481. STDMETHOD(CreateVertexShader)(THIS_ Const DWORD* pFunction,IDirect3DVertexShader9** ppShader) PURE;
  482. STDMETHOD(SetVertexShader)(THIS_ IDirect3DVertexShader9* pShader) PURE;
  483. STDMETHOD(GetVertexShader)(THIS_ IDirect3DVertexShader9** ppShader) PURE;
  484. STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT StartRegister,Const Float* pConstantData,UINT Vector4fCount) PURE;
  485. STDMETHOD(GetVertexShaderConstantF)(THIS_ UINT StartRegister,Float* pConstantData,UINT Vector4fCount) PURE;
  486. STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT StartRegister,Const Int* pConstantData,UINT Vector4iCount) PURE;
  487. STDMETHOD(GetVertexShaderConstantI)(THIS_ UINT StartRegister,Int* pConstantData,UINT Vector4iCount) PURE;
  488. STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT StartRegister,Const BOOL* pConstantData,UINT BoolCount) PURE;
  489. STDMETHOD(GetVertexShaderConstantB)(THIS_ UINT StartRegister,BOOL* pConstantData,UINT BoolCount) PURE;
  490. STDMETHOD(SetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride) PURE;
  491. STDMETHOD(GetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer9** ppStreamData,UINT* OffsetInBytes,UINT* pStride) PURE;
  492. STDMETHOD(SetStreamSourceFreq)(THIS_ UINT StreamNumber,UINT Divider) PURE;
  493. STDMETHOD(GetStreamSourceFreq)(THIS_ UINT StreamNumber,UINT* Divider) PURE;
  494. STDMETHOD(SetIndices)(THIS_ IDirect3DIndexBuffer9* pIndexData) PURE;
  495. STDMETHOD(GetIndices)(THIS_ IDirect3DIndexBuffer9** ppIndexData) PURE;
  496. STDMETHOD(CreatePixelShader)(THIS_ Const DWORD* pFunction,IDirect3DPixelShader9** ppShader) PURE;
  497. STDMETHOD(SetPixelShader)(THIS_ IDirect3DPixelShader9* pShader) PURE;
  498. STDMETHOD(GetPixelShader)(THIS_ IDirect3DPixelShader9** ppShader) PURE;
  499. STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT StartRegister,Const Float* pConstantData,UINT Vector4fCount) PURE;
  500. STDMETHOD(GetPixelShaderConstantF)(THIS_ UINT StartRegister,Float* pConstantData,UINT Vector4fCount) PURE;
  501. STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT StartRegister,Const Int* pConstantData,UINT Vector4iCount) PURE;
  502. STDMETHOD(GetPixelShaderConstantI)(THIS_ UINT StartRegister,Int* pConstantData,UINT Vector4iCount) PURE;
  503. STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT StartRegister,Const BOOL* pConstantData,UINT BoolCount) PURE;
  504. STDMETHOD(GetPixelShaderConstantB)(THIS_ UINT StartRegister,BOOL* pConstantData,UINT BoolCount) PURE;
  505. STDMETHOD(DrawRectPatch)(THIS_ UINT Handle,Const Float* pNumSegs,Const D3DRECTPATCH_INFO* pRectPatchInfo) PURE;
  506. STDMETHOD(DrawTriPatch)(THIS_ UINT Handle,Const Float* pNumSegs,Const D3DTRIPATCH_INFO* pTriPatchInfo) PURE;
  507. STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE;
  508. STDMETHOD(CreateQuery)(THIS_ D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery) PURE;
  509. 'End Rem
  510. End Rem
  511. End Interface
  512. Interface IDirect3DSwapChain9 Extends IUnknown_
  513. Method Present( pSourceRect:Byte Ptr,pDestRect:Byte Ptr,hDestWindowOverride,pDirtyRegion:Byte Ptr,Flags )
  514. Method GetFrontBufferData(pDestSurface:IDirect3DSurface9)
  515. Method GetBackBuffer(iBackBuffer:Int, Type_:Int,ppBackBuffer:IDirect3DSurface9 Var)
  516. Method GetRasterStatus(pRasterStatus:Byte Ptr)
  517. Rem
  518. STDMETHOD(Present)(THIS_ Const RECT* pSourceRect,Const RECT* pDestRect,HWND hDestWindowOverride,Const RGNDATA* pDirtyRegion,DWORD dwFlags) PURE;
  519. STDMETHOD(GetFrontBufferData)(THIS_ IDirect3DSurface9* pDestSurface) PURE;
  520. STDMETHOD(GetBackBuffer)(THIS_ UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer) PURE;
  521. STDMETHOD(GetRasterStatus)(THIS_ D3DRASTER_STATUS* pRasterStatus) PURE;
  522. STDMETHOD(GetDisplayMode)(THIS_ D3DDISPLAYMODE* pMode) PURE;
  523. STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE;
  524. STDMETHOD(GetPresentParameters)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE;
  525. End Rem
  526. End Interface
  527. Interface IDirect3DResource9 Extends IUnknown_
  528. Method GetDevice( ppDevice:IDirect3DDevice9 Var )
  529. Method SetPrivateData( refguid:Byte Ptr,pData:Byte Ptr,SizeOfData,Flags )
  530. Method GetPrivateData( refguid:Byte Ptr,pData:Byte Ptr,pSizeOfData )
  531. Method FreePrivateData( refguid:Byte Ptr )
  532. Method SetPriority( PriorityNew )
  533. Method GetPriority()
  534. Method PreLoad()
  535. Method GetType()
  536. Rem
  537. STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE;
  538. STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,Const void* pData,DWORD SizeOfData,DWORD Flags) PURE;
  539. STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE;
  540. STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE;
  541. STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE;
  542. STDMETHOD_(DWORD, GetPriority)(THIS) PURE;
  543. STDMETHOD_(void, PreLoad)(THIS) PURE;
  544. STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE;
  545. End Rem
  546. End Interface
  547. End Extern
  548. Extern "win32"
  549. Interface IDirect3DSurface9 Extends IDirect3dResource9
  550. Method GetContainer( riid:Byte Ptr,ppContainer:Byte Ptr Var )
  551. Method GetDesc( pDesc:D3DSURFACE_DESC Var )
  552. Method LockRect( pLockedRect:Byte Ptr,pRect:Byte Ptr,Flags )
  553. Method UnlockRect()
  554. Method GetDC( phdc:Byte Ptr Var )
  555. Method ReleaseDC( hdc:Byte Ptr )
  556. Rem
  557. STDMETHOD(GetContainer)(THIS_ REFIID riid,void** ppContainer) PURE;
  558. STDMETHOD(GetDesc)(THIS_ D3DSURFACE_DESC *pDesc) PURE;
  559. STDMETHOD(LockRect)(THIS_ D3DLOCKED_RECT* pLockedRect,Const RECT* pRect,DWORD Flags) PURE;
  560. STDMETHOD(UnlockRect)(THIS) PURE;
  561. STDMETHOD(GetDC)(THIS_ HDC *phdc) PURE;
  562. STDMETHOD(ReleaseDC)(THIS_ HDC hdc) PURE;
  563. End Rem
  564. End Interface
  565. Interface IDirect3DVertexBuffer9 Extends IDirect3DResource9
  566. Method Lock( OffsetToLock,SizeToLock,ppbData:Byte Ptr Var,Flags )
  567. Method Unlock()
  568. Rem
  569. STDMETHOD(Lock)(THIS_ UINT OffsetToLock,UINT SizeToLock,void** ppbData,DWORD Flags) PURE;
  570. STDMETHOD(Unlock)(THIS) PURE;
  571. STDMETHOD(GetDesc)(THIS_ D3DVERTEXBUFFER_DESC *pDesc) PURE;
  572. End Rem
  573. End Interface
  574. Interface IDirect3DIndexBuffer9 Extends IDirect3DResource9
  575. Method Lock( OffsetToLock,SizeToLock,ppbData:Byte Ptr Var,Flags )
  576. Method Unlock()
  577. Rem
  578. STDMETHOD(Lock)(THIS_ UINT OffsetToLock,UINT SizeToLock,void** ppbData,DWORD Flags) PURE;
  579. STDMETHOD(Unlock)(THIS) PURE;
  580. STDMETHOD(GetDesc)(THIS_ D3DINDEXBUFFER_DESC *pDesc) PURE;
  581. End Rem
  582. End Interface
  583. Interface IDirect3DBaseTexture9 Extends IDirect3DResource9
  584. Method SetLOD( LODNew )
  585. Method GetLOD()
  586. Method GetLevelCount()
  587. Method SetAutoGenFilterType( FilterType )
  588. Method GetAutoGenFilterType()
  589. Method GenerateMipSubLevels()
  590. Rem
  591. STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE;
  592. STDMETHOD_(DWORD, GetLOD)(THIS) PURE;
  593. STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE;
  594. STDMETHOD(SetAutoGenFilterType)(THIS_ D3DTEXTUREFILTERTYPE FilterType) PURE;
  595. STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE;
  596. STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE;
  597. End Rem
  598. End Interface
  599. End Extern
  600. Extern "win32"
  601. Interface IDirect3DTexture9 Extends IDirect3DBaseTexture9
  602. Method GetLevelDesc( Level,pDesc:Byte Ptr )
  603. Method GetSurfaceLevel( Level,ppSurfaceLevel:IDirect3DSurface9 Var)
  604. Method LockRect( Level,pLockedRect:Byte Ptr,pRect:Byte Ptr,Flags )
  605. Method UnlockRect( Level )
  606. Method AddDirtyRect( pDirtyRect:Byte Ptr )
  607. Rem
  608. STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DSURFACE_DESC *pDesc) PURE;
  609. STDMETHOD(GetSurfaceLevel)(THIS_ UINT Level,IDirect3DSurface9** ppSurfaceLevel) PURE;
  610. STDMETHOD(LockRect)(THIS_ UINT Level,D3DLOCKED_RECT* pLockedRect,Const RECT* pRect,DWORD Flags) PURE;
  611. STDMETHOD(UnlockRect)(THIS_ UINT Level) PURE;
  612. STDMETHOD(AddDirtyRect)(THIS_ Const RECT* pDirtyRect) PURE;
  613. End Rem
  614. End Interface
  615. Interface IDirect3DCubeTexture9 Extends IDirect3DBaseTexture9
  616. Method GetLevelDesc( Level,pDesc:Byte Ptr )
  617. Method GetCubeMapSurface( FaceType,Level,ppCubeMapSurface:IDirect3DSurface9 Var )
  618. Method LockRect( FaceType,Level,pLockedRect:Byte Ptr,pRect:Byte Ptr,Flags )
  619. Method UnlockRect( FaceType,Level )
  620. Method AddDirtyRect( FaceType,pDirtyRect:Byte Ptr )
  621. Rem
  622. STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DSURFACE_DESC *pDesc) PURE;
  623. STDMETHOD(GetCubeMapSurface)(THIS_ D3DCUBEMAP_FACES FaceType,UINT Level,IDirect3DSurface9** ppCubeMapSurface) PURE;
  624. STDMETHOD(LockRect)(THIS_ D3DCUBEMAP_FACES FaceType,UINT Level,D3DLOCKED_RECT* pLockedRect,Const RECT* pRect,DWORD Flags) PURE;
  625. STDMETHOD(UnlockRect)(THIS_ D3DCUBEMAP_FACES FaceType,UINT Level) PURE;
  626. STDMETHOD(AddDirtyRect)(THIS_ D3DCUBEMAP_FACES FaceType,Const RECT* pDirtyRect) PURE;
  627. End Rem
  628. End Interface
  629. Interface IDirect3DVolumeTexture9 Extends IDirect3DBaseTexture9
  630. ' Method GetLevelDesc( Level,pDesc:Byte Ptr )
  631. ' Method GetVolumeLevel( Level,ppVolumeLevel:IDirect3DVolume9 Var )
  632. ' Method LockBox( Level,pLockedVolume:Byte Ptr,pBox:Byte Ptr,Flags )
  633. ' Method UnlockBox( Level )
  634. ' Method AddDirtyBox( pDirtyBox:Byte Ptr )
  635. Rem
  636. STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DVOLUME_DESC *pDesc) PURE;
  637. STDMETHOD(GetVolumeLevel)(THIS_ UINT Level,IDirect3DVolume9** ppVolumeLevel) PURE;
  638. STDMETHOD(LockBox)(THIS_ UINT Level,D3DLOCKED_BOX* pLockedVolume,Const D3DBOX* pBox,DWORD Flags) PURE;
  639. STDMETHOD(UnlockBox)(THIS_ UINT Level) PURE;
  640. STDMETHOD(AddDirtyBox)(THIS_ Const D3DBOX* pDirtyBox) PURE;
  641. End Rem
  642. End Interface
  643. End Extern
  644. 'End Extern
  645. Extern
  646. Function bmx_directx_d3d9_Direct3DCreate9:IDirect3D9(SDKVersion:Int)
  647. End Extern
  648. Function Direct3DCreate9:IDirect3D9(SDKVersion:Int)
  649. Local id:IDirect3D9 = bmx_directx_d3d9_Direct3DCreate9(SDKVersion)
  650. If id Then
  651. Return id
  652. End If
  653. End Function
  654. 'Global _d3d9Lib:Byte Ptr=LoadLibraryW( "d3d9.dll" )
  655. 'If Not _d3d9Lib Return
  656. 'Global Direct3DCreate9:IDirect3D9( SDKVersion )"win32" = GetProcAddress( d3d9Lib,"Direct3DCreate9" )