CmD3D9VertexDeclaration.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #pragma once
  2. #include "CmD3D9Prerequisites.h"
  3. #include "CmVertexDeclaration.h"
  4. #include "CmD3D9Resource.h"
  5. namespace BansheeEngine
  6. {
  7. /** Specialisation of VertexDeclaration for D3D9 */
  8. class BS_D3D9_EXPORT D3D9VertexDeclaration : public VertexDeclaration, public D3D9Resource
  9. {
  10. public:
  11. ~D3D9VertexDeclaration();
  12. // Called immediately after the Direct3D device has been created.
  13. virtual void notifyOnDeviceCreate(IDirect3DDevice9* d3d9Device);
  14. // Called before the Direct3D device is going to be destroyed.
  15. virtual void notifyOnDeviceDestroy(IDirect3DDevice9* d3d9Device);
  16. /** Gets the D3D9-specific vertex declaration. */
  17. IDirect3DVertexDeclaration9* getD3DVertexDeclaration();
  18. protected:
  19. friend class D3D9HardwareBufferManager;
  20. D3D9VertexDeclaration(const VertexDeclaration::VertexElementList& elements);
  21. void releaseDeclaration();
  22. /**
  23. * @copydoc VertexDeclaration::destroy_internal().
  24. */
  25. void destroy_internal();
  26. protected:
  27. typedef Map<IDirect3DDevice9*, IDirect3DVertexDeclaration9*> DeviceToDeclarationMap;
  28. typedef DeviceToDeclarationMap::iterator DeviceToDeclarationIterator;
  29. DeviceToDeclarationMap mMapDeviceToDeclaration;
  30. };
  31. }