-
Notifications
You must be signed in to change notification settings - Fork 151
feat(gameclient): Introduce imgui framework #2127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(gameclient): Introduce imgui framework #2127
Conversation
Greptile Overview
|
| Filename | Overview |
|---|---|
| Core/Libraries/Source/ImGui/dx8_backend/imgui_impl_dx8.cpp | Custom DirectX 8 backend for ImGui with proper error checking, device state management, and stencil-based clipping implementation |
| Core/Libraries/Source/ImGui/wrapper/ImGuiFrameManager.h | Well-documented wrapper interface with clear separation of concerns comment explaining RenderDrawData is called separately |
| Generals/Code/GameEngine/Source/GameClient/GameClient.cpp | ImGui integrated into game loop with BeginFrame/ShowDemoWindow/EndFrame at correct points, including before early returns |
| GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp | Zero Hour variant with identical ImGui integration pattern to Generals |
| Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp | DX8 device lifecycle integration with ImGui initialization, device object management, and render call in End_Scene() |
| GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp | Zero Hour DX8 wrapper with identical ImGui integration to Generals variant |
Sequence Diagram
sequenceDiagram
participant User
participant WndProc
participant DX8Wrapper
participant GameClient
participant ImGuiWin32
participant ImGuiDX8
participant Display
Note over DX8Wrapper: Application Initialization
DX8Wrapper->>DX8Wrapper: Create_Device()
DX8Wrapper->>ImGuiWin32: ImGui_ImplWin32_Init()
DX8Wrapper->>ImGuiDX8: ImGui_ImplDX8_Init()
DX8Wrapper->>ImGuiDX8: CreateDeviceObjects()
Note over User,Display: Main Game Loop
User->>WndProc: Input Events (mouse, keyboard)
WndProc->>ImGuiWin32: ImGui_ImplWin32_WndProcHandler()
ImGuiWin32-->>WndProc: Returns handled status
GameClient->>GameClient: update()
GameClient->>ImGuiDX8: BeginFrame() [NewFrame sequence]
GameClient->>ImGuiWin32: NewFrame()
GameClient->>GameClient: ImGui::ShowDemoWindow()
GameClient->>GameClient: EndFrame() [Render()]
GameClient->>Display: DRAW()
Display->>DX8Wrapper: End_Scene()
DX8Wrapper->>ImGuiDX8: ImGui_ImplDX8_RenderDrawData()
ImGuiDX8->>ImGuiDX8: SetupRenderState()
ImGuiDX8->>DX8Wrapper: DrawIndexedPrimitive()
Note over DX8Wrapper: Device Reset Handling
DX8Wrapper->>ImGuiDX8: InvalidateDeviceObjects()
DX8Wrapper->>DX8Wrapper: Reset D3D Device
DX8Wrapper->>ImGuiDX8: CreateDeviceObjects()
Note over DX8Wrapper: Application Shutdown
DX8Wrapper->>ImGuiDX8: ImGui_ImplDX8_Shutdown()
DX8Wrapper->>ImGuiWin32: ImGui_ImplWin32_Shutdown()
DX8Wrapper->>DX8Wrapper: DestroyContext()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
14 files reviewed, 4 comments
Greptile found no issues!From now on, if a review finishes and we haven't found any issues, we will not post anything, but you can confirm that we reviewed your changes in the status check section. This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR". |
ab35d8a to
742f8be
Compare
|
relates to : #387 and #2084 (comment) |
de59853 to
d7e3765
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
14 files reviewed, 1 comment
d7e3765 to
4e08d7e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
14 files reviewed, 4 comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
14 files reviewed, 3 comments
86dec82 to
d72b80f
Compare
d579452 to
21171d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
21 files reviewed, 1 comment
Thanks. i did exactly that but given the large differences between both backends, some braces might slip the net while i am scanning. i hope i got them all now |
after moving link location multiple targets fail to render imgui. this has been fixed in ZH and generals but is yet to be fixed in worldbuilder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
25 files reviewed, 1 comment
xezon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
@xezon since it is no longer active only in Debug mode, i think the Debug label no longer fits . what do you think ? |
|
Debug label is ok. It is meant to be compiled out in regular builds for Players. Just because it does not sit behind RTS_DEBUG does not mean it is no Debug. |


Note : to test this please configure in Debug mode before building with
-A Win32 ~~-DRTS_BUILD_OPTION_DEBUG=ON~~ -DRTS_BUILD_OPTION_IMGUI=Onall the code is gated behind a RTS_IMGUI_ENABLED perprocessor define for
debugging purposesWhat it does : Integrates the Dear Imgui framework and loads a console and demo window overlay
in debug mode(generalsv, generalszh, WorldBuilderV and WorldBuilderZH)What is missing
Some useful command or Ideas what it should look like: this PR will just focus on build and runtime integration via ImGui DemoCurrently it is permanently enabled when the game is builtwith the imgui option onGated behind RTS_BUILD_OPTION_IMGUICode cleanup and SuperHackers Comments etc...doneBackporting to Generalsdone