3template <
typename Func>
4component& opaque(
const Func& type_support) {
6 auto ts = type_support(world);
7 ts.desc.entity = _::cpp_type<T>::id(m_world);
17 return this->opaque(as_type.
id());
21 return this->opaque(as_type.
id());
25template <
typename ElemType>
31component<T>& constant(
const char *name, T value) {
32 int32_t v =
static_cast<int32_t
>(value);
33 untyped_component::constant(name, v);
entity_t id() const
Get entity id.
Type safe interface for opaque types.
opaque & as_type(flecs::id_t func)
Type that describes the type kind/structure of the opaque type.