-
Notifications
You must be signed in to change notification settings - Fork 310
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
Integration of ImPlot, ImNodes and ImGuizmo #218
Changes from 4 commits
02a838f
0bf95cb
13ce5ec
5f15fdf
3c14895
7b26ec8
d6f961f
a5a66dd
d2fe090
3db0d27
7ab250f
2d1fc76
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,12 @@ public class TypeInfo | |
{ "ImFileHandle", "IntPtr" }, | ||
{ "ImU8", "byte" }, | ||
{ "ImS8", "sbyte" }, | ||
{ "ImU16", "ushort" }, | ||
{ "ImS16", "short" }, | ||
{ "ImU32", "uint" }, | ||
{ "ImS32", "int" }, | ||
{ "ImU64", "ulong" }, | ||
{ "ImS64", "long" }, | ||
{ "unsigned short", "ushort" }, | ||
{ "unsigned int", "uint" }, | ||
{ "ImVec2", "Vector2" }, | ||
|
@@ -29,10 +34,11 @@ public class TypeInfo | |
{ "ImDrawIdx", "ushort" }, | ||
{ "ImDrawListSharedData", "IntPtr" }, | ||
{ "ImDrawListSharedData*", "IntPtr" }, | ||
{ "ImU32", "uint" }, | ||
{ "ImDrawCallback", "IntPtr" }, | ||
{ "size_t", "uint" }, | ||
{ "ImGuiContext*", "IntPtr" }, | ||
{ "ImPlotContext*", "IntPtr" }, | ||
{ "EditorContext*", "IntPtr" }, | ||
{ "float[2]", "Vector2*" }, | ||
{ "float[3]", "Vector3*" }, | ||
{ "float[4]", "Vector4*" }, | ||
|
@@ -44,7 +50,12 @@ public class TypeInfo | |
{ "char* []", "byte**" }, | ||
{ "unsigned char[256]", "byte*"}, | ||
}; | ||
|
||
|
||
public static readonly List<string> WellKnownEnums = new List<string>() | ||
{ | ||
"ImGuiMouseButton" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, I guess this is needed because one of the new projects uses ImGuiMouseButton, but the definitions.json file that is used for it doesn't include it (since it's part of cimgui). This might work as a quick fix, but it points to a deeper issue. It seems like the new libraries should reference the cimgui definitions while generating code. |
||
}; | ||
|
||
public static readonly Dictionary<string, string> WellKnownFieldReplacements = new Dictionary<string, string>() | ||
{ | ||
{ "bool", "bool" }, // Force bool to remain as bool in type-safe wrappers. | ||
|
@@ -62,16 +73,35 @@ public class TypeInfo | |
{ | ||
{ "((void *)0)", "null" }, | ||
{ "((void*)0)", "null" }, | ||
{ "NULL", "null"}, | ||
{ "nullptr", "null"}, | ||
{ "ImVec2(0,0)", "new Vector2()" }, | ||
{ "ImVec2(-1,0)", "new Vector2(-1, 0)" }, | ||
{ "ImVec2(1,0)", "new Vector2(1, 0)" }, | ||
{ "ImVec2(1,1)", "new Vector2(1, 1)" }, | ||
{ "ImVec2(0,1)", "new Vector2(0, 1)" }, | ||
{ "ImVec4(0,0,0,0)", "new Vector4()" }, | ||
{ "ImVec4(1,1,1,1)", "new Vector4(1, 1, 1, 1)" }, | ||
{ "ImVec4(0,0,0,-1)", "new Vector4(0, 0, 0, -1)" }, | ||
{ "ImPlotPoint(0,0)", "new ImPlotPoint { x = 0, y = 0 }" }, | ||
{ "ImPlotPoint(1,1)", "new ImPlotPoint { x = 1, y = 1 }" }, | ||
{ "ImDrawCornerFlags_All", "ImDrawCornerFlags.All" }, | ||
{ "ImPlotFlags_None", "ImPlotFlags.None"}, | ||
{ "ImPlotAxisFlags_None", "ImPlotAxisFlags.None"}, | ||
{ "ImPlotAxisFlags_NoGridLines", "ImPlotAxisFlags.NoGridLines"}, | ||
{ "ImGuiCond_Once", "ImGuiCond.Once"}, | ||
{ "ImPlotOrientation_Vertical", "ImPlotOrientation.Vertical"}, | ||
{ "PinShape_CircleFilled", "PinShape._CircleFilled"}, | ||
{ "FLT_MAX", "float.MaxValue" }, | ||
{ "(((ImU32)(255)<<24)|((ImU32)(255)<<16)|((ImU32)(255)<<8)|((ImU32)(255)<<0))", "0xFFFFFFFF" } | ||
{ "(((ImU32)(255)<<24)|((ImU32)(255)<<16)|((ImU32)(255)<<8)|((ImU32)(255)<<0))", "0xFFFFFFFF" }, | ||
{ "sizeof(ImU8)", "sizeof(byte)"}, | ||
{ "sizeof(ImS8)", "sizeof(sbyte)"}, | ||
{ "sizeof(ImU16)", "sizeof(ushort)"}, | ||
{ "sizeof(ImS16)", "sizeof(short)"}, | ||
{ "sizeof(ImU32)", "sizeof(uint)"}, | ||
{ "sizeof(ImS32)", "sizeof(int)"}, | ||
{ "sizeof(ImU64)", "sizeof(ulong)"}, | ||
{ "sizeof(ImS64)", "sizeof(long)"} | ||
}; | ||
|
||
public static readonly Dictionary<string, string> IdentifierReplacements = new Dictionary<string, string>() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After looking into this more,
cimnodes
actually wraps the imnodes project, which is similar but different to another project called ImNodes. UsingImNodes
as the class name (instea of imnodes) might be confusing because of that.