ID3DXLine Interface

 

 

' ****************************************************************************************
' ID3DXLine interface
' $IID_ID3DXLine = GUID$("{D379BA7F-9042-4ac4-9F5E-58192A4C6BD8}")
' ****************************************************************************************

' ****************************************************************************************
' The ID3DXLine interface implements line drawing using textured triangles.
' Remarks
'    Create a line drawing object with D3DXCreateLine.
' Interface Information
'    Stock Implementation   d3d9.dll
'    Custom Implementation  No
'    Inherits from  IUnknown
'    Header     d3dx9core.h
'    Import library     d3dx9.lib
'    Minimum operating systems  Windows 98
' ****************************************************************************************

' ****************************************************************************************
'DECLARE_INTERFACE_(ID3DXLine, IUnknown)
'{
'    // IUnknown
'  0.  STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
'  1.  STDMETHOD_(ULONG, AddRef)(THIS) PURE;
'  2.  STDMETHOD_(ULONG, Release)(THIS) PURE;

'    // ID3DXLine
'  3.  STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE;

'  4.  STDMETHOD(Begin)(THIS) PURE;

'  5.  STDMETHOD(Draw)(THIS_ CONST D3DXVECTOR2 *pVertexList,
'          DWORD dwVertexListCount, D3DCOLOR Color) PURE;

'  6.  STDMETHOD(DrawTransform)(THIS_ CONST D3DXVECTOR3 *pVertexList,
'          DWORD dwVertexListCount, CONST D3DXMATRIX* pTransform,
'          D3DCOLOR Color) PURE;

'  7.  STDMETHOD(SetPattern)(THIS_ DWORD dwPattern) PURE;
'  8.  STDMETHOD_(DWORD, GetPattern)(THIS) PURE;

'  9.  STDMETHOD(SetPatternScale)(THIS_ FLOAT fPatternScale) PURE;
' 10.  STDMETHOD_(FLOAT, GetPatternScale)(THIS) PURE;

' 11.  STDMETHOD(SetWidth)(THIS_ FLOAT fWidth) PURE;
' 12.  STDMETHOD_(FLOAT, GetWidth)(THIS) PURE;

' 13.  STDMETHOD(SetAntialias)(THIS_ BOOL bAntialias) PURE;
' 14.  STDMETHOD_(BOOL, GetAntialias)(THIS) PURE;

' 15.  STDMETHOD(SetGLLines)(THIS_ BOOL bGLLines) PURE;
' 16.  STDMETHOD_(BOOL, GetGLLines)(THIS) PURE;

' 17.  STDMETHOD(End)(THIS) PURE;

' 18.  STDMETHOD(OnLostDevice)(THIS) PURE;
' 19.  STDMETHOD(OnResetDevice)(THIS) PURE;
'};
' ****************************************************************************************

