class CDXUTLineManager//线条
{
public:
CDXUTLineManager();
~CDXUTLineManager();
HRESULT OnCreatedDevice( IDirect3DDevice9* pd3dDevice );//选入设备
HRESULT OnResetDevice();//变化窗口后重新设置窗口
HRESULT OnRender();//渲染
HRESULT OnLostDevice();//变化窗口时丢失设备
HRESULT OnDeletedDevice();//删除CDXUTLineManager中的设备
HRESULT AddLine( int* pnLineID, D3DXVECTOR2* pVertexList, DWORD dwVertexListCount, D3DCOLOR Color, float fWidth,
float fScaleRatio, bool bAntiAlias );//添加线条 (线条id, D3DXVECTOR2数组, 图元数, 颜色, 宽度, 放大比例, 是否锯齿)
HRESULT AddRect( int* pnLineID, RECT rc, D3DCOLOR Color, float fWidth, float fScaleRatio, bool bAntiAlias );//添加线框 (线框ID, 线框位子, 颜色, 宽度, 放大比例, 是否锯齿)
HRESULT RemoveLine( int nLineID );//删除线条或线框
HRESULT RemoveAllLines();//删除所有
protected:
struct LINE_NODE//线条属性
{
int nLineID;
D3DCOLOR Color;
float fWidth;
bool bAntiAlias;
float fScaleRatio;
D3DXVECTOR2* pVertexList;
DWORD dwVertexListCount;
};
CGrowableArray <LINE_NODE*> m_LinesList;//动态对象数组,
IDirect3DDevice9* m_pd3dDevice;//设备
ID3DXLine* m_pD3DXLine;// directx SDK
};
{
public:
CDXUTLineManager();
~CDXUTLineManager();
HRESULT OnCreatedDevice( IDirect3DDevice9* pd3dDevice );//选入设备
HRESULT OnResetDevice();//变化窗口后重新设置窗口
HRESULT OnRender();//渲染
HRESULT OnLostDevice();//变化窗口时丢失设备
HRESULT OnDeletedDevice();//删除CDXUTLineManager中的设备
HRESULT AddLine( int* pnLineID, D3DXVECTOR2* pVertexList, DWORD dwVertexListCount, D3DCOLOR Color, float fWidth,
float fScaleRatio, bool bAntiAlias );//添加线条 (线条id, D3DXVECTOR2数组, 图元数, 颜色, 宽度, 放大比例, 是否锯齿)
HRESULT AddRect( int* pnLineID, RECT rc, D3DCOLOR Color, float fWidth, float fScaleRatio, bool bAntiAlias );//添加线框 (线框ID, 线框位子, 颜色, 宽度, 放大比例, 是否锯齿)
HRESULT RemoveLine( int nLineID );//删除线条或线框
HRESULT RemoveAllLines();//删除所有
protected:
struct LINE_NODE//线条属性
{
int nLineID;
D3DCOLOR Color;
float fWidth;
bool bAntiAlias;
float fScaleRatio;
D3DXVECTOR2* pVertexList;
DWORD dwVertexListCount;
};
CGrowableArray <LINE_NODE*> m_LinesList;//动态对象数组,
IDirect3DDevice9* m_pd3dDevice;//设备
ID3DXLine* m_pD3DXLine;// directx SDK
};