-
-
Notifications
You must be signed in to change notification settings - Fork 33
FAQ
Before opening an issue on GitHub, please first check whether your question has already been answered here.
Q: Why are there missing functions or overloads in ImGui?
A: The missing functions or overloads you may encounter in ImGui are due to certain functionalities being classified as internal to the library. These internal functions are not exposed through the main ImGui interface.
To access these functions, you should use ImGuiP instead. ImGuiP includes these internal functionalities that are not part of the standard ImGui interface.
Common issue: When using ImGuiP functions, you may run into confusing cases such as missing overloads, type mismatches, or “weird casts.” For example:
ImGuiP.DockBuilderAddNode(dock, (ImGuiDockNodeFlags)ImGuiDockNodeFlagsPrivate.Space);
At first glance this looks odd, but what’s happening is that ImGuiDockNodeFlagsPrivate is effectively the same enum as ImGuiDockNodeFlags — the “Private” version is just an internal extension that lives outside the public API. That’s why you need to cast it when calling functions that expect the public enum.
This design choice ensures a clear separation between public and internal APIs. For more details on why this decision was made, refer to this issue: #16.
Due to ABI issues on windows the function signatures GetWindowPos
and GetWindowSize
differ from other Operation systems
Windows signatures:
private static unsafe Vector2* GetWindowPos(Vector2* size, ImGuiViewport* viewport)
{
ViewportData* vd = (ViewportData*)viewport->PlatformUserData;
int x = 0, y = 0;
SDL.GetWindowPosition(vd->Window, &x, &y);
*size = new Vector2(x, y);
return size;
}
private static unsafe Vector2* GetWindowSize(Vector2* size, ImGuiViewport* viewport)
{
ViewportData* vd = (ViewportData*)viewport->PlatformUserData;
int w = 0, h = 0;
SDL.GetWindowSize(vd->Window, &w, &h);
*size = new Vector2(w, h);
return size;
}
Linux (and others) signatures:
private static unsafe Vector2 GetWindowPos(ImGuiViewport* viewport)
{
ViewportData* vd = (ViewportData*)viewport->PlatformUserData;
int x = 0, y = 0;
SDL.GetWindowPosition(vd->Window, &x, &y);
return new Vector2(x, y);
}
private static unsafe Vector2 GetWindowSize(ImGuiViewport* viewport)
{
ViewportData* vd = (ViewportData*)viewport->PlatformUserData;
int w = 0, h = 0;
SDL.GetWindowSize(vd->Window, &w, &h);
return new Vector2(w, h);
}
for more information on this, visit those issues: #9 #9-line