简体   繁体   中英

How to make a button in OpenGL c++ with imgui

I want to know how to make buttons in OpenGL c++ with glfw. I know how to make a button and text box in OpenGL but I have one problem. When I make a button on the top of the imgui, there is a window like rectangle that has a name(imgui demo, or any name you name it) I want to remove that. And can I blend the color in so the OpenGL window and imgui window look the same. Just remove the top part and blend color.

Imgui 按钮

As you can see in the image everything is the same expect the top part. I want to fix that, or remove it.

You can easily use any of the Window creation flags

ImGuiWindowFlags flags = ImGuiWindowFlags_NoMove
                         | ImGuiWindowFlags_NoDecoration
                         | ImGuiWindowFlags_AlwaysAutoResize
                         | ImGuiWindowFlags_NoSavedSettings;

if(transparent) flags |= ImGuiWindowFlags_NoBackground;

ImGui::Begin("##name", nullptr, flags);
{

... buttons widget etc..

}
ImGui::End();

Please refer the imgui_demo.cpp. It got everything possible with imgui

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM