' ########################################################################################
' Microsoft Windows
' File: d3dx9core.inc
' Contents: D3DX core types and functions
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_d3dx9core_PBI)
#DEFINE PBX_d3dx9core_PBI
%EQUATE `D3DX9CORE_INC = 1
#INCLUDE ONCE "Legacy/Graphics/d3dx9math.inc"
#INCLUDE ONCE "Legacy/Graphics/d3dx9.inc"
'///////////////////////////////////////////////////////////////////////////
'// D3DX_SDK_VERSION:
'// -----------------
'// This identifier is passed to D3DXCheckVersion in order to ensure that an
'// application was built against the correct header files and IMPORT files.
'// This number is incremented whenever a header (or other) change would
'// require applications to be rebuilt. If the version doesn't match,
'// D3DXCreateVersion will return FALSE. (The number itself has no meaning.)
'///////////////////////////////////////////////////////////////////////////
%EQUATE `D3DX_VERSION = &H0902
%EQUATE `D3DX_SDK_VERSION = 22
DECLARE FUNCTION D3DXCheckVersion IMPORT $D3DX_DLLNAME ALIAS "D3DXCheckVersion" ( BYVAL D3DSdkVersion AS QUAD , BYVAL D3DXSdkVersion AS QUAD ) AS LONG
'///////////////////////////////////////////////////////////////////////////
'// D3DXDebugMute
'// Mutes D3DX and D3D debug spew (TRUE - mute, FALSE - not mute)
'//
'// returns previous mute value
'//
'///////////////////////////////////////////////////////////////////////////
DECLARE FUNCTION D3DXDebugMute IMPORT $D3DX_DLLNAME ALIAS "D3DXDebugMute" ( BYVAL Mute AS LONG ) AS LONG
'///////////////////////////////////////////////////////////////////////////
'// D3DXGetDriverLevel:
'// Returns driver version information:
'//
'// 700 - DX7 level driver
'// 800 - DX8 level driver
'// 900 - DX9 level driver
'///////////////////////////////////////////////////////////////////////////
DECLARE FUNCTION D3DXGetDriverLevel IMPORT $D3DX_DLLNAME ALIAS "D3DXGetDriverLevel" ( BYVAL pDevice AS IDirect3DDevice9 ) AS QUAD ' UINT
'///////////////////////////////////////////////////////////////////////////
'// ID3DXBuffer:
'// ------------
'// The buffer object is used by D3DX to return arbitrary size data.
'//
'// GetBufferPointer -
'// Returns a pointer to the beginning of the buffer.
'//
'// GetBufferSize -
'// Returns the size of the buffer, in bytes.
'///////////////////////////////////////////////////////////////////////////
$IID_ID3DXBuffer = GUID$("{8BA5FB08-5195-40E2-AC58-0D989C3A0102}")
INTERFACE ID3DXBuffer $IID_ID3DXBuffer
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetBufferPointer ( ' VTable offset = 12
 ) AS DWORD
 ' =====================================================================================
 METHOD GetBufferSize ( ' VTable offset = 16
 ) AS DWORD
 ' =====================================================================================
END INTERFACE
'//////////////////////////////////////////////////////////////////////////////
'// D3DXSPRITE flags:
'// -----------------
'// D3DXSPRITE_DONOTSAVESTATE
'// Specifies device state is not to be saved and restored in Begin/End.
'// D3DXSPRITE_DONOTMODIFY_RENDERSTATE
'// Specifies device render state is not to be changed in Begin. The device
'// is assumed to be in a valid state to draw vertices containing POSITION0,
'// TEXCOORD0, and COLOR0 data.
'// D3DXSPRITE_OBJECTSPACE
'// The WORLD, VIEW, and PROJECTION transforms are NOT modified. The
'// transforms currently set to the device are used to transform the sprites
'// when the batch is drawn (at Flush or End). If this is not specified,
'// WORLD, VIEW, and PROJECTION transforms are modified so that sprites are
'// drawn in screenspace coordinates.
'// D3DXSPRITE_BILLBOARD
'// Rotates each sprite about its center so that it is facing the viewer.
'// D3DXSPRITE_ALPHABLEND
'// Enables ALPHABLEND(SRCALPHA, INVSRCALPHA) and ALPHATEST(alpha > 0).
'// ID3DXFont expects this to be set when drawing text.
'// D3DXSPRITE_SORT_TEXTURE
'// Sprites are sorted by texture prior to drawing. This is recommended when
'// drawing non-overlapping sprites of uniform depth. For example, drawing
'// screen-aligned text with ID3DXFont.
'// D3DXSPRITE_SORT_DEPTH_FRONTTOBACK
'// Sprites are sorted by depth front-to-back prior to drawing. This is
'// recommended when drawing opaque sprites of varying depths.
'// D3DXSPRITE_SORT_DEPTH_BACKTOFRONT
'// Sprites are sorted by depth back-to-front prior to drawing. This is
'// recommended when drawing transparent sprites of varying depths.
'//////////////////////////////////////////////////////////////////////////////
%EQUATE `D3DXSPRITE_DONOTSAVESTATE = 1 ' (1 << 0)
%EQUATE `D3DXSPRITE_DONOTMODIFY_RENDERSTATE = 2 ' (1 << 1)
%EQUATE `D3DXSPRITE_OBJECTSPACE = 4 ' (1 << 2)
%EQUATE `D3DXSPRITE_BILLBOARD = 8 ' (1 << 3)
%EQUATE `D3DXSPRITE_ALPHABLEND = 16 ' (1 << 4)
%EQUATE `D3DXSPRITE_SORT_TEXTURE = 32 ' (1 << 5)
%EQUATE `D3DXSPRITE_SORT_DEPTH_FRONTTOBACK = 64 ' (1 << 6)
%EQUATE `D3DXSPRITE_SORT_DEPTH_BACKTOFRONT = 128 ' (1 << 7)
'//////////////////////////////////////////////////////////////////////////////
'// ID3DXSprite:
'// ------------
'// This object intends to provide an easy way to drawing sprites using D3D.
'//
'// Begin -
'// Prepares device for drawing sprites.
'//
'// Draw -
'// Draws a sprite. Before transformation, the sprite is the size of
'// SrcRect, with its top-left corner specified by Position. The color
'// and alpha channels are modulated by Color.
'//
'// Flush -
'// Forces all batched sprites to submitted to the device.
'//
'// End -
'// Restores device state to how it was when Begin was called.
'//
'// OnLostDevice, OnResetDevice -
'// Call OnLostDevice() on this object before calling Reset() on the
'// device, so that this object can release any stateblocks and video
'// memory resources. After Reset(), the call OnResetDevice().
'//////////////////////////////////////////////////////////////////////////////
$IID_ID3DXSprite = GUID$("{BA0B762D-7D28-43EC-B9DC-2F84443B0614}")
INTERFACE ID3DXSprite $IID_ID3DXSprite
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetDevice ( ' VTable offset = 12
 BYREF ppDevice AS IDirect3DDevice9
 ) AS LONG
 ' =====================================================================================
 METHOD GetTransform ( ' VTable offset = 16
 BYREF pTransform AS D3DXMATRIX
 ) AS LONG
 ' =====================================================================================
 METHOD SetTransform ( ' VTable offset = 20
 BYREF pTransform AS D3DXMATRIX
 ) AS LONG
 ' =====================================================================================
 METHOD SetWorldViewRH ( ' VTable offset = 24
 BYREF pWorld AS D3DXMATRIX
 , BYREF pView AS D3DXMATRIX
 ) AS LONG
 ' =====================================================================================
 METHOD SetWorldViewLH ( ' VTable offset = 28
 BYREF pWorld AS D3DXMATRIX
 , BYREF pView AS D3DXMATRIX
 ) AS LONG
 ' =====================================================================================
 METHOD Begin ( ' VTable offset = 32
 BYVAL Flags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Draw ( ' VTable offset = 36
 BYVAL pTexture AS IDirect3DTexture9
 , BYREF pSrcRect AS RECT
 , BYREF pCenter AS D3DXVECTOR3
 , BYREF pPosition AS D3DXVECTOR3
 , BYVAL Color AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Flush ( ' VTable offset = 40
 ) AS LONG
 ' =====================================================================================
 METHOD End ( ' VTable offset = 44
 ) AS LONG
 ' =====================================================================================
 METHOD OnLostDevice ( ' VTable offset = 48
 ) AS LONG
 ' =====================================================================================
 METHOD OnResetDevice ( ' VTable offset = 52
 ) AS LONG
 ' =====================================================================================
END INTERFACE
DECLARE FUNCTION D3DXCreateSprite IMPORT $D3DX_DLLNAME ALIAS "D3DXCreateSprite" ( BYVAL pDevice AS IDirect3DDevice9 , BYREF ppSprite AS ID3DXSprite ) AS LONG
'//////////////////////////////////////////////////////////////////////////////
'// ID3DXFont:
'// ----------
'// Font objects contain the textures and resources needed to render a specific
'// font on a specific device.
'//
'// GetGlyphData -
'// Returns glyph cache data, for a given glyph.
'//
'// PreloadCharacters/PreloadGlyphs/PreloadText -
'// Preloads glyphs into the glyph cache textures.
'//
'// DrawText -
'// Draws formatted text on a D3D device. Some parameters are
'// surprisingly similar to those of GDI's DrawText function. See GDI
'// documentation for a detailed description of these parameters.
'// If pSprite is NULL, an internal sprite object will be used.
'//
'// OnLostDevice, OnResetDevice -
'// Call OnLostDevice() on this object before calling Reset() on the
'// device, so that this object can release any stateblocks and video
'// memory resources. After Reset(), the call OnResetDevice().
'//////////////////////////////////////////////////////////////////////////////
' // Size = 56 byes
TYPE D3DXFONT_DESCA BYTE
 Height AS LONG ' INT
 Width AS DWORD ' UINT
 Weight AS DWORD ' UINT
 MipLevels AS DWORD ' UINT
 Italic AS LONG
 CharSet AS BYTE ' BYTE
 OutputPrecision AS BYTE ' BYTE
 Quality AS BYTE ' BYTE
 PitchAndFamily AS BYTE ' BYTE
 FaceName AS ASCIIZ * %LF_FACESIZE ' CHAR FaceName[LF_FACESIZE]
END TYPE
' // Size = 88 bytes
TYPE D3DXFONT_DESCW BYTE
 Height AS LONG ' INT
 Width AS DWORD ' UINT
 Weight AS DWORD ' UINT
 MipLevels AS DWORD ' UINT
 Italic AS LONG
 CharSet AS BYTE ' BYTE
 OutputPrecision AS BYTE ' BYTE
 Quality AS BYTE ' BYTE
 PitchAndFamily AS BYTE ' BYTE
 FaceName AS WSTRINGZ * %LF_FACESIZE ' WCHAR FaceName[LF_FACESIZE]
END TYPE
#IF %DEF(%UNICODE)
 MACRO D3DXFONT_DESC = D3DXFONT_DESCW
#ELSE
 MACRO D3DXFONT_DESC = D3DXFONT_DESCA
#ENDIF
$IID_ID3DXFont = GUID$("{D79DBB70-5F21-4d36-BBC2-FF525C213CDC}")
INTERFACE ID3DXFont $IID_ID3DXFont
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetDevice ( ' VTable offset = 12
 BYREF ppDevice AS IDirect3DDevice9
 ) AS LONG
 ' =====================================================================================
 METHOD GetDescA ( ' VTable offset = 16
 BYREF pDesc AS D3DXFONT_DESCA
 ) AS LONG
 ' =====================================================================================
 METHOD GetDescW ( ' VTable offset = 20
 BYREF pDesc AS D3DXFONT_DESCW
 ) AS LONG
 ' =====================================================================================
 METHOD GetTextMetricsA ( ' VTable offset = 24
 BYREF pTextMetrics AS TEXTMETRIC
 ) AS LONG
 ' =====================================================================================
 METHOD GetTextMetricsW ( ' VTable offset = 28
 BYREF pTextMetrics AS TEXTMETRIC
 ) AS LONG
 ' =====================================================================================
 METHOD GetDC ( ' VTable offset = 32
 ) AS DWORD ' HDC
 ' =====================================================================================
 METHOD GetGlyphData ( ' VTable offset = 36
 BYVAL Glyph AS DWORD
 , BYREF ppTexture AS IDirect3DTexture9
 , BYREF pBlackBox AS RECT
 , BYREF pCellInc AS POINT
 ) AS DWORD ' HDC
 ' =====================================================================================
 METHOD PreloadCharacters ( ' VTable offset = 40
 BYVAL First AS DWORD
 , BYVAL Last AS DWORD
 ) AS DWORD ' HDC
 ' =====================================================================================
 METHOD PreloadGlyphs ( ' VTable offset = 44
 BYVAL First AS DWORD
 , BYVAL Last AS DWORD
 ) AS DWORD ' HDC
 ' =====================================================================================
 METHOD PreloadTextA ( ' VTable offset = 48
 BYREF pString AS ASCIIZ
 , BYVAL Count AS LONG
 ) AS DWORD ' HDC
 ' =====================================================================================
 METHOD PreloadTextW ( ' VTable offset = 52
 BYREF pString AS WSTRINGZ
 , BYVAL Count AS LONG
 ) AS DWORD ' HDC
 ' =====================================================================================
 METHOD DrawTextA ( ' VTable offset = 56
 BYVAL pSprite AS ID3DXSprite
 , BYREF pString AS ASCIIZ
 , BYVAL Count AS LONG
 , BYREF pRect AS RECT
 , BYVAL Format AS DWORD
 , BYVAL Color AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD DrawTextW ( ' VTable offset = 60
 BYVAL pSprite AS ID3DXSprite
 , BYREF pString AS WSTRINGZ
 , BYVAL Count AS LONG
 , BYREF pRect AS RECT
 , BYVAL Format AS DWORD
 , BYVAL Color AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD OnLostDevice ( ' VTable offset = 64
 ) AS LONG
 ' =====================================================================================
 METHOD OnResetDevice ( ' VTable offset = 68
 ) AS LONG
 ' =====================================================================================
END INTERFACE
DECLARE FUNCTION D3DXCreateFontA IMPORT $D3DX_DLLNAME ALIAS "D3DXCreateFontA" ( BYVAL pDevice AS IDirect3DDevice9 , BYVAL Height AS LONG , BYVAL Width AS QUAD , BYVAL Weight AS QUAD , BYVAL MipLevels AS QUAD , BYVAL Italic AS LONG , BYVAL CharSet AS QUAD , BYVAL OutputPrecision AS QUAD , BYVAL Quality AS QUAD , BYVAL PitchAndFamily AS QUAD , BYREF pFaceName AS ASCIIZ , BYREF ppFont AS ID3DXFont ) AS LONG
DECLARE FUNCTION D3DXCreateFontW IMPORT $D3DX_DLLNAME ALIAS "D3DXCreateFontW" ( BYVAL pDevice AS IDirect3DDevice9
 , BYVAL Height AS LONG
 , BYVAL Width AS DWORD
 , BYVAL Weight AS DWORD
 , BYVAL MipLevels AS DWORD
 , BYVAL Italic AS LONG
 , BYVAL CharSet AS DWORD
 , BYVAL OutputPrecision AS DWORD
 , BYVAL Quality AS DWORD
 , BYVAL PitchAndFamily AS DWORD
 , BYREF FaceName AS WSTRINGZ
 , BYREF ppFont AS ID3DXFont
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO D3DXCreateFont = D3DXCreateFontW
#ELSE
 MACRO D3DXCreateFont = D3DXCreateFontA
#ENDIF
DECLARE FUNCTION D3DXCreateFontIndirectA IMPORT $D3DX_DLLNAME ALIAS "D3DXCreateFontIndirectA" ( BYVAL pDevice AS IDirect3DDevice9 , BYREF pDesc AS D3DXFONT_DESCA , BYREF ppFont AS ID3DXFont ) AS LONG
DECLARE FUNCTION D3DXCreateFontIndirectW IMPORT $D3DX_DLLNAME ALIAS "D3DXCreateFontIndirectW" ( BYVAL pDevice AS IDirect3DDevice9
 , BYREF pDesc AS D3DXFONT_DESCW
 , BYREF ppFont AS ID3DXFont
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO D3DXCreateFontIndirect = D3DXCreateFontIndirectW
#ELSE
 MACRO D3DXCreateFontIndirect = D3DXCreateFontIndirectA
#ENDIF
'///////////////////////////////////////////////////////////////////////////
'// ID3DXRenderToSurface:
'// ---------------------
'// This object abstracts rendering to surfaces. These surfaces do not
'// necessarily need to be render targets. If they are not, a compatible
'// render target is used, and the result copied into surface at end scene.
'//
'// BeginScene, EndScene -
'// Call BeginScene() and EndScene() at the beginning and ending of your
'// scene. These calls will setup and restore render targets, viewports,
'// etc..
'//
'// OnLostDevice, OnResetDevice -
'// Call OnLostDevice() on this object before calling Reset() on the
'// device, so that this object can release any stateblocks and video
'// memory resources. After Reset(), the call OnResetDevice().
'///////////////////////////////////////////////////////////////////////////
' // Size = 20 bytes
TYPE D3DXRTS_DESC DWORD
 Width AS DWORD ' UINT
 Height AS DWORD ' UINT
 Format AS DWORD ' D3DFORMAT
 DepthStencil AS LONG
 DepthStencilFormat AS DWORD ' D3DFORMAT
END TYPE
$IID_ID3DXRenderToSurface = GUID$("{6985F346-2C3D-43B3-BE8B-DAAE8A03D894}")
INTERFACE ID3DXRenderToSurface $IID_ID3DXRenderToSurface
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetDevice ( ' VTable offset = 12
 BYREF ppDevice AS IDirect3DDevice9
 ) AS LONG
 ' =====================================================================================
 METHOD GetDesc ( ' VTable offset = 16
 BYREF pDesc AS D3DXRTS_DESC
 ) AS LONG
 ' =====================================================================================
 METHOD BeginScene ( ' VTable offset = 20
 BYVAL pSurface AS IDirect3DSurface9
 , BYREF pViewport AS D3DVIEWPORT9
 ) AS LONG
 ' =====================================================================================
 METHOD EndScene ( ' VTable offset = 24
 BYVAL MipFilter AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD OnLostDevice ( ' VTable offset = 28
 ) AS LONG
 ' =====================================================================================
 METHOD OnResetDevice ( ' VTable offset = 32
 ) AS LONG
 ' =====================================================================================
END INTERFACE
DECLARE FUNCTION D3DXCreateRenderToSurface IMPORT $D3DX_DLLNAME ALIAS "D3DXCreateRenderToSurface" ( BYVAL pDevice AS IDirect3DDevice9 , BYVAL Width AS QUAD , BYVAL Height AS QUAD , BYVAL Format AS QUAD , BYVAL DepthStencil AS LONG , BYVAL DepthStencilFormat AS QUAD , BYREF ppRenderToSurface AS ID3DXRenderToSurface ) AS LONG
'///////////////////////////////////////////////////////////////////////////
'// ID3DXRenderToEnvMap:
'// --------------------
'// This object abstracts rendering to environment maps. These surfaces
'// do not necessarily need to be render targets. If they are not, a
'// compatible render target is used, and the result copied into the
'// environment map at end scene.
'//
'// BeginCube, BeginSphere, BeginHemisphere, BeginParabolic -
'// This function initiates the rendering of the environment map. As
'// parameters, you pass the textures in which will get filled in with
'// the resulting environment map.
'//
'// Face -
'// Call this function to initiate the drawing of each face. For each
'// environment map, you will call this six times.. once for each face
'// in D3DCUBEMAP_FACES.
'//
'// End -
'// This will restore all render targets, and if needed compose all the
'// rendered faces into the environment map surfaces.
'//
'// OnLostDevice, OnResetDevice -
'// Call OnLostDevice() on this object before calling Reset() on the
'// device, so that this object can release any stateblocks and video
'// memory resources. After Reset(), the call OnResetDevice().
'///////////////////////////////////////////////////////////////////////////
' // Size = 20 bytes
TYPE D3DXRTE_DESC DWORD
 Size AS DWORD ' UINT
 MipLevels AS DWORD ' UINT
 Format AS DWORD ' D3DFORMAT
 DepthStencil AS LONG
 DepthStencilFormat AS DWORD ' D3DFORMAT
END TYPE
$IID_ID3DXRenderToEnvMap = GUID$("{313F1B4B-C7B0-4FA2-9D9D-8D380B64385E}")
INTERFACE ID3DXRenderToEnvMap $IID_ID3DXRenderToEnvMap
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetDevice ( ' VTable offset = 12
 BYREF ppDevice AS IDirect3DDevice9
 ) AS LONG
 ' =====================================================================================
 METHOD GetDesc ( ' VTable offset = 16
 BYREF pDesc AS D3DXRTE_DESC
 ) AS LONG
 ' =====================================================================================
 METHOD BeginCube ( ' VTable offset = 20
 BYVAL pCubeTex AS IDirect3DCubeTexture9
 ) AS LONG
 ' =====================================================================================
 METHOD BeginSphere ( ' VTable offset = 24
 BYVAL pTex AS IDirect3DTexture9
 ) AS LONG
 ' =====================================================================================
 METHOD BeginHemisphere ( ' VTable offset = 28
 BYVAL pTexZPos AS IDirect3DTexture9
 , BYVAL pTexZNeg AS IDirect3DTexture9
 ) AS LONG
 ' =====================================================================================
 METHOD BeginParabolic ( ' VTable offset = 32
 BYVAL pTexZPos AS IDirect3DTexture9
 , BYVAL pTexZNeg AS IDirect3DTexture9
 ) AS LONG
 ' =====================================================================================
 METHOD Face ( ' VTable offset = 36
 BYVAL Face AS DWORD
 , BYVAL MipFilter AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD End ( ' VTable offset = 40
 BYVAL MipFilter AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD OnLostDevice ( ' VTable offset = 28
 ) AS LONG
 ' =====================================================================================
 METHOD OnResetDevice ( ' VTable offset = 32
 ) AS LONG
 ' =====================================================================================
END INTERFACE
DECLARE FUNCTION D3DXCreateRenderToEnvMap IMPORT $D3DX_DLLNAME ALIAS "D3DXCreateRenderToEnvMap" ( BYVAL pDevice AS IDirect3DDevice9 , BYVAL Size AS QUAD , BYVAL MipLevels AS QUAD , BYVAL Format AS QUAD , BYVAL DepthStencil AS LONG , BYVAL DepthStencilFormat AS QUAD , BYREF ppRenderToEnvMap AS ID3DXRenderToEnvMap ) AS LONG
'///////////////////////////////////////////////////////////////////////////
'// ID3DXLine:
'// ------------
'// This object intends to provide an easy way to draw lines using D3D.
'//
'// Begin -
'// Prepares device for drawing lines
'//
'// Draw -
'// Draws a line strip in screen-space.
'// Input is in the form of a array defining points on the line strip. of D3DXVECTOR2
'//
'// DrawTransform -
'// Draws a line in screen-space with a specified input transformation matrix.
'//
'// End -
'// Restores device state to how it was when Begin was called.
'//
'// SetPattern -
'// Applies a stipple pattern to the line. Input is one 32-bit
'// DWORD which describes the stipple pattern. 1 is opaque, 0 is
'// transparent.
'//
'// SetPatternScale -
'// Stretches the stipple pattern in the u direction. Input is one
'// floating-point value. 0.0f is no scaling, whereas 1.0f doubles
'// the length of the stipple pattern.
'//
'// SetWidth -
'// Specifies the thickness of the line in the v direction. Input is
'// one floating-point value.
'//
'// SetAntialias -
'// Toggles line antialiasing. Input is a BOOL.
'// TRUE = Antialiasing on.
'// FALSE = Antialiasing off.
'//
'// SetGLLines -
'// Toggles non-antialiased OpenGL line emulation. Input is a BOOL.
'// TRUE = OpenGL line emulation on.
'// FALSE = OpenGL line emulation off.
'//
'// OpenGL line: Regular line:
'// *\ *\
'// | \ / \
'// | \ *\ \
'// *\ \ \ \
'// \ \ \ \
'// \ * \ *
'// \ | \ /
'// \| *
'// *
'//
'// OnLostDevice, OnResetDevice -
'// Call OnLostDevice() on this object before calling Reset() on the
'// device, so that this object can release any stateblocks and video
'// memory resources. After Reset(), the call OnResetDevice().
'///////////////////////////////////////////////////////////////////////////
$IID_ID3DXLine = GUID$("{D379BA7F-9042-4AC4-9F5E-58192A4C6BD8}")
INTERFACE ID3DXLine $IID_ID3DXLine
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetDevice ( ' VTable offset = 12
 BYREF ppDevice AS IDirect3DDevice9
 ) AS LONG
 ' =====================================================================================
 METHOD Begin ( ' VTable offset = 16
 ) AS LONG
 ' =====================================================================================
 METHOD Draw ( ' VTable offset = 20
 BYREF pVertexList AS D3DXVECTOR2
 , BYVAL dwVertexListCount AS DWORD
 , BYVAL Color AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD DrawTransform ( ' VTable offset = 24
 BYREF pVertexList AS D3DXVECTOR3
 , BYVAL dwVertexListCount AS DWORD
 , BYREF pTransform AS D3DXMATRIX
 , BYVAL Color AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetPattern ( ' VTable offset = 28
 BYVAL dwPattern AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetPattern ( ' VTable offset = 32
 ) AS DWORD
 ' =====================================================================================
 METHOD SetPatternScale ( ' VTable offset = 36
 BYVAL fPatternScale AS SINGLE
 ) AS LONG
 ' =====================================================================================
 METHOD GetPatternScale ( ' VTable offset = 40
 ) AS SINGLE ' SINGLE
 ' =====================================================================================
 METHOD SetWidth ( ' VTable offset = 44
 BYVAL fWidth AS SINGLE
 ) AS LONG
 ' =====================================================================================
 METHOD GetWidth ( ' VTable offset = 44
 ) AS SINGLE ' SINGLE
 ' =====================================================================================
 METHOD SetAntialias ( ' VTable offset = 48
 BYVAL bAntialias AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD GetAntialias ( ' VTable offset = 52
 ) AS LONG
 ' =====================================================================================
 METHOD SetGLLines ( ' VTable offset = 56
 BYVAL bGLLines AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD GetGLLines ( ' VTable offset = 60
 ) AS LONG
 ' =====================================================================================
 METHOD End ( ' VTable offset = 64
 ) AS LONG
 ' =====================================================================================
 METHOD OnLostDevice ( ' VTable offset = 28
 ) AS LONG
 ' =====================================================================================
 METHOD OnResetDevice ( ' VTable offset = 32
 ) AS LONG
 ' =====================================================================================
END INTERFACE
DECLARE FUNCTION D3DXCreateLine IMPORT $D3DX_DLLNAME ALIAS "D3DXCreateLine" ( BYVAL pDevice AS IDirect3DDevice9 , BYREF ppLine AS ID3DXLine ) AS LONG
#ENDIF
