BsD3D9VertexDeclaration.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsD3D9Prerequisites.h"
  5. #include "BsVertexDeclaration.h"
  6. #include "BsD3D9Resource.h"
  7. namespace BansheeEngine
  8. {
  9. /**
  10. * @brief DirectX 9 implementation of a vertex declaration.
  11. */
  12. class BS_D3D9_EXPORT D3D9VertexDeclarationCore : public VertexDeclarationCore, public D3D9Resource
  13. {
  14. public:
  15. ~D3D9VertexDeclarationCore();
  16. /**
  17. * @copydoc D3D9Resource::notifyOnDeviceCreate
  18. */
  19. virtual void notifyOnDeviceCreate(IDirect3DDevice9* d3d9Device) override;
  20. /**
  21. * @copydoc D3D9Resource::notifyOnDeviceDestroy
  22. */
  23. virtual void notifyOnDeviceDestroy(IDirect3DDevice9* d3d9Device) override;
  24. /**
  25. * @brief Creates a DirectX 9 vertex declaration object.
  26. */
  27. IDirect3DVertexDeclaration9* getD3DVertexDeclaration();
  28. protected:
  29. friend class D3D9HardwareBufferCoreManager;
  30. D3D9VertexDeclarationCore(const List<VertexElement>& elements);
  31. /**
  32. * @brief Releases the internal DirectX 9 vertex declaration object.
  33. */
  34. void releaseDeclaration();
  35. protected:
  36. Map<IDirect3DDevice9*, IDirect3DVertexDeclaration9*> mMapDeviceToDeclaration;
  37. };
  38. }