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

Backends: OSX, Metal: Support multi-contexts #5221

Closed
wants to merge 2 commits into from

Conversation

noisewuwei
Copy link
Contributor

Restructure imgui_impl_metal.mm and imgui_impl_osx.mm for support Muti-contexts

imgui.h Outdated
@@ -1953,7 +1954,7 @@ struct ImGuiIO

// Optional: Notify OS Input Method Editor of the screen position of your cursor for text input position (e.g. when using Japanese/Chinese IME on Windows)
// (default to use native imm32 api on Windows)
void (*SetPlatformImeDataFn)(ImGuiViewport* viewport, ImGuiPlatformImeData* data);
std::function<void(ImGuiViewport* viewport, ImGuiPlatformImeData* data)> SetPlatformImeDataFn;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::function is not necessary here and would be problematic for people using Dear ImGui from other languages. Your SetPlatformImeDataFn handler should not capture bd, it should use ImGui_ImplOSX_GetBackendData instead like all of the other backends.

(No comment on the rest of the PR, this just stood out to me while skimming.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK.Thanks.I have modified the code.

@ocornut ocornut changed the title support muti-contexts Backends: OSX, Metal: Support multi-contexts Apr 21, 2022
ocornut pushed a commit that referenced this pull request Apr 27, 2022
…owing to use these backends with multiple contexts. (#5203, #5221, #4141)

# Conflicts:
#	docs/CHANGELOG.txt
@ocornut
Copy link
Owner

ocornut commented Apr 27, 2022

Thank you! We have now merged e54db4e which is your PR + various fixes/cleanup done by @rokups.
(Your PR accidentally reverted the two latest commit on those files)

@ocornut ocornut closed this Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants