Daandelange / ofxImGui

Please refer to the develop branch in https://github.com/jvcleave/ofxImGui. I'll keep this fork in sync until it's merged in master.
12 stars 1 forks source link

Wrong initialization in the example-fonts ? #14

Closed moebiussurfing closed 1 year ago

moebiussurfing commented 1 year ago

Hey, I am checking the: https://github.com/Daandelange/ofxImGui/tree/master/example-fonts and I think there's an error, Correct me and sorry if I am missing something...

2nd argument on gui.setup( is ImGuiConfigFlags_DockingEnable but should be a bool (autoDraw_) Maybe don't warn the error bc auto converts the value...

//--------------------------------------------------------------
void ofApp::setup()
{
    ofSetLogLevel(OF_LOG_VERBOSE);

    //required call
    gui.setup(nullptr, ImGuiConfigFlags_DockingEnable);

But the method declaration is:

void Gui::setup(BaseTheme* theme_, bool autoDraw_, ImGuiConfigFlags customFlags_, bool _restoreGuiState, bool _showImGuiMouseCursor )

I changed here like that to be more clearly:

    bool _autoDraw = true;
    ImGuiConfigFlags _customFlags = ImGuiConfigFlags_DockingEnable;
    bool _restoreGuiState = false;
    bool _showImGuiMouseCursor = false;

    gui.setup(nullptr, _autoDraw, _customFlags, _restoreGuiState, _showImGuiMouseCursor);
Daandelange commented 1 year ago

You're right, there's some wrong code in that example. Probably some old setup() code left around. Thanks ! Good idea to separate the args so the example is easier to understand.