This repository contains Microsoft Visual Studio 2022 code for a library wich provides a (somewhat) convenient interface for using ImGui 1.87 in a DirectX11 window created by Geometric Tools Engine version 6.3. It also includes an example usage, specifically the BlendedTerrainWindow3 demo from GTE:
Using the ImGuiGTE library in an existing GTE window mainly involves these changes:
- Instead of calling
TheWindowSystem.MessagePump
to handle the Windows message loop, useImGuiMessagePump
with the same arguments (or make the equivalent changes if you have your own custom message loop). - Instead of deriving your GTE window class from
gte::Window3
, derive fromImGuiWindow3
. - When rendering your GTE window (done in
BlendedTerrainWindow3::OnIdle
in this example), add your ImGui window by callingStartImGuiFrame()
after clearing your render buffers, issuing the ImGui commands for your UI, then callRenderImGui()
before callingmEngine->DisplayColorBuffer()
.
There are a couple of issues that should be addressed before using any of this code in a real project:
- Several files included in the ImGuiGTE library are copied directly from the ImGui examples and backend directories. There is probably a better way to structure this.
- The paths to the GTE library projects are hard-coded in the solution to D:\GeometricTools\GTE (where they were located on my machine). You will need to manually add the GTE library projects to your own solution and update the references to them in your project.