BsScriptViewport.generated.cpp 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. #include "BsScriptViewport.generated.h"
  2. #include "BsMonoMethod.h"
  3. #include "BsMonoClass.h"
  4. #include "BsMonoUtil.h"
  5. #include "../../../bsf/Source/Foundation/bsfCore/RenderAPI/BsViewport.h"
  6. #include "Reflection/BsRTTIType.h"
  7. #include "Wrappers/BsScriptColor.h"
  8. #include "BsScriptRenderTarget.generated.h"
  9. #include "../../../bsf/Source/Foundation/bsfCore/RenderAPI/BsRenderTexture.h"
  10. #include "BsScriptRenderTexture.generated.h"
  11. #include "BsScriptViewport.generated.h"
  12. namespace bs
  13. {
  14. ScriptViewport::ScriptViewport(MonoObject* managedInstance, const SPtr<Viewport>& value)
  15. :ScriptObject(managedInstance), mInternal(value)
  16. {
  17. }
  18. void ScriptViewport::initRuntimeData()
  19. {
  20. metaData.scriptClass->addInternalCall("Internal_setTarget", (void*)&ScriptViewport::Internal_setTarget);
  21. metaData.scriptClass->addInternalCall("Internal_getTarget", (void*)&ScriptViewport::Internal_getTarget);
  22. metaData.scriptClass->addInternalCall("Internal_setArea", (void*)&ScriptViewport::Internal_setArea);
  23. metaData.scriptClass->addInternalCall("Internal_getArea", (void*)&ScriptViewport::Internal_getArea);
  24. metaData.scriptClass->addInternalCall("Internal_getPixelArea", (void*)&ScriptViewport::Internal_getPixelArea);
  25. metaData.scriptClass->addInternalCall("Internal_setClearFlags", (void*)&ScriptViewport::Internal_setClearFlags);
  26. metaData.scriptClass->addInternalCall("Internal_getClearFlags", (void*)&ScriptViewport::Internal_getClearFlags);
  27. metaData.scriptClass->addInternalCall("Internal_setClearColorValue", (void*)&ScriptViewport::Internal_setClearColorValue);
  28. metaData.scriptClass->addInternalCall("Internal_getClearColorValue", (void*)&ScriptViewport::Internal_getClearColorValue);
  29. metaData.scriptClass->addInternalCall("Internal_setClearDepthValue", (void*)&ScriptViewport::Internal_setClearDepthValue);
  30. metaData.scriptClass->addInternalCall("Internal_getClearDepthValue", (void*)&ScriptViewport::Internal_getClearDepthValue);
  31. metaData.scriptClass->addInternalCall("Internal_setClearStencilValue", (void*)&ScriptViewport::Internal_setClearStencilValue);
  32. metaData.scriptClass->addInternalCall("Internal_getClearStencilValue", (void*)&ScriptViewport::Internal_getClearStencilValue);
  33. metaData.scriptClass->addInternalCall("Internal_create", (void*)&ScriptViewport::Internal_create);
  34. }
  35. MonoObject* ScriptViewport::create(const SPtr<Viewport>& value)
  36. {
  37. if(value == nullptr) return nullptr;
  38. bool dummy = false;
  39. void* ctorParams[1] = { &dummy };
  40. MonoObject* managedInstance = metaData.scriptClass->createInstance("bool", ctorParams);
  41. new (bs_alloc<ScriptViewport>()) ScriptViewport(managedInstance, value);
  42. return managedInstance;
  43. }
  44. void ScriptViewport::Internal_setTarget(ScriptViewport* thisPtr, MonoObject* target)
  45. {
  46. SPtr<RenderTarget> tmptarget;
  47. ScriptRenderTargetBase* scripttarget;
  48. scripttarget = (ScriptRenderTargetBase*)ScriptRenderTarget::toNative(target);
  49. if(scripttarget != nullptr)
  50. tmptarget = scripttarget->getInternal();
  51. thisPtr->getInternal()->setTarget(tmptarget);
  52. }
  53. MonoObject* ScriptViewport::Internal_getTarget(ScriptViewport* thisPtr)
  54. {
  55. SPtr<RenderTarget> tmp__output;
  56. tmp__output = thisPtr->getInternal()->getTarget();
  57. MonoObject* __output;
  58. if(tmp__output)
  59. {
  60. if(rtti_is_of_type<RenderTexture>(tmp__output))
  61. __output = ScriptRenderTexture::create(std::static_pointer_cast<RenderTexture>(tmp__output));
  62. else
  63. __output = ScriptRenderTarget::create(tmp__output);
  64. }
  65. else
  66. __output = ScriptRenderTarget::create(tmp__output);
  67. return __output;
  68. }
  69. void ScriptViewport::Internal_setArea(ScriptViewport* thisPtr, Rect2* area)
  70. {
  71. thisPtr->getInternal()->setArea(*area);
  72. }
  73. void ScriptViewport::Internal_getArea(ScriptViewport* thisPtr, Rect2* __output)
  74. {
  75. Rect2 tmp__output;
  76. tmp__output = thisPtr->getInternal()->getArea();
  77. *__output = tmp__output;
  78. }
  79. void ScriptViewport::Internal_getPixelArea(ScriptViewport* thisPtr, Rect2I* __output)
  80. {
  81. Rect2I tmp__output;
  82. tmp__output = thisPtr->getInternal()->getPixelArea();
  83. *__output = tmp__output;
  84. }
  85. void ScriptViewport::Internal_setClearFlags(ScriptViewport* thisPtr, ClearFlagBits flags)
  86. {
  87. thisPtr->getInternal()->setClearFlags(flags);
  88. }
  89. ClearFlagBits ScriptViewport::Internal_getClearFlags(ScriptViewport* thisPtr)
  90. {
  91. Flags<ClearFlagBits> tmp__output;
  92. tmp__output = thisPtr->getInternal()->getClearFlags();
  93. ClearFlagBits __output;
  94. __output = (ClearFlagBits)(uint32_t)tmp__output;
  95. return __output;
  96. }
  97. void ScriptViewport::Internal_setClearColorValue(ScriptViewport* thisPtr, Color* color)
  98. {
  99. thisPtr->getInternal()->setClearColorValue(*color);
  100. }
  101. void ScriptViewport::Internal_getClearColorValue(ScriptViewport* thisPtr, Color* __output)
  102. {
  103. Color tmp__output;
  104. tmp__output = thisPtr->getInternal()->getClearColorValue();
  105. *__output = tmp__output;
  106. }
  107. void ScriptViewport::Internal_setClearDepthValue(ScriptViewport* thisPtr, float depth)
  108. {
  109. thisPtr->getInternal()->setClearDepthValue(depth);
  110. }
  111. float ScriptViewport::Internal_getClearDepthValue(ScriptViewport* thisPtr)
  112. {
  113. float tmp__output;
  114. tmp__output = thisPtr->getInternal()->getClearDepthValue();
  115. float __output;
  116. __output = tmp__output;
  117. return __output;
  118. }
  119. void ScriptViewport::Internal_setClearStencilValue(ScriptViewport* thisPtr, uint16_t value)
  120. {
  121. thisPtr->getInternal()->setClearStencilValue(value);
  122. }
  123. uint16_t ScriptViewport::Internal_getClearStencilValue(ScriptViewport* thisPtr)
  124. {
  125. uint16_t tmp__output;
  126. tmp__output = thisPtr->getInternal()->getClearStencilValue();
  127. uint16_t __output;
  128. __output = tmp__output;
  129. return __output;
  130. }
  131. void ScriptViewport::Internal_create(MonoObject* managedInstance, MonoObject* target, float x, float y, float width, float height)
  132. {
  133. SPtr<RenderTarget> tmptarget;
  134. ScriptRenderTargetBase* scripttarget;
  135. scripttarget = (ScriptRenderTargetBase*)ScriptRenderTarget::toNative(target);
  136. if(scripttarget != nullptr)
  137. tmptarget = scripttarget->getInternal();
  138. SPtr<Viewport> instance = Viewport::create(tmptarget, x, y, width, height);
  139. new (bs_alloc<ScriptViewport>())ScriptViewport(managedInstance, instance);
  140. }
  141. }