' d3dx9core.sbp


#ifndef _INC_D3DX9CORE
#define _INC_D3DX9CORE


Class ID3DXBuffer
	Inherits IUnknown
Public
	'ID3DXBuffer
	Abstract Function GetBufferPointer() As VoidPtr
	Abstract Function GetBufferSize() As DWord
End Class
TypeDef LPD3DXBUFFER = *ID3DXBuffer


Const D3DXSPRITE_DONOTSAVESTATE            = 1 << 0
Const D3DXSPRITE_DONOTMODIFY_RENDERSTATE   = 1 << 1
Const D3DXSPRITE_OBJECTSPACE               = 1 << 2
Const D3DXSPRITE_BILLBOARD                 = 1 << 3
Const D3DXSPRITE_ALPHABLEND                = 1 << 4
Const D3DXSPRITE_SORT_TEXTURE              = 1 << 5
Const D3DXSPRITE_SORT_DEPTH_FRONTTOBACK    = 1 << 6
Const D3DXSPRITE_SORT_DEPTH_BACKTOFRONT    = 1 << 7


Class ID3DXSprite
	Inherits IUnknown
Public
	'ID3DXSprite
	Abstract Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord

	Abstract Function GetTransform(pTransform As *D3DMATRIX) As DWord
	Abstract Function SetTransform(pTransform As *D3DMATRIX) As DWord

	Abstract Function SetWorldViewRH(pWorld As *D3DMATRIX, pView As *D3DMATRIX) As DWord
	Abstract Function SetWorldViewLH(pWorld As *D3DMATRIX, pView As *D3DMATRIX) As DWord

	Abstract Function Begin(Flags As DWord) As DWord
	Abstract Function Draw(pTexture As *IDirect3DTexture9, pSrcRect As *RECT, pCenter As *D3DXVECTOR3, pPosition As *D3DVECTOR, Color As DWord) As DWord
	Abstract Function Flush() As DWord
	Abstract Function _End() As DWord

	Abstract Function OnLostDevice() As DWord
	Abstract Function OnResetDevice() As DWord
End Class
TypeDef LPD3DXSPRITE = *ID3DXSprite

Declare Function D3DXCreateSprite Lib "dx9abm" Alias "D3DXCreateSprite_abm" (pDevice As LPDIRECT3DDEVICE9, ppSprite As **ID3DXSprite) As DWord


Type D3DXFONT_DESC
	Height As Long
	Width As DWord
	Weight As DWord
	MipLevels As DWord
	Italic As Long
	CharSet As Byte
	OutputPrecision As Byte
	Quality As Byte
	PitchAndFamily As Byte
	FaceName[LF_FACESIZE-1] As Byte
End Type
Type D3DXFONT_DESCW
	Height As Long
	Width As DWord
	Weight As DWord
	MipLevels As DWord
	Italic As Long
	CharSet As Byte
	OutputPrecision As Byte
	Quality As Byte
	PitchAndFamily As Byte
    FaceName[LF_FACESIZE-1] As Word
End Type

Class ID3DXFont
	Inherits IUnknown
Public
	'ID3DXFont
	Abstract Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
	Abstract Function GetDesc(pDesc As *D3DXFONT_DESC) As DWord
	Abstract Function GetDescW(pDesc As *D3DXFONT_DESCW) As DWord
	Abstract Function GetTextMetricsA(pTextMetrics As *TEXTMETRIC) As Long
	Abstract Function GetTextMetricsW(pTextMetrics As VoidPtr) As Long

	Abstract Function GetDC() As DWord
	Abstract Function GetGlyphData(Glyph As DWord, ppTexture As **IDirect3DTexture9, pBlackBox As *RECT, pCellInc As *POINTAPI) As DWord

	Abstract Function PreloadCharacters(First As DWord, Last As DWord) As DWord
	Abstract Function PreloadGlyphs(First As DWord, Last As DWord) As DWord
	Abstract Function PreloadText(pString As BytePtr, Count As Long) As DWord
	Abstract Function PreloadTextW(pString As WordPtr, Count As Long) As DWord

	Abstract Function DrawText(pSprite As *ID3DXSprite, pString As BytePtr, Count As Long, pRect As *RECT, Format As DWord, Color As DWord) As Long
	Abstract Function DrawTextW(pSprite As *ID3DXSprite, pString As WordPtr, Count As Long, pRect As *RECT, Format As DWord, Color As DWord) As Long

	Abstract Function OnLostDevice() As DWord
	Abstract Function OnResetDevice() As DWord
End Class
TypeDef LPD3DXFONT = *ID3DXFont

Declare Function D3DXCreateFont Lib "dx9abm" Alias "D3DXCreateFont_abm" (pDevice As LPDIRECT3DDEVICE9, Height As Long, Width As DWord, Weight As DWord, MipLevels As DWord, Italic As Long, CharSet As DWord, OutputPrecision As DWord, Quality As DWord, PitchAndFamily As DWord, pFaceName As BytePtr, ppFont As **ID3DXFont) As DWord

