D3DSimpleShape.h
上传用户:wymy58
上传日期:2007-01-07
资源大小:2086k
文件大小:1k
源码类别:

DirextX编程

开发平台:

Visual C++

  1. // Copyright (C) 1999 DXGuide.  All Rights Reserved.
  2. // File: D3DSimpleShape.h
  3. #ifndef _D3DSIMPLESHAPE__H
  4. #define _D3DSIMPLESHAPE__H
  5. #if _MSC_VER >= 1000
  6. #pragma once
  7. #endif // _MSC_VER >= 1000
  8. #include "D3DVertex.h"
  9. class CD3DDevice;
  10. class CD3DSimpleShape
  11. {
  12. protected:
  13. CD3DSimpleShape(DWORD  dwVertexTypeDesc);
  14. virtual ~CD3DSimpleShape();
  15. public:
  16. HRESULT Render(CD3DDevice*  pD3DDevice,
  17. DWORD  dwFlags = 0);
  18. CD3DUN1Vertex* GetVertices(void)
  19. {
  20. return  m_pVertices;
  21. }
  22. DWORD GetNumVertices(void) const
  23. {
  24. return  m_dwNumVertices;
  25. }
  26. const WORD* GetIndices(void) const
  27. {
  28. return  m_pwIndices;
  29. }
  30. DWORD GetNumIndices(void) const
  31. {
  32. return  m_dwNumIndices;
  33. }
  34. DWORD GetVertexTypeDesc(void) const
  35. {
  36. return  m_dwVertexTypeDesc;
  37. }
  38. protected:
  39. int AllocBuffer(void);
  40. protected:
  41. CD3DUN1Vertex* m_pVertices;
  42. DWORD m_dwNumVertices;
  43. WORD* m_pwIndices;
  44. DWORD m_dwNumIndices;
  45. DWORD m_dwVertexTypeDesc;
  46. };
  47. #endif // _D3DSIMPLESHAPE__H