Skip to content
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

Allow packaged imgui to be used (and allow newer version of this library #657

Closed
wants to merge 1 commit into from
Closed

Conversation

coldtobi
Copy link

@coldtobi coldtobi commented Mar 28, 2022

The changes in CMakeList.txt allows to avoid the bundled imgui, as for Debian
this is a policy*. This is via the USE_SYSTEM_IMGUI option, defaulting to OFF.

The only change I see to imgui.cpp is that there is an assertion commented out,
in ImGui::End() -- this triggers if there is a mismatched number of counts to
ImGui::Begin() and End(), howeever looking over the code, End() is only called
in one location (and another in the Editor) and it matches a Begin() call, so it
should not trigger. (Tested also with com_showFPS = 2)

The change requires some include directives changes from ''libs/imgui/imgui.h''
to ''imgui/imgui.h'', but this is ensured in CMakeList.txt that it will be
transparent whether its the system one or bundled one.

The change in BFGimguiImpl.cpp is recommended with any imgui > 1.60, required with > 1.80:
''io.RenderDrawListsFn'' has been deprecated in 1.60 and subsequently removed
in 1.80: Code should call their backend render function directly after ImGui::Render()
themselves.
Strictly, the version guard is not required, as the bundled version
is newer than 1.60; I've just added it for clarity; let me know if you prefer
me to remove the guard. Upstream details on this topic:
ocornut/imgui#1599 and the Changelog entry:
https://github.com/ocornut/imgui/blob/dfbe938e54858b8b443ca2981d037cc2f35cc931/docs/CHANGELOG.txt#L821

Cheers,
tobi

@coldtobi coldtobi changed the title llow packaged imgui to be used (and allow newer version of this libra… llow packaged imgui to be used (and allow newer version of this library Mar 28, 2022
@coldtobi coldtobi changed the title llow packaged imgui to be used (and allow newer version of this library Allow packaged imgui to be used (and allow newer version of this library Mar 28, 2022
…ary.)

The changes in CMakeList.txt allows to avoid the bundled imgui, as for Debian
this is a policy*. This is via the USE_SYSTEM_IMGUI option, defaulting to OFF.

The only change I see to imgui.cpp is that there is an assertion commented out,
in ImGui::End() -- this triggers if there is a mismatched number of counts to
ImGui::Begin() and End(), howeever looking over the code, End() is only called
in one location (and another in the Editor) and it matches a Begin() call, so it
should not trigger. (Tested also with com_showFPS = 2)

The change requires some include directives changes from ''libs/imgui/imgui.h''
to ''imgui/imgui.h'', but this is ensured in CMakeList.txt that it will be
transparent whether its the system one or bundled one.

The change in BFGimguiImpl.cpp is recommended with any imgui > 1.60, required with > 1.80:
''io.RenderDrawListsFn'' has been deprecated in 1.60 and subsequently removed
in 1.80: Code should call their backend render function directly after ImGui::Render()
themselves.
Strictly, the version guard is not required, as the bundled version
is newer than 1.60; I've just added it for clarity; let me know if you prefer
me to remove the guard.  Upstream details on this topic:
ocornut/imgui#1599 and the Changelog entry:
https://github.com/ocornut/imgui/blob/dfbe938e54858b8b443ca2981d037cc2f35cc931/docs/CHANGELOG.txt#L821

Cheers,
tobi
@runlevel5
Copy link

@coldtobi can't we just bump the bundled version to latest instead?

@coldtobi
Copy link
Author

coldtobi commented May 18, 2022

@coldtobi can't we just bump the bundled version to latest instead?

@runlevel5 Well, Debian has policies against embedded code copies.

So basically, I need this patch applied.. Either by carrying it in the Debian packaging repository or (my preferred way) by sending it here....

This is also true for other distribution; e.g Fedora (also in the packaging guidelines ) and Gentoo have similar policies...

Good essay on the topic why this is not only of benefits for pacakgers..,

@runlevel5
Copy link

Thanks for the explanation.

@coldtobi coldtobi mentioned this pull request Jan 19, 2023
@coldtobi coldtobi closed this by deleting the head repository May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants