Currently some component classes additionally provide the DrawDebugGeometry() method without passing the DebugRenderer as argument.
Is it OK to add this method to every component class?
At the level of the bindings, should we expose the 2 methods, or just one of them?
Edit: maybe adding method without DebugRender to Component class and removing it from children classes would be wise
Typically subsystem-like components have offered this function. I don’t oppose adding it to every component, considering it’s mostly a shortcut and usually you don’t want to use any other debug renderer than the one at the scene root.
Easiest would be to add it to the component base class (remember proper lookup from scene with nullchecks along the way) in which case the bindings could also add it to the base class.
Also, because Urho is nowadays one monolithic library, there is no problem to access a Graphics component from the base class, when you just use the correct include path. Graphics classes are always compiled in.
Speaking of DebugDraw, I just notice today that UI::DebugDraw() is now broken. It used to be able to debug draw a blue bounding rectangle around the UI element being highlighted/selected. Currently PICK_UIELEMENT mode in the Editor does not display the bounding box because of that. It could have been broken already since a few releases back and it seems nobody has missed it . I have just tried compiling from old releases and it only works in v1.3.
Yes, that’s a nasty and easily overlooked problem related to static initialization: if a static const initializer refers to another static const, it may be garbage at that time since the initialization order is not mandated.