BsD3D9GpuProgramRTTI.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #pragma once
  2. #include "BsD3D9Prerequisites.h"
  3. #include "BsRTTIType.h"
  4. #include "BsGpuProgramManager.h"
  5. #include "BsD3D9GpuProgram.h"
  6. namespace BansheeEngine
  7. {
  8. class BS_D3D9_EXPORT D3D9GpuProgramRTTI : public RTTIType<D3D9GpuProgram, GpuProgram, D3D9GpuProgramRTTI>
  9. {
  10. public:
  11. D3D9GpuProgramRTTI()
  12. { }
  13. virtual const String& getRTTIName()
  14. {
  15. static String name = "D3D9GpuProgram";
  16. return name;
  17. }
  18. virtual UINT32 getRTTIId()
  19. {
  20. return TID_D3D9_GpuProgram;
  21. }
  22. virtual std::shared_ptr<IReflectable> newRTTIObject()
  23. {
  24. BS_EXCEPT(InvalidStateException, "Cannot create an instance of an abstract class.");
  25. }
  26. };
  27. class BS_D3D9_EXPORT D3D9GpuVertexProgramRTTI : public RTTIType<D3D9GpuVertexProgram, D3D9GpuProgram, D3D9GpuVertexProgramRTTI>
  28. {
  29. public:
  30. D3D9GpuVertexProgramRTTI()
  31. { }
  32. virtual const String& getRTTIName()
  33. {
  34. static String name = "D3D9GpuVertexProgram";
  35. return name;
  36. }
  37. virtual UINT32 getRTTIId()
  38. {
  39. return TID_D3D9_GpuVertexProgram;
  40. }
  41. virtual std::shared_ptr<IReflectable> newRTTIObject()
  42. {
  43. return GpuProgramManager::instance().createEmpty("hlsl", GPT_VERTEX_PROGRAM);
  44. }
  45. };
  46. class BS_D3D9_EXPORT D3D9GpuFragmentProgramRTTI : public RTTIType<D3D9GpuFragmentProgram, D3D9GpuProgram, D3D9GpuFragmentProgramRTTI>
  47. {
  48. public:
  49. D3D9GpuFragmentProgramRTTI()
  50. { }
  51. virtual const String& getRTTIName()
  52. {
  53. static String name = "D3D9GpuFragmentProgram";
  54. return name;
  55. }
  56. virtual UINT32 getRTTIId()
  57. {
  58. return TID_D3D9_GpuFragmentProgram;
  59. }
  60. virtual std::shared_ptr<IReflectable> newRTTIObject()
  61. {
  62. return GpuProgramManager::instance().createEmpty("hlsl", GPT_FRAGMENT_PROGRAM);
  63. }
  64. };
  65. }