-
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 | DirectX 8 rendering backend implementation with proper depth buffer handling and state management |
| Core/Libraries/Source/ImGui/wrapper/ImGuiContextManager.cpp | RAII wrapper for ImGui context lifecycle with proper initialization and cleanup |
| Core/Libraries/Source/ImGui/wrapper/ImGuiFrameManager.cpp | Frame lifecycle management with guard pattern to ensure proper begin/end frame calls |
| Core/Libraries/Source/ImGui/CMakeLists.txt | Fetches ImGui library and configures build with custom DX8 backend |
| Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp | Integrates ImGui context initialization and frame management into DirectX 8 rendering pipeline |
| GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp | Integrates ImGui context initialization and frame management into DirectX 8 rendering pipeline (Zero Hour version) |
Sequence Diagram
sequenceDiagram
participant App as WinMain
participant WndProc as WndProc
participant DX8 as DX8Wrapper
participant ImGuiCtx as ImGuiContextManager
participant GameClient as GameClient
participant ImGuiFrame as ImGuiFrameManager
participant ImGuiBackend as ImGui_ImplDX8
Note over App,ImGuiBackend: Application Startup
App->>DX8: Init()
DX8->>DX8: Create_Device()
DX8->>ImGuiCtx: Init(hwnd, device)
ImGuiCtx->>ImGuiBackend: ImGui_ImplDX8_Init(device)
ImGuiCtx->>ImGuiBackend: ImGui_ImplWin32_Init(hwnd)
Note over App,ImGuiBackend: Frame Rendering Loop
loop Every Frame
WndProc->>WndProc: ImGui_ImplWin32_WndProcHandler()
Note over WndProc: Forward input events to ImGui
GameClient->>ImGuiFrame: FrameGuard constructor
ImGuiFrame->>ImGuiBackend: ImGui_ImplDX8_NewFrame()
ImGuiFrame->>ImGuiBackend: ImGui_ImplWin32_NewFrame()
ImGuiFrame->>ImGuiBackend: ImGui::NewFrame()
GameClient->>GameClient: ImGui::ShowDemoWindow()
Note over GameClient: Build ImGui UI
GameClient->>ImGuiFrame: FrameGuard destructor
ImGuiFrame->>ImGuiBackend: ImGui::Render()
ImGuiFrame->>ImGuiBackend: ImGui_ImplDX8_RenderDrawData()
DX8->>DX8: Begin_Scene()
Note over DX8: Render game content
DX8->>DX8: End_Scene()
end
Note over App,ImGuiBackend: Device Reset (resolution change, etc.)
DX8->>ImGuiBackend: ImGui_ImplDX8_InvalidateDeviceObjects()
DX8->>DX8: Reset device
DX8->>ImGuiBackend: ImGui_ImplDX8_CreateDeviceObjects()
Note over App,ImGuiBackend: Application Shutdown
App->>DX8: Shutdown()
DX8->>ImGuiCtx: ~ContextManager()
ImGuiCtx->>ImGuiBackend: ImGui_ImplDX8_Shutdown()
ImGuiCtx->>ImGuiBackend: ImGui_ImplWin32_Shutdown()
ImGuiCtx->>ImGuiBackend: ImGui::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
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
bc453ca to
eb5f3f1
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.
6 files reviewed, 3 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.
6 files reviewed, 5 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.
7 files reviewed, 6 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.
5 files reviewed, 6 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.
8 files reviewed, 4 comments
SUMMARY (of what has been achieved in that direction):
|
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
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.
6 files reviewed, 4 comments
…icLizard/GeneralsGameCode into feature/imgui_console_integration
Note : to test this please configure in Debug mode before building with
-A Win32 -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