You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is good if you're just trying to familiarize yourself with the code, but throughout the View components I'm sporadically experimenting with the ImGui library using the demo window and source as a reference, so often times I will directly copy code from the demo and retool it to my needs based on the feature I'm trying to lay out. As you can imagine, this leaves behind a lot of unsavory code and copy pastes. So I figured I'd make it a task to go through any View layouts and make sure of the following.
Variables that can be declared in the View class header should (e.g. static flags for a table,child,etc)
Variables that cannot be declared in the header (e.g. arrays being passed to a gui element that takes as argument) should be overloaded to support an STL structure that will make it possible to declare the element as a class variable. Only use static scoped variables in extreme circumstances.
Elements without unique identifiers/labels should be given a unique name (use ## before the name to negate a text display of the string)
Reproducible code should be moved into a simple void function to leave the update function clean and straightforward
You can look at the imgui_demo.cpp for examples of what I mean and then compare against the View components themselves. Also, it's good to have that demo source file handy when you're learning ImGui anyway.
The text was updated successfully, but these errors were encountered:
This is good if you're just trying to familiarize yourself with the code, but throughout the View components I'm sporadically experimenting with the ImGui library using the demo window and source as a reference, so often times I will directly copy code from the demo and retool it to my needs based on the feature I'm trying to lay out. As you can imagine, this leaves behind a lot of unsavory code and copy pastes. So I figured I'd make it a task to go through any View layouts and make sure of the following.
You can look at the imgui_demo.cpp for examples of what I mean and then compare against the View components themselves. Also, it's good to have that demo source file handy when you're learning ImGui anyway.
The text was updated successfully, but these errors were encountered: