Begin: WIP consistent Begin/End behavior.

This commit is contained in:
omar
2020-07-20 23:20:16 +02:00
committed by ocornut
parent 8035405481
commit f4edca3e65
9 changed files with 596 additions and 495 deletions

View File

@ -429,8 +429,10 @@ provide similar or better string helpers.
### Q: How can I display custom shapes? (using low-level ImDrawList API)
- You can use the low-level `ImDrawList` api to render shapes within a window.
```cpp
ImGui::Begin("My shapes");
if (!ImGui::Begin("My shapes"))
return;
ImDrawList* draw_list = ImGui::GetWindowDrawList();

View File

@ -52,7 +52,8 @@ Result:
Code:
```cpp
// Create a window called "My First Tool", with a menu bar.
ImGui::Begin("My First Tool", &my_tool_active, ImGuiWindowFlags_MenuBar);
if (!ImGui::Begin("My First Tool", &my_tool_active, ImGuiWindowFlags_MenuBar))
return;
if (ImGui::BeginMenuBar())
{
if (ImGui::BeginMenu("File"))