I wrote a fairly extensive structure that controls the characters in physical modeling. Despite the fact that everyone warned me not to do this, I used the global public data structure to store information and called it State. It is not in the namespace. I make it globally accessible by declaring an external state state ;. The reason I did this is because this structure is needed everywhere in the application, and itβs very convenient for me to simply turn on my State.h and then write to state.var anywhere and read state.var anywhere. The frame also changes quickly, and I also feel that you do not need to worry about data transfer, synchronization, etc., when new components are introduced.
Anyway, now s *** got into the fan. I want to use one of the GUI classes of the GUI, and it already has its own member called state of type State. Their state is at least in the namespace, but that doesn't seem to matter, since inside the class I already use this namespace.
What can i do now?
source share