-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
IMGUI_API in imgui.h and imgui_impl_... #1888
Comments
Since you are presumably only including the imgui_impl_xxx.h files once, can't you change the IMGUI_API define jusr for them? |
now fighting with cmake for that solution |
after being able to do it with
compiler complains with
which is caused by: @ocornut |
I thought imgui_impl_opengl3.cpp wouldn't need that define, but it must affect decorated symbol names so it needs to be consistent. We could add IMGUI_IMPL_API for a small extra cognitive cost for the user but we need to carry the guarantee that this API will translate to a C-style API. You could also make a wrapper for the 4 functions? |
Yes I did it and tried in my binding. Althought there is a default argument this was not a stopper. |
TL;DR: I think IMGUI_IMPL_API is the better way, because it avoid problems with build systems. For example:
Application link to both libraries which cause conflict in IMGUI_API macro and there is no way to solve that without touching imgui_impl_xxx sources. This is no ideal, bacause it is adding maintainance burden and I wish I could just replace old version with a new one without need to modify it. Hence, see TL;DR. : ) Edit: there are reasons why things are organized this way, but they are not relevant to the issue at hand |
|
…_IMPL_API (which defaults to IMGUI_API) to facilitate some uses. (#1888) + Comments in imgui.h
@sonoro1234, @thedmd: Applied this change now. |
Hi,
In imgui_impl_... files IMGUI_API precedes function declaration, If IMGUI_API is defined as extern "C" __declspec(dllexport) they can be compiled as functions accesible by a binding, but IMGUI_API defined this way in imgui.h fails because they are not exportable C function.
Solution would be to have IMGUI_API in imgui.h but IMGUI_APIX (any different name is ok) in the implementations
The text was updated successfully, but these errors were encountered: