forked from electronicarts/CnC_Generals_Zero_Hour
-
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
Open
jurassicLizard
wants to merge
50
commits into
TheSuperHackers:main
Choose a base branch
from
jurassicLizard:feature/imgui_console_integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
7a118ef
feat(gameclient) Introduce imgui console
jurassicLizard 019af6d
Fix failing Release build with imgui enabled
jurassicLizard a7806a8
Move ImGui Render before DRAW call for consistency
jurassicLizard 38407bf
Remove redundant Frame creation in dx8wrapper
jurassicLizard 34d99c4
Fix configuration to also accept RTS_BUILD_OPTION_DEBUG
jurassicLizard 9865b8d
Add feature info for ImGui build option
jurassicLizard 821222b
Backport ImGui integration to generals
jurassicLizard f41c6d5
Cleanup redundant deadcode
jurassicLizard 731da38
Add TheSuperHackers comments according to guidlines
jurassicLizard 67a4645
Remove redundant Render
jurassicLizard 8f9f434
Fix type in ImGui CMakeLists
jurassicLizard 34e3752
Fix NullPointer dereference in imgui_impl_dx8
jurassicLizard dada1a4
fix missing result status check
jurassicLizard 4361776
fix second potential nullptr dereference in dx8 backend
jurassicLizard 473f9d7
Fix crash in worldbuilder and guiedit
jurassicLizard dd8541a
Fix further nullptr deref issues in ImGui dx8backend
jurassicLizard a23ab53
Fix indentation in ImGui CMakeLists.txt
jurassicLizard 0b25693
Fix cmake option description for imgui
jurassicLizard 86a0677
Change RTS_IMGUI_ENABLED to RTS_HAS_IMGUI
jurassicLizard 34374cb
Remove excess lines
jurassicLizard 3adbc7a
Update Error messsages in CMakeLists
jurassicLizard 56c92d7
Change NULL to nullptr in dx8 backend
jurassicLizard d0db383
Remove and centralize description comments
jurassicLizard 39de6fc
Revert "Change NULL to nullptr in dx8 backend"
jurassicLizard 3f7f17e
Move lib_imgui linking away from corei_always
jurassicLizard cec768f
Restore nullptr fixes
jurassicLizard ebc7fad
Fix copyright header and space issues
jurassicLizard 1558483
Fix style issues
jurassicLizard d288d6e
Fix ImGui dx8 style and copyright header
jurassicLizard d086853
unify cmake win dx8 imgui impl variables
jurassicLizard 22b9274
remove redundant C-Style casting for ImGui Io
jurassicLizard ca0b995
Fix SuperHackers comment alignment and redundancy
jurassicLizard ff01f44
add dx9 imgui impl header to our own dx8 impl files
jurassicLizard e9a36e6
Create wrapper for ImGui Frame mgmt and integrate in WorldbuilderV
jurassicLizard 94124e3
Finalize ImGui integration in Gen and ZH worldbuilders
jurassicLizard 34a4dc6
Add copyright headers and fix indentation in frame mgr
jurassicLizard 21171d1
Remove imgui integration naming
jurassicLizard 32a61c4
link lib_imgui to g_gameengine and z_gameengine instead of _always
jurassicLizard 17a3000
fix copyright header order
jurassicLizard a4957f7
fix more style issues in imgui dx8 backend
jurassicLizard e916ac7
remove excess spaces from ImGuiFrameManager
jurassicLizard eb43457
align class and namespace for ImGuiFrameManager
jurassicLizard abe01e0
remove unwanted comments
jurassicLizard f142bcd
move comments inside conditional compilation block in wbview3d
jurassicLizard 2eeab3f
remove superfluous superhackers comment
jurassicLizard 1a575df
partially fix regression that stopped imgui from rendering
jurassicLizard 3a1828b
fix worldbuilder regression with imgui not showing
jurassicLizard e49ef39
Apply Microsoft Codestyle and Allman Bracestyle to imgui codebase
jurassicLizard eb90ad1
Fix minor style and functional issues
jurassicLizard bc453ca
remove conditional build on Debug only modes
jurassicLizard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| FetchContent_Declare( | ||
| imgui | ||
| GIT_REPOSITORY https://github.com/ocornut/imgui.git | ||
| GIT_TAG 791ad9b82db44ada9fedb3e26b2d900974ac0959 | ||
| SYSTEM | ||
| ) | ||
|
|
||
| FetchContent_MakeAvailable(imgui) | ||
|
|
||
| # Main IMGUI sources we are going to need | ||
| set(IMGUI_BASE_SRCS | ||
| "${imgui_SOURCE_DIR}/imgui.cpp" | ||
| "${imgui_SOURCE_DIR}/imgui_draw.cpp" | ||
| "${imgui_SOURCE_DIR}/imgui_tables.cpp" | ||
| "${imgui_SOURCE_DIR}/imgui_widgets.cpp" | ||
| "${imgui_SOURCE_DIR}/imgui_demo.cpp" | ||
| ) | ||
|
|
||
| # Main Win32 DX8 specific sources we are going to need we can specify more if we need extra platforms | ||
| set(IMGUI_WIN32_DX8_ALL_SRCS | ||
| "${IMGUI_BASE_SRCS}" | ||
| "${imgui_SOURCE_DIR}/backends/imgui_impl_win32.cpp" | ||
| "${CMAKE_SOURCE_DIR}/Core/Libraries/Source/ImGui/dx8_backend/imgui_impl_dx8.cpp" | ||
| ) | ||
|
|
||
| # All Include directories | ||
| set(IMGUI_INCLUDE_DIRS | ||
| "${imgui_SOURCE_DIR}" | ||
| "${imgui_SOURCE_DIR}/backends" | ||
| # DX8 override. Remove the following once we are using a standard backend | ||
| "${CMAKE_SOURCE_DIR}/Core/Libraries/Source/ImGui/dx8_backend" | ||
| ) | ||
|
|
||
| # start target build section | ||
| # we currently have a hard dependency on dx8 and win32 api | ||
| if (WIN32) | ||
| MESSAGE(STATUS "Enabling ImGui") | ||
|
|
||
| add_library(lib_imgui STATIC ${IMGUI_WIN32_DX8_ALL_SRCS} | ||
| "${CMAKE_CURRENT_LIST_DIR}/wrapper/ImGuiFrameManager.cpp" | ||
| ) | ||
| target_include_directories(lib_imgui | ||
| PUBLIC ${IMGUI_INCLUDE_DIRS} | ||
| PUBLIC "${CMAKE_CURRENT_LIST_DIR}/wrapper") | ||
| target_link_libraries(lib_imgui PRIVATE d3d8lib) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can add newline before this for readability. |
||
|
|
||
| # use our own imconfig.h | ||
| target_compile_definitions(lib_imgui | ||
| PRIVATE IMGUI_DISABLE_DEFAULT_IMCONFIG | ||
| PRIVATE IMGUI_USER_CONFIG="${CMAKE_CURRENT_LIST_DIR}/imconfig.h" | ||
| INTERFACE RTS_HAS_IMGUI | ||
| ) | ||
| else () | ||
| # currently only WIN32 DX is supported | ||
| MESSAGE(FATAL_ERROR "Non-Windows platforms currently not supported for ImGui") | ||
| endif () | ||
| # end target build section | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Superfluous comment |
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This file does not need touching. Newline can be reverted.