jvcleave / ofxImGui

Use ImGui in openFrameworks
300 stars 123 forks source link

can't understand how to close a window !!! #40

Closed StudioDeTelevision closed 8 years ago

StudioDeTelevision commented 8 years ago

Hello, i spent few hours trying to :

jvcleave commented 8 years ago

    static bool showWindow = true;

    if(showWindow)
    {
        if(!ImGui::Begin("Test WIndow", &showWindow))
        {
            ImGui::End();
        }else
        {
            ImGui::Text("Application average %.3f ms/frame (%.1f FPS)",
                        1000.0f / ImGui::GetIO().Framerate,
                        ImGui::GetIO().Framerate);
            ImGui::End();
        }
    }

Look in here for other uses: https://github.com/jvcleave/ofxImGui/blob/master/libs/imgui/src/imgui_demo.cpp

StudioDeTelevision commented 8 years ago

thanks Jason if i put that code between gui.begin(); and gui.end(); it just crash when i click the close button

i guess that ' s not normal , i must have a bad configuration somewhere

have a nice day

Le 15 juin 2016 à 20:35, Jason Van Cleave notifications@github.com a écrit :

static bool showWindow = true;

if(showWindow)
{
    if(!ImGui::Begin("Pi Mapper", &showWindow))
    {
        ImGui::End();
    }else
    {
        ImGui::Text("Application average %.3f ms/frame (%.1f FPS)",
                    1000.0f / ImGui::GetIO().Framerate,
                    ImGui::GetIO().Framerate);
        ImGui::End();
    }
}

Look in here for other uses: https://github.com/jvcleave/ofxImGui/blob/master/libs/imgui/src/imgui_demo.cpp

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

jvcleave commented 8 years ago

weird - I tested it with example-demo and it was fine

StudioDeTelevision commented 8 years ago

in example demo you put it just after gui.begin or just before gui.end() ? thanks

Le 16 juin 2016 à 09:46, Jason Van Cleave notifications@github.com a écrit :

weird - I tested it with example-demo and it was fine

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

jvcleave commented 8 years ago

right after gui.begin();