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

Plugin architecture in imgui(C++)? #7605

Open
AmanRathoreP opened this issue May 19, 2024 · 4 comments
Open

Plugin architecture in imgui(C++)? #7605

AmanRathoreP opened this issue May 19, 2024 · 4 comments
Labels

Comments

@AmanRathoreP
Copy link

Version/Branch of Dear ImGui:

Version 1.90.6 Branch: docking

Back-ends:

imgui_impl_opengl3.cpp

Compiler, OS:

Windows/Linux/MacOS

Full config/build information:

No response

Details:

Plugin Architecture

Well, I had searched enough to know that plugin architecture in compiled languages like C/C++ is quite difficult (if not impossible) to implement.
I don't want do fancy tasks via plugins but just to draw some extra widgets, tools, windows etc. in my application(of imgui). I want to ask whether there is any example or way of how to achieve this goal.

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

No response

@WerWolv
Copy link

WerWolv commented May 19, 2024

This is probably not really an ImGui specific thing but I implemented a pretty extensive plugin system in ImHex. Mainly focused around loading shared libraries that link to a central interface library but there's also support for C# plugins that can also draw their own ImGui interfaces by going through ImGui.NET -> cimgui -> ImGui

@ocornut
Copy link
Owner

ocornut commented May 19, 2024

Implementing a plug-in system in a C/C++ app is not particularly difficult. The plugin could have access to imgui header with correct IMGUI_API define to refer to code linked inside main app. I don’t remember the details but it’s not imgui specific.

@AmanRathoreP
Copy link
Author

Implementing a plug-in system in a C/C++ app is not particularly difficult. The plugin could have access to imgui header with correct IMGUI_API define to refer to code linked inside main app. I don’t remember the details but it’s not imgui specific.

I know it's may not be imgui specific but could you provide me links of some of the repositories that uses imgui with plugins via C/C++(C#/Java/Rust will also work)

@alien-brother
Copy link

If the main application and the plugin dll are statically linked to ImGui, I guess one would need to make sure that they use the same context (assuming that it contains all global state).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants