1//************************************ bs::framework - Copyright 2018 Marko Pintera **************************************//
2//*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********//
3#pragma once
4
5#include "BsCorePrerequisites.h"
6#include "Reflection/BsRTTIType.h"
7#include "RenderAPI/BsVertexDataDesc.h"
8
9namespace bs
10{
11 /** @cond RTTI */
12 /** @addtogroup RTTI-Impl-Core
13 * @{
14 */
15
16 class BS_CORE_EXPORT VertexDataDescRTTI : public RTTIType<VertexDataDesc, IReflectable, VertexDataDescRTTI>
17 {
18 private:
19 VertexElement& getVertexElementData(VertexDataDesc* obj, UINT32 arrayIdx) { return obj->mVertexElements[arrayIdx]; }
20 void setVertexElementData(VertexDataDesc* obj, UINT32 arrayIdx, VertexElement& value) { obj->mVertexElements[arrayIdx] = value; }
21
22 UINT32 getNumVertexElementData(VertexDataDesc* obj) { return (UINT32)obj->mVertexElements.size(); }
23 void setNumVertexElementData(VertexDataDesc* obj, UINT32 numElements) { obj->mVertexElements.resize(numElements); }
24
25 public:
26 VertexDataDescRTTI()
27 {
28 addPlainArrayField("mVertexData", 0, &VertexDataDescRTTI::getVertexElementData,
29 &VertexDataDescRTTI::getNumVertexElementData, &VertexDataDescRTTI::setVertexElementData, &VertexDataDescRTTI::setNumVertexElementData);
30 }
31
32 SPtr<IReflectable> newRTTIObject() override
33 {
34 return bs_shared_ptr<VertexDataDesc>(new (bs_alloc<VertexDataDesc>()) VertexDataDesc());
35 }
36
37 const String& getRTTIName() override
38 {
39 static String name = "VertexDataDesc";
40 return name;
41 }
42
43 UINT32 getRTTIId() override
44 {
45 return TID_VertexDataDesc;
46 }
47 };
48
49 /** @} */
50 /** @endcond */
51}