Declare Function D3DXCreateFontIndirect Lib "dx9abm" Alias "D3DXCreateFontIndirect_abm" (pDevice As LPDIRECT3DDEVICE9, pDesc As *D3DXFONT_DESC, ppFont As **ID3DXFont) As DWord


'----------------------
' ID3DXRenderToSurface
'----------------------

Type D3DXRTS_DESC
	Width As DWord
	Height As DWord
	Format As D3DFORMAT
	DepthStencil As Long
	DepthStencilFormat As D3DFORMAT
End Type

Class ID3DXRenderToSurface
	Inherits IUnknown
Public
	'ID3DXRenderToSurface
	Abstract Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
	Abstract Function GetDesc(pDesc As *D3DXRTS_DESC) As DWord

	Abstract Function BeginScene(pSurface As *IDirect3DSurface9, pViewport As *D3DVIEWPORT9) As DWord
	Abstract Function EndScene(MipFilter As DWord) As DWord

	Abstract Function OnLostDevice() As DWord
	Abstract Function OnResetDevice() As DWord
End Class
TypeDef LPD3DXRENDERTOSURFACE = *ID3DXRenderToSurface

Declare Function D3DXCreateRenderToSurface Lib "dx9abm" Alias "D3DXCreateRenderToSurface_abm" (pDevice As LPDIRECT3DDEVICE9, Width As DWord, Height As DWord, Format As D3DFORMAT, DepthStencil As Long, DepthStencilFormat As D3DFORMAT, ppRenderToSurface As **ID3DXRenderToSurface) As DWord


'---------------------
' ID3DXRenderToEnvMap
'---------------------

Type D3DXRTE_DESC
	Size As DWord
	MipLevels As DWord
	Format As D3DFORMAT
	DepthStencil As Long
	DepthStencilFormat As D3DFORMAT
End Type

Class ID3DXRenderToEnvMap
	Inherits IUnknown
Public
	'ID3DXRenderToEnvMap
	Abstract Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord
	Abstract Function GetDesc(pDesc As *D3DXRTE_DESC) As DWord

	Abstract Function BeginCube(pCubeTex As *IDirect3DCubeTexture9) As DWord

	Abstract Function BeginSphere(pTex As *IDirect3DTexture9) As DWord

	Abstract Function BeginHemisphere(pTexZPos As *IDirect3DTexture9, pTexZNeg As *IDirect3DTexture9) As DWord

	Abstract Function BeginParabolic(pTexZPos As *IDirect3DTexture9, pTexZNeg As *IDirect3DTexture9) As DWord

	Abstract Function Face(Face As D3DCUBEMAP_FACES, MipFilter As DWord) As DWord
	Abstract Function _End(MipFilter As DWord) As DWord

	Abstract Function OnLostDevice() As DWord
	Abstract Function OnResetDevice() As DWord
End Class
TypeDef LPD3DXRenderToEnvMap = *ID3DXRenderToEnvMap

Declare Function D3DXCreateRenderToEnvMap Lib "dx9abm" Alias "D3DXCreateRenderToEnvMap_abm" (pDevice As LPDIRECT3DDEVICE9, Size As DWord, MipLevels As DWord, Format As D3DFORMAT, DepthStencil As Long, DepthStencilFormat As D3DFORMAT, ppRenderToEnvMap As *LPD3DXRenderToEnvMap) As DWord


'-----------
' ID3DXLine
'-----------

Class ID3DXLine
	Inherits IUnknown
Public
    'ID3DXLine
	Abstract Function GetDevice(ppDevice As *LPDIRECT3DDEVICE9) As DWord

	Abstract Function Begin() As DWord

	Abstract Function Draw(pVertexList As *D3DXVECTOR2, dwVertexListCount As DWord, dwColor As DWord) As DWord

	Abstract Function DrawTransform(pVertexList As *D3DXVECTOR3, dwVertexListCount As DWord, pTransform As *D3DXMATRIX, dwColor As DWord) As DWord

	Abstract Function SetPattern(dwPattern As DWord) As DWord
	Abstract Function GetPattern() As DWord

	Abstract Function SetPatternScale(fPatternScale As Single) As DWord
	Abstract Function GetPatternScale() As Single

	Abstract Function SetWidth(fWidth As Single) As DWord
	Abstract Function GetWidth() As Single

	Abstract Function SetAntialias(bAntialias As Long) As DWord
	Abstract Function GetAntialias() As Long

	Abstract Function SetGLLines(bGLLines As Long) As DWord
	Abstract Function GetGLLines() As Long

	Abstract Function _End() As DWord

	Abstract Function OnLostDevice() As DWord
	Abstract Function OnResetDevice() As DWord
End Class
TypeDef LPD3DXLINE = *ID3DXLine

Declare Function D3DXCreateLine Lib "dx9abm" Alias "D3DXCreateLine_abm" (pDevice As LPDIRECT3DDEVICE9, ppLine As **ID3DXLine) As DWord


#endif '_INC_D3DX9CORE
