8 if (type ==
"float4")
return sizeof(glm::vec4);
9 else if (type ==
"float3")
return sizeof(glm::vec3);
10 else if (type ==
"float2")
return sizeof(glm::vec2);
11 else if (type ==
"float")
return sizeof(
float);
12 else if (type ==
"int")
return sizeof(
int);
13 else if (type ==
"bool")
return sizeof(
bool);
15 SPICES_CORE_ERROR(
"StrType2Size: Not supported type.");
bool has_value(const std::string &name)
Determine is item inside this container.
void for_each(const std::function< bool(const std::string &name, void *pt)> &fn) const
Iter the object_ and call explain_element() to filling data.
void build()
Malloc a memory to begin_.
void add_element(const std::string &name, const std::string &type)
Add a element to object_, means a memory block will be occupied with given param type.
size_t item_location(const std::string &name)
Get item location in blocks.
virtual ~runtime_memory_block()
Destructor Function.
void * begin_
The begin pointer of the continue memory block handled.
The container is wrapper of a continue memory block. Used in Material::BuildMaterial(),...
static size_t StrType2Size(const std::string &type)