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

DirextX编程

开发平台:

Visual C++

  1. // Copyright (C) 1999 DXGuide.  All Rights Reserved.
  2. // File: D3DVertexBuffer.h
  3. #ifndef _D3DVERTEXBUFFER__H
  4. #define _D3DVERTEXBUFFER__H
  5. #if _MSC_VER >= 1000
  6. #pragma once
  7. #endif // _MSC_VER >= 1000
  8. #pragma warning(disable: 4201)
  9. #include <d3d.h>
  10. #pragma warning(default: 4201)
  11. class CD3DVertexBuffer
  12. {
  13. friend class CD3DDevice;
  14. public:
  15. CD3DVertexBuffer(void);
  16. ~CD3DVertexBuffer();
  17. public:
  18. bool Create(CD3DDevice*  pD3DDevice,
  19. DWORD  dwFVF, DWORD  dwNumVertices, bool  bWriteOnly/* = false*/);
  20. public:
  21. HRESULT Lock(LPVOID*  lplpData, LPDWORD  lpdwSize,
  22. DWORD  dwFlags = DDLOCK_WAIT);
  23. HRESULT Unlock(void);
  24. HRESULT Optimize(void);
  25. HRESULT ProcessVertices(CD3DVertexBuffer*  pSrcBuffer,
  26. DWORD  dwVertexOp, DWORD  dwDestIndex,
  27. DWORD  dwCount, DWORD  dwSrcIndex);
  28. HRESULT ProcessVerticesStrided(
  29. DWORD  dwVertexOp, DWORD  dwDestIndex,
  30. DWORD  dwCount,
  31. LPD3DDRAWPRIMITIVESTRIDEDDATA  lpVertexArray,
  32. DWORD  dwSrcIndex,
  33. DWORD  dwFlags);
  34. protected:
  35. LPDIRECT3DVERTEXBUFFER7 m_lpD3DVertexBuffer;
  36. CD3DDevice* m_pD3DDevice;
  37. bool m_bWriteOnly;
  38. };
  39. #endif  // _D3DVERTEXBUFFER__H