-
Notifications
You must be signed in to change notification settings - Fork 145
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
|
| Filename | Overview |
|---|---|
| Core/Libraries/Source/ImGui/dx8_backend/imgui_impl_dx8.cpp | Custom DX8 backend implementation for ImGui with proper error handling for depth stencil operations |
| Core/Libraries/Source/ImGui/CMakeLists.txt | CMake configuration that fetches ImGui and configures the build with debug mode requirement |
| Generals/Code/GameEngine/Source/GameClient/GameClient.cpp | Integration of ImGui frame lifecycle in game client update loop with proper render calls before early returns |
| Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp | DX8 wrapper handles ImGui context initialization, device reset, and render data output |
Sequence Diagram
sequenceDiagram
participant User
participant WndProc
participant GameClient
participant DX8Wrapper
participant ImGui
participant DX8Device
Note over User,DX8Device: Initialization (Create_Device)
DX8Wrapper->>ImGui: CreateContext()
DX8Wrapper->>ImGui: ImGui_ImplWin32_Init(hwnd)
DX8Wrapper->>ImGui: ImGui_ImplDX8_Init(device)
ImGui->>DX8Device: AddRef()
Note over User,DX8Device: Frame Loop
User->>WndProc: Input Events
WndProc->>ImGui: ImGui_ImplWin32_WndProcHandler()
GameClient->>ImGui: ImGui_ImplDX8_NewFrame()
GameClient->>ImGui: ImGui_ImplWin32_NewFrame()
GameClient->>ImGui: ImGui::NewFrame()
GameClient->>ImGui: ImGui::ShowDemoWindow()
GameClient->>ImGui: ImGui::Render()
GameClient->>DX8Wrapper: TheDisplay->DRAW()
DX8Wrapper->>DX8Device: BeginScene()
Note over DX8Wrapper: Render game content
DX8Wrapper->>ImGui: ImGui::GetDrawData()
DX8Wrapper->>ImGui: ImGui_ImplDX8_RenderDrawData()
ImGui->>DX8Device: SetRenderState/DrawIndexedPrimitive
DX8Wrapper->>DX8Device: EndScene()
Note over User,DX8Device: Device Reset
DX8Wrapper->>ImGui: ImGui_ImplDX8_InvalidateDeviceObjects()
DX8Wrapper->>DX8Device: Reset()
DX8Wrapper->>ImGui: ImGui_ImplDX8_CreateDeviceObjects()
Note over User,DX8Device: Shutdown
DX8Wrapper->>ImGui: ImGui_ImplDX8_Shutdown()
DX8Wrapper->>ImGui: ImGui_ImplWin32_Shutdown()
DX8Wrapper->>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
introduces working imgui console and demo window in debug mode
- Finalize imgui isolation in debug modes via ifdefs - Remove Console.cpp and Console.h to focus on ImGui integration
when opening worldbuilder or guiedit ImGui has no frames to render and thus attemtimg to call RenderDrawData crashes in those applications as soon as they start this change fixes that behaviour by only rendering when we have stuff to render
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
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.
14 files reviewed, 3 comments
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 purposes
What it does : Integrates the Dear Imgui framework and loads a console and demo window overlay
in debug mode
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