Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup leftover demo code in View components #7

Open
scawful opened this issue May 5, 2022 · 0 comments
Open

Cleanup leftover demo code in View components #7

scawful opened this issue May 5, 2022 · 0 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@scawful
Copy link
Owner

scawful commented May 5, 2022

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.

@scawful scawful added help wanted Extra attention is needed good first issue Good for newcomers labels May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant