CmGpuProgramRTTI.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #pragma once
  2. #include "CmPrerequisites.h"
  3. #include "CmRTTIType.h"
  4. #include "CmGpuProgram.h"
  5. namespace BansheeEngine
  6. {
  7. class CM_EXPORT GpuProgramRTTI : public RTTIType<GpuProgram, Resource, GpuProgramRTTI>
  8. {
  9. private:
  10. CM_SETGET_MEMBER(mSize, UINT32, GpuProgram)
  11. CM_SETGET_MEMBER(mType, GpuProgramType, GpuProgram);
  12. CM_SETGET_MEMBER(mNeedsAdjacencyInfo, bool, GpuProgram);
  13. CM_SETGET_MEMBER(mEntryPoint, String, GpuProgram);
  14. CM_SETGET_MEMBER(mProfile, GpuProgramProfile, GpuProgram);
  15. CM_SETGET_MEMBER(mSource, String, GpuProgram);
  16. CM_SETGET_MEMBER(mSyntaxCode, String, GpuProgram);
  17. public:
  18. GpuProgramRTTI()
  19. {
  20. CM_ADD_PLAINFIELD(mSize, 0, GpuProgramRTTI)
  21. CM_ADD_PLAINFIELD(mType, 2, GpuProgramRTTI)
  22. CM_ADD_PLAINFIELD(mNeedsAdjacencyInfo, 3, GpuProgramRTTI)
  23. CM_ADD_PLAINFIELD(mEntryPoint, 4, GpuProgramRTTI)
  24. CM_ADD_PLAINFIELD(mProfile, 5, GpuProgramRTTI)
  25. CM_ADD_PLAINFIELD(mSource, 6, GpuProgramRTTI)
  26. CM_ADD_PLAINFIELD(mSyntaxCode, 7, GpuProgramRTTI)
  27. }
  28. virtual void onDeserializationEnded(IReflectable* obj)
  29. {
  30. GpuProgram* gpuProgram = static_cast<GpuProgram*>(obj);
  31. gpuProgram->initialize();
  32. }
  33. virtual const String& getRTTIName()
  34. {
  35. static String name = "GpuProgram";
  36. return name;
  37. }
  38. virtual UINT32 getRTTIId()
  39. {
  40. return TID_GpuProgram;
  41. }
  42. virtual std::shared_ptr<IReflectable> newRTTIObject()
  43. {
  44. CM_EXCEPT(InternalErrorException, "Cannot instantiate abstract class!"); // TODO - Need to initialize this properly
  45. }
  46. };
  47. }