diff --git a/Getting-Started.md b/Getting-Started.md index 46e37ca..311dc96 100644 --- a/Getting-Started.md +++ b/Getting-Started.md @@ -63,6 +63,7 @@ In the case of your example application, we explicitly attempt to synchronize to - Add selected `imgui/backends/imgui_impl_xxxx{.cpp,.h}` files corresponding to the technology you use from the `imgui/backends/` folder (e.g. if your app uses SDL2 + DirectX11, add `imgui_impl_sdl2.cpp`, `imgui_impl_dx11.cpp` etc.). If your engine uses multiple APIs you may include multiple backends. - Visual Studio users: Add `misc/debuggers/imgui.natvis` and `misc/debuggers/imgui.natstepfilter` to improve the debugging experience. - std::string users: Add `misc/cpp/imgui_stdlib.*` to easily use InputText with std::string. +- (4) Add `imgui/` and `imgui/backends/` folders to include paths. (You may omit the `imgui/backends` one and add a `backends/` prefix when including the backends header files). It is recommended that you follow those steps and not attempt to build Dear ImGui as a static or shared library! It's perfectly possible to do, but if you are following a "Getting Started" guide the last thing you want to do is to create yourself more problems. Note that Dear ImGui is both small and easy to build, so adding its files directly to your project should be fine. Note that Dear ImGui is a very call-heavy API, so building as a shared library is not ideal because of increased function calling overhead. @@ -77,7 +78,7 @@ If you are creating a new application from scratch: while it is generally outsid (below this list we will show the corresponding code) -- (1) Add `imgui/` to include paths. Include header files for main lib (`#include "imgui.h"`) + backends (e.g. `#include "imgui_impl_win32.h"`, `#include "imgui_impl_dx11.h"`). +- (1) Include header files for main lib (`#include "imgui.h"`) + backends (e.g. `#include "imgui_impl_win32.h"`, `#include "imgui_impl_dx11.h"`). - (2) Create Dear ImGui context with `ImGui::CreateContext()`. - (3) Optionally set configuration flags, load fonts, setup style. - (4) Initialize Platform and Rendering backends (e.g. `ImGui_ImplWin32_Init()` + `ImGui_ImplDX11_Init()`). @@ -343,7 +344,8 @@ Add to start of main loop: ```cpp // (Where your code calls SDL_PollEvent()) ImGui_ImplSDL2_ProcessEvent(&event); // Forward your event to backend - +``` +```cpp // (After event loop) // Start the Dear ImGui frame ImGui_ImplOpenGL3_NewFrame(); @@ -429,7 +431,8 @@ Add to start of main loop: ```cpp // (Where your code calls SDL_PollEvent()) ImGui_ImplSDL2_ProcessEvent(&event); // Forward your event to backend - +``` +```cpp // (After event loop) // Start the Dear ImGui frame ImGui_ImplVulkan_NewFrame();