BsGpuProgramRTTI.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //__________________________ Banshee Project - A modern game development toolkit _________________________________//
  2. //_____________________________________ www.banshee-project.com __________________________________________________//
  3. //________________________ Copyright (c) 2014 Marko Pintera. All rights reserved. ________________________________//
  4. #pragma once
  5. #include "BsCorePrerequisites.h"
  6. #include "BsRTTIType.h"
  7. #include "BsGpuProgram.h"
  8. namespace BansheeEngine
  9. {
  10. class BS_CORE_EXPORT GpuProgramRTTI : public RTTIType<GpuProgram, Resource, GpuProgramRTTI>
  11. {
  12. private:
  13. BS_SETGET_MEMBER(mSize, UINT32, GpuProgram)
  14. BS_SETGET_MEMBER(mType, GpuProgramType, GpuProgram);
  15. BS_SETGET_MEMBER(mNeedsAdjacencyInfo, bool, GpuProgram);
  16. BS_SETGET_MEMBER(mEntryPoint, String, GpuProgram);
  17. BS_SETGET_MEMBER(mProfile, GpuProgramProfile, GpuProgram);
  18. BS_SETGET_MEMBER(mSource, String, GpuProgram);
  19. public:
  20. GpuProgramRTTI()
  21. {
  22. BS_ADD_PLAINFIELD(mSize, 0, GpuProgramRTTI)
  23. BS_ADD_PLAINFIELD(mType, 2, GpuProgramRTTI)
  24. BS_ADD_PLAINFIELD(mNeedsAdjacencyInfo, 3, GpuProgramRTTI)
  25. BS_ADD_PLAINFIELD(mEntryPoint, 4, GpuProgramRTTI)
  26. BS_ADD_PLAINFIELD(mProfile, 5, GpuProgramRTTI)
  27. BS_ADD_PLAINFIELD(mSource, 6, GpuProgramRTTI)
  28. }
  29. virtual void onDeserializationEnded(IReflectable* obj)
  30. {
  31. GpuProgram* gpuProgram = static_cast<GpuProgram*>(obj);
  32. gpuProgram->initialize();
  33. }
  34. virtual const String& getRTTIName()
  35. {
  36. static String name = "GpuProgram";
  37. return name;
  38. }
  39. virtual UINT32 getRTTIId()
  40. {
  41. return TID_GpuProgram;
  42. }
  43. virtual std::shared_ptr<IReflectable> newRTTIObject()
  44. {
  45. BS_EXCEPT(InternalErrorException, "Cannot instantiate abstract class!"); // TODO - Need to initialize this properly
  46. }
  47. };
  48. }