-
I hope it's alright to ask this here since I could not find the answer anywhere else. Currently I am working on a tiny custom C++ engine and what I want to do is make a hierarchy where I can click on an object in order to modify its variables. Here I set up the meta data
This is my drawUI function. As you can see, I have a seperate window for this and I check the view for the empty struct called SerializableTraits. I then go through the entire list of meta data types, then construct an empty class and call the function.
I really hope someone can help me out or tell me that what I am trying to do is impossible :D |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
There is a |
Beta Was this translation helpful? Give feedback.
-
Thank you for the answer. I actually really wanted this to be expandable in the future, since it is supposed to be an engine and users likely would not have access to the library itself, thus, if this was hard-coded, users could not add their own types unless I'd use something like delegates, which, while possible, I feel like would clutter the code more when combined with all the hard-coded lines for all existing components. |
Beta Was this translation helpful? Give feedback.
There is a
value(entity)
function on the storage, you can combine it withtype.from_void(...)
to get ameta_any
on which to invokefunc
.However, I get it doesn't work for you due to a hypothetical performance problem that was never measured but only imagined? 🤔
In this case, the other alternative is to attach yet another function to the meta type to get the component from the registry.
My two cents: I'd use the cooked solution first, measure and only change it if you spot a bottleneck there.