' ****************************************************************************************
' GetDevice method
' Retrieves the Microsoft Direct3D device associated with the line object.
' Note  Calling this method will increase the internal reference count on the
' IDirect3DDevice9 interface. Be sure to call IUnknown::Release when you are done using
' this IDirect3DDevice9 interface or you will have a memory leak.
' HRESULT GetDevice(
'   LPDIRECT3DDEVICE9 * ppDevice
' );
' ****************************************************************************************
FUNCTION ID3DXLine_GetDevice ALIAS "ID3DXLine_GetDevice" ( _
    BYVAL pthis AS DWORD PTR, BYREF ppDevice AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[3] USING ID3DXLine_GetDevice(pthis, ppDevice) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Begin method
' Prepares a device for drawing lines.
' HRESULT Begin();
' ****************************************************************************************
FUNCTION ID3DXLine_Begin ALIAS "ID3DXLine_Begin" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[4] USING ID3DXLine_Begin(pthis) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Draw method
' Draws a line strip in screen space. Input is in the form of an array that defines points
' (of D3DXVECTOR2) on the line strip.
' HRESULT Draw(
'   CONST D3DXVECTOR2* pVertexList,
'   DWORD dwVertexListCount,
'   D3DCOLOR Color
' );
' ****************************************************************************************
FUNCTION ID3DXLine_Draw ALIAS "ID3DXLine_Draw" ( _
    BYVAL pthis AS DWORD PTR, BYVAL pVertexList AS DWORD, BYVAL dwVertexList AS DWORD, _
    BYVAL prmColor AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[5] USING ID3DXLine_Draw(pthis, pVertexList, dwVertexList, prmColor) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' DrawTransform method
' Draws a line strip in screen space with a specified input transformation matrix.
' HRESULT DrawTransform(
'   CONST D3DXVECTOR3* pVertexList,
'   DWORD dwVertexListCount,
'   CONST D3DXMATRIX* pTransform,
'   D3DCOLOR Color
' );
' ****************************************************************************************
FUNCTION ID3DXLine_DrawTransform ALIAS "ID3DXLine_DrawTransform" ( _
    BYVAL pthis AS DWORD PTR, BYVAL pVertexList AS DWORD, BYVAL dwVertexListCount AS DWORD, _
    BYREF pTransform AS D3DXMATRIX, BYVAL prmColor AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[6] USING ID3DXLine_DrawTransform(pthis, pVertexList, dwVertexListCount, pTransform, prmColor) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetPattern method
' Applies a stipple pattern to the line.
' HRESULT SetPattern(
'   DWORD dwPattern
' );
' ****************************************************************************************
FUNCTION ID3DXLine_SetPattern ALIAS "ID3DXLine_SetPattern" ( _
    BYVAL pthis AS DWORD PTR, BYVAL dwPattern AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[7] USING ID3DXLine_SetPattern(pthis, dwPattern) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetPattern method
' Gets the line stipple pattern.
' DWORD GetPattern();
' ****************************************************************************************
FUNCTION ID3DXLine_GetPattern ALIAS "ID3DXLine_GetPattern" (BYVAL pthis AS DWORD PTR) EXPORT AS DWORD

    LOCAL DWRESULT AS DWORD
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[8] USING ID3DXLine_GetPattern(pthis) TO DWRESULT
    FUNCTION = DWRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetPatternScale method
' Stretches the stipple pattern along the line direction.
' HRESULT SetPatternScale(
'   FLOAT fPatternScale
' );
' ****************************************************************************************
FUNCTION ID3DXLine_SetPatternScale ALIAS "ID3DXLine_SetPatternScale" ( _
    BYVAL pthis AS DWORD PTR, BYVAL fPatternScale AS SINGLE) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[9] USING ID3DXLine_SetPatternScale(pthis, fPatternScale) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetPatternScale method
' Gets the stipple-pattern scale value.
' FLOAT GetPatternScale();
' ****************************************************************************************
FUNCTION ID3DXLine_GetPatternScale ALIAS "ID3DXLine_GetPatternScale" (BYVAL pthis AS DWORD PTR) EXPORT AS SINGLE

    LOCAL SRESULT AS SINGLE
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[10] USING ID3DXLine_GetPatternScale(pthis) TO SRESULT
    FUNCTION = SRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetWidth method
' Specifies the thickness of the line.
' HRESULT SetWidth(
'   FLOAT fWidth
' );
' ****************************************************************************************
FUNCTION ID3DXLine_SetWidth ALIAS "ID3DXLine_SetWidth" ( _
    BYVAL pthis AS DWORD PTR, BYVAL fWidth AS SINGLE) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[11] USING ID3DXLine_SetWidth(pthis, fWidth) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetWidth method
' Gets the thickness of the line.
' FLOAT GetWidth();
' ****************************************************************************************
FUNCTION ID3DXLine_GetWidth ALIAS "ID3DXLine_GetWidth" (BYVAL pthis AS DWORD PTR) EXPORT AS SINGLE

    LOCAL SRESULT AS SINGLE
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[12] USING ID3DXLine_GetWidth(pthis) TO SRESULT
    FUNCTION = SRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetAntiAlias method
' Toggles line antialiasing.
' HRESULT SetAntialias(
'   BOOL bAntiAlias
' );
' ****************************************************************************************
FUNCTION ID3DXLine_SetAntiAlias ALIAS "ID3DXLine_SetAntiAlias" ( _
    BYVAL pthis AS DWORD PTR, BYVAL bAntiAlias AS LONG) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[13] USING ID3DXLine_SetAntiAlias(pthis, bAntiAlias) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetAntiAlias method
' Gets the line antialiasing state.
' BOOL GetAntialias();
' ****************************************************************************************
FUNCTION ID3DXLine_GetAntiAlias ALIAS "ID3DXLine_GetAntiAlias" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG

    LOCAL LRESULT AS LONG
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[14] USING ID3DXLine_GetAntiAlias(pthis) TO LRESULT
    FUNCTION = LRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetGLLines method
' Toggles the mode to draw OpenGL-style lines.
' HRESULT SetGLLines(
'   BOOL bGLLines
' );
' ****************************************************************************************
FUNCTION ID3DXLine_SetGLLines ALIAS "ID3DXLine_SetGLLines" (BYVAL pthis AS DWORD PTR, BYVAL bGLLines AS LONG) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[15] USING ID3DXLine_SetGLLines(pthis, bGLLines) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetGLLines method
' Gets the OpenGL-style line-drawing mode.
' BOOL GetGLLines();
' ****************************************************************************************
FUNCTION ID3DXLine_GetGLLines ALIAS "ID3DXLine_GetGLLines" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG

    LOCAL LRESULT AS LONG
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[16] USING ID3DXLine_GetGLLines(pthis) TO LRESULT
    FUNCTION = LRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' End method
' Restores the device state to how it was when ID3DXLine::Begin was called.
' HRESULT End();
' ****************************************************************************************
FUNCTION ID3DXLine_End ALIAS "ID3DXLine_End" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[17] USING ID3DXLine_End(pthis) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' OnLostDevice method
' Releases all references to video memory resources and deletes all stateblocks.
' HRESULT OnLostDevice();
' ****************************************************************************************
FUNCTION ID3DXLine_OnLostDevice ALIAS "ID3DXLine_OnLostDevice"  (BYVAL pthis AS DWORD PTR) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[18] USING ID3DXLine_OnLostDevice (pthis) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' OnResetDevice method
' Should be called after the device has been reset.
' HRESULT OnResetDevice();
' ****************************************************************************************
FUNCTION ID3DXLine_OnResetDevice ALIAS "ID3DXLine_OnResetDevice" (BYVAL pthis AS DWORD PTR) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[19] USING ID3DXLine_OnResetDevice (pthis) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************
 

 

Page last updated on Tuesday, 14 March 2006 23:00:52 +